G:
/
PleskVhosts
/
seeonsoft.com
/
hp.thefalconunited.com
/
up file
home
<?php session_start(); include ('config.php'); $fdate = $_GET['fdate']; $tdate = $_GET['tdate']; $vatstatus = 'Vatable'; header("Content-Type: application/xls"); header("Content-Disposition: attachment; filename=Income Report From $fdate To $tdate.xls"); header("Pragma: no-cache"); header("Expires: 0"); ?> <!DOCTYPE html> <html lang="en"> <head> <title>VAT Puchase</title> <meta charset="utf-8" /> <style type="text/css"> @page { size: A4; margin: .6in; } @media print { #table{ max-width: 2480px; width:100%; } #table td{ width: auto; overflow: hidden; word-wrap: break-word; } .noprint {display:none;} } </style> <script> function myFunction() { window.print(); } </script> </head> <body> <div align="center" style="background-color:#FFF"> <img src="images/logodmc.png"><HR style="border-color:#5053FD" /> <!--<h3><b><u>VAT Puchase <?php echo $sname?> From <?php echo $fdate?> To <?php echo $tdate?></u></b></h3>--> <table style="border-collapse: collapse; " border="1" cellpadding="5" id = "table" width="100%"> <thead> <tr style="background-color:#030303; color:#fff;"> <th width="15%">Date</th> <th width="16%">Item Description</th> <th width="25%">Amount</th> <!--<th>Entered By</th>--> </tr> </thead> <?php $totcredit = 0; $totdebit = 0; $c=1; $bank = 'BANKACCT'; $begin = new DateTime( $fdate ); $end = new DateTime( $tdate ); for($i = $begin; $i <= $end; $i->modify('+1 day')) { $sdates = $i->format("Y-m-d"); //echo $sdates."<br>"; $resultip = $js->prepare('SELECT * FROM `invoicepayments` WHERE `paydate` = :sdates AND `banks` = :bank ORDER BY `paydate` '); $resultip->execute(array(':sdates' => $sdates, ':bank' => $bank)); while($rowip = $resultip->fetch(PDO::FETCH_ASSOC)) { $ipinvid = $rowip['invoiceid']; $sqlcin = $js->prepare('SELECT * FROM invoiced WHERE id = :ipinvid '); $sqlcin->execute(array(':ipinvid' => $ipinvid)); while($rowcin = $sqlcin->fetch(PDO::FETCH_ASSOC)) { $cust = $rowcin['cust']; $rremarks = $rowcin['descr']; } $sqlc = $js->prepare('SELECT * FROM customer_entry WHERE id = :cust '); $sqlc->execute(array(':cust' => $cust)); while($rowc = $sqlc->fetch(PDO::FETCH_ASSOC)) { $custname = $rowc['custname']; } $sdate = date('d-m-Y', strtotime($rowip['paydate'])); $totalpaymentin = $rowip['payamount']; $totcredit += $totalpaymentin; $gross = $totalpaymentin; $mode = $rowip['mode']; $ref = $rowip['remarks']; /*$vat = $row['vat']; $status = $row['status']; $gross = $totalpayment + ($totalpayment * $vat / 100); $totcredit += $gross;*/ if($c % 2 == '0') { echo "<tr style='background-color:#EEEEEE'>"; } else { echo "<tr style='background-color:#CCC'>"; } echo "<td align='center'>$sdate</td>"; echo "<td>Paid By $custname - $rremarks"; echo "<td align='right' style='padding-right:10px; color:#0179C1'>$gross</td>"; $totalincome += $gross; $piecest = explode(".", $totalincome); $mainmenut = $piecest[0]; $submenut = $piecest[1]; $strt= strlen($submenut); if($strt == '1') $submenut .= '00'; elseif($strt == '2') $submenut .= '0'; elseif($strt == '0') $submenut .= '000'; else{} if($mainmenut == '0') $mainmenut = '00'; $balance = $mainmenut.".".$submenut; $roundbalance = round($totalincome, 3); echo "</tr>"; $c++; } } $invid = ''; $services = ''; $mode = ''; //echo "total credit".$totcredit."<br>"; //echo "total debit".$totdebit; $closing = $totcredit - $totdebit; ?> <tr style="line-height:30px;"> <th colspan="2" align="right" style="color:#FC4136">Total</th> <th align="right" style="padding-right:10px; color:#990066"><?php echo $roundbalance; ?></th> </tr> </table> <div class="noprint"> <p align="center"> <a href="#" onClick="myFunction()" style="border:5px solid; background-color:#093; color:#FFF; padding:8px; text-decoration:none;">PRINT</a> <a href="excelvatincome.php?fdate=<?php echo $fdate?>&&tdate=<?php echo $tdate?>" onClick="myFunction()" style="border:5px solid; background-color:#093; color:#FFF; padding:8px; text-decoration:none;">EXPORT IN EXCEL</a> <a href="home.php" style="border:5px solid; background-color:#F00; color:#FFF; padding:8px; text-decoration:none;">CLOSE</a> </p> </div> </div>