Vote count:
0
I am in need of help, I am a newbie so i really need some help, i have this problem.
I am required to generate reports on a Yearly, Quarterly, Monthly, Weekly, and Daily basis.
I dont know where to start and how to start, My professor said that when the user clicks for example year 2014, it would break down into quarterly, when the user clicks on 1st quarter, it would break down to monthly and so on while displaying the total sales gained every time the user clicks on a report. It like a bullet form, an outline and breaks down to the daily reports.
How do I do it that way? or could you provide alternatives? currently i am working with this.
<?php
if(isset($_GET['datefrom']) && ($_GET['dateto'])){
$datefrom = $_GET['datefrom'];
$dateto = $_GET['dateto'];
$qry = "SELECT sum(order_detail.quantity*order_detail.price) as chenes, orders.date
FROM order_detail
LEFT JOIN orders
ON order_detail.orderid=orders.serial
WHERE date(orders.date) BETWEEN '$datefrom' AND '$dateto'";
}
else {
$qry = "SELECT sum(order_detail.quantity*order_detail.price) as chenes, orders.date
FROM order_detail
LEFT JOIN orders
ON order_detail.orderid=orders.serial";
}
mysql_set_charset("UTF8");
$result = @mysql_query($qry);
if($result === FALSE) {
die(mysql_error()); // TODO: better error handling
}
while ($row=mysql_fetch_array($result)){
echo "₱".number_format($row['chenes'],2);
}
?>
this would only allow the user to select from the date picker, but it is too much work for the user, how do i do the instruction explained to me above the yearly to daily basis or if it is too hard for me, could you provide alternatives that would also do it in a similar way?
Thank you for Reading, I hope you could help me.
Generating reports on a yearly, quarterly, monthly, weekly and daily. PHP
Aucun commentaire:
Enregistrer un commentaire