function getAllOrdersTable() { $table_str = '<table id="taskTable"> '; $table_str .= '<tbody> '; $table_str .= '<tr class="topRowClass">'; $table_str .= '<td>שעת הזמנה</td><td>מספר הזמנה</td><td>מנוי</td><td>שם לקוח</td><td>כתובת</td><td>איזור</td><td>סטאטוס</td><td>עוד</td>'; $table_str .= '</tr>'; $orders = getAllOrders(); foreach ($orders as $order) { $fieldNumber = 1; $orderNumber; $table_str .= '<tr>'; foreach ($order as $field) { switch ($fieldNumber) { case 2: $orderNumber = $field; case 7: if (!strcmp($field, "נשלח")) { $table_str .= '<td> <img src="images/email-4096-black.png" alt="נשלח" title="נשלח"></td>'; } else { if (!strcmp($field, "במקום")) { $table_str .= '<td> <img src="images/target.png" alt="במקום" title="במקום"></td>'; } else { if (!strcmp($field, "בנסיעה")) { $table_str .= '<td> <img src="images/car.png" alt="בנסיעה" title="בנסיעה"></td>'; } else { if (!strcmp($field, "בוצע")) { $table_str .= '<td> <img src="images/done.png" alt="בוצע" title="בוצע"></td>'; } else { $table_str .= '<td> ' . $field . '</td>'; } } } } break; case 8: $str1 = '<td> <a href="visitDetails.php?orderNum='; $str1 .= $orderNumber; $str1 .= '">'; $str1 .= '<img src="images/info_3-512.png"></a></td>'; $table_str .= $str1; break; default: if ($fieldNumber > 8) { } else { $table_str .= '<td> ' . $field . '</td>'; } break; } $fieldNumber++; } $table_str .= '</tr>'; $counter = 1; } $table_str .= '</tbody> '; $table_str .= '</table>'; return $table_str; }
error_reporting(-1); regGet('searchBy', 'searchByProd', 'searchByCat', 'searchByDist'); if (isset($searchBy)) { if ($searchBy == "prod") { $orders = getOrdresByProductNo($searchByProd); } else { if ($searchBy == "cat") { $orders = getOrdresByCatNo($searchByCat); } else { if ($searchBy == "dist") { $orders = getOrdersByDistNo($searchByDist); } } } } else { $orders = getAllOrders(); } var_dump($orders); //echo "something"; ?> <div class='row adminTable_C'> <form action='admin_order.php' method='get'> <div class="filter_C col-m-100 iblk"> <span class='col-m-100 iblk'>Search by:</span> <select name='searchBy' onchange="updateSearch(this)"> <option value='prod'>Product</option> <option value='cat'>Category</option> <option value='dist'>District</option> </select> <select name='searchByProd'>