X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fprofil%2Fget_adresses.inc.php;h=d31c65117598db52292f205472078031e58adc4b;hb=509e6025de4089e96f8511032b55c8745919e8d1;hp=341a563268401ddc69fe53fb1babcf668658d982;hpb=79a5acea67d00315fe79f2daad4568cd4d423235;p=platal.git diff --git a/include/profil/get_adresses.inc.php b/include/profil/get_adresses.inc.php index 341a563..d31c651 100644 --- a/include/profil/get_adresses.inc.php +++ b/include/profil/get_adresses.inc.php @@ -1,6 +1,6 @@ xdb->execute("DELETE FROM adresses WHERE uid = {?} AND adrid = {?}",Session::getInt('uid', -1), $adrid); - $globals->xdb->execute("DELETE FROM tels WHERE uid = {?} AND adrid = {?}",Session::getInt('uid', -1), $adrid); - if($in_request_array == true){ - unset($_REQUEST['adrid'][$adrid]); - } - else{ - unset($GLOBALS['adresses'][$adrid]); + XDB::execute("DELETE FROM adresses WHERE uid = {?} AND adrid = {?}", + S::v('uid', -1), $adrid); + XDB::execute("DELETE FROM tels WHERE uid = {?} AND adrid = {?}", + S::v('uid', -1), $adrid); + if ($in_request_array == true){ + unset($_REQUEST['adrid'][$adrid]); + } else{ + unset($GLOBALS['adresses'][$adrid]); } } //on verifie si on nous a demande une suppression -$req_adrid_del = Env::getMixed('adrid_del', Array()); -for($i = 1; $i <= $nb_adr_max; $i++){ - if( isset( $req_adrid_del[$i] ) ) { - delete_address($i,true); - } +$req_adrid_del = Env::v('adrid_del', Array()); +for ($i = 1; $i <= $nb_adr_max; $i++) { + if (isset($req_adrid_del[$i])) { + delete_address($i,true); + } } //$sql_order = "ORDER BY (NOT FIND_IN_SET('active', statut)), FIND_IN_SET('temporaire', statut)"; $sql_order = ''; //recuperation des adrid -$res = $globals->xdb->query("SELECT adrid FROM adresses WHERE uid = {?} AND NOT FIND_IN_SET('pro', statut) ".$sql_order, Session::getInt('uid', -1)); +$res = XDB::query("SELECT adrid FROM adresses WHERE uid = {?} AND NOT FIND_IN_SET('pro', statut) ".$sql_order, S::v('uid', -1)); $adrids = $res->fetchColumn(); //recuperation des donnees de la bd -$res = $globals->xdb->iterRow( +$res = XDB::iterRow( "SELECT FIND_IN_SET('res-secondaire', statut), FIND_IN_SET('courrier', statut), FIND_IN_SET('active', statut), FIND_IN_SET('temporaire', statut), @@ -74,7 +76,7 @@ $res = $globals->xdb->iterRow( gp.pays AS countrytxt, gp.display FROM adresses AS a INNER JOIN geoloc_pays AS gp ON(gp.a2 = a.country) WHERE uid = {?} AND NOT FIND_IN_SET('pro',statut) ".$sql_order -, Session::getInt('uid', -1) +, S::v('uid', -1) ); $nb_adr = $res->total(); @@ -95,12 +97,12 @@ for ($i = 0; $i < $nb_adr; $i++) { $adresses[$adrid]['txt'] = get_address_text($adresses[$adrid]); } -$restels = $globals->xdb->iterator( +$restels = XDB::iterator( "SELECT t.adrid, telid, tel_type, t.tel_pub, t.tel FROM tels AS t INNER JOIN adresses AS a ON(t.uid = a.uid AND t.adrid = a.adrid) WHERE t.uid = {?} AND NOT FIND_IN_SET('pro',statut) ORDER BY t.adrid, tel_type DESC, telid" -, Session::getInt('uid', -1) +, S::v('uid', -1) ); while ($tel = $restels->next()) { $adrid = $tel['adrid'];