function generate_manifest_unq_number() { $token = rand(1000, 10000); //generate the unique manifest number //small modification: we add also post code to generator $manifest_new_number = get_site_sesion() . "4" . get_post_code_session(get_site_sesion()) . "5" . rand(100, 10000) . $token; return $manifest_new_number; }
if (!empty($custom)) { //this helped i think to don not loose customer id on the manifest } else { set_site($customer_id); } echo "<table data-role='button'><tr>"; foreach ($arr = read_customers($customer_id) as $key => $customer) { echo "<td>"; echo $customer; echo "</td>"; } echo "</tr></table>"; echo "</p>"; } else { //here $check_id = get_site_sesion(); if (!empty($check_id)) { echo "SESSUION" . ($customer_id = $check_id); $FLAG_SITE_PICKED_UP = 1; } } //keep in sesson if (isset($_POST['sticker_id'])) { echo "SS" . strlen($_POST['first_sticker']); if (validate_size_barcode($_POST['first_sticker']) == 1) { echo "First sticker"; $sticky = 1; $first_sticker = set_first_sticker($_POST['first_sticker']); } } else { if (get_sticker_session()) {
<p>Manifest <a href="atts.php" data-role="button" data-transition="pop" data-ajax="false">Finish Manifest</a> </p> <!-- <div data-filter="true" class="ui-grid-a">--> <div > <!--<div >1. TV's 21</div> <div>2. TV'2 45</div> <div>3. Sky box</div> <div>4. Monitors : /NEW/</div>--> <?php //show_full_items_list_all_stock(); echo "SITE_SESSIOn" . get_site_sesion(); //echo $SIZE_OF_MANIFEST; //variable for qtty sign incremented on manifest - tmp //here we initialize manifest for testing purposes. But should be first function checking if last len manifest generated correctly all state $FINISHED_CORRECTLY $MANIFEST_STATE = initialize_manifest_reg(); //is in llop of every item add generet new one. shall have a lock and check if ($MANIFEST_STATE > 1) { // echo "MANIFEST GENERATED CORRECTLY"; $FLAG_MANIFEST_UNQ_NUMBER = $MANIFEST_STATE; } //here initialize the counter generator // $SIZE_OF_MANIFEST; //here lets check get and change sqlload if needes echo "GET"; var_dump($_GET); if (isset($_GET['type'])) {
echo '</div>'; //here a space for a table with collection details echo '<p>Your manifest collection details: </p>'; echo '<div>'; echo '<table data-role="table" data-mode="columntoggle" class="ui-responsive" data-column-btn-text="Edit!" >'; echo '<thead><tr> <th data-priority="6">Collection</th> <th>First</th> <th data-priority="1">Last Sticker</th> <th>You collected: </th> </tr> </thead>'; echo '<tbody>'; echo '<tr>'; echo '<td>'; echo get_post_code_session(get_site_sesion()); echo '</td>'; echo '<td>'; echo $first_sticker = get_sticker_session(); echo '</td>'; echo '<td>'; echo $last_sticker; echo '</td>'; echo '<td>'; echo $range = calculate_sticker_range($first_sticker, $last_sticker); echo " items"; //add to db dbi_write_sticker_range($site_id, $range); echo '</td>'; echo '</tr>'; echo '</tbody>';
function dbi_generate_site() { $customer_id = get_site_sesion(); //here we redad from session every generation. this is customer origin $site_ref_number = generate_manifest_unq_number(); //we change it later for site generator $batch_date = date("Y-m-d"); global $db; $batch_id = 70; //changed incremeneted every month $site_size = 0; //Zero. to be updated echo $sql = "INSERT INTO site(Origin_origin_id,site_ref_number,Rep_Auth,Dest_Location,batch_date,batch_id,closed) VALUES('{$customer_id}','{$site_ref_number}','14','7932','{$batch_date}','{$batch_id}','{$site_size}')"; $result = query_selecti($sql); $last_site = mysqli_insert_id($db); //lets take and return site_id. Shall be kept for manifest counter if (mysqli_affected_rows($result) == 1) { echo "generated site"; return $last_site; } else { echo "No site inserted. Initialised"; return $last_site; } }