$id_lettre"; $res=Sql_Verif_Exec($req,"U","mysql_query"); } header("Location: ../admin/p_admin.php?inc=lettres_consult&resultpage=$resultpage"); break; case reglement: // recherche du code categorie if ($categorie!="0") { $req="SELECT cat_code FROM categorie where idcateg=$categorie"; $cat=Sql_Verif_Exec($req,"S","fetch_array_et_query"); $cat_code = $cat[cat_code]; } else { $cat_code = 'Toutes'; } // recherche du code region if ($region!="0") { $req="SELECT zo_nom FROM zone where id_zone=$region"; $reg=Sql_Verif_Exec($req,"S","fetch_array_et_query"); $reg_code = $reg[zo_nom]; } else { $reg_code = 'Toutes'; } // recherche du code pays if ($pays!="0") { $req="SELECT pa_nom FROM pays where id_pays=$pays"; $r_pays=Sql_Verif_Exec($req,"S","fetch_array_et_query"); $pays_code = $r_pays[pa_nom]; } else { $pays_code = 'Tous'; } // recherche du code transport if ($transport!="0") { $req="SELECT cat_code FROM categorie where idcateg=$transport"; $trans=Sql_Verif_Exec($req,"S","fetch_array_et_query"); $trans_code = $trans[cat_code]; } else { $trans_code = 'Tous'; } // recherche du code utilisateur $req="SELECT adm_login FROM administrateur where id_admin=$iduser"; $user=Sql_Verif_Exec($req,"S","fetch_array_et_query"); $nomFichier = "../upload/pdf/".array_pop(explode('\\', $docpdf)); if ($docpdf!="") { $req="update reglementation set reg_idcateg='$categorie',reg_codecateg='$cat_code',reg_idreg='$region',reg_codereg='$reg_code' ,reg_idpays='$pays',reg_codepays='$pays_code',reg_idtrans='$transport',reg_codetrans='$trans_code',reg_date=now(),reg_titre='$titre',reg_text='$texte',reg_pdf='$nomFichier',reg_iduser='$iduser',reg_codeuser='$user[adm_login]' where idregl=$idregl"; } else { $req="update reglementation set reg_idcateg='$categorie',reg_codecateg='$cat_code',reg_idreg='$region',reg_codereg='$reg_code' ,reg_idpays='$pays',reg_codepays='$pays_code',reg_idtrans='$transport',reg_codetrans='$trans_code',reg_date=now(),reg_titre='$titre',reg_text='$texte',reg_pdf='',reg_iduser='$iduser',reg_codeuser='$user[adm_login]' where idregl=$idregl"; } $res=Sql_Verif_Exec($req,"U","mysql_query"); header("Location: ../admin/p_admin.php?inc=regl_consult&resultpage=$resultpage"); break; case deplacer: //$res=mysql_query("select port.id_port,po_nom,esc_transbord,esc_transit,id_escale from escale,port where port.id_port=escale.id_port and id_ligne=$id_ligne order by esc_ordre "); $req="select port.id_port,po_nom,esc_transbord,esc_transit,id_escale from escale,port where port.id_port=escale.id_port and id_ligne=$id_ligne order by esc_ordre "; $res=Sql_Verif_Exec($req,"S","mysql_query"); while ($row=mysql_fetch_array($res)) {$tab[]=$row[id_escale];} while (list($key, $value) = each ($tab)){ if($vers==$key){$vers=$value;} } $de=$id_escale; $tab=deplacement($tab,$de,$vers);//fonction de deplacement while (list($key, $value) = each ($tab)) { $req="update escale set esc_ordre =$key where id_escale=$value"; //$res=mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); } header("Location: ../admin/p_admin.php?inc=ligne_modif&id_ligne=$id_ligne&li_type=$li_type&port=$port"); break; case escale: $req="update escale set esc_transbord ='$esc_transbord' , esc_transit='$esc_transit' where id_escale=$id_escale ";//mise à jour escale $res=Sql_Verif_Exec($req,"U","mysql_query"); $req="SELECT max(esc_transbord) as transbord FROM ligne,escale where ligne.id_ligne=escale.id_ligne and ligne.id_ligne=$id_ligne and esc_transbord >0"; $row=Sql_Verif_Exec($req,"S","fetch_array_et_query"); $req="update ligne set li_transbord ='$row[transbord]' where id_ligne=$id_ligne";// mise à jour du transbord pour la table ligne $res=Sql_Verif_Exec($req,"U","mysql_query"); header("Location: ../admin/p_admin.php?inc=ligne_modif&id_ligne=$id_ligne&li_type=$li_type&port=$port"); break; case choix_couple_escale : $req="delete from ligne_couple where id_escale= $id_escale "; $res=Sql_Verif_Exec($req,"D","mysql_query"); if($check_escale) { while( list ($cle, $valeur) =each($check_escale) ) { $req="insert into ligne_couple(id_ligne, id_escale,id_arm_soc) values('$id_ligne','$id_escale','$valeur') "; //$res=mysql_query($req); $res=Sql_Verif_Exec($req,"I","mysql_query"); } } header("Location: ../admin/p_admin.php?inc=ligne_modif&id_ligne=$id_ligne&li_type=$li_type&port=$port"); break; case pub_page: $req="update pub set "; if($transports_name) { copy($transports,"../upload/bandeau/$transports_name"); $req.=" pu_bandeau= '$transports_name' , "; } $req.= " pu_lien='$lien_transports' where id_pub = 1"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); $req="update pub set "; if($auxiliaires_name) { copy($auxiliaires,"../upload/bandeau/$auxiliaires_name"); $req.=" pu_bandeau= '$auxiliaires_name' , "; } $req.= " pu_lien='$lien_auxiliaires' where id_pub = 2"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); $req="update pub set "; if($auxiliairescie_name) { copy($auxiliairescie,"../upload/bandeau/$auxiliairescie_name"); $req.=" pu_bandeau= '$auxiliairescie_name' , "; } $req.= " pu_lien='$lien_auxiliairescie' where id_pub = 5"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); $req="update pub set "; if($auxiliairesrep_name) { copy($auxiliairesrep,"../upload/bandeau/$auxiliairesrep_name"); $req.=" pu_bandeau= '$auxiliairesrep_name' , "; } $req.= " pu_lien='$lien_auxiliairesrep' where id_pub = 6"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); $req="update pub set "; if($auxiliairesagent_name) { copy($auxiliairesagent,"../upload/bandeau/$auxiliairesagent_name"); $req.=" pu_bandeau= '$auxiliairesagent_name' , "; } $req.= " pu_lien='$lien_auxiliairesagent' where id_pub = 7"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); $req="update pub set "; if($transitairemar_name) { copy($auxiliairesagent,"../upload/bandeau/$transitairemar_name"); $req.=" pu_bandeau= '$transitairemar_name' , "; } $req.= " pu_lien='$lien_transitairemar' where id_pub = 9"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); $req="update pub set "; if($nvoccmar_name) { copy($auxiliairesagent,"../upload/bandeau/$nvoccmar_name"); $req.=" pu_bandeau= '$nvoccmar_name' , "; } $req.= " pu_lien='$lien_nvoccmar' where id_pub = 10"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); $req="update pub set "; if($entreposage_name) { copy($entreposage,"../upload/bandeau/$entreposage_name"); $req.=" pu_bandeau= '$entreposage_name' , "; } $req.= " pu_lien='$lien_entreposage' where id_pub = 3"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); $req="update pub set "; if($ressources_name) { copy($ressources,"../upload/bandeau/$ressources_name"); $req.=" pu_bandeau= '$ressources_name' , "; } $req.= " pu_lien='$lien_ressources' where id_pub = 4"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); $req="update pub set "; if($fluvialcons_name) { copy($ressources,"../upload/bandeau/$fluvialcons_name"); $req.=" pu_bandeau= '$fluvialcons_name' , "; } $req.= " pu_lien='$lien_fluvialcons' where id_pub = 11"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); $req="update pub set "; if($fluvialtrans_name) { copy($ressources,"../upload/bandeau/$fluvialtrans_name"); $req.=" pu_bandeau= '$fluvialtrans_name' , "; } $req.= " pu_lien='$lien_fluvialtrans' where id_pub = 12"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); //reglementation $req="update pub set "; if($reglement_name) { copy($ressources,"../upload/bandeau/$reglement_name"); $req.=" pu_bandeau= '$reglement_name' , "; } $req.= " pu_lien='$lien_reglement' where id_pub = 13"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); //fret $req="update pub set "; if($fret_name) { copy($ressources,"../upload/bandeau/$fret_name"); $req.=" pu_bandeau= '$fret_name' , "; } $req.= " pu_lien='$lien_fret' where id_pub = 14"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); //consignataire maritime $req="update pub set "; if($consignatairemar_name) { copy($ressources,"../upload/bandeau/$consignatairemar_name"); $req.=" pu_bandeau= '$consignatairemar_name' , "; } $req.= " pu_lien='$lien_fret' where id_pub = 15"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); //routier $req="update pub set "; if($routier_name) { copy($ressources,"../upload/bandeau/$routier_name"); $req.=" pu_bandeau= '$routier_name' , "; } $req.= " pu_lien='$lien_fret' where id_pub = 16"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); header("Location: ../admin/p_admin.php?inc=pub_page"); break; case pub_pays: $req="select * from pub where id_pays=$id_pays"; $res=Sql_Verif_Exec($req,"S","mysql_query"); if($count=mysql_num_rows($res)>0) { $req="update pub set "; if($pu_bandeau) { copy($pu_bandeau,"../upload/bandeau/$pu_bandeau_name"); $req.=" pu_bandeau= '$pu_bandeau_name' , "; } $req.= " pu_lien='$pu_lien' where id_pays = $id_pays"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); } else { if($pu_bandeau){copy($pu_bandeau,"../upload/bandeau/$pu_bandeau_name");} $req="insert into pub(pu_bandeau,pu_lien,id_pays) values('$pu_bandeau_name','$pu_lien',$id_pays) "; $res=Sql_Verif_Exec($req,"I","mysql_query"); } header("Location: ../admin/p_admin.php?inc=zone_consult&id_zone=$id_zone&id_pays=$id_pays&niveau=pays&pa_nom=$pa_nom&pub=oui"); break; case pub_port: $req="select * from pub where id_port=$id_port"; $res=Sql_Verif_Exec($req,"S","mysql_query"); if($count=mysql_num_rows($res)>0) { $req="update pub set "; if($pu_bandeau) { copy($pu_bandeau,"../upload/bandeau/$pu_bandeau_name"); $req.=" pu_bandeau= '$pu_bandeau_name' , "; } $req.= " pu_lien='$pu_lien', pu_affichage='$pu_affichage' ,id_pays=$id_pays where id_port= $id_port"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); } else { if($pu_bandeau){copy($pu_bandeau,"../upload/bandeau/$pu_bandeau_name");} $req="insert into pub(pu_bandeau,pu_lien,pu_affichage,id_port,id_pays) values('$pu_bandeau_name','$pu_lien','$pu_affichage',$id_port,$id_pays) "; $res=Sql_Verif_Exec($req,"I","mysql_query"); } header("Location: ../admin/p_admin.php?inc=zone_consult&id_zone=$id_zone&id_pays=$id_pays&niveau=port&po_nom=$po_nom&id_port=$id_port&type=$type&pub=oui"); break; case pub_region: $req="select * from pub where id_region=$region"; $res=Sql_Verif_Exec($req,"S","mysql_query"); if($count=mysql_num_rows($res)>0) { $req="update pub set "; if($pu_bandeau) { copy($pu_bandeau,"../upload/bandeau/$pu_bandeau_name"); $req.=" pu_bandeau= '$pu_bandeau_name' , "; } $req.= " pu_lien='$pu_lien', pu_affichage='$pu_affichage' where id_region= $region"; //$req =mysql_query($req); $res=Sql_Verif_Exec($req,"U","mysql_query"); } else { if($pu_bandeau){copy($pu_bandeau,"../upload/bandeau/$pu_bandeau_name");} $req="insert into pub(pu_bandeau,pu_lien,pu_affichage,id_region) values('$pu_bandeau_name','$pu_lien','$pu_affichage',$region) "; $res=Sql_Verif_Exec($req,"I","mysql_query"); } header("Location: ../admin/p_admin.php?inc=societe_consult&so_type=$so_type&pub=oui&resultpage=$resulpage®ion=$region"); break; case fret: $zdate_livr = $fr_datelivrA.'-'.$fr_datelivrM.'-'.$fr_datelivrJ; $req="update fret set fr_idsociete='$fr_idsociete',fr_type='$fr_type',fr_titre='$fr_titre',fr_de='$fr_de',fr_idde='$fr_idde' ,fr_paysde='$fr_paysde',fr_idpaysde='$fr_idpaysde',fr_a='$fr_a',fr_ida='$fr_ida',fr_paysa='$fr_paysa' ,fr_idpaysa='$fr_idpaysa' ,fr_typetrans='$fr_trans' ,fr_march='$fr_march' ,fr_detail='$fr_detail',fr_datelivr='$zdate_livr',fr_datemaj=now(),fr_idzonede='$fr_idzonede',fr_idzonea='$fr_idzonea' where idfret=$idfret"; $res=Sql_Verif_Exec($req,"U","mysql_query"); header("Location: ../admin/p_admin.php?inc=$consult&id_societe=$fr_idsociete&resultpage=$resultpage"); break; case fret_lettres: $req="update fret_lettres set fl_date=now(),fl_titre='$fl_titre',fl_idsociete='$id_societe',fl_objet='$fl_objet' ,fl_corps='$fl_corps' where idfretlettre='$idfretlettre'"; //echo $req; $res=Sql_Verif_Exec($req,"U","mysql_query"); header("Location: ../admin/p_admin.php?inc=fret_lettres_consult&id_societe=$id_societe&resultpage=$resultpage"); break; //PGF case actualites: $dte=substr($date,6,4)."-".substr($date,3,2)."-".substr($date,0,2); if(isset($statut)) { $etat = 'A'; } else { $etat = ''; } if($pdfname=='') { $req="update actualites set ac_date='$dte',ac_titre='$titre',ac_auteur='$auteur',ac_admin='$admin',ac_statut='$etat',ac_notes='$notes',ac_lien='$lien',ac_texte_lien='$textelien',ac_pdf='',ac_article='$texte' where id_actualite=$id_actualite"; } else { $nomFichier = "../upload/pdf/".array_pop(explode('\\', $pdfname)); $req="update actualites set ac_date='$dte',ac_titre='$titre',ac_auteur='$auteur',ac_admin='$admin',ac_statut='$etat',ac_notes='$notes',ac_lien='$lien',ac_texte_lien='$textelien',ac_pdf='$nomFichier',ac_article='$texte' where id_actualite=$id_actualite"; } $res=Sql_Verif_Exec($req,"U","mysql_query"); header("Location: ../admin/p_admin.php?inc=actualites_liste&resultpage=$resultpage"); break; } include "../inc_admin/close.php"; //phpinfo(); ?>