function get_manifest_to_be_import_details() { global $FLAG_MESSG; //i think the problem is that was linked to dbs3 root sytem connect_tablet(); $sql = 'SELECT DISTINCT idmanifest_reg, manifest_unq_num,driver_num,date_manifest,siteid,start_dbs,end_dbs FROM manifest_reg INNER JOIN manifest_counter ON idmanifest_reg=manifest_reg_idmanifest_reg WHERE manifest_counter.finished=1 AND closed=0'; $result = add_db($sql); global $origin_id; $tab = array(); for ($z = 0; $z <= 1000; $z++) { $tab[$z] = 0; } echo '<table>'; while ($rek = mysql_fetch_array($result, MYSQL_BOTH)) { //changed from 1 $i++; $origin_none_detect = 0; $id_manif_id = $rek['idmanifest_reg']; //if($tab[$rek["id_test"]]<'1') //{ //echo '<tr><td>'.$rek["Name_sub"].'</td>'; // echo '<td>'.$rek["kind"].'</td>'; //echo '<td>'.$rek["weight"].'</td>'; echo '<tr><td>' . $rek["idmanifest_reg"] . '</td>'; echo '<td>' . $rek["manifest_unq_num"] . '</td>'; echo '<td>' . $rek["date_manifest"] . '</td>'; echo '<td>' . $rek["closed"] . '</td>'; echo '<td>' . get_site_id($rek["siteid"]) . '</td>'; echo '<td>' . get_origin_id($origin_id) . '</td>'; echo '<td>' . $rek['driver_num'] . '</td>'; echo '<td>collected by ' . get_user_id($rek['driver_num']) . '</td>'; echo '<td>' . $rek['start_dbs'] . '</td>'; echo '<td>' . $rek['end_dbs'] . '</td>'; echo '<td> <form action="import_mobile_new.php" method="POST">'; $idmanifest_counter = $rek['idmanifest_reg']; $select_mani_count = "SELECT SUM(manifest_counter) as ile FROM manifest_counter WHERE manifest_reg_idmanifest_reg='{$idmanifest_counter}'"; $result_count = mysql_query($select_mani_count); //echo mysql_error(); $rek_count = mysql_fetch_array($result_count); echo "<td>" . $rek_count['ile'] . "</td>"; echo "<td>"; if (($or_id = root_system_origin(tablet_detect_origins($origin_id))) != 0) { echo "DTCT: " . $or_id . " PO " . ($post_code = search_post_code_on_root(get_post_code(tablet_detect_origins($origin_id)))); if (empty($post_code)) { $origin_none_detect = 1; } } else { //tablet can detect and pass to get postcode echo "Got post codeL" . ($post_code = get_post_code(tablet_detect_origins($origin_id))); if (tablet_system_origin_post_code($post_code) == root_system_origin_post_code($post_code)) { echo "in root system that post code" . tablet_system_origin_post_code($post_code); $origin_none_detect = 0; } else { $origin_none_detect = 1; } //echo "none in the root"; // draw_origin_form(); } connect_tablet(); // echo get_origin_id($originid); echo "</td>"; echo "<td>"; echo $rek['driver_num']; $name_sub_cat = $rek['id']; echo '</td><td><input type="checkbox" name="att_ck" value="'; if (isset($_POST['att_ck'])) { echo 'checked'; } echo '">' . $rek[type_2] . '<br>'; //echo '</td><td><input style="padding:10px;margin:10px" type="text" name="batch_date" value="'.htmlentities($weight).'">'; echo '<input style="padding:10px;margin:10px" type="hidden" placeholder="Item type" name="name_sub_cat" value="' . htmlentities($name_sub_cat) . '">'; echo '<input type="hidden" name="submitted" value="1" >'; echo '<input type="hidden" name="id_manif_id" value="' . $id_manif_id . '" >'; if ($origin_none_detect != 1) { echo "<input style='padding:10px;margin:10px' type='submit' name='Submit' value='Import' align='right'>"; } else { //perform operation $FLAG_MESSG .= "Detected in root: " . ($origin_id_from_root = tablet_detect_origins($origin_id)); echo $origin_id_from_root; //if the case is none specified origin in the root system draw_origin_form($origin_id_from_root); } echo '</tr>'; //echo '<td>'.$rek["sum_weight"].'</td>'; // echo '<td>'.$rek["Name_sub"].'</td>'; //} echo "</form></td>"; //$tab[$rek["id_test"]]+=1; } echo '</tr></table><BR />'; }
echo '<table>'; while ($rek = mysql_fetch_array($result, MYSQL_BOTH)) { //changed from 1 $i++; $id_manif_id = $rek['idmanifest_reg']; //if($tab[$rek["id_test"]]<'1') //{ //echo '<tr><td>'.$rek["Name_sub"].'</td>'; // echo '<td>'.$rek["kind"].'</td>'; //echo '<td>'.$rek["weight"].'</td>'; echo '<tr><td>' . $rek["idmanifest_reg"] . '</td>'; echo '<td>' . $rek["manifest_unq_num"] . '</td>'; echo '<td>' . $rek["date_manifest"] . '</td>'; echo '<td>' . $rek["closed"] . '</td>'; echo '<td>' . get_site_id($rek["siteid"]) . '</td>'; echo '<td>' . get_origin_id($origin_id) . '</td>'; echo '<td>' . $rek['driver_num'] . '</td>'; echo '<td>collected by ' . get_user_id($rek['driver_num']) . '</td>'; echo '<td>' . $rek['start_dbs'] . '</td>'; echo '<td>' . $rek['end_dbs'] . '</td>'; echo '<td> <form action="import_mobile.php" method="POST">'; $idmanifest_counter = $rek['idmanifest_reg']; $select_mani_count = "SELECT SUM(manifest_counter) as ile FROM manifest_counter WHERE manifest_reg_idmanifest_reg='{$idmanifest_counter}'"; $result_count = mysql_query($select_mani_count); echo mysql_error(); $rek_count = mysql_fetch_array($result_count); echo "<td>" . $rek_count['ile'] . "</td>"; echo $rek['driver_num']; $name_sub_cat = $rek['id']; echo '</td><td><input type="checkbox" name="att_ck" value="'; if (isset($_POST['att_ck'])) {