"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "Archimede Servizi srl"; echo ""; echo ""; //echo ""; echo ""; echo ""; popup_script(); //tasto_destro_sp(); //tasto_ctrk_no(); echo ""; echo ""; list($status, $user) = auth_get_status(); $nome = basename($_SERVER['PHP_SELF']); $path = dirname($_SERVER['PHP_SELF']); $compl = $path.$nome; echo "
"; echo "
"; echo "
"; echo "
"; echo "

Archimede Servizi

"; echo "

soggetta alla direzione e coordinamento del Comune di San Martino Buon Albergo

"; echo "
"; echo "
"; echo " "; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; } function head_iframe(){ echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "Archimede Servizi srl"; echo ""; echo ""; //echo ""; echo ""; echo ""; popup_script(); //tasto_destro_sp(); //tasto_ctrk_no(); echo ""; echo ""; list($status, $user) = auth_get_status(); $nome = basename($_SERVER['PHP_SELF']); $path = dirname($_SERVER['PHP_SELF']); $compl = $path.$nome; echo "
"; echo "
    "; if ($status == '99' ) echo "
  • Logout
  • "; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; } function sitebar(){ list($status, $user) = auth_get_status(); echo "
"; //bisogna combinare lo stato e il patth $situation = '0'; $path = dirname($_SERVER['PHP_SELF']); if (($status == 99)) if (strpos($path,'weburp')>0 OR strpos($path,'usr_uti')>0) $situation = '1'; switch($situation){ case 0: echo " "; break; case 1: echo " "; break; } echo "
"; } function foot(){ $html = << 
EOT; echo $html; } function popup_script(){ echo""; } function tasto_destro_sp(){ echo""; } function tasto_ctrk_no(){ echo" "; } function querygo($query){ global $db; require('../include/db.conf.php'); $db = mysql_connect($db_host, $db_user,$db_pwd); if ($db == FALSE) die ("Errore nella connessione. Verificare i parametri nel file config.php"); mysql_select_db($db_name, $db) or die ("Errore nella selezione del database. Verificare i parametri nel file config.inc.php"); $res =mysql_query($query,$db); return $res; mysql_close($db); } function data_it($data){ $array = explode("-", $data); $data_it = $array[2]."/".$array[1]."/".$array[0]; return $data_it; } function data_en($data){ $array = explode("/", $data); $data_it = $array[2]."-".$array[1]."-".$array[0]; return $data_it; } function date_time_it($str){ $array=explode(" ",$str); $data=data_it($array[0]).' '.$array[1]; return $data; } function date_time_it_sd($str){ $array=explode(" ",$str); $data=data_it($array[0]); return $data; } function form_contatti(){ echo "
"; echo "
    "; echo "
  • "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "

    Compila i campi con i dati richiesti.

    "; echo "
  • "; echo ""; echo ""; echo " "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "

    Compila i campi con i dati richiesti.

    "; echo "
  • "; echo "
  • "; echo ""; echo "
    "; echo " "; echo "
    "; echo "
    "; echo "
    Si, accetto
    "; echo "
    "; echo "

    Compila i campi con i dati richiesti.

    "; echo "
  • "; echo "
  • "; echo ""; echo ""; echo "
  • "; echo "
"; echo "
"; echo ""; } ?>",$str); $str = str_replace(""",'"',$str); $str = str_replace("&",'&',$str); $str = str_replace(" ",'',$str); $str = str_replace("’",'\'',$str); $str = str_replace("–",'–',$str); $str = str_replace("“",'“',$str); $str = str_replace("”",'”',$str); $str = str_replace("€",'€',$str); $str = str_replace("♦",'->',$str); $str = str_replace("…",'...',$str); $str = str_replace("'","‘",$str); //$str = str_replace("'"," ",$str); return $str; } function select_form($campo,$tabella,$selected,$orderby,$id_campo,$campo_class){ $sql="SELECT id,descr FROM "; $sql.=$tabella; $sql.=" WHERE fl_att='1' ORDER BY "; $sql.=$orderby; //echo $sql; $temp=querygo($sql); $html=""; return $html; } function select_form_area_set( $campo,$tabella,$selected,$orderby,$id_campo,$campo_class ){ $sql="SELECT id,descr,id_set FROM wu_arint"; $sql.=" WHERE fl_att='1' ORDER BY descr "; //echo $sql; $temp=querygo($sql); $html=""; return $html; } function segnalaz_pub_insert($name,$surname,$codfis,$telef,$adrmail,$areaint,$messaggio,$webuser,$dataora,$ip_adr){ $name = convert_str($name); $surname = convert_str($surname); $telef = convert_str($telef); $messaggio = convert_str($messaggio); $codfis = strtoupper($codfis); $anno_rif=date("Y"); $rich = $name." ".$surname; $sql = "INSERT INTO wu_comm (id,an_rif,rich,cf,tel,admail,areain,oggetto,user_ins,data_ins,ip_ins) VALUES ('','".$anno_rif."','".$rich."','".$codfis."','".$telef."','".$adrmail."','".$areaint."','".$messaggio."','".$webuser."','".$dataora."','".$ip_adr."')"; //aggiungo record nella tabella decisioni //echo $sql; if (querygo($sql)) return TRUE; else FALSE; } function segnalaz_cons_st($codfis){ $codfis = strtoupper ( $codfis ); $sql_cont = "SELECT COUNT(id) AS num FROM wu_comm WHERE cf='".$codfis."' AND data_esec ='0000-00-00' " ; $num = mysql_fetch_array(querygo($sql_cont)); if ( $num[ 'num' ] > 0 ){ $a = 1; echo "

Con il codice fiscale $codfis sono state trovate n. $num[num] segnalazioni associate APERTE.

"; } else $a = 0; switch ( $a ){ case 0: echo "
Non esiste nessuna segnalazione corrispondente al codice fiscale inserito."; break; case 1: $sql = "SELECT id,an_rif,rich,cf,tel,admail,areain,oggetto,user_ins,data_ins,data_val,ip_ins,data_prog,data_esec,note,data_mod,concl FROM wu_comm WHERE cf='".$codfis."' AND data_esec = '0000-00-00' ORDER BY data_ins"; $temp = querygo ( $sql ); $html = ""; while ( $res = mysql_fetch_array ( $temp ) ) { $ai = return_descrizione('wu_arint',$res['areain'],'descr'); $st = return_stato_comm($res['data_val'],$res['data_prog'],$res['data_esec'],$res['data_mod']); $html .= "

N. Rif. $res[id]/$res[an_rif] Aperta il ".date_time_it_sd($res['data_ins'])." da $res[rich]
Area Interesse: $ai
Oggetto: $res[oggetto]
$st $res[concl]

" ; } echo $html; break; } } function return_descrizione($tabella,$id,$campo){ $sql="SELECT $campo"; $sql.=" FROM $tabella WHERE (id = $id AND fl_att = '1')"; $link=(querygo($sql)); $arr=mysql_fetch_array($link); $valore=$arr[$campo]; return $valore; } function return_stato_comm($dv,$dp,$de,$dm){ if ($dv > "0000-00-00 00:00:00" ) $st="PRESA IN CARICO il ".date_time_it_sd($dv); else $st="In attesa di presa in carico da parte del settore competente"; if ($dp > "0000-00-00") $st.=" - PROGRAMMATA per il ".data_it($dp); if ($de > "0000-00-00") $st.=" - ESEGUITA il ".data_it($de); //$st.= "
( situazione aggiornata al ".date_time_it_sd($dm)." )"; //if ($dv != "" AND $dp != "" AND $de != "") // $st="PRESA IN CARICO il ".date_time_it_sd($dv).", PROGRAMMATA per il ".data_it($dp).", ESEGUITA il ".data_it($de); //if ($dv!="" AND $dp="") // $st="PRESA IN CARICO il ".data_it($dv); //if ($dv!="" AND $dp!="" AND $de="") // $st="PRESA IN CARICO il ".data_it($dv).", PROGRAMMATA per il ".data_it($dp); //if ($dv=="" AND $dp=="" AND $de=="") //$st="In attesa di presa in carico da parte del settore competente"; return $st; } function show_tickets($profilo,$settore){ //se urp cerco tutte le comm senza data_val //se settore cerco tutte le comm con data_val !="" e di propria area interesse switch ($profilo){ case 'urp': $sql = "SELECT id,an_rif,rich,cf,areain,data_ins FROM wu_comm WHERE data_val='0000-00-00 00:00:00' ORDER BY data_ins"; $table = ""; $tmp = querygo ($sql); $count=0; while ($res = mysql_fetch_array($tmp)){ $table .= ''; $areain= return_descrizione("wu_arint",$res['areain'],"descr"); $table .= ""; if ($settore == 4) $table .= ""; else $table .= ""; $table .= ''; $count++; } $table .= "
Rif Richiedente Area Interesse Data Inserimento Stato Azioni
$res[id]/$res[an_rif] $res[rich]/$res[cf] $areain ".date_time_it_sd($res['data_ins'])." IN ATTESAVedi
"; echo $table; break; case 'settore': $sql_int = "SELECT id FROM wu_arint WHERE id_set='$settore'"; $tmp_int = querygo($sql_int); $wh=''; while ($res_int = mysql_fetch_array( $tmp_int ) ){ $wh.= " areain ='".$res_int['id']."' OR "; } $wh .=" areain='0'"; $sql = "SELECT id,an_rif,rich,cf,areain,data_ins,data_val,user_val FROM wu_comm WHERE (data_val!='0000-00-00 00:00:00' AND data_prog='0000-00-00 00:00:00') AND"; $sql .= "( ".$wh." )"; $sql .=" ORDER BY data_ins DESC"; $table = ""; $tmp = querygo ($sql); $count=0; while ($res = mysql_fetch_array($tmp)){ $table .= ''; $areain= return_descrizione("wu_arint",$res['areain'],"descr"); $table .= ""; $table .= ''; $count++; } $table .= "
Rif Richiedente Area Interesse Data Validazione Stato Azioni
$res[id]/$res[an_rif] $res[rich]/$res[cf] $areain ".date_time_it_sd($res['data_val'])." VALIDATA Vedi
"; echo $table; break; } } function tks_detail($id){ $sql = "SELECT * FROM wu_comm WHERE id='$id'"; $result = mysql_fetch_array (querygo( $sql )); return $result; } function tks_valida($ar,$id,$e_v,$us){ $e_v = convert_str($e_v); $sql = "UPDATE wu_comm SET areain='".$ar."', esito_val='".$e_v."', data_val='".date("Y-m-d H:i:s")."', user_val='".$us."', ip_val='".$_SERVER['REMOTE_ADDR']."' WHERE id='".$id."'"; //echo $sql; $adr_mail = return_mail_adr($ar); if (mail($adr_mail,"NUOVA SEGNALAZIONE","Oggi ".date("d/m/Y H:i:s")." è arrivata la segnalazione n. ".$id."Di probabile competenza del suo settore\r\nNON RISPONDERE A QUESTA MAIL","From: info@archimedeservizi.eu\r\nBcc: pmarino@comunesanmartinobuonalbergo.it" ) ) echo "Mail inviata correttamente a $adr_mail
"; if (querygo ($sql)) return TRUE; else return FALSE; } function return_mail_adr($arint){ $sql = "SELECT id_set FROM wu_arint WHERE id='".$arint."'"; $res = mysql_fetch_array (querygo ($sql)); $sql_m = "SELECT adr_m FROM wu_set WHERE id='".$res['id_set']."'"; $res_m = mysql_fetch_array (querygo ($sql_m)); return $res_m['adr_m']; } function tks_pianifica($sp,$lg,$id,$e_p,$d_p,$us){ $e_p = convert_str($e_p); $sql = "UPDATE wu_comm SET specie='".$sp."', luogo='".$lg."', esito_pro='".$e_p."', note='".$e_p."', data_prog='".$d_p."', data_pro='".date("Y-m-d H:i:s")."', user_pro='".$us."', ip_pro='".$_SERVER['REMOTE_ADDR']."' WHERE id='".$id."'"; echo $sql; if (querygo ($sql)) return TRUE; else return FALSE; } function tks_concludi ($note,$inca,$de_dd,$de_mm,$de_yyyy,$cecc,$h_op1,$h_op2,$h_op3,$h_op4,$h_op5,$h_op6,$h_op7,$h_op8,$h_op9,$h_op10, $h_op11,$h_op12,$concl,$id,$us){ $data_esec = $de_yyyy."-".$de_mm."-".$de_dd; $note = convert_str($note); $concl = convert_str($concl); $sql = "UPDATE wu_comm SET data_esec = '".$data_esec."', note='".$note."', concl='".$concl."', c_c='".$cecc."', user_mod='".$us."', data_mod='".date("Y-m-d H:i:s")."', ip_mod='".$_SERVER['REMOTE_ADDR']."', inca='".$inca."', h_op1='".$h_op1."', h_op2='".$h_op2."', h_op3='".$h_op3."', h_op4='".$h_op4."', h_op5='".$h_op5."', h_op6='".$h_op6."', h_op7='".$h_op7."', h_op8='".$h_op8."', h_op9='".$h_op9."', h_op10='".$h_op10."', h_op11='".$h_op11."', h_op12='".$h_op12."' WHERE id='".$id."'"; //echo $sql; if (querygo ($sql)) return TRUE; else return FALSE; } function gestione_tickets($profilo,$settore,$offset,$rowsPerPage,$nu,$an,$us,$ar,$lu,$sp,$og,$st,$dd,$dm,$dy,$order1,$ri,$settore){ //se urp cerco tutte le comm senza data_val //se settore cerco tutte le comm con data_val !="" e di propria area interesse //URP vede tutto ma può editare solo quelli di propria competenza //SETTORE vede ed elabora solo i suoi //ARCHIMEDE come URP //SUPER USER vede ed edita tutto //mostro a tutti la propria tabella o gestisto tutta dalla pagina di dettaglio???????????? // CONCLUSIONE : MOSTRO TUTT A TUTTI GESTISCO i PERMESSI NELLA PAGINA DI DETTAGLIO $sql_vis =""; if ($profilo =="settore" OR $profilo =="esterno"){ //echo $settore; if ( $settore !=13){ $sql_lim_visib = "SELECT id FROM wu_arint WHERE id_set='".$settore."'"; $tmp = querygo ( $sql_lim_visib ); $sql_vis = " AND ( "; while ( $res_vis = mysql_fetch_array ( $tmp )){ $sql_vis .= " areain ='".$res_vis ['id']."' OR "; } $sql_vis .= " areain < 0 ) "; } } $data_prog = $dy."-".$dm."-".$dd; $og_link = $og; switch ($order1){ case 'NUMERO': $order_q = 'id'; break; case 'INSERIMENTO': $order_q = 'data_ins'; break; case 'PROGRAMMAZIONE': $order_q = 'data_prog'; break; case 'ESECUZIONE': $order_q = 'data_esec'; break; } $sql = "SELECT id,an_rif,rich,areain,data_ins,user_ins,data_prog,data_esec,luogo,specie,oggetto FROM wu_comm WHERE (data_val>'0000-00-00 00:00:00' ) "; if ($nu > 0) $sql .= " AND id ='$nu' "; if ($an !='0') $sql .= " AND an_rif ='$an' "; if ($us != '0') $sql .= " AND user_ins ='$us' "; if ($ar != '0') $sql .= " AND areain ='$ar' "; if ($lu != '0') $sql .= " AND luogo ='$lu' "; if ($sp != '0') $sql .= " AND specie ='$sp' "; if ($data_prog > "0000-00-00") $sql .= " AND data_prog ='$data_prog' "; if ($ri != "") $sql .= " AND rich LIKE '%$ri%' "; if ($st != 'TUTTE') $sql .= sql_status($st); if ($og != '0'){ $sql .= " AND ( "; $og = convert_str($og); $og = explode(" ",$og); $lung = count($og); for($i=0;$i<$lung;$i++) $sql .= " oggetto LIKE '%$og[$i]%' OR "; $sql .= " 0 ) "; } $sql .= $sql_vis." ORDER BY ".$order_q." DESC LIMIT $offset, $rowsPerPage"; //echo $sql; $table = " \"pdf\" "; $tmp = querygo ($sql); $count=0; while ($res = mysql_fetch_array($tmp)){ $table .= ''; $areain = return_descrizione("wu_arint",$res['areain'],"descr"); $luogo = return_descrizione("wu_ples",$res['luogo'],"descr"); $specie = return_descrizione("wu_spec",$res['specie'],"descr"); $stato = stato_segnalazione($res['id']); if ( $settore !='11' AND $settore !='13'){ if ($stato == 'VALIDATA' OR $stato == 'SCADUTA'){ if ($stato == 'VALIDATA') $table .= ""; if ( $stato == 'SCADUTA') $table .= ""; } else $table .= ""; } else $table .= ""; $table .= ""; // $table .=" "; $table .= ""; $table .= ''; $table .= ""; $count++; } $table .= "
Rif Richiedente Ins. Data Ins. Area Interesse Tipo Lav. Data Prog. Stato
$res[id]/$res[an_rif]$res[id]/$res[an_rif]$res[id]/$res[an_rif]$res[id]/$res[an_rif]$res[rich] ".substr($res['user_ins'],0,6)." ".date_time_it_sd($res['data_ins'])." $areain$luogo$specie ".data_it($res['data_prog'])." $stato
LUOGO: ".$luogo." ".$res['oggetto']."
"; echo $table; } function gestione_tickets_iframe($profilo,$settore,$offset,$rowsPerPage,$nu,$an,$us,$ar,$lu,$sp,$og,$st,$dd,$dm,$dy,$order1,$ri,$settore){ //se urp cerco tutte le comm senza data_val //se settore cerco tutte le comm con data_val !="" e di propria area interesse //URP vede tutto ma può editare solo quelli di propria competenza //SETTORE vede ed elabora solo i suoi //ARCHIMEDE come URP //SUPER USER vede ed edita tutto //mostro a tutti la propria tabella o gestisto tutta dalla pagina di dettaglio???????????? // CONCLUSIONE : MOSTRO TUTT A TUTTI GESTISCO i PERMESSI NELLA PAGINA DI DETTAGLIO $sql_vis =""; if ($profilo =="settore" OR $profilo =="esterno"){ //echo $settore; if ( $settore !=13){ $sql_lim_visib = "SELECT id FROM wu_arint WHERE id_set='".$settore."'"; $tmp = querygo ( $sql_lim_visib ); $sql_vis = " AND ( "; while ( $res_vis = mysql_fetch_array ( $tmp )){ $sql_vis .= " areain ='".$res_vis ['id']."' OR "; } $sql_vis .= " areain < 0 ) "; } } $data_prog = $dy."-".$dm."-".$dd; $og_link = $og; switch ($order1){ case 'NUMERO': $order_q = 'id'; break; case 'INSERIMENTO': $order_q = 'data_ins'; break; case 'PROGRAMMAZIONE': $order_q = 'data_prog'; break; case 'ESECUZIONE': $order_q = 'data_esec'; break; } $sql = "SELECT id,an_rif,rich,areain,data_ins,user_ins,data_prog,data_esec,luogo,specie,oggetto FROM wu_comm WHERE (data_val>'0000-00-00 00:00:00' ) "; if ($nu > 0) $sql .= " AND id ='$nu' "; if ($an !='0') $sql .= " AND an_rif ='$an' "; if ($us != '0') $sql .= " AND user_ins ='$us' "; if ($ar != '0') $sql .= " AND areain ='$ar' "; if ($lu != '0') $sql .= " AND luogo ='$lu' "; if ($sp != '0') $sql .= " AND specie ='$sp' "; if ($data_prog > "0000-00-00") $sql .= " AND data_prog ='$data_prog' "; if ($ri != "") $sql .= " AND rich LIKE '%$ri%' "; if ($st != 'TUTTE') $sql .= sql_status($st); if ($og != '0'){ $sql .= " AND ( "; $og = convert_str($og); $og = explode(" ",$og); $lung = count($og); for($i=0;$i<$lung;$i++) $sql .= " oggetto LIKE '%$og[$i]%' OR "; $sql .= " 0 ) "; } $sql .= $sql_vis." ORDER BY ".$order_q." DESC LIMIT $offset, $rowsPerPage"; //echo $sql; $table = " "; $tmp = querygo ($sql); $count=0; while ($res = mysql_fetch_array($tmp)){ $table .= ''; $areain = return_descrizione("wu_arint",$res['areain'],"descr"); $luogo = return_descrizione("wu_ples",$res['luogo'],"descr"); $specie = return_descrizione("wu_spec",$res['specie'],"descr"); $stato = stato_segnalazione($res['id']); $table .= ""; $table .= ""; // $table .=" "; $table .= ""; $table .= ''; $table .= ""; $count++; } $table .= "
Rif Richiedente Ins. Data Ins. Area Interesse Tipo Lav. Data Prog. Stato
$res[id]/$res[an_rif]$res[rich] ".substr($res['user_ins'],0,6)." ".date_time_it_sd($res['data_ins'])." $areain$luogo$specie ".data_it($res['data_prog'])." $stato
LUOGO: ".$luogo." ".$res['oggetto']."
"; echo $table; } function gestione_tickets_count($profilo,$settore,$nu,$an,$us,$ar,$lu,$sp,$og,$st,$dd,$dm,$dy,$ri,$settore){ $sql_vis =""; if ($profilo =="settore" OR $profilo =="esterno"){ $sql_lim_visib = "SELECT id FROM wu_arint WHERE id_set='".$settore."'"; $tmp = querygo ( $sql_lim_visib ); $sql_vis = " AND ( "; while ( $res_vis = mysql_fetch_array ( $tmp )){ $sql_vis .= " areain ='".$res_vis ['id']."' OR "; } $sql_vis .= " areain > 0 ) "; } $data_prog = $dy."-".$dm."-".$dd; $og_link = $og; $data_prog = $dy."-".$dm."-".$dd; $sql = "SELECT COUNT(id) AS numrows FROM wu_comm WHERE (data_val>'0000-00-00 00:00:00' ) "; if ($nu > 0) $sql .= " AND id ='$nu' "; if ($an !='0') $sql .= " AND an_rif ='$an' "; if ($us != '0') $sql .= " AND user_ins ='$us' "; if ($ar != '0') $sql .= " AND areain ='$ar' "; if ($lu != '0') $sql .= " AND luogo ='$lu' "; if ($sp != '0') $sql .= " AND specie ='$sp' "; if ($data_prog > "0000-00-00") $sql .= " AND data_prog ='$data_prog' "; if ($ri != "") $sql .= " AND rich LIKE '%$ri%' "; if ($st != 'TUTTE') $sql .= sql_status($st); if ($og != '0'){ $sql .= " AND ( "; $og = convert_str($og); $og = explode(" ",$og); $lung = count($og); for($i=0;$i<$lung;$i++) $sql .= " oggetto LIKE '%$og[$i]%' OR "; $sql .= " 0 ) "; } $sql .= $sql_vis." ORDER BY data_ins DESC "; //echo $sql; $result = mysql_query($sql) or die('Error, query failed'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; return $numrows; } function form_select_search($nome_field , $query , $sel ){ $tmp = querygo ( $query ) ; $html = " "; return $html; } function form_select_distinct_search($nome_field , $query , $sel ){ $tmp = querygo ( $query ) ; $html = " "; return $html; } function form_select_stato($selected){ $stati = array ('TUTTE','VALIDATE','PIANIFICATE','ESEGUITE','SCADUTE'); $html = " "; return $html; } function form_select_order($selected){ $ord = array ('NUMERO','INSERIMENTO','PROGRAMMAZIONE','ESECUZIONE'); $html = " "; return $html; } function stato_segnalazione($id){ $sql = "SELECT data_val,data_prog,data_esec FROM wu_comm WHERE id='$id'"; $res = mysql_fetch_array(querygo($sql)); if ($res['data_val']>'0000-00-00 00:00:00') if ($res['data_prog']>'0000-00-00') if ($res['data_esec']>'0000-00-00') $stato = "ESEGUITA"; else if ($res['data_prog'] <= date("Y-m-d")) $stato = "SCADUTA"; else $stato = "PIANIFICATA"; else $stato = "VALIDATA"; else $stato = "DA VALIDARE"; return $stato; } function visibilita_settore($area_int,$settore){ $sql = " SELECT id FROM wu_arint WHERE id_set='$settore'"; $aree = mysql_fetch_array (querygo ( $sql ) ) ; $dd = count ($aree); $check = 0 ; for ($i= 0; $i<$check; $i++){ if ($area_int == $dd[$i]) $check++; } } function sql_status($st){ //gestione stati sql //aperte data_prog <= oggi and data_esec ='' //incorso data_prog == oggi and data_esec = '' //scadute data_prog >= oggi and data_esec = '' //chiuse data_esec > 0000-00-00 $oggi = date ('Y-m-d'); switch ($st){ case 'PIANIFICATE': $sql = " AND (data_prog > '$oggi' AND data_esec='0000-00-00') "; break; case 'VALIDATE': $sql = " AND ( data_val <> '0000-00-00' AND data_prog = '0000-00-00' AND data_esec='0000-00-00') "; break; case 'SCADUTE': $sql = " AND (data_prog <> '0000-00-00' AND data_prog < '$oggi' AND data_esec='0000-00-00') "; break; case 'ESEGUITE': $sql = " AND ( data_esec > '0000-00-00') "; break; } return $sql; } function form_incaricati($op){ $html = "
  • "; $html.=""; $h = 1 ; for($i=0;$i<3;$i++){ $html.=""; for($k=0;$k<4;$k++){ $html.=""; $h++; } $html.=""; } $html.=""; $html.="
    "; $sql = "SELECT abbr FROM wc_oper WHERE ( fl_att ='1' AND cod ='h_op".$h."')"; $res = mysql_fetch_array(querygo($sql)); if ($res['abbr']!='v'){ $html.=""; } else { $html.=""; } $html.="
  • "; return $html; } function report_ore ($orr){ $tot = array_sum($orr); $html= "Ore Intervento: $tot
    "; //print_r($orr); $html.= ""; $html.=""; $h = 1 ; for($i=0;$i<3;$i++){ $html.=""; for($k=0;$k<4;$k++){ $html.=""; $h++; } $html.=""; } $html.="
    "; $sql = "SELECT abbr FROM wc_oper WHERE ( fl_att ='1' AND cod ='h_op".$h."')"; $res = mysql_fetch_array(querygo($sql)); if ($res['abbr']!='v'){ $k=$h-1; $html.="$res[abbr]: ".$orr[$k]." "; } $html.="
    "; return $html; } function settore_interesse ($area){ $sql = "SELECT id_set FROM wu_arint WHERE id ='".$area."' "; $res = mysql_fetch_array(querygo($sql)); return $res['id_set']; } ?>