File manager - Edit - /home/autoph/public_html/portal/includes/sales-report-summary.php
Back
<?php $myDate = explode("/",$toDate); $myDay = $myDate[1]; $myMonth = $myDate[0]; $myYear = $myDate[2]; $compCode = $user_data['company_assignment']; $dateFrom = $_GET['dateFrom']; $dateTo = $_GET['dateTo']; //echo "My Company Code: ".$compCode; ?> <div STYLE='height: 30px; width: 100%; font-size: 12px; overflow: auto;'> <table style="border-collapse:collapse;background:#fff:border:none;width:100%"> <tr> <td class="lightGradient" style="border:1px solid lightgray;height:32px;font-size:14px;font-weight:normal;color:gray"> <img src="images/bullet.gif" width="10px" height="10px"> </img> <b style="font-size:14px;color:red">SALES REPORT SUMMARY ( <?php echo $_GET['dateFrom']. " | ".$_GET['dateTo'];?>)</b> </td> </tr> </table> </div> <div STYLE='border:1px solid lightgray;height: 490px; width: 100%; font-size: 12px; overflow: auto;'> <?php //$txCash = mysql_query("SELECT * FROM `payments` WHERE `payment_method`='Cash' AND `branch_code`='$compCode' AND `payment_date` BETWEEN '$dateFrom' AND '$dateTo' AND `cancel`='no' ORDER BY `payment_date` ASC"); echo "<table style='width:100%;border-collapse:collapse'>"; echo "<tr>"; echo "<th style='width:10%'>Date.</th>"; echo "<th style='width:9%'>TREATMENT</th>"; echo "<th style='width:8%'>DIALYZER</th>"; echo "<th style='width:8%'>ERYTHROPOEITIN</th>"; echo "<th style='width:8%'>MEDICINES</th>"; echo "<th style='width:8%'>KIT</th>"; echo "<th style='width:8%'>OTHERS</th>"; echo "<th style='width:8%'>LABORATORY</th>"; echo "<th style='width:8%'>SUPPLIES</th>"; echo "<th style='width:20%'>TOTAL</th>"; echo "</tr>"; $begin = new DateTime($dateFrom); $end = new DateTime($dateTo); for($i = $begin; $i <= $end; $i->modify('+1 day')){ $ruNDate = $i->format("m/d/Y"); $getSalesTX = mysql_result(mysql_query("SELECT SUM(`payment_amount`) FROM `payments` WHERE `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='CASH' AND `cancel`='no' AND `payment_type`='Treatment' || `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='ADVANCE' AND `cancel`='no' AND `payment_type`='Treatment' "),0); $getSalesTXTOTAL = $getSalesTXTOTAL + $getSalesTX; $getSalesDIAL = mysql_result(mysql_query("SELECT SUM(`payment_amount`) FROM `payments` WHERE `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='CASH' AND `cancel`='no' AND `payment_type`='Dialyzer' || `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='ADVANCE' AND `cancel`='no' AND `payment_type`='Dialyzer' "),0); $getSalesDIALTOTAL = $getSalesDIALTOTAL + $getSalesDIAL; $getSalesEPO = mysql_result(mysql_query("SELECT SUM(`payment_amount`) FROM `payments` WHERE `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='CASH' AND `cancel`='no' AND `payment_type`='Epo' || `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='ADVANCE' AND `cancel`='no' AND `payment_type`='Epo' "),0); $getSalesEPOTOTAL = $getSalesEPOTOTAL + $getSalesEPO; $getSalesMED = mysql_result(mysql_query("SELECT SUM(`payment_amount`) FROM `payments` WHERE `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='CASH' AND `cancel`='no' AND `payment_type`='Medicine' || `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='ADVANCE' AND `cancel`='no' AND `payment_type`='Medicine' "),0); $getSalesMEDTOTAL = $getSalesMEDTOTAL + $getSalesMED; $getSaleKIT = mysql_result(mysql_query("SELECT SUM(`payment_amount`) FROM `payments` WHERE `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='CASH' AND `cancel`='no' AND `payment_type`='Kit' || `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='ADVANCE' AND `cancel`='no' AND `payment_type`='Kit' "),0); $getSaleKITTOTAL = $getSaleKITTOTAL + $getSaleKIT; $getSalesOTHERS = mysql_result(mysql_query("SELECT SUM(`payment_amount`) FROM `payments` WHERE `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='CASH' AND `cancel`='no' AND `payment_type`='Others' || `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='ADVANCE' AND `cancel`='no' AND `payment_type`='Others' "),0); $getSalesOTHERSTOTAL = $getSalesOTHERSTOTAL + $getSalesOTHERS; $getSalesSUP = mysql_result(mysql_query("SELECT SUM(`payment_amount`) FROM `payments` WHERE `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='CASH' AND `cancel`='no' AND `payment_type`='Supplies' || `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='ADVANCE' AND `cancel`='no' AND `payment_type`='Supplies' "),0); $getSalesSUPTOTAL = $getSalesSUPTOTAL + $getSalesSUP; $getSalesLAB = mysql_result(mysql_query("SELECT SUM(`payment_amount`) FROM `payments` WHERE `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='CASH' AND `cancel`='no' AND `payment_type`='Laboratory' || `branch_code`='$compCode' AND `payment_date`='$ruNDate' AND `payment_method`='ADVANCE' AND `cancel`='no' AND `payment_type`='Laboratory' "),0); $getSalesLABTOTAL = $getSalesLABTOTAL + $getSalesLAB; $dateSalesTotal = $getSalesTX + $getSalesDIAL + $getSalesEPO + $getSalesMED + $getSaleKIT + $getSalesOTHERS + $getSalesLAB + $getSalesSUP; $grandTotal= $grandTotal + $dateSalesTotal; echo "<tr>"; echo "<td align='center'>".$ruNDate."</td>"; echo "<td align='right' style='padding-right:5px;'>".number_format($getSalesTX,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;'>".number_format($getSalesDIAL,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;'>".number_format($getSalesEPO,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;'>".number_format($getSalesMED,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;'>".number_format($getSaleKIT,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;'>".number_format($getSalesOTHERS,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;'>".number_format($getSalesLAB,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;'>".number_format($getSalesSUP,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;'>".number_format($dateSalesTotal,2,'.',',')."</td>"; echo "</tr>"; } echo "<tr>"; echo "<td align='center'>TOTAL</td>"; echo "<td align='right' style='padding-right:5px;font-size:12px;font-weight:bold'>".number_format($getSalesTXTOTAL,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;font-size:12px;font-weight:bold'>".number_format($getSalesDIALTOTAL,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;font-size:12px;font-weight:bold'>".number_format($getSalesEPOTOTAL,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;font-size:12px;font-weight:bold'>".number_format($getSalesMEDTOTAL,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;font-size:12px;font-weight:bold'>".number_format($getSaleKITTOTAL,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;font-size:12px;font-weight:bold'>".number_format($getSalesOTHERSTOTAL,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;font-size:12px;font-weight:bold'>".number_format($getSalesLABTOTAL,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;font-size:12px;font-weight:bold'>".number_format($getSalesSUPTOTAL,2,'.',',')."</td>"; echo "<td align='right' style='padding-right:5px;font-size:12px;font-weight:bold'>".number_format($grandTotal,2,'.',',')."</td>"; echo "</tr>"; echo "</table>"; echo "<center> <br><br><a href='sales-report-summary-by-date-range.php?dateFrom=".$_GET['dateFrom']."&dateTo=".$_GET['dateTo']."' target='Blank'>Print Version</a></center>"; ?> </div>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings