action = $act; $this->section = $section; } /** * Execution des différentes actions */ public function proceed(){ global $msg, $id_col, $col_name, $expr_col, $expr_filtre, $view_name, $view_comment, $id_view; global $id, $id_req, $move, $conso, $date_deb,$date_fin,$date_ech, $list_ck,$remove_data, $remove_data_interval, $remove_data_interval_date_deb, $remove_data_interval_date_fin; if($id) $id_req=$id; switch($this->section){ case 'view_list': switch($this->action){ case 'save_view': //Enregistrement/Insertion d'une vue $this->save_view($id_view,$view_name,$view_comment); print $this->do_form(); break; case 'suppr_view': //Suppression d'une vue $this->delete_view($id_view); print $this->do_form(); break; case 'consolide_view': if($date_deb>$date_fin) error_form_message($msg['stat_wrong_date_interval']); elseif(!$list_ck) error_form_message($msg['stat_no_view_selected']); else { $consolidation = new consolidation($conso,$date_deb,$date_fin,$date_ech, $list_ck,$remove_data, $remove_data_interval); if(!empty($remove_data_interval_date_deb)) { $consolidation->set_remove_data_interval_date_debut($remove_data_interval_date_deb); } if(!empty($remove_data_interval_date_fin)) { $consolidation->set_remove_data_interval_date_fin($remove_data_interval_date_fin); } $consolidation->make_consolidation(); } print $this->do_form(); break; case 'reinit': //Réinitialisation de la vue $this->reinitialiser_view($id_view); print $this->do_form(); break; //Actions liées aux requêtes case 'configure': case 'update_config': case 'update_request': case 'exec_req': case 'final': //Actions liées aux requêtes $stq = new stat_query($id_req,$this->action,$id_view); $stq->proceed(); break; case 'save_request': case 'suppr_request': $stq = new stat_query($id_req,$this->action,$id_view); $stq->proceed(); print $this->do_form(); break; default: print $this->do_form(); break; } break; case 'view_gestion': switch($this->action){ case 'add_view': //ajout d'une vue //print $this->do_addview_form(); break; case 'update_view': //MaJ vue switch($move){ case 'up': //Déplacer un élément dans la liste des colonnes $this->monter_element($id_col); break; case 'down': //Déplacer un élément dans la liste des colonnes $this->descendre_element($id_col); break; } break; case 'save_col': //Enregistrement/Insertion d'une colonne $this->save_col($id_col,$col_name,$expr_col,$expr_filtre,$id_view); break; case 'suppr_col': //Suppression d'une colonne $this->delete_col($id_col); break; } print $this->do_addview_form($id_view); break; case 'colonne': switch($this->action){ case 'add_col': //ajout d'une colonne print $this->do_col_form(); break; case 'save_col': //Enregistrement/Insertion d'une colonne $this->save_col($id_col,$col_name,$expr_col,$expr_filtre,$id_view); print $this->do_addview_form($id_view); break; case 'update_col': //MaJ colonne print $this->do_col_form($id_col); break; case 'suppr_col': //Suppression d'une colonne $this->delete_col($id_col); print $this->do_addview_form($id_view); break; } break; case 'query': //Actions liées aux requêtes $stq = new stat_query($id_req,$this->action,$id_view); $stq->proceed(); break; case 'import': //Formulaire import de requete print $this->do_import_req_form($id_view); break; case 'importsuite': //Import de requete $this->do_import_req($id_view); break; default: break; } } /** * On fait appel au formulaire qui affiche la liste des vues */ public function do_form(){ global $stat_opac_view_form, $msg; global $msg; global $charset; global $javascript_path; global $open_view,$alert_consolid; print " "; $requete_vue = "select * from statopac_vues order by date_consolidation desc, nom_vue"; $res = pmb_mysql_query($requete_vue); $vue_affichage=""; if(pmb_mysql_num_rows($res) == 0){ $stat_opac_view_form = str_replace('!!liste_vues!!',$msg['stat_no_view_created'],$stat_opac_view_form); $stat_opac_view_form = str_replace('!!options_conso!!','',$stat_opac_view_form); $stat_opac_view_form = str_replace('!!btn_consolide!!','',$stat_opac_view_form); return $stat_opac_view_form; } else { $vue_affichage=""; $parity=1; $btn_consolide= ""; while(($vue = pmb_mysql_fetch_object($res))){ $min_date=''; $max_date=''; $view_scope = htmlentities($msg['stat_no_scope'],ENT_QUOTES,$charset); $min_date=$vue->date_debut_log; $max_date=$vue->date_fin_log; if ($min_date!='0000-00-00 00:00:00' && $max_date!='0000-00-00 00:00:00') { $view_scope = sprintf(htmlentities($msg['stat_view_scope'],ENT_QUOTES,$charset),formatdate($min_date),formatdate($max_date)); } $rqt="select * from statopac_request where num_vue='".addslashes($vue->id_vue)."' order by name"; $result = pmb_mysql_query($rqt); $liste_requete =""; while(($request = pmb_mysql_fetch_object($result))){ if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity++; $tr_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" "; $td_action = " onmousedown=\"document.location='./admin.php?categ=opac&sub=stat§ion=query&act=update_request&id_req=$request->idproc&id_view=$vue->id_vue';\" "; $btn_exec = ""; $btn_save = ""; $liste_requete.=" $btn_exec $request->name
$request->comment "; if (preg_match_all("|!!(.*)!!|U",$request->requete,$query_parameters)) $liste_requete.="".$msg["procs_options_config_param"].""; $liste_requete.="$btn_save"; } $tab_list="".$liste_requete."
".htmlentities($vue->nom_vue,ENT_QUOTES, $charset)."
"; $lien = "".htmlentities($vue->nom_vue,ENT_QUOTES, $charset) .""; $space = ""; $checkbox = ""; $btn = "
id_vue';\" /> id_vue';\" />
"; $date_conso=''; if ($vue->date_consolidation!=='0000-00-00 00:00:00') { $date_conso = sprintf($msg['stat_view_date_conso'],formatdate($vue->date_consolidation,true),$view_scope); } $libelle_titre = $space.$checkbox.$space.$lien.$space.$date_conso; $maximise = false; if ($open_view == $vue->id_vue) { $maximise = true; } $vue_affichage.=gen_plus($vue->id_vue,$libelle_titre,$tab_list.$btn,$maximise); } //Liste des options de consolidation $min_date=''; $max_date=''; $stat_scope = htmlentities($msg['stat_no_scope'],ENT_QUOTES,$charset); $q_sc = 'select min(date_log) as min_date, max(date_log) as max_date from statopac'; $r_sc = pmb_mysql_query($q_sc); if ($r_sc && pmb_mysql_num_rows($r_sc)) { $res_sc=pmb_mysql_fetch_object($r_sc); $min_date=$res_sc->min_date; $max_date=$res_sc->max_date; if ($min_date!='0000-00-00 00:00:00' && $min_date!='0000-00-00 00:00:00') { $stat_scope = sprintf(htmlentities($msg['stat_scope'],ENT_QUOTES,$charset),formatdate($res_sc->min_date),formatdate($res_sc->max_date)); } } $options = "
"; $options .= ""; $options .= "$space ".htmlentities($msg['stat_options_consolidation'],ENT_QUOTES,$charset).""; $options .= "$space $stat_scope"; $options .= "
"; $options_contenu ="









"; $options.=""; $stat_opac_view_form=str_replace("!!options_conso!!",$options,$stat_opac_view_form); $stat_opac_view_form=str_replace("!!liste_vues!!",$vue_affichage,$stat_opac_view_form); $stat_opac_view_form=str_replace("!!btn_consolide!!",$btn_consolide,$stat_opac_view_form); $btn_date_deb = ""; $btn_date_fin = ""; $btn_date_echeance = ""; $btn_remove_data_interval_date_deb = ""; $btn_remove_data_interval_date_fin = ""; $date_debut = strftime("%Y-%m-%d", mktime(0, 0, 0, date('m'), date('d')-1, date('y'))); $btn_date_deb=str_replace("!!date_deb!!",$date_debut,$btn_date_deb); $btn_date_deb=str_replace("!!date_deb_lib!!",formatdate($date_debut),$btn_date_deb); $date_fin = today(); $btn_date_fin=str_replace("!!date_fin!!",$date_fin,$btn_date_fin); $btn_date_fin=str_replace("!!date_fin_lib!!",formatdate($date_fin),$btn_date_fin); $date_echeance = today(); $btn_date_echeance=str_replace("!!date_ech!!",$date_echeance,$btn_date_echeance); $btn_date_echeance=str_replace("!!date_ech_lib!!",formatdate($date_echeance),$btn_date_echeance); $stat_opac_view_form=str_replace("!!date_deb_btn!!",$btn_date_deb,$stat_opac_view_form); $stat_opac_view_form=str_replace("!!date_fin_btn!!",$btn_date_fin,$stat_opac_view_form); $stat_opac_view_form=str_replace("!!echeance_btn!!",$btn_date_echeance,$stat_opac_view_form); $stat_opac_view_form=str_replace("!!remove_data_interval_date_deb!!",$btn_remove_data_interval_date_deb,$stat_opac_view_form); $stat_opac_view_form=str_replace("!!remove_data_interval_date_fin!!",$btn_remove_data_interval_date_fin,$stat_opac_view_form); if ($alert_consolid) { $stat_opac_view_form.=display_notification($msg["stat_import_consolide"]); } } return $stat_opac_view_form; } /** * On fait appel au formulaire d'ajout d'une vue */ public function do_addview_form($vue_id=''){ global $stat_view_addview_form; global $msg, $charset; if(!$vue_id){ $stat_view_addview_form=str_replace("!!name_view!!",'',$stat_view_addview_form); $stat_view_addview_form=str_replace("!!view_comment!!",'',$stat_view_addview_form); $stat_view_addview_form=str_replace("!!table_colonne!!",'',$stat_view_addview_form); $stat_view_addview_form=str_replace("!!bouton_add_col!!",'',$stat_view_addview_form); $stat_view_addview_form=str_replace("!!bouton_reinit_view!!",'',$stat_view_addview_form); $stat_view_addview_form=str_replace("!!btn_suppr!!",'',$stat_view_addview_form); $stat_view_addview_form=str_replace("!!view_title!!",$msg["stat_view_create_title"],$stat_view_addview_form); $stat_view_addview_form=str_replace("!!id_view!!",'',$stat_view_addview_form); return $stat_view_addview_form; } else { $btn_add_col = ""; $bouton_reinit_view=""; $btn_suppr = ""; $requete = "select nom_vue, comment from statopac_vues where id_vue='".addslashes($vue_id)."'"; $resultat = pmb_mysql_query($requete); while(($vue=pmb_mysql_fetch_object($resultat))){ $stat_view_addview_form=str_replace("!!name_view!!",htmlentities($vue->nom_vue,ENT_QUOTES,$charset),$stat_view_addview_form); $stat_view_addview_form=str_replace("!!view_comment!!",htmlentities($vue->comment,ENT_QUOTES, $charset),$stat_view_addview_form); } $stat_view_addview_form=str_replace("!!bouton_add_col!!",$btn_add_col,$stat_view_addview_form); $stat_view_addview_form=str_replace("!!bouton_reinit_view!!",$bouton_reinit_view,$stat_view_addview_form); $stat_view_addview_form=str_replace("!!btn_suppr!!",$btn_suppr,$stat_view_addview_form); $stat_view_addview_form=str_replace("!!id_view!!",$vue_id,$stat_view_addview_form); $res=""; $requete="select id_col, nom_col, expression, filtre, ordre, datatype from statopac_vues_col where num_vue='".$vue_id."' order by ordre"; $resultat=pmb_mysql_query($requete); if(pmb_mysql_num_rows($resultat) == 0){ $res="
".$msg["stat_no_col_associate"]."
"; $stat_view_addview_form=str_replace("!!table_colonne!!",$res,$stat_view_addview_form); $stat_view_addview_form=str_replace("!!view_title!!",$msg["stat_view_modif_title"],$stat_view_addview_form); return $stat_view_addview_form; } else { $res="\n"; $res.=""; $parity=1; $n=0; while ($r=pmb_mysql_fetch_object($resultat)) { if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity+=1; $tr_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" "; $action_td=" onmousedown=\"document.location='./admin.php?categ=opac&sub=stat§ion=colonne&act=update_col&id_col=$r->id_col&id_view=$vue_id';\" "; $res.=""; $res.=""; $res.=""; } $res.="
".$msg["stat_col_order"]."".$msg["stat_col_name"]."".$msg["stat_col_expr"]."".$msg["stat_col_filtre"]."".$msg['stat_col_type']."
"; $res.=""; $res .= ""; $res.="".htmlentities($r->nom_col,ENT_QUOTES,$charset)." ".htmlentities($r->expression,ENT_QUOTES,$charset)." ".htmlentities($r->filtre,ENT_QUOTES,$charset)." ".htmlentities($r->datatype,ENT_QUOTES,$charset)."
"; $stat_view_addview_form=str_replace("!!table_colonne!!",$res,$stat_view_addview_form); $stat_view_addview_form=str_replace("!!view_title!!",$msg["stat_view_modif_title"],$stat_view_addview_form); } } return $stat_view_addview_form; } /** * On fait appel au formulaire d'ajout de colonne */ public function do_col_form($id_col=''){ global $stat_view_addcol_form, $msg, $charset, $id_view; $datatype_list=array("small_text"=>"Texte","text"=>"Texte large","integer"=>"Entier","date"=>"Date","datetime"=>"Date/Heure","float"=>"Nombre à virgule"); if(!$id_col) { $stat_view_addcol_form=str_replace("!!col_name!!",'',$stat_view_addcol_form); $stat_view_addcol_form=str_replace("!!expr_col!!",'',$stat_view_addcol_form); $stat_view_addcol_form=str_replace("!!btn_suppr!!",'',$stat_view_addcol_form); $stat_view_addcol_form=str_replace("!!expr_filtre!!",'',$stat_view_addcol_form); $stat_view_addcol_form=str_replace("!!id_view!!",$id_view,$stat_view_addcol_form); $stat_view_addcol_form=str_replace("!!id_col!!",$id_col,$stat_view_addcol_form); $stat_view_addcol_form=str_replace("!!col_title!!",$msg["stat_col_create_title"],$stat_view_addcol_form); //liste des type de données $t_list="\n"; $stat_view_addcol_form=str_replace("!!datatype!!",$t_list,$stat_view_addcol_form); return $stat_view_addcol_form; } else { $requete="select nom_col, expression, filtre, datatype from statopac_vues_col where id_col='".$id_col."'"; $resultat=pmb_mysql_query($requete); while (($col=pmb_mysql_fetch_object($resultat))){ $col_name = htmlentities($col->nom_col,ENT_QUOTES,$charset); $expr = htmlentities($col->expression,ENT_QUOTES,$charset); $filtre = htmlentities($col->filtre,ENT_QUOTES,$charset); $datatype = htmlentities($col->datatype,ENT_QUOTES,$charset); } $stat_view_addcol_form=str_replace("!!col_name!!",$col_name,$stat_view_addcol_form); $stat_view_addcol_form=str_replace("!!expr_col!!",$expr,$stat_view_addcol_form); $stat_view_addcol_form=str_replace("!!expr_filtre!!",$filtre,$stat_view_addcol_form); $btn_suppr = ""; $stat_view_addcol_form=str_replace("!!btn_suppr!!",$btn_suppr,$stat_view_addcol_form); $stat_view_addcol_form=str_replace("!!col_title!!",$msg["stat_col_modif_title"],$stat_view_addcol_form); $stat_view_addcol_form=str_replace("!!id_view!!",$id_view,$stat_view_addcol_form); $stat_view_addcol_form=str_replace("!!id_col!!",$id_col,$stat_view_addcol_form); //liste des types de données $t_list="\n"; $stat_view_addcol_form=str_replace("!!datatype!!",$t_list,$stat_view_addcol_form); } return $stat_view_addcol_form; } /** * On insere ou enregistre une colonne */ public function save_col($id_col='', $col_name='',$expr_col='',$expr_filtre='', $vue_id=''){ global $datatype; if((!$id_col) && $vue_id){ $req_ordre = "select max(ordre) from statopac_vues_col where num_vue='".addslashes($vue_id)."'"; $resultat = pmb_mysql_query($req_ordre); if($resultat) $order = pmb_mysql_result($resultat,0,0); else $order=0; $ordre = $order+1; $req = "INSERT INTO statopac_vues_col(nom_col,expression,filtre,num_vue, ordre,datatype) VALUES ('".$col_name."', '".$expr_col."','".$expr_filtre."','".$vue_id."','".$ordre."', '".$datatype."')"; $resultat=pmb_mysql_query($req); } else { $rqt="select * from statopac_vues_col where nom_col='".$col_name."' and expression='".$expr_col."' and num_vue='".$vue_id."' and filtre='".$expr_filtre."' and datatype='".$datatype."'"; $res_exist = pmb_mysql_query($rqt); if(pmb_mysql_num_rows($res_exist)){ $modif=0; } else $modif=1; $req = "UPDATE statopac_vues_col SET nom_col='".$col_name."', expression='".$expr_col."', num_vue='".$vue_id."', filtre='".$expr_filtre."', datatype='".$datatype."', maj_flag=$modif WHERE id_col='".$id_col."'"; $resultat=pmb_mysql_query($req); } } /** * On insere ou enregistre une vue */ public function save_view($vue_id='', $view_name='',$view_comment=''){ if(!$vue_id){ $req = "INSERT INTO statopac_vues(nom_vue,comment) VALUES ('".$view_name."', '".$view_comment."')"; pmb_mysql_query($req); } else { $req = "UPDATE statopac_vues SET nom_vue='".$view_name."', comment='".$view_comment."' WHERE id_vue='".$vue_id."'"; pmb_mysql_query($req); } } /** * Supprime une vue et ces colonnes associées */ public function delete_view($vue_id){ if($vue_id){ $req="DELETE FROM statopac_vues where id_vue='".$vue_id."'"; pmb_mysql_query($req); $req="DELETE FROM statopac_vues_col where num_vue='".$vue_id."'"; pmb_mysql_query($req); $req="DELETE FROM statopac_request where num_vue='".$vue_id."'"; pmb_mysql_query($req); $req="DROP TABLE statopac_vue_".$vue_id; pmb_mysql_query($req); } } /** * Réinitialise la vue à zéro */ public function reinitialiser_view($vue_id=''){ if($vue_id){ $req="DELETE FROM statopac_vues_col where num_vue='".$vue_id."'"; pmb_mysql_query($req); $req="DELETE FROM statopac_request where num_vue='".$vue_id."'"; pmb_mysql_query($req); $req="DELETE FROM statopac_vue_".$vue_id; pmb_mysql_query($req); $req="update statopac_vues set date_consolidation='0000-00-00 00:00:00', date_debut_log='0000-00-00 00:00:00', date_fin_log='0000-00-00 00:00:00' where num_vue='".$vue_id."'"; pmb_mysql_query($req); } } /** * Supprime une colonne */ public function delete_col($id_col){ if($id_col){ $req="SELECT nom_col,num_vue FROM statopac_vues_col WHERE id_col='".$id_col."'"; $res=pmb_mysql_query($req); if(pmb_mysql_num_rows($res)){ //On supprime la colonne de la vue $id_vue=pmb_mysql_result($res,0,1); pmb_mysql_query("ALTER TABLE statopac_vue_".$id_vue." DROP `".pmb_mysql_result($res,0,0)."`"); $req="DELETE FROM statopac_vues_col where id_col='".$id_col."'"; pmb_mysql_query($req); //On recalcule l'ordre des colonnes $req="SELECT id_col FROM statopac_vues_col WHERE num_vue ='".$id_vue."' ORDER BY ordre"; $res=pmb_mysql_query($req); if(pmb_mysql_num_rows($res)){ $ordre=1; while ($ligne=pmb_mysql_fetch_object($res)) { pmb_mysql_query("UPDATE statopac_vues_col SET ordre='".$ordre."' WHERE id_col='".$ligne->id_col."'"); $ordre++; } } } } } /** * Changer l'ordre dans la liste en montant un élément */ public function monter_element($col_id=''){ $requete="select ordre from statopac_vues_col where id_col='".$col_id."'"; $resultat=pmb_mysql_query($requete); $ordre=pmb_mysql_result($resultat,0,0); $requete="select max(ordre) as ordre from statopac_vues_col where ordre<".addslashes($ordre); $resultat=pmb_mysql_query($requete); $ordre_max=@pmb_mysql_result($resultat,0,0); if ($ordre_max) { $requete="select id_col from statopac_vues_col where ordre='".addslashes($ordre_max)."' limit 1"; $resultat=pmb_mysql_query($requete); $idcol_max=pmb_mysql_result($resultat,0,0); $requete="update statopac_vues_col set ordre='".addslashes($ordre_max)."' where id_col='".$col_id."'"; pmb_mysql_query($requete); $requete="update statopac_vues_col set ordre='".addslashes($ordre)."' where id_col='".addslashes($idcol_max)."'"; pmb_mysql_query($requete); } } /** * Changer l'ordre dans la liste en descendant un élément */ public function descendre_element($col_id=''){ $requete="select ordre from statopac_vues_col where id_col='".$col_id."'"; $resultat=pmb_mysql_query($requete); $ordre=pmb_mysql_result($resultat,0,0); $requete="select min(ordre) as ordre from statopac_vues_col where ordre>".addslashes($ordre); $resultat=pmb_mysql_query($requete); $ordre_min=@pmb_mysql_result($resultat,0,0); if ($ordre_min) { $requete="select id_col from statopac_vues_col where ordre='".addslashes($ordre_min)."' limit 1"; $resultat=pmb_mysql_query($requete); $idcol_min=pmb_mysql_result($resultat,0,0); $requete="update statopac_vues_col set ordre='".addslashes($ordre_min)."' where id_col='".$col_id."'"; pmb_mysql_query($requete); $requete="update statopac_vues_col set ordre='".addslashes($ordre)."' where id_col='".addslashes($idcol_min)."'"; pmb_mysql_query($requete); } } /** * Verification de la presence et de la syntaxe des parametres de la requete * retourne true si OK, le nom du parametre entre parentheses sinon */ public function check_param($requete) { $query_parameters=array(); //S'il y a des termes !!*!! dans la requête alors il y a des paramètres if (preg_match_all("|!!(.*)!!|U",$requete,$query_parameters)) { for ($i=0; $i', '', $contenu) ; }elseif(strpos($contenu,'#charset=utf-8')!==false && $charset=='iso-8859-1'){ //mise à jour de l'encodage du contenu $contenu = utf8_decode($contenu); //mise à jour de l'entête des paramètres $contenu = str_replace('', '', $contenu) ; } //On distingue les différentes parties, la requête se trouve en $arrayFichier[2] preg_match('`(.+requete=\')(.+)(\', comment=\'.+)`s',$contenu,$arrayFichier); unset($arrayFichier[0]); //On va vérifier les colonnes de la vue existante $nbColAjout=0; foreach ($arrayCols as $col){ $res = pmb_mysql_query("SELECT * FROM statopac_vues_col WHERE num_vue=".$vue_id." AND expression='".addslashes($col[1])."'"); if($res){ if(!pmb_mysql_num_rows($res)){ //on va ajouter une colonne, on vérifie qu'il n'y a pas déjà une colonne avec le même nom $ok = false; $suffixe=0; while(!$ok){ $res2 = pmb_mysql_query("SELECT * FROM statopac_vues_col WHERE num_vue=".$vue_id." AND nom_col='".addslashes($col[0]).($suffixe?$suffixe:"")."'"); if($res2){ if(!pmb_mysql_num_rows($res2)){ $ok=true; if($suffixe){ $arrayFichier[2] = preg_replace('`(?<=\W)'.$col[0].'(?"; } $suffixe++; } pmb_mysql_query("INSERT INTO statopac_vues_col SET nom_col='".addslashes($col[0])."', expression='".addslashes($col[1])."', filtre='".addslashes($col[2])."', datatype='".addslashes($col[3])."', num_vue=".$vue_id); $nbColAjout++; }else{ //une colonne existe déjà avec la même fonction : on adapte la requête qu'on importe $row=pmb_mysql_fetch_object($res); $arrayFichier[2] = str_replace('`(?<=\W)'.$col[0].'(?nom_col,$arrayFichier[2]); } }else{ echo pmb_mysql_error()."
"; } } //Ajout requete $contenu=implode("",$arrayFichier); pmb_mysql_query($contenu) ; if (pmb_mysql_error()) { echo pmb_mysql_error()."

".htmlentities($contenu,ENT_QUOTES, $charset)."

" ; }else{ $idStat = pmb_mysql_insert_id(); //maj num_vue sur requete pmb_mysql_query("UPDATE statopac_request SET num_vue=".$vue_id." WHERE idproc=".$idStat); $add_url=''; if($nbColAjout){ $add_url='&alert_consolid=1'; } print ""; } } else { print "

".$msg['stat_import_invalide']."

Error code = $erreur
"; } print ""; //On efface le fichier temporaire if ($userfile_name) { unlink('./temp/'.$userfile_moved); } }else{ $erreur=1; print "

".$msg['stat_import_invalide']."

Error code = $erreur
"; } } public static function get_id_from_label($label) { $query = "SELECT id_vue FROM statopac_vues WHERE nom_vue='".addslashes($label)."'"; $result = pmb_mysql_query($query); if (pmb_mysql_num_rows($result)) { return pmb_mysql_result($result, 0, 'id_vue'); } return 0; } } ?>