D7net Mini Sh3LL v1
Current File : C:/Domains/maymaytinson.com/httpdocs/lib/images/13/../10/../7/../16/../activity/../JUKI/../15/../zip_food/../18/../17/../2/../21/../20/../22/../5/../11/../7/../5/../22/../22/../../../upload/../upload/../conn/../include/zip_report.php |
<div id="frame">
<div id="titleFrame"><h2>Doanh thu</h2>
<div id='selecetR'>
<select id='report' class='inputReport'><option>-Chọn thống kê-</option><option value='day'>Ngày</option><option value='month'>Tháng</option><option value='year'>Năm</option></select>
<form id='reportday' class='report' hidden><input class='inputReport' type='date' name='dateReport' id='dateReport' onchange="this.form.submit()"></form>
<form id='reportmonth' class='report' hidden><input class='inputReport' type='month' name='monthReport' id='monthReport' onchange="this.form.submit()"></form>
<form id='reportyear' class='report' hidden>
<select class='inputReport' name='yearReport' id='yearReport' onchange="this.form.submit()">
<option>-Chọn năm-</option>
<?php for($i=2018;$i<=date("Y");$i++){ ?>
<option value="<?php echo $i; ?>"><?php echo $i ?></option>
<?php }?>
</select></form></div>
</div>
<div id="listFrame">
<?php
$where = "";
if(isset($_GET['dateReport'])){
$where =" WHERE dateOrder='".$_GET['dateReport']."'";
}
if(isset($_GET['monthReport'])){
$monthR=explode("-",$_GET['monthReport']);
if($monthR[1]<10){
$monthR[1]=substr($monthR[1],1);
}
$where =" WHERE MONTH(dateOrder)='".$monthR[1]."' AND YEAR(dateOrder)='".$monthR[0]."'";
}
if(isset($_GET['yearReport'])){
$where =" WHERE YEAR(dateOrder)='".$_GET['yearReport']."'";
}
$stmt=$conn->prepare("SELECT * FROM cart_zip".$where);
$stmt->execute();
$carts=$stmt->fetchAll(PDO::FETCH_ASSOC);
$stt=1;$total=0;?>
<table>
<thead>
<th>Stt</th>
<th>Món</th>
<th>Số lượng</th>
<th>Giá</th>
<th>Thành tiền</th>
<th>Ngày</th>
</thead>
<?php foreach ($carts as $cart){
$total+=$cart['price']*$cart['amount'];
?>
<tr>
<td><?php echo $stt;$stt++ ?></td>
<td><?php echo $cart['name']; ?></td>
<td><?php echo $cart['amount']; ?></td>
<td><?php echo number_format($cart['price'])." đ"; ?></td>
<td><?php echo number_format($cart['price']*$cart['amount'])." đ"; ?></td>
<td><?php $date=date_create($cart['dateOrder']);echo date_format($date,"d/m/Y"); ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
<div><h4 align="right" style="margin-right: 100px">Tổng : <?php echo number_format($total)." đ"; ?></h4></div>
AnonSec - 2021 | Recode By D7net