1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
$query = "SELECT * FROM stock_livraison ".$innerjoin." WHERE 1=1 ".$where_recipient." ".$where_like." ".$where_date." ".$groupby." ORDER BY date_note DESC, loga_ref = REPLACE (loga_ref,'/','1') ASC";
$tot_enregistrement=$sql->QueryItem("SELECT count(1) FROM stock_livraison ".$innerjoin." WHERE 1=1 ".$where_recipient." ".$where_like." ".$where_date." ORDER BY date_note DESC, loga_ref = REPLACE (ref,'/','1') ASC");
$query.=" LIMIT ".$limit_deb.",".$nb_affichage_par_page."";
if($sql->Exists($query)){
$sql->Query($query);
for ($i=0; $i<$sql->rows; $i++){
$sql->GetRow($i);
$sql->data=clean_affich($sql->data);
$sql->data['loga_ref']=str_replace("-","/",$sql->data['loga_ref']);
if($i%2 == 0)
$sql->data['class']="paire";
else
$sql->data['class']="impaire";
//Status
$query2="SELECT * FROM stockr WHERE id_stock='".$sql->data['id_stock']."'";
if($sql2->Exists($query2)){
$sql2->Query($query2);
for ($j=0; $j<$sql2->rows; $j++){
$sql2->GetRow($j);
$sql2->=clean_affich($sql2->data);
if($sql2->data['status']=='1'){
$sql->data['status_image']="green";
$sql->data['awb']=$sql2->data['awb'];
$sql->data['hawb']=$sql2->data['hawb'];
}
else{
$sql->data['status_image']="red";
$sql->data['awb']="EN ATTENTE";
}
}
}
//colis
$query2="SELECT * FROM stock_colis WHERE id_stock='".$sql->data['id_stock']."'";
if($sql2->Exists($query2)){
$sql2->Query($query2);
for ($j=0; $j<$sql2->rows; $j++){
$sql2->GetRow($j);
$sql2->data=clean_affich($sql2->data);
$sql->data['number']=$sql2->data['number'];
$colis = explode("-", $sql2->data['parcel_no']);
if(count($colis)<=16)
$parse_parcel_id_view_more=0;
else
$parse_parcel_id_view_more=1;
for($jj=0;$jj<count($colis);$jj=$jj+4){
if($jj<=15){
if(isset($colis[$jj]) && isset($colis[$jj+1]) && isset($colis[$jj+2]) && isset($colis[$jj+3]))
$sql->data['no_affich'].=$colis[$jj]." - ".$colis[$jj+1]." - ".$colis[$jj+2]." - ".$colis[$jj+3]."<br>";
elseif(isset($colis[$jj]) && isset($colis[$jj+1]) && isset($colis[$j+2]) && !isset($colis[$jj+3]))
$sql->data['no_affich'].=$colis[$jj]." - ".$colis[$jj+1]." - ".$colis[$jj+2]."<br>";
elseif(isset($colis[$jj]) && isset($colis[$jj+1]) && !isset($colis[$j+2]))
$sql->data['no_affich'].=$colis[$jj]." - ".$colis[$jj+1]."<br>";
elseif(isset($colis[$jj]) && !isset($colis[$jj+1]))
$sql->data['no_affich'].=$colis[$jj]."<br>";
}
}
}
$sql->data['id']=$sql->data['no_affich'];
}
//AFFICHAGE
$xtpl2->assign("DATA", $sql->data);
if(!empty($parse_parcel_id_view_more)) $xtpl2->parse("main.table_result.ligne.parcel_id_view_more");
$xtpl2->parse("main.table_result.ligne");
}
} |
Partager