← Back
Editing: modulo_ts.php
<?php require_once ("../funct.php"); require_once ("sess.php"); require_once ("conn.php"); require_once ("class.php"); $mm = $_GET['mm'] < 10 ? "0".$_GET['mm'] : $_GET['mm']; $aa = $_GET['aa']; $ms = date ("m"); $as = date ("Y"); $query = new doQuery(); if (!$mm) { # scelta del mese e anno $mesi = array ('', 'gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'); echo "<h2>Dati presenze per tassa soggiorno/ricestat</h2> Scegli il giorno per l'invio<br /> <table border=\"1\" cellpadding=\"5\"><tr>\n"; for ($i=2; $i>=0; $i--) { $dateR = date("d/m/Y", time()-(3600*24*$i)); list ($gi, $mi, $ai) = explode ('/', $dateR); echo "<td><a href=\"".$_SERVER['php_SELF']."?aaq=".$ai."&\mm=".$mi."&gg=".$gi."\">".$dateR."</a></td>\n"; } echo "</tr></table>"; } else { $codStrTw = array (11=>'053024CAM0005', 12=>'053024CAM0002', 21=>'053011CAM0003', 22=>'053018AAT0053'); $sql = "SELECT `nome`, `cognome` FROM `presenze`, `persone`, `comuni`, `stati` WHERE `presenze`.`id_utente`= ".$id_utente." AND (`data_in` LIKE '".$aa."-".$mm."-".$gg." %' OR `data_out` LIKE '".$aa."-".$mm."-".$gg." %') AND `id_persona`=`persone`.`id` AND `comune_res`=`comuni`.`id` AND `stato_res`=`stati`.`id` ORDER BY `data_in`"; $rows = $query->freeQuery ($sql, 1); foreach ($rows as $row) { # se non è entrato e uscito nello stesso giorno if (!(strpos ($row['data_in'], '-'.$mm.'-'.$g.' ') && strpos ($row['data_out'], '-'.$mm.'-'.$g.' '))) { //for ($i=0; $i<count($row); $i++) $elenco.= $row[$i]." "; if ($row['cod_tw'] == 'I') $cod = $row['targa']; else $cod = $row['cod_tw']; //$elenco.= $cod; if (strpos ($row['data_in'], '-'.$mm.'-'.$g.' ')) { $conti[$cod]['in'] = $conti[$cod]['in']+1; $pres++; } else if (strpos ($row['data_out'], '-'.$mm.'-'.$g.' ')) { $conti[$cod]['out'] = $conti[$cod]['out']+1; $pres--; } //$elenco.= "<br />"; } } } $filename = "Ricestat_".$aa.$mm; header ("Content-type: text/plain\n\n"); header ("Content-disposition: xml".date ("Y-m-d").".xml"); header ("Content-disposition: filename=".$filename.".xml"); print "<messaggio-turiweb xmlns=\"http://www.w4b.it/turiweb\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.w4b.it/turiweb http://www.w4b.it/turiweb/turiweb.xsd\"> <report id-struttura=\"".$codStrTw[$id_utente]."\"> <riepilogo-mensile anno=\"$aa\" mese=\"$mm\"> $elenco </riepilogo-mensile> </report> </messaggio-turiweb>"; } ?>
Save File
Cancel