<h1>Inventory List</h1> <p><a href="inventory-add.php">Add New Product</a></p> <div id="container"> <?php echo "<p>"; include "header-inventory.php"; echo "</p>"; // number of results to show per page $per_page = 25; $find = isset($_REQUEST['find']) && $_REQUEST['find'] != 'search text' ? mysql_real_escape_string($_REQUEST['find']) : ''; $page = isset($_GET['page']) ? intval($_GET['page']) : 0; $result = mysql_query("SELECT * FROM inventory WHERE product_name LIKE'%{$find}%' OR product_code LIKE'%{$find}%' OR product_category LIKE'%{$find}%' OR product_subcategory LIKE'%{$find}%' ORDER BY product_code LIMIT " . $page * $per_page . ", {$per_page};"); $pagination = createPagination('inventory', $page, './' . basename(__FILE__) . ($find != '' ? "?find=" . urlencode($find) : ''), $per_page, "product_name LIKE'%{$find}%' OR product_code LIKE'%{$find}%' OR product_category LIKE'%{$find}%' OR product_subcategory LIKE'%{$find}%'"); // display pagination if (mysql_num_rows($result) == 0) { echo "<p>No results found for <b>{$find}</b>.</p><p>Would you like to <a href='inventory-add.php' . '&find='.urlencode({$find}).'&page='.{$page}.'>add</a> a new product?"; exit; } echo "<p>{$pagination}</p>"; // display data in table echo "<table border='1' style=\"width:100%;margin:auto\">"; echo "<tr><th width=100>Product Code</th><th width=200>Product Name</th><th width=150>Category</th><th width=75>Base Price</th><th width=75>S.O.H</th></tr>"; // loop through results of database query, displaying them in the table if (mysql_num_rows($result) > 0) { // make sure that PHP doesn't try to show results that don't exist while ($row = mysql_fetch_assoc($result)) { $activeyesno = $row['product_active']; if ($activeyesno == "Y") {
echo "<h4>Supplier List</h4>"; ?> <?php // number of results to show per page $per_page = isset($_GET['limit']) ? intval($_GET['limit']) : 25; $find = isset($_REQUEST['find']) && $_REQUEST['find'] != 'search text' ? mysql_real_escape_string($_REQUEST['find']) : ''; $page = isset($_GET['page']) ? intval($_GET['page']) : 0; $resultcount = mysql_query("SELECT * FROM supplier WHERE supplier_name LIKE'%{$find}%' ORDER BY supplier_name"); $result = mysql_query("SELECT * FROM supplier WHERE supplier_name LIKE'%{$find}%' ORDER BY supplier_name LIMIT " . $page * $per_page . ", {$per_page};"); $num_rows = mysql_num_rows($resultcount); echo "<i>{$num_rows} Suppliers found in database.</i><br>\n"; echo "<em class='noprint'>Click on any of the rows to modify the supplier data</em>"; echo "</p>"; echo '<input type="button" id="new_supplier" style="width:150px; height:30px; font-weight:bold" onClick="window.location=\'supplier-add.php\'" value="ADD SUPPLIER" />'; $pagination = createPagination('supplier', $page, './' . basename(__FILE__) . ($find != '' ? "?find=" . urlencode($find) : ''), $per_page, "supplier_name LIKE'%{$find}%'"); echo "<p>{$pagination}</p>"; // display data in table echo "<table border='1' style='width:100%; margin:auto;'>\n\t\t\t\t<tr style='font-weight:bold; background:#AAA'>\n\t\t\t\t\t<th width=25%>Supplier Name</th>\n\t\t\t\t\t<th width=25%>Address</th>\n\t\t\t\t\t<th width=10%>Phone #</th>\n\t\t\t\t\t<th width=20%>Email</th>\n\t\t\t\t\t<th width=20%>Website</th>\n\t\t\t\t</tr>"; // loop through results of database query, displaying them in the table if (mysql_num_rows($result) > 0) { $rowcount = 0; while ($row = mysql_fetch_assoc($result)) { $rowcount++; if ($rowcount < 2) { $rowcolour = '#EEE'; } else { $rowcolour = '#CCC'; $rowcount = 0; } // echo out the contents of each row into a table
$num_rows = mysql_num_rows($resultcount); echo "<h4>Customer List" . (empty($sort) ? '' : ' (BY ' . strtoupper($sort) . ')') . "</h4>"; echo "<i>{$num_rows} Customers found in database.</i><br>\n"; echo "<em class='noprint'>Click on any of the rows to modify the customer data</em>"; echo "</p>"; //echo '<input type="button" onClick="window.location="' . "'customer-add.php';" . '" value="Add" />'; echo '<input type="button" style="width:150px; height:30px; font-weight:bold" value="ADD CUSTOMER" id="new_customer"/>'; echo '<form method="post" action="customer-mail.php" style="float:left;"><input type="hidden" name="fquery" value="' . $querys . '" /><input type="submit" style="width:150px; height:30px; font-weight:bold" value="GENERATE MAIL" class="submitme2"/></form>'; if ($sort != 'expire') { echo '<input type="button" style="width:150px; height:30px; font-weight:bold" value="FILTER EXPIRED" onclick="document.location=\'' . './' . basename(__FILE__) . (!empty($find) ? "?find=" . urlencode($find) . "&sort=expire" : "?sort=expire") . '\';" />'; } if ($sort != 'balance') { echo '<input type="button" style="width:150px; height:30px; font-weight:bold" value="OUTSTANDING" onclick="document.location=\'' . './' . basename(__FILE__) . (!empty($find) ? "?find=" . urlencode($find) . "&sort=balance" : "?sort=balance") . '\';" />'; } // display pagination $pagination = createPagination('customer', $page, './' . basename(__FILE__) . (!empty($find) ? "?find=" . urlencode($find) . "&sort={$sort}" : "?sort={$sort}"), $per_page, $wheres); echo "<p>{$pagination}</p>"; // display data in table echo "<table border='1' width='100%' style=\"margin:auto\">"; echo "<tr style='background:#AAA'>\n\t\t\t\t<th width=9%>Customer</th>\n\t\t\t\t<th width=9%>Trading As</th>\n\t\t\t\t<th width=9%>Ebay</th>\n\t\t\t\t<th width=6%>ABN</th>\n\t\t\t\t<th width=12%>Address</th>\n\t\t\t\t<th width=12%>Shipping</th>\n\t\t\t\t<th width=7%>Phone #</th>\n\t\t\t\t<th width=7%>Mobile #</th>\n\t\t\t\t<th width=9%>Email</th>\n\t\t\t\t<th width=5%>Subsrcibe</th>\n\t\t\t\t<th width=5%>Balance</th>\n\t\t\t\t<th width=3%>Disc</th>\n\t\t\t\t<th width=7%>Expire</th>\n\t\t\t\t<!--\n\t\t\t\t<th width=7%><a href='#' title='Customer Purchase From 31/JULY/" . (date('Y') - 1) . " - 1/JUNE/" . date('Y') . "'>Total Buy</a></th>\n\t\t\t\t-->\n\t\t\t </tr>"; $result = mysql_query("{$querys} LIMIT " . $page * $per_page . ", {$per_page};"); // loop through results of database query, displaying them in the table if (mysql_num_rows($result) > 0) { // make sure that PHP doesn't try to show results that don't exist $rowcount = 0; while ($row = mysql_fetch_assoc($result)) { $rowcount++; if ($rowcount < 2) { $rowcolour = '#EEE'; } else { $rowcolour = '#CCC';
echo ' <small> ' . getTimeDate(substr($objNotice->dateRegistration, 0, 10)) . '</small>'; echo ' <p>' . $objNotice->summary . '</p>'; echo ' </div> </a>'; echo ' </div>'; echo ' </div>'; echo ' <hr>'; } } else { ?> <br><br> <div class="alert alert-danger" role="alert">No hay notas para mostrar :(</div> <?php } ?> <?php echo createPagination($objNoticeController->objNoticeService->totalNotices, $offset); ?> </div><!--/div sub_noticia--> <?php include '../taglibs/footer.inc'; ?> <?php include '../taglibs/scripts.inc'; ?> </body> </html>
case 'MD': $fact = "member_disc='N'"; break; default: $fact = "product_active='" . mysql_real_escape_string($_REQUEST['fact']) . "'"; } } $page = !empty($_REQUEST['page']) ? intval($_REQUEST['page']) : 0; $resultcount = mysql_query("SELECT * FROM inventory WHERE {$fact} AND (product_name LIKE'%{$find}%' OR product_code LIKE'%{$find}%' OR product_category LIKE'%{$find}%' OR product_subcategory LIKE'%{$find}%' OR product_supplier LIKE'%{$find}%') ORDER BY product_code"); $resultcountactive = mysql_query("SELECT * FROM inventory WHERE product_active='Y' AND product_name LIKE'%{$find}%'"); $result = mysql_query("SELECT * FROM inventory WHERE {$fact} AND (product_name LIKE'%{$find}%' OR product_code LIKE'%{$find}%' OR product_category LIKE'%{$find}%' OR product_subcategory LIKE'%{$find}%' OR product_supplier LIKE'%{$find}%') ORDER BY product_code LIMIT " . $page * $per_page . ", {$per_page};"); $num_rows1 = mysql_num_rows($resultcount); $num_rows2 = mysql_num_rows($resultcountactive); echo "<em class='noprint'>\n\t\t\t\t{$num_rows1} search items found in database.</i><br/>\n\t\t\t\t{$num_rows2} active items found in database.<br>\n\t\t\t\tClick on any of the rows to modify the inventory data\n\t\t\t </em>"; echo "</p>"; $pagination = createPagination('inventory', $page, './' . basename(__FILE__) . ($find != '' ? "?find=" . urlencode($find) : '') . ($fact != '' && $fact != '1=1' ? ($find != '' ? '&' : '?') . "fact=" . (!empty($_REQUEST['fact']) ? $_REQUEST['fact'] : '') : ''), $per_page, " {$fact} AND (product_name LIKE'%{$find}%' OR product_code LIKE'%{$find}%' OR product_category LIKE'%{$find}%' OR product_subcategory LIKE'%{$find}%' OR product_supplier LIKE'%{$find}%')"); // display pagination ?> <?php if ((int) $_COOKIE['terminal'] == 2) { ?> <input type="button" style="width:150px; height:30px; font-weight:bold" onClick="window.location='inventory-edit.php'" value="ADD PRODUCT" /> <input type="button" style="width:150px; height:30px; font-weight:bold" onClick="window.location='inventory-uexcel.php'" value="EXCEL UPDATE" /> <input type="button" style="width:150px; height:30px; font-weight:bold" onClick="window.location='inventory-sync.php'" value="SYNC WEBSITE" /> <?php } ?> <? echo "<p>$pagination</p>";
$find = "stock_arrival.date>=$date1 AND stock_arrival.date<($date2+86400) AND"; } if (isset($_GET['find'])) { $search = $_GET['find']; $find .= " (supplier.supplier_name LIKE '%".$_GET['find']."%'"; if (floatval($_GET['find']!=0)) $find .= " OR (stock_arrival.amount>='".(floatval($_GET['find'])-0.99)."' AND stock_arrival.amount<='".(floatval($_GET['find'])+0.99)."')"; $find .= ") AND"; } $where = "$find stock_arrival.supplier = supplier.id"; $page = isset($_GET['page']) ? intval($_GET['page']) : 0; $limit = isset($_GET['limit']) ? intval($_GET['limit']) : 25; $offset = $limit * $page; $pagination = createPagination('stock_arrival,supplier', $page, basename(__FILE__), $limit, $where); if (isset($_GET['date1']) && ($_GET['date2']) ) { $pagination = str_replace('page=',"date1=$from&date2=$ntil&page=",$pagination); } if (isset($_GET['find'])) { $pagination = str_replace('page=',"find=$search&page=",$pagination); } if (isset($_GET["view"])&&$_GET["view"]=='detail') { $pagination = str_replace('page=','view=detail&page=',$pagination); } echo $pagination; ?> <p></p>
<link rel="stylesheet" href="../style.css"> <div id="container"> <?php echo "<p>"; include "header-reports.php"; echo "<h4>Outstanding Accounts</h4>"; echo "</p>"; ?> <?php $page = isset($_GET['page']) ? intval($_GET['page']) : 0; $limit = 25; $offset = $page * $limit; $pagination = createPagination('customer', $page, basename(__FILE__), $limit, "customer_balance < 0"); echo "<p>"; // include ("header-inventory.php"); echo "</p>"; $query = "select * from customer WHERE customer_balance < 0 LIMIT {$offset}, {$limit}"; // query string stored in a variable $rt = mysql_query($query); // query executed if (mysql_num_rows($rt) > 0) { echo "<p>{$pagination}</p>"; echo mysql_error(); echo "<table border=1 style=\"width: 500;margin: auto\">"; echo "<tr><th width=300>Customer</th><th width=100>Balance</th></tr>"; $total = 0; while ($nt = mysql_fetch_assoc($rt)) { $total += $nt['customer_balance'];
<input type="submit" value="Go" style="width:50px" /> </form> </div> <?php $company = array(); $coquery = mysql_query("SELECT * FROM company"); while ($colist = mysql_fetch_array($coquery)) { $company[$colist['id']] = $colist['company_name']; } //$concat = "GROUP_CONCAT(if(partial=0 OR partial=NULL,'$ 0.00',CONCAT('$ ',partial)) separator ', ') multitend, GROUP_CONCAT(if(payment='' OR payment=NULL,'Undefined',payment) separator ', ') multipay"; //$tbl_invoices = "( SELECT x.*, y.split, y.tendered, y.multitend, y.multipay FROM invoices x LEFT JOIN (SELECT id, COUNT(id) split, SUM(partial) tendered, {$concat} FROM invoices_multi GROUP BY id) y ON (x.id=y.id) ) AS invoices"; $tbl_invoices = 'invoices'; //$tbl_customer = "( SELECT * FROM customer UNION SELECT 0 id, 'CASH SALE' customer_name, '' customer_tradingas, '' customer_address, '' customer_shipping, '' customer_phone, '' customer_mobile, '' customer_email, 0 customer_balance, 0 customer_terms, 0 customer_discount, 0 customer_expire) AS customer"; $pagination = ''; if (strtolower(DOC_TYPE) == 'invoice') { $pagination = createPagination("invoices, customer", $page, basename(__FILE__) . '?type=' . DOC_TYPE . '&dt1=' . $dt1 . '&dt2=' . $dt2 . '&find=' . urlencode($find), $limit, "\n\t\t\t\t\t\t\t\tinvoices.customer_id = customer.id AND\n\t\t\t\t\t\t\t\tinvoices.type = '" . DOC_TYPE . "' AND\n\t\t\t\t\t\t\t\tinvoices.customer_id = customer.id AND\n\t\t\t\t\t\t\t\tinvoices.type = '" . DOC_TYPE . "' AND\n\t\t\t\t\t\t\t\t( invoices.id LIKE '%{$find}%' OR customer.customer_name LIKE '%{$find}%' OR customer.customer_tradingas LIKE '%{$find}%' OR customer.customer_ebay LIKE '%{$find}%' ) AND\n\t\t\t\t\t\t\t\tinvoices.customer_id = customer.id AND\n\t\t\t\t\t\t\t\tinvoices.type = '" . DOC_TYPE . "' AND\n\t\t\t\t\t\t\t\tinvoices.customer_id = customer.id AND\n\t\t\t\t\t\t\t\tinvoices.type = '" . DOC_TYPE . "' AND\n\t\t\t\t\t\t\t\tinvoices.date >= '{$start_time}' AND\n\t\t\t\t\t\t\t\tinvoices.date < '{$end_time}'\n\t\t\t\t\t\t\t"); } $offset = $limit * $page; $query = "SELECT\n\t\t\t\t\t\t\tinvoices.id,\n\t\t\t\t\t\t\tinvoices.user,\n\t\t\t\t\t\t\tinvoices.terminal,\n\t\t\t\t\t\t\tinvoices.company,\n\t\t\t\t\t\t\tcustomer.customer_name,\n\t\t\t\t\t\t\tcustomer.customer_tradingas,\n\t\t\t\t\t\t\tcustomer.customer_ebay,\n\t\t\t\t\t\t\tinvoices.total,\n\t\t\t\t\t\t\tinvoices.partial,\n\t\t\t\t\t\t\tinvoices.payment,\n\t\t\t\t\t\t\tinvoices.paid,\n\t\t\t\t\t\t\tinvoices.goods,\n\t\t\t\t\t\t\tinvoices.date\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t{$tbl_invoices}, customer\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tinvoices.customer_id = customer.id AND\n\t\t\t\t\t\t\tinvoices.type = '" . DOC_TYPE . "' AND\n\t\t\t\t\t\t\tinvoices.customer_id = customer.id AND\n\t\t\t\t\t\t\tinvoices.type = '" . DOC_TYPE . "' AND\n\t\t\t\t\t\t\t( invoices.id LIKE '%{$find}%' OR customer.customer_name LIKE '%{$find}%' OR customer.customer_tradingas LIKE '%{$find}%' OR customer.customer_ebay LIKE '%{$find}%' ) AND\n\t\t\t\t\t\t\tinvoices.customer_id = customer.id AND\n\t\t\t\t\t\t\tinvoices.type = '" . DOC_TYPE . "' AND\n\t\t\t\t\t\t\tinvoices.customer_id = customer.id AND\n\t\t\t\t\t\t\tinvoices.type = '" . DOC_TYPE . "'\n\t\t\t\t\t\t"; if (strtolower(DOC_TYPE) == 'invoice') { $query .= " AND invoices.date >= '{$start_time}' AND invoices.date < '{$end_time}'"; } $query .= " ORDER BY date DESC, invoices.id DESC"; if (strtolower(DOC_TYPE) == 'invoice') { $query .= " LIMIT {$offset}, {$limit}"; } $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result) == 0) { echo "<p style='color:red;'>There are currently no saved " . strtolower(DOC_TYPE) . (strtolower(DOC_TYPE) == 'invoice' ? " from {$dt1} until {$dt2}" : "") . (trim($find) !== '' ? ' with that keyword' : '') . " on the database !</p>"; } else { echo "<p>Click on any of the rows to open up the " . strtolower(DOC_TYPE) . "!</p>";
$colv_opt .= '<option '.($colv==$row[0]?'selected="selected"':'').' value="'.$row[0].'">'.$row[0].'</option>'; } } if (!empty($colv)) { $wherefix = "({$colh}='{$colv}') AND"; } $result = mysql_query("SELECT count(*) as counting FROM `{$tablename}`"); $row_all = mysql_fetch_assoc($result); $result = mysql_query("SELECT count(*) as counting FROM `{$tablename}` WHERE {$wherefix} (".implode(' OR ',$where).")"); $row_flt = mysql_fetch_assoc($result); $result = mysql_query("SELECT * FROM `{$tablename}` WHERE {$wherefix} (".implode(' OR ',$where).") LIMIT ".($page*$per_page).", $per_page;"); $pagination = createPagination($tablename, $page, basename(__FILE__).'?colf='.urlencode($colf).'&colh='.urlencode($colh).'&colv='.urlencode($colv).'&find='.urlencode($find), $per_page, implode(' OR ',$where)); ?> <form method="get" class='noprint' style="width:100%; text-align:center;"> <select name="colh" style="width:200px;" onchange="$(this).parent().submit()" ><?=$colh_opt?></select> <select name="colv" style="width:200px;" <?=empty($colh)?'disabled="disabled"':''?> ><?=$colv_opt?></select> <input name="find" style="width:300px;" type="text" value="<?=$find?>" /> <select name="colf" style="width:200px;" onchange="$(this).parent().submit()" ><?=$colf_opt?></select> <input type="hidden" name="page" value="<?=$page?>" /> <input type="hidden" name="limit" value="<?=$limit?>" /> <button type="submit" style="width: 150px;">Find Ink & Toners</button> <div style="font: 12px normal 'courier new';"> shows <?=$row_flt['counting']?> items, from <?=$row_all['counting']?> total records. </div> </form>
</style> <div id="container"> <?php echo "<p>"; include "header-inventory.php"; echo "<h4>Inventory Grouping</h4>"; // number of results to show per page $per_page = isset($_GET['limit']) ? intval($_GET['limit']) : 25; $find = isset($_REQUEST['find']) && $_REQUEST['find'] != 'search text' ? mysql_real_escape_string($_REQUEST['find']) : ''; $page = isset($_GET['page']) ? intval($_GET['page']) : 0; $result = mysql_query("SELECT * FROM inventory_group WHERE group_name LIKE'%{$find}%' OR group_code LIKE'%{$find}%' ORDER BY group_code LIMIT " . $page * $per_page . ", {$per_page};"); echo "<em class='noprint'>Click on any of the rows to modify the group data</em>"; echo "</p>"; $pagination = createPagination('inventory_group', $page, './' . basename(__FILE__) . ($find != '' ? "?find=" . urlencode($find) : ''), $per_page, "group_name LIKE'%{$find}%' OR group_code LIKE'%{$find}%'"); if (isset($_GET['find'])) { $pagination = str_replace('page=', "find={$search}&page=", $pagination); } if (isset($_GET["view"]) && $_GET["view"] == 'detail') { $pagination = str_replace('page=', 'view=detail&page=', $pagination); } //if($accessLevel == 1) { ?> <input type="button" style="width:150px; height:30px; font-weight:bold" onClick="window.location='group-edit.php'" value="ADD GROUP" /> <? if (!isset($_GET["view"]) || $_GET["view"]!='detail') { echo "<form method='get' action='' style='display:inline'> ".(!isset($_GET['page'])?"":"<input type='hidden' name='page' value='{$_GET['page']}'/>")." ".(!isset($_GET['limit'])?"":"<input type='hidden' name='limit' value='{$_GET['limit']}'/>")." ".(!isset($_GET['find'])?"":"<input type='hidden' name='find' value='{$_GET['find']}'/>")."
echo "<em class='noprint'>Click on any of the rows to modify the expense data</em>"; echo "</p>"; ?> <input type="button" style="width: 150px; height: 30px; font-weight: bold;" onClick="window.location='expense-add.php'" value="ADD EXPENSE" /> <input type="button" style="width: 150px; height: 30px; font-weight: bold;" onClick="window.location='expense-uexcel.php'" value="EXCEL UPDATE" /> <?php // number of results to show per page $per_page = isset($_GET['limit']) ? intval($_GET['limit']) : 25; $order_types = array('date' => array('field' => 'expense_date', 'type' => 'DESC'), 'company' => array('field' => 'expense_company', 'type' => 'ASC'), 'amount' => array('field' => 'expense_amount', 'type' => 'DESC'), 'notes' => array('field' => 'expense_notes', 'type' => 'ASC'), 'reff' => array('field' => 'expense_reff', 'type' => 'DESC')); $order = isset($_GET['order']) && $_GET['order'] != '' && isset($order_types[$_GET['order']]) ? $order_types[$_GET['order']] : $order_types['date']; $find = isset($_REQUEST['find']) && $_REQUEST['find'] != 'search text' ? mysql_real_escape_string($_REQUEST['find']) : ''; $page = isset($_GET['page']) ? intval($_GET['page']) : 0; $offset = $page * $per_page; $pagination = createPagination('expenses', $page, basename(__FILE__) . ($find != '' ? "?find=" . urlencode($find) : '') . ($find != '' ? '&' : '?') . "order=" . array_search($order, $order_types), $per_page, "expense_date LIKE'%{$find}%' OR expense_company LIKE'%{$find}%' OR expense_category LIKE'%{$find}%' OR expense_notes LIKE'%{$find}%'"); $result = mysql_query("SELECT * FROM expenses WHERE expense_date LIKE'%{$find}%' OR expense_company LIKE'%{$find}%' OR expense_category LIKE'%{$find}%' OR expense_notes LIKE'%{$find}%' ORDER BY {$order['field']} {$order['type']} LIMIT {$offset}, {$per_page}"); echo "<p>{$pagination}</p>"; // display data in table echo "<table border='1' style='width: 80%; margin: auto;'>"; echo "<tr style='background:#AAA'>\n\t\t\t\t<th width='10%'><a href='expense-list.php?order=date&find=" . urlencode($find) . "'>Date</a></th>\n\t\t\t\t<th width='25%'><a href='expense-list.php?order=company&find=" . urlencode($find) . "'>Company</a></th>\n\t\t\t\t<th width='10%'><a href='expense-list.php?order=amount&find=" . urlencode($find) . "'>Amount</a></th>\n\t\t\t\t<th width='10%'><a href=\"expense-list.php?order=reff&find=" . urlencode($find) . "\">Reference</a></th>\n\t\t\t\t<th width='12%'><a href=\"expense-list.php?order=category&find=" . urlencode($find) . "\">Category</a></th>\n\t\t\t\t<th width='30%'><a href=\"expense-list.php?order=notes&find=" . urlencode($find) . "\">Notes</a></th>\n\t\t\t\t<th> </th>\n\t\t\t </tr>"; // loop through results of database query, displaying them in the table if (mysql_num_rows($result) > 0) { $rowcount = 0; while ($row = mysql_fetch_assoc($result)) { $rowcount++; if ($rowcount < 2) { $rowcolour = '#EEE'; } else { $rowcolour = '#CCC'; $rowcount = 0;
<div id="container"> <? echo "<p>"; include ("header-inventory.php"); echo "<h4>Wastage List</h4>"; echo "</p>"; ?> <button id="new_waste" onClick="location.href='new-waste.php'" class="submitme">Record Waste</button> <?php $page = isset($_GET['page']) ? intval($_GET['page']) : 0; $limit = isset($_GET['limit']) ? intval($_GET['limit']) : 25; $offset = $limit * $page; $paginator = '<p>' . createPagination('waste', $page, basename(__FILE__), $limit) . '</p>'; ?> <?php echo $paginator; ?> <table style="margin:auto;" border=1> <tr> <th width=100>DATE</th> <th width=300>PRODUCT</th> <th width=50>QTY</th> <th width=200>NOTE</th> </tr> <?php $result = mysql_query("SELECT waste.*, inventory.product_name FROM waste, inventory WHERE inventory.product_code = waste.product ORDER BY waste.date DESC LIMIT {$offset}, {$limit};") or die(mysql_error()); if (mysql_num_rows($result) == 0) { echo "<tr><th colspan=\"5\">EMPTY</th></tr>";