url=basename($_SERVER['PHP_SELF']); $this->num_pulsanti="5"; $this->record_per_pagina="1"; $arr_ordine = explode(";", $_POST['ord']); $this->ordine_campo=$arr_ordine[0]; $this->ordine_tipo=$arr_ordine[1]; $this->url_folder_img="../img/"; if($this->ordine_tipo==''){ $this->ordine_tipo="ASC"; } if($this->ordine_tipo!='ASC' & $this->ordine_tipo!='DESC'){ $this->ordine_tipo="ASC"; } $this->id_lingua="1"; $this->pagina_corrente=$_POST['pag']; if($this->pagina_corrente==''){ $this->pagina_corrente=1; } } //------------------------------------------------------------------------------------------------------------- // funzioni: db_connect (si connette al DB) //------------------------------------------------------------------------------------------------------------- function db_connect($siteDbhost,$siteDbuser,$siteDbpassword,$siteDbname,$siteDbtype){ $dsn_db = $siteDbtype."://".$siteDbuser.":".$siteDbpassword."@".$siteDbhost."/".$siteDbname; $my_db = DB::connect($dsn_db); if (DB::isError($my_db)){ die ($my_db->getMessage()); } $this->db=$my_db; } //------------------------------------------------------------------------------------------------------------- // funzioni: execute_query (esegue una query) //------------------------------------------------------------------------------------------------------------- function execute_query($sql){ $result = $this->db->query($sql); if (DB::isError($result)) die ("$sql
In execute_query A
".$result->getMessage()); return "ok"; } //------------------------------------------------------------------------------------------------------------- // funzioni: run_query (ritorna un array con tutti gli elementi di una query) //------------------------------------------------------------------------------------------------------------- function run_query($sql){ $result = $this->db->query($sql); if (DB::isError($result)) die ("$sql
In run_query A
".$result->getMessage()); $info = $result->tableInfo(); $tot_campi=count($info); while ($result->fetchInto($row)) { for($i=0; $i<$tot_campi; $i++){ $arr[$info[$i]['table']."_".$info[$i]['name']][]=$row[$i]; } } $arr['tot_record']=$result->numRows(); return $arr; } //------------------------------------------------------------------------------------------------------------- // funzioni: run_query_standard (ritorna un array con tutti gli elementi di una query senza modificare campi) //------------------------------------------------------------------------------------------------------------- function run_query_standard($sql){ $result = $this->db->query($sql); if (DB::isError($result)) die ("$sql
In run_query A
".$result->getMessage()); $info = $result->tableInfo(); $tot_campi=count($info); while ($result->fetchInto($row)) { for($i=0; $i<$tot_campi; $i++){ $arr[$info[$i]['name']][]=$row[$i]; } } $arr['tot_record']=$result->numRows(); return $arr; } //------------------------------------------------------------------------------------------------------------- // funzioni: run_query (ritorna un array con tutti gli elementi di una query) //------------------------------------------------------------------------------------------------------------- function run_query_one($sql){ $result = $this->db->query($sql); if (DB::isError($result)) die ("$sql
In run_query_one A
".$result->getMessage()); $info = $result->tableInfo(); $tot_campi=count($info); while ($result->fetchInto($row)) { for($i=0; $i<$tot_campi; $i++){ $str_result=$row[$i]; } } return $str_result; } //------------------------------------------------------------------------------------------------------------- // funzioni: Traduttore //------------------------------------------------------------------------------------------------------------- function traduttore($codice,$id_lingua=''){ if ($id_lingua==''){ $id_lingua=$this->id_lingua; } $sql="SELECT Testo FROM testi_traduzioni WHERE Codice = '$codice' AND IDLingua = '$id_lingua'"; $result=$this->run_query_one($sql); if($result==''){ return $codice."!!!"; }else{ return $result; } } //------------------------------------------------------------------------------------------------------------- // funzioni: Paginatore-> paginatore($url, $num_pulsanti='3', $tot_pagine='', $pagina_corrente='', $class1='', // $class2='', $style1='', $style2='') //------------------------------------------------------------------------------------------------------------- var $url; var $num_pulsanti; var $class1; var $class2; var $style1; var $style2; function paginatore(){ if ($this->special_target!=''){ $str_target="target=\"mywindow\""; } //cerco la pagina corrente per il controllo $tot_pagine=$this->tot_pagine; //il numero di pulsanti deve essere sempre dispari. $num_pulsanti_prima_dopo=($this->num_pulsanti-1)/2; //<< if ($this->pagina_corrente > 1){ $link="1"; $arr['button'][]="<<"; } //< if ($this->pagina_corrente > 1){ $link=$this->pagina_corrente-1; $arr['button'][]="<"; } //1-2-3-4-... for ($i=($this->pagina_corrente-$num_pulsanti_prima_dopo)-1; $i<($this->pagina_corrente+$num_pulsanti_prima_dopo); $i++){ if ($i>=0 & $i<$this->tot_pagine){ if (($i+1)!=$this->pagina_corrente){ $link=$i+1; $arr['button'][]="".($i+1).""; }else{ $arr['button'][]="".($i+1).""; } } } //> if ($this->pagina_corrente < $tot_pagine){ $link=$this->pagina_corrente + 1; $arr['button'][]=">"; } //> if ($this->pagina_corrente < $tot_pagine){ $link=$this->tot_pagine; $arr['button'][]=">>"; } //tot item $txt_pagina=$this->traduttore('txt_pagina'); $txt_di=$this->traduttore('txt_di'); if($this->tot_pagine==0){ $this->tot_pagine=1; } $result['pagina_x_di_y'].="".$txt_pagina." ".$this->pagina_corrente." ".$txt_di." ".$this->tot_pagine; for ($i=0; $ispecial_target!=''){ $str_target="target=\"mywindow\""; } //trasforma la query per calcolare il numero di dati ed il numero di pagine, e per impostare il limit della query //trasformo la query if(trim($_POST['txtricerca'])!=''){ $sqlcerca=$sql." LIMIT 1"; $result = $this->db->query($sqlcerca); if (DB::isError($result)) die ("$sql
In run_query A
".$result->getMessage()); $info = $result->tableInfo(); $tot_campi=count($info); if(strpos($sql, "WHERE")!=''){ $sql.=" AND ("; }else{ $sql.=" WHERE ("; } $arr_search=explode(" ", $_POST['txtricerca']); for($i=0; $ifetchInto($row)) { for($j=0; $j<$tot_campi; $j++){ if ($info[$j]['table']!=''){ $sql.=$info[$j]['table'].".".$info[$j]['name']." LIKE '%".$arr_search[$i]."%' OR "; } } } } $sql.="1=0)"; } $sql_quanti="SELECT COUNT(*) AS TOTRECORD ".strstr($sql, "FROM"); $tot_record=$this->run_query_one($sql_quanti); if (($tot_record*$this->record_per_pagina)<($this->pagina_corrente*$this->record_per_pagina)){ $this->pagina_corrente=1; } $this->tot_pagine=ceil($tot_record/$this->record_per_pagina); $start_record=($this->pagina_corrente*$this->record_per_pagina)-$this->record_per_pagina; if ($this->ordine_campo!=''){ //dato il campo ordine devo scomporto per trovare l'evvettivo nome della tabella e del campo if(strpos($sql, "WHERE")!=''){ $sqlcerca=$sql." OR 1=1 LIMIT 1"; }else{ $sqlcerca=$sql." WHERE 1=1 LIMIT 1"; } $result = $this->db->query($sqlcerca); if (DB::isError($result)) die ("$sqlcerca
In run_query A
".$result->getMessage()); $info = $result->tableInfo(); $tot_campi=count($info); while ($result->fetchInto($row)) { for($i=0; $i<$tot_campi; $i++){ if($info[$i]['table']!=''){ if((strpos($this->ordine_campo, $info[$i]['table'])>-1)&(strpos($this->ordine_campo, $info[$i]['name'])>-1)){ $ordine_esatto=$info[$i]['table'].".".$info[$i]['name']; } } } } if ($this->campo_ordine_speciale!='true'){ $sql.=" ORDER BY $ordine_esatto $this->ordine_tipo"; }else{ } }else{ $sql.=$this->first_order; } $sql.=" LIMIT $start_record,".$this->record_per_pagina; //Creo il datasource $datasource=$this->run_query($sql); //print_r($datasource); //Scrivo la tabella if ($datasource['tot_record']>0){ $mypag=$this->paginatore(); return $this->datagridstyle($datasource, $mypag); }else{ $tab="
class_container\" style=\"$this->style_container\">class_table\" style=\"$this->style_table\" ".$this->prop_table." >"; //caption if($this->view_caption!='' & $this->view_caption!='true'){ $this->view_caption='false'; } if($this->view_caption!='false'){ $tab.="class_trc\" style=\"$this->style_trc\">"; $tab.=""; $tab.=""; } //Ricerca if ($this->view_ricerca!='false'){ $tab.="class_trr\" style=\"$this->style_trr\">"; $tab.=""; $tab.=""; } $tab.="class_trr\" style=\"$this->style_trr\">"; $tab.=""; $tab.=""; $tab.="
class_tdc\" style=\"$this->style_tdc\" colspan=\"$num_col_view\">"; $tab.=$this->caption; $tab.="
class_tdr\" style=\"$this->style_tdr\" colspan=\"$num_col_view\">"; $tab.=$this->traduttore('txt_ricerca')."  "; $tab.="url_folder_img."view.png\" border=\"0\" align=\"absmiddle\" alt=\"trova\">"; $tab.="
class_tdr\" colspan=\"$num_col_view\" align=\"center\">"; $tab.="La ricerca non ha portato alcun risultato"; $tab.="
"; return $tab; } } //------------------------------------------------------------------------------------------------------------- // funzioni: datastyle //------------------------------------------------------------------------------------------------------------- var $style_container; var $class_container; var $prop_table; var $class_table; var $style_table; var $view_column; var $view_caption; var $caption; var $class_trc; var $style_trc; var $class_tdc; var $style_tdc; var $view_ricerca; var $class_trr; var $style_trr; var $class_tdr; var $style_tdr; var $view_header; var $class_trh; var $style_trh; var $column_name; var $class_tdh; var $style_tdh; var $class_trb; var $style_trb; var $class_tdb; var $style_tdb; var $view_footer; var $footer; var $class_trf; var $style_trf; var $class_tdf; var $style_tdf; var $view_pager; var $class_trp; var $style_trp; var $class_tdp; var $style_tdp; var $add_column_name; var $add_column_text; var $class_tda; var $style_tda; function datagridstyle($datasource, $paginatore){ if ($this->special_target!=''){ $str_target="target=\"mywindow\""; } //INIZIO $tab="
class_container\" style=\"$this->style_container\">class_table\" style=\"$this->style_table\" ".$this->prop_table." >"; //scelgo cosa vedere $i=0; $num_col_view=0; foreach ($datasource as $key => $value) { if($key!='tot_record'){ if($this->view_column[$i]!='' & $this->view_column[$i]!='true'){ $this->view_column[$i]='false'; }else{ $num_col_view++; } } $i++; } $num_col_view+=count($this->add_column_name); //caption if($this->view_caption!='' & $this->view_caption!='true'){ $this->view_caption='false'; } if($this->view_caption!='false'){ $tab.="class_trc\" style=\"$this->style_trc\">"; $tab.=""; $tab.=""; } //Ricerca if ($this->view_ricerca!='false'){ $tab.="class_trr\" style=\"$this->style_trr\">"; $tab.=""; $tab.=""; } //Pager if($this->view_pager!='' & $this->view_pager!='true'){ $this->view_pager='false'; } if($this->view_pager!='false'){ $tab.="class_trp\" style=\"$this->style_trp\">"; $tab.=""; $tab.=""; } //header if($this->view_header!='' & $this->view_header!='true'){ $this->view_header='false'; } if($this->view_header!='false'){ $i=0; $tab.="class_trh[$i]."\" style=\"".$this->style_trh[$i]."\">"; foreach ($datasource as $key => $value) { if($key!='tot_record' & $this->view_column[$i]!='false'){ ($this->column_name[$i]=='') ? $nome_colonna=$key."(".$i.")" : $nome_colonna=$this->column_name[$i]; $tab.=""; } $i++; $special='false'; } //add_column for($k=0; $kadd_column_name); $k++){ $tab.=""; } $tab.=""; } //corpo for($i=0; $i<$datasource['tot_record']; $i++){ $tab.="class_trb."\" style=\"".$this->style_trb."\">"; $j=0; foreach ($datasource as $key => $value) { if($j==0){ $varid=$datasource[$key][$i]; } if($j==1){ $varid2=$datasource[$key][$i]; } if($j==2){ $varid3=$datasource[$key][$i]; } if($j==3){ $varid4=$datasource[$key][$i]; } if($j==4){ $varid5=$datasource[$key][$i]; } if($j==5){ $varid6=$datasource[$key][$i]; } if($j==6){ $varid7=$datasource[$key][$i]; } if($j==7){ $varid8=$datasource[$key][$i]; } if($j==8){ $varid9=$datasource[$key][$i]; } if($j==9){ $varid10=$datasource[$key][$i]; } if($j==10){ $varid11=$datasource[$key][$i]; } if($key!='tot_record' & $this->view_column[$j]!='false'){ $tab.=""; } $j++; } //add_column for($k=0; $kadd_column_name); $k++){ if($this->add_column_condition[$k]==''){ $tab.=""; }else{ $arr_condition=explode(',', $this->add_column_condition[$k]); if($arr_condition[1]=='!='){ $tab.=""; }elseif($arr_condition[1]=='=='){ $tab.=""; } } } $tab.=""; } //Footer if($this->view_footer!='' & $this->view_footer!='true'){ $this->view_footer='false'; } if($this->view_footer!='false'){ $tab.="class_trf\" style=\"$this->style_trf\">"; $tab.=""; $tab.=""; } //Pager if($this->view_pager!='' & $this->view_pager!='true'){ $this->view_pager='false'; } if($this->view_pager!='false'){ $tab.="class_trp\" style=\"$this->style_trp\">"; $tab.=""; $tab.=""; } $tab.="
class_tdc\" style=\"$this->style_tdc\" colspan=\"$num_col_view\">"; $tab.=$this->caption; $tab.="
class_tdr\" style=\"$this->style_tdr\" colspan=\"$num_col_view\">"; $tab.="Ricerca  "; $tab.="url_folder_img."view.png\" border=\"0\" align=\"absmiddle\" alt=\"trova\">"; $tab.="
class_tdp\" style=\"$this->style_tdp\" colspan=\"$num_col_view\">"; $tab.=$paginatore['pagina_x_di_y']."
".$paginatore['navigatore']; $tab.="
class_tdh[$i]."\" style=\"".$this->style_tdh[$i]."\">"; if($key[0]=='_'){ $cur_link=substr($key, 1); }else{ $cur_link=$key; } if ($cur_link==$this->ordine_campo & $trovato!='true'){ if($this->ordine_tipo=='ASC'){ $tab.="".$nome_colonna."  url_folder_img."asc_order.png"."\" border=\"0\" align=\"absmiddle\">"; }else{ $tab.="".$nome_colonna."  url_folder_img."desc_order.png"."\" border=\"0\" align=\"absmiddle\">"; } $trovato='true'; }else{ $tab.="".$nome_colonna.""; } $tab.="class_tda[$k]."\" style=\"".$this->style_tda[$k]."\">"; $tab.=$this->add_column_name[$k]; $tab.="
class_tdb[$j]."\" style=\"".$this->style_tdb[$j]."\">"; $tab.=$datasource[$key][$i]; $tab.="class_tdb[$j]."\" style=\"".$this->style_tdb[$j]."\">"; $str_rep=str_replace("#varid#", $varid, $this->add_column_text[$k]); $str_rep=str_replace("#varid2#", addslashes($varid2), $str_rep); $tab.=$str_rep; $tab.="class_tdb[$j]."\" style=\"".$this->style_tdb[$j]."\">"; $cur_var=str_replace("#", "", $arr_condition[0]); if(str_replace($arr_condition[0], addslashes($$cur_var),$arr_condition[0])!=$arr_condition[2]){ $str_rep=str_replace("#varid#", $varid, $this->add_column_text[$k]); $str_rep=str_replace("#varid2#", addslashes($varid2), $str_rep); $tab.=$str_rep; }else{ $tab.=" "; } $tab.="class_tdb[$j]."\" style=\"".$this->style_tdb[$j]."\">"; $cur_var=str_replace("#", "", $arr_condition[0]); if(str_replace($arr_condition[0], addslashes($$cur_var),$arr_condition[0])==$arr_condition[2]){ $str_rep=str_replace("#varid#", $varid, $this->add_column_text[$k]); $str_rep=str_replace("#varid2#", addslashes($varid2), $str_rep); $tab.=$str_rep; }else{ $tab.=" "; } $tab.="
class_tdf\" style=\"$this->style_tdf\" colspan=\"$num_col_view\">"; $tab.=$this->footer; $tab.="
class_tdp\" style=\"$this->style_tdp\" colspan=\"$num_col_view\">"; $tab.=$paginatore['pagina_x_di_y']."
".$paginatore['navigatore']; $tab.="
"; return $tab; } //------------------------------------------------------------------------------------------------------------- // funzioni: workup_select //------------------------------------------------------------------------------------------------------------- var $class_ws; var $style_ws; function workup_select($name, $datasource, $value, $text, $selected_value, $sql_ricerca, $campo_ricerca, $nome_tabella, $path=''){ //scrivo la funzione $str_select=""; //scrivo il controllo $str_select.="class_ws."\" style=\"width:25%;".$this->style_ws."\" onblur=\"ws_blur('$name')\">"; $str_select.=" "; $str_select.=""; $str_select.=" "; $str_select.="url_folder_img."view.png\" border=\"0\" align=\"absmiddle\">"; return $str_select; } //------------------------------------------------------------------------------------------------------------- // funzioni: workup_select_simply //------------------------------------------------------------------------------------------------------------- function workup_select_simply($name, $datasource, $text, $value, $selected_value){ //scrivo la funzione $str_select=""; //scrivo il controllo $str_select.=""; return $str_select; } //------------------------------------------------------------------------------------------------------------- // funzioni: Format data //------------------------------------------------------------------------------------------------------------- function format_data($data,$separatore,$formato){ //creo l'array $arr_data=explode($separatore, $data); switch ($formato) { case 'dd/mm/yyyy': $result=$arr_data[2]."/".$result=$arr_data[1]."/".$result=$arr_data[0]; break; case 'yyyy-mmm-dd': $result=$arr_data[2]."-".$result=$arr_data[1]."-".$result=$arr_data[0]; break; } return $result; } //------------------------------------------------------------------------------------------------------------- // funzioni: format_link //------------------------------------------------------------------------------------------------------------- function format_link($link){ if ($link) { $check_url=strstr($link, 'http://'); if (!$check_url) $link="http://".$link; } //print($link); return $link; } //------------------------------------------------------------------------------------------------------------- // funzioni: check_folder //------------------------------------------------------------------------------------------------------------- function check_folder($folder){ if(file_exists($folder)){ if (!is_dir($folder)){ $oldumask = umask(0); mkdir($folder,0777); umask($oldumask); } } else { $oldumask = umask(0); mkdir($folder,0777); umask($oldumask); } } //------------------------------------------------------------------------------------------------------------- // funzioni: creazione thmbnail //------------------------------------------------------------------------------------------------------------- function create_thumbnail($src,$dest,$maxWidth,$maxHeight,$quality=100, $prop=false) { if($src!=''){ $checkjpg=$this->check_image_type($src,2); $checkgif=$this->check_image_type($src,1); if (($checkjpg!="")&&($checkgif!="")) { unlink($src); } else { $this->image_createThumb($src,$dest,$maxWidth,$maxHeight,$quality, $prop); } } } function check_image_type($pathname,$deftype) { list($width, $height, $type, $attr) = getimagesize($pathname); if ($type==$deftype) return(""); else return("Errore: non Ŕ del tipo corretto"); } function image_createThumb($src,$dest,$maxWidth,$maxHeight,$quality=100, $prop) { if (file_exists($src) && isset($dest)) { // path info $destInfo = pathInfo($dest); // image src size $srcSize = getImageSize($src); if($maxWidth==0){ $maxWidth=($maxHeight*$srcSize[0])/$srcSize[1]; } if($maxHeight==0){ $maxHeight=($maxWidth*$srcSize[1])/$srcSize[0]; } if ($srcSize[0]>$maxWidth | $srcSize[1]>$maxHeight){ // image dest size $destSize[0] = width, $destSize[1] = height $srcRatio = $srcSize[0]/$srcSize[1]; // width/height ratio $destRatio = $maxWidth/$maxHeight; $propW=$srcSize[0]/$maxWidth; $propH=$srcSize[1]/$maxHeight; if($propH>$propW){ $maxHeight=$maxHeight; $maxWidth=($srcSize[0]*$maxHeight)/$srcSize[1]; }else{ $maxWidth=$maxWidth; $maxHeight=($srcSize[1]*$maxWidth)/$srcSize[0]; } /* if ($destRatio > $srcRatio) { $destSize[1] = $maxHeight; $destSize[0] = $maxHeight*$srcRatio; print "A"; } else { $destSize[0] = $maxWidth; $destSize[1] = $maxWidth/$srcRatio; print "B"; } */ // path rectification if ($destInfo['extension'] == "gif") { $dest = substr_replace($dest, 'jpg', -3); } // true color image, with anti-aliasing $destImage = imageCreateTrueColor($maxWidth,$maxHeight); imageAntiAlias($destImage,true); // src image switch ($srcSize[2]) { case 1: //GIF $srcImage = imageCreateFromGif($src); break; case 2: //JPEG $srcImage = imageCreateFromJpeg($src); break; case 3: //PNG $srcImage = imageCreateFromPng($src); break; default: return false; break; } // resampling imageCopyResampled($destImage, $srcImage, 0, 0, 0, 0,$maxWidth,$maxHeight,$srcSize[0],$srcSize[1]); // generating image switch ($srcSize[2]) { case 1: case 2: imageJpeg($destImage,$dest,$quality); break; case 3: imagePng($destImage,$dest); break; } if ($prop==true){ $insert = imageCreateFromJpeg($dest); if (imagesx($insert)>imagesy($insert)){ $max_side=imagesx($insert); //orizzontale $or='o'; } else { $max_side=imagesy($insert); //verticale $or='v'; } $background = imageCreateTrueColor($max_side,$max_side); $back = ImageColorAllocate($background, 125,125,125); imagefill($background,0,0,$back); if ($or=='v'){ $start= (($max_side-imagesx($insert))/2); imagecopymerge($background,$insert,$start,0,0,0,imagesx($insert),imagesy($insert),100); } else { $start= (($max_side-imagesy($insert))/2); imagecopymerge($background,$insert,0,$start,0,0,imagesx($insert),imagesy($insert),100); } imagejpeg($background,$dest,100); } }else{ //copio l'immagine dalla cartella ordginin alla cartella di destinazione copy($src,$dest); } } } //------------------------------------------------------------------------------------------------------------- // funzioni: arr_file //------------------------------------------------------------------------------------------------------------- function file_list_short($foder) { $handle=opendir($foder); $tot_file=0; while ($file = readdir($handle)) { if($file=='.'||$file=='..') continue; if(is_dir($foder."/".$file)) { continue; } if(addslashes($file)!=''){ $file_name['long'][]=addslashes($file); $name_file=strstr(addslashes($file), '_'); $file_name['short'][]=substr($name_file,-(strlen($name_file)-1)); } $tot_file++; } if($file=='.'||$file=='..') continue; if(addslashes($file)!=''){ $file_name['long'][]=addslashes($file); $name_file=strstr(addslashes($file), '_'); $file_name['short'][]=substr($name_file,0,-(strlen($name_file)-1)); } $tot_file++; closedir($handle); //$file_name['tot_file']=$tot_file--; return $file_name; } function file_list($foder) { $handle=opendir($foder); $tot_file=0; while ($file = readdir($handle)) { if($file=='.'||$file=='..') continue; if(is_dir($foder."/".$file)) { continue; } if(addslashes($file)!=''){ $file_name[]=addslashes($file); } $tot_file++; } if($file=='.'||$file=='..') continue; if(addslashes($file)!=''){ $file_name[]=addslashes($file); } $tot_file++; closedir($handle); //$file_name['tot_file']=$tot_file--; return $file_name; } function file_list_personal($foder,$key) { $handle=opendir($foder); $tot_file=0; while ($file = readdir($handle)) { if($file=='.'||$file=='..') continue; if(is_dir($foder."/".$file)) { continue; } if (addslashes($file)!='') { $tmp=explode("_",$file); if ($tmp[0]==$key) { $file_name[]=addslashes($file); $file_name['output'][]=substr(stristr($file,"_"),1); } else continue; } $tot_file++; } if($file=='.'||$file=='..') continue; if(addslashes($file)!=''){ $tmp=explode("_",$file); if ($tmp[0]==$key) { $file_name[]=addslashes($file); $file_name['output'][]=substr(stristr($file,"_"),1); } } $tot_file++; closedir($handle); //$file_name['tot_file']=$tot_file--; return $file_name; } //------------------------------------------------------------------------------------------------------------- // funzioni: upload //------------------------------------------------------------------------------------------------------------- function upload($tmp, $dest, $index='') { global $HTTP_POST_FILES; if($index==''){ if($HTTP_POST_FILES[$tmp]["name"]!=''){ $nome_file_upload=$HTTP_POST_FILES[$tmp]["name"]; $src=$dest."/".$nome_file_upload; if($nome_file_upload!="") { move_uploaded_file($HTTP_POST_FILES[$tmp]["tmp_name"],$src); $result[0]=$nome_file_upload; $result[1]=$src; return $result; } } return ""; }else{ if($HTTP_POST_FILES[$tmp]["name"][$index]!=''){ $nome_file_upload=$HTTP_POST_FILES[$tmp]["name"][$index]; $src=$dest."/".$nome_file_upload; if($nome_file_upload!="") { move_uploaded_file($HTTP_POST_FILES[$tmp]["tmp_name"][$index],$src); $result[0]=$nome_file_upload; $result[1]=$src; return $result; } } return ""; } return ""; } function upload_personal($tmp, $dest, $personal,$index='') { global $HTTP_POST_FILES; if($index==''){ if($HTTP_POST_FILES[$tmp]["name"]!=''){ $nome_file_upload=$HTTP_POST_FILES[$tmp]["name"]; $src=$dest."/".$personal."_".$nome_file_upload; if($nome_file_upload!="") { move_uploaded_file($HTTP_POST_FILES[$tmp]["tmp_name"],$src); $result[0]=$personal."_".$nome_file_upload; $result[1]=$src; return $result; } } return ""; }else{ if($HTTP_POST_FILES[$tmp]["name"][$index]!=''){ $nome_file_upload=$HTTP_POST_FILES[$tmp]["name"][$index]; $src=$dest."/".$personal."_".$nome_file_upload; if($nome_file_upload!="") { move_uploaded_file($HTTP_POST_FILES[$tmp]["tmp_name"][$index],$src); $result[0]=$personal."_".$nome_file_upload; $result[1]=$src; return $result; } } return ""; } return ""; } //------------------------------------------------------------------------------------------------------------- // funzioni: print //------------------------------------------------------------------------------------------------------------- function sprint($array){ if (!DEBUG) return; //$nome_array=$$array; //echo "
$nome_array";
		echo "
";
		if (is_array($array) || is_object($array)) print_r($array);
		else echo $array;
		echo "";
		echo "
"; } //------------------------------------------------------------------------------------------------------------- // funzioni: Get Page Name //------------------------------------------------------------------------------------------------------------- function get_page_name($str, $with_out_extention=false){ $arr_str=explode("/", $str); $last_part=$arr_str[count($arr_str)-1]; if($with_out_extention){ $arr_res=explode(".",$last_part); return $arr_res[0]; }else{ return $last_part; } } //------------------------------------------------------------------------------------------------------------- // funzioni: Get Querystring //------------------------------------------------------------------------------------------------------------- function get_querystring($str){ $arr_str=explode("?", $str); if (count($arr_str)>0){ return $arr_str[1]; }else{ return ""; } } //------------------------------------------------------------------------------------------------------------- // funzioni: Check Email //------------------------------------------------------------------------------------------------------------- function check_email($strEmails){ // init espressione regolare per il controllo se l'email Ŕ valida $regex = '^'. '[_a-z0-9-]+'. /* One or more underscore, alphanumeric, or hyphen charactures. */ '(\.[_a-z0-9-]+)*'. /* Followed by zero or more sets consisting of a period and one or more underscore, alphanumeric, or hyphen charactures. */ '@'. /* Followed by an "at" characture. */ '[a-z0-9-]+'. /* Followed by one or more alphanumeric or hyphen charactures. */ '(\.[a-z0-9-]{2,})+'. /* Followed by one or more sets consisting of a period and two or more alphanumeric or hyphen charactures. */ '$'; $arEmails=split(",",$strEmails); for ($k=0;$k
Fatal error: Class 'workup_class' not found in /web/htdocs/www.fdbitalia.it/home/CommonVars.php on line 23