function show_site() { $db = connect_dbi(); $sql_select = "SELECT * FROM Origin" . " INNER JOIN Source ON source.source_id=Origin.Source_source_id" . " ORDER BY origin_id DESC"; $result = query_selecti($db, $sql_select); while ($rek = mysqli_fetch_array($result)) { //echo "<table>"; echo "<tr><td>"; echo $rek["post_code"]; echo "</td><td>"; echo $rek["company_name"]; echo "</td><td>"; echo $rek["name"]; //echo "sdfsdf"; echo "</td><td>"; echo $rek["surname"]; echo "</td><td>"; echo $rek["street"]; echo "</td><td>"; echo $rek["town"]; echo "</td><td>"; //$postal_code = strtoupper (str_replace(' ', '', $postal_code)); echo $rek["Source_source_id"]; echo "</td><td>"; echo $rek["town_name"]; echo "</td><td>"; echo $email = $rek['email']; echo "</td><td>"; echo $phone = $rek['phone']; echo "</td></tr>"; } mysqli_free_result($result); mysqli_close($db); }
function check_cat($id) { $db = connect_dbi(); $sql = "SELECT * FROM category"; $result = query_selecti($db, $sql); while ($rek = mysqli_fetch_array($result)) { echo "<option value='" . $rek['id'] . "'>" . $rek['name_cat'] . "</option>"; } // return $rek['town_name']; }
function dbi_check_customer($post_code) { $sql = "SELECT * FROM origin WHERE post_code ='{$post_code}'"; $result = query_selecti($sql); //mysqli_fetch_array($result); $num = mysqli_num_rows($result); if ($num == 0) { return 0; } else { return $num; } }
function check_cat($id) { $db = connect_dbi(); $sql = "SELECT * FROM item_has_cat INNER JOIN item ON item.Item_has_cat_id_item_cat=item_has_cat.id_item_cat WHERE active=1 GROUP BY assign_nr ORDER By id_item_cat"; $result = query_selecti($db, $sql); // echo $id; while ($rek = mysqli_fetch_array($result)) { $sub_cat = $rek['sub_cat']; if ($id == $rek['id_item_cat']) { echo "<option value='" . $rek['id_item_cat'] . "' selected >" . $rek['name'] . " - <b>" . get_sub_cat_name($sub_cat) . "</b></option>"; } else { echo "<option value='" . $rek['id_item_cat'] . "'>" . $rek['name'] . " - <b>" . get_sub_cat_name($rek['sub_cat']) . "</b></option>"; } } // return $rek['town_name']; }
$sql = "UPDATE delivery SET att_num='{$att_mobile}',QtyPickedUp='{$qtty_mobile}',QNum='{$qtty_mobile}' WHERE Site_site_id='{$site_id}' AND Trans_Category_Category_id='A2'"; query_selecti($sql); //weee $sql = "UPDATE delivery SET att_num='{$att_weee}',QtyPickedUp='{$qtty_weee}',QNum='{$qtty_weee}' WHERE Site_site_id='{$site_id}' AND Trans_Category_Category_id='93'"; query_selecti($sql); //toners $sql = "UPDATE delivery SET att_num='{$att_ink}',QtyPickedUp='{$qtty_ink}',QNum='{$qtty_ink}' WHERE Site_site_id='{$site_id}' AND Trans_Category_Category_id='99'"; query_selecti($sql); //cds $sql = "UPDATE delivery SET att_num='{$att_cd}',QtyPickedUp='{$qtty_cd}',QNum='{$qtty_cd}' WHERE Site_site_id='{$site_id}' AND Trans_Category_Category_id='A1'"; query_selecti($sql); //bric $sql = "UPDATE delivery SET att_num='{$att_bric}',QtyPickedUp='{$qtty_bric}',QNum='{$qtty_bric}' WHERE Site_site_id='{$site_id}' AND Trans_Category_Category_id='94'"; query_selecti($sql); $sql = "UPDATE delivery SET att_num='{$att_nferr}',QtyPickedUp='{$qtty_nferr}',QNum='{$qtty_nferr}' WHERE Site_site_id='{$site_id}' AND Trans_Category_Category_id='19'"; query_selecti($sql); } //this goes also with condition si is not reste automaticaly //lets consider to keep it in session //cause they are reseted while refresed // // //end of atts modif //this two executed while closed link clicke /* echo $sql="UPDATE manifest_reg SET closed=0 WHERE idmanifest_reg='$manifest_reg_id'"; $result_closed=query_selecti($sql); //$rek=mysqli_fetch_array($result_closed); //$site_id=$rek[0]; echo $sql="UPDATE manifest_counter SET finished=1 WHERE manifest_reg_idmanifest_reg='$manifest_reg_id'";
function check_cat_ext($id) { $db = connect_dbi(); $sql = "SELECT * FROM weee_extension"; $result = query_selecti($db, $sql); // echo $id; while ($rek = mysqli_fetch_array($result)) { //$sub_cat=$rek['sub_cat']; if ($id == $rek['idweee_extension']) { echo "<option value='" . $rek['idweee_extension'] . "' selected >" . $rek['name_ext'] . " - <b>" . $rek['weee_extension'] . "</b></option>"; } else { echo "<option value='" . $rek['idweee_extension'] . "'>" . $rek['name_ext'] . " - <b>" . $rek['weee_extension'] . "</b></option>"; } } // return $rek['town_name']; }
function dbi_set_last_sticker($manifest_reg_id, $last_sticker) { $sql = "UPDATE manifest_reg SET end_dbs='{$last_sticker}' WHERE idmanifest_reg='{$manifest_reg_id}'"; $result = query_selecti($sql); //$rek=mysqli_fetch_array($result); }
</p> </div> </div> <div data-role="collapsible"> <h3>Change current site <?php if (isset($new_customer)) { echo $new_customer; $site_id = get_site_session_change(); set_site_id($site_id); //we save in sesson if (isset($site_id)) { echo $sql = "UPDATE site SET Origin_origin_id='{$new_customer}' WHERE site_id='{$site_id}'"; $result = query_selecti($sql); } if ($result) { echo " - Changed for: " . $new_date; } } ?> </h3> <p>If you done mistake, and specified a wrong site. Please change a site</p> <?php echo '<div data-role="main" class="ui-content">'; //form for pickin a site echo '<form action="options.php" method="POST">'; echo "<p>"; echo '<label for="customer">Customer Location: </label>';
/** Function gets the size of origin table. Shall be grouped with get_ and size_ functions * * @return num_customers */ function get_size_of_manifest_customer() { $sql = "SELECT * FROM origin"; $result = query_selecti($sql); $num_customers = mysqli_num_rows($result); return $num_customers; }
function get_dbi_sub_cat_name($id_c) { $sql = "SELECT Name_sub FROM sub_cat where id_c='{$id_c}'"; $result = query_selecti($sql); $rek = mysqli_fetch_array($result); return strtoupper($rek[0]); }