Mini Shell

Direktori : /home/eymajans/public_html/kurumsalv11.ofisimweb.com/
Upload File :
Current File : /home/eymajans/public_html/kurumsalv11.ofisimweb.com/TeklifYazdir.php

<?php
require("Ayarlar/Baglantim.php"); 
require("Ayarlar/Guvenlik.php"); 

?>
<?php
if ($_POST) {
$id = intval($_POST['id']);
$sorgu = $baglanti->prepare("SELECT * FROM TeklifBilgi Where id=:id");
$sorgu->execute(array(':id'=>$id));
$sonuc = $sorgu->fetch();
$cari=$baglanti->prepare("SELECT * FROM Cariler where id=".$sonuc["cariadi"]);
$cari->execute();
$carim= $cari->fetch();
?>

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <title>A4</title>
<link href="Tasarim/css/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" href="Tasarim/css/bosluk.css" />
	<link rel="stylesheet" href="Tasarim/css/kenar.css" />
	<link rel="stylesheet" href="Tasarim/css/renk.css" />
	<link rel="stylesheet" href="Tasarim/css/yazitipi.css" />
	<link rel="stylesheet" href="Tasarim/css/yukseklikgenislik.css" />

<style>
@page { margin: 0 }
body { margin: 0 }
.sheet {
  margin: 0;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  page-break-after: always;
}

/** Paper sizes **/

body.A4 .sayfa { 
width: 190mm; 
height: 280mm;
margin-left: 10mm;
margin-right: 10mm;
}
.sayfa .sol{
width: 130mm;
float: left;
}
.sayfa .sag{
width: 60mm;
margin-top: 12mm;
float: right;
}

body.A4 .sayfa .sag .teklif{
font-weight: 800;
font-size: 35px;
border-style: solid;
border-size: 2px;
border-bottom-color: #000;
border-top-color: transparent;
border-left-color: transparent;
border-right-color: transparent;
text-align: right;
padding-bottom: 18px;
}
 .sayfa .icerik{
margin-top: 50px;
}




/** For screen preview **/
@media screen {
  body { background: #e0e0e0 }
  .sheet {
    background: white;
    box-shadow: 0 0mm 0mm rgba(0,0,0,.3);
    margin: 5mm auto;
  }
}

/** Fix for Chrome issue #273306 **/
@media print {

  body.A4  { width: 148mm }

}


  </style>
  <style>@page { size: A4}</style>
<style>


    article { border: 4px double black; padding: 0mm 0mm; border-radius: 3mm; display: inline-block }
  </style>
</head>
<body class="A4 arkaplan-beyaz">
<div class="sayfa">
<div class="sol">
<img src="Resimler/sehrivan.png">
<BR>
<span class="text-dark"><b>TEKLİF VEREN FİRMA İSMİ</b></span>
<BR>
<span class="text-dark"><b>TEKLİF VEREN FİRMA ADRESİ</b></span>
<BR>
<BR>
<span class="text-dark"><b>İLÇE / İL</b></span>
<BR>
<span class="text-dark">TELEFON</span>
<BR>
<BR>
<span class="text-dark"><b>VD: VERGİ DAİRESİ</b></span>
<BR>
<span class="text-dark">VERGİ NUMARASI</span>
</div>
<div class="sag">
    <div class="teklif">
<span class="text-dark">TEKLİF</span>
</div>
<BR>
<span class="text-dark"><b>MÜŞTERİ</b></span>
<BR>
<span class="text-dark"><?=$carim["unvani"];?></span>
<hr class="text-dark">
<BR>
<span class="text-dark"><b>TEKLİF TARİHİ:</b> <?=$sonuc["tarih"];?></span>
<hr class="text-dark">
</div>

<div class="icerik">

<table class="table text-dark kenar-yok mb-0">
    <thead>
<tr>
<th class="g-y40 text-start" scope="col">Hizmet/Ürün</th>
<th class="g-y15 text-center" scope="col">Miktar</th>
<th class="g-y15 text-center" scope="col">Br.Fiyat</th>
<th class="g-y15 text-center" scope="col">Kdv</th>
<th class="g-y15 text-end" scope="col">Toplam</th>
</tr>
</thead>
<tbody>
    <?php $alfatbags = $baglanti->query("SELECT * FROM TeklifBag where bilgiid=".$sonuc["id"])->fetchAll();
                                                            foreach ($alfatbags as $alfatbag) {
                                                        ?> 
           <?php 
                                                      $fatura = $baglanti->query("SELECT * FROM TeklifFaturasi where id=".$alfatbag["faturaid"])->fetchAll(PDO::FETCH_ASSOC);
                                                                
                                                if(count($fatura)>0){


                                                ?>
                                                
                                                
                                           
                                                    <?php
    
                                                        foreach($fatura as $faturasi){
                                                            ?>
<tr>
<td class="text-start" scope="row"><?php 
                                                      $urunlerim = $baglanti->query("SELECT * FROM Urunler where id=".$faturasi["urunadi"])->fetchAll(PDO::FETCH_ASSOC);
                                                                
                                                if(count($urunlerim)>0){


                                                ?>
                                                
                                                
                                           
                                                    <?php
    
                                                        foreach($urunlerim as $urunum){
                                                            ?>
<?php echo $urunum['urunadi'] ?>
       <?php } ?><?php } ?></td>
<td class="text-center" scope="row"><?= $faturasi['adet']?><?php 
                                                      $birim = $baglanti->query("SELECT * FROM Birim where id=".$urunum["birimadi"])->fetchAll(PDO::FETCH_ASSOC);
                                                                
                                                if(count($birim)>0){


                                                ?>
                                                
                                                
                                           
                                                    <?php
    
                                                        foreach($birim as $birimi){
                                                            ?>
                                                    
                                                     <?php echo $birimi['kisaltma']; ?>
                                                    <?php


                                                        }
                                                            
                                                    
                                                    ?>
       <?php } ?></td>
<td class="text-center" scope="row"><?= number_format($faturasi['fiyat'], 2, ',', '.');?></td>
<td class="text-center" scope="row"><?php
$vergi = $faturasi['kdvtutar'];
?>

    <?= number_format($vergi, 2, ',', '.');?></td>
<td class="text-end" scope="row"><?= number_format($faturasi['kdvlitoplam'], 2, ',', '.');?></td>
</tr>
<?php } ?> 
 <?php } ?> 
 <?php } ?> 
<tfoot>

<tr>
<td colspan="2" rowspan="3"><?=$sonuc["odeme"];?></td>
<td class="text-end" colspan="2">Ara Toplam</td>
<td class="text-end"><?= number_format($sonuc['aratoplam'], 2, ',', '.');?></td>
</tr>
<tr>
<td class="text-end" colspan="2">Kdv Toplam</td>
<td class="text-end"><?= number_format($sonuc['kdvtoplam'], 2, ',', '.');?></td>
</tr>
<tr>
<td class="text-end" colspan="2">Genel Toplam</td>
<td class="text-end"><?= number_format($sonuc['geneltoplam'], 2, ',', '.');?></td>
</tr>
</tfoot>

                                    </tbody>
                                </table>
</div>



</div>
<script type="text/javascript">
         window.onafterprint = window.close;
         window.print();
</script>
</body>


</html>
<?php }?>