| Current Path : /var/www/html/mmishra/istore/ |
| Current File : /var/www/html/mmishra/istore/stdailyuse.inc |
<h3 align='left'>Datewise Utilization</h3>
<center>
<?php
$tbl = 'st_stockout';
$dated = $_REQUEST["dated"];
if (!$dated) $dated = date("Y-m-d");
$dated1 = date('Y-m-d', strtotime($dated .' -1 day'));
$dated2 = date('Y-m-d', strtotime($dated .' +1 day'));
echo "<a href='?pg=$pg&dated=$dated1'>$dated1</a>
<font size='+1' color='red'>[ $dated ]</font>";
if ($dated != date("Y-m-d")) echo "<a href='?pg=$pg&dated=$dated2'>$dated2</a>";
$sql = "select concat(b.code,' (',b.description,')') Particulars,a.indent_no,a.qty_out,a.unit,a.dated
from $tbl as a, st_items as b
where a.item=b.id and a.dated like '$dated%' order by a.item";
//echo list_tabledata($sql);
$rs = mysql_query($sql);
if (mysql_num_rows($rs)) {
$colHeads = mysql_num_fields($rs);
$str = "<table border='1' width='90%'><tr><th>Sr</th>";
for ($i=0; $i < $colHeads; $i++) { // Header
$str .= "<th>".ucwords(str_replace("_"," ",mysql_field_name($rs, $i)))."</th>";
}
$str .= "</tr>";
$j = $pgno;
while ($row = mysql_fetch_row($rs)) { //data
$j++;
$str .= "<tr><td>$j</td><td>".implode($row,'</td><td>')."</td></tr>";
}
$str .= "</table>";
} else {
$str = "<div><h2>Nothing to list.</h2></div>";
}
echo $str;
?>
</center>