PageRenderTime 64ms CodeModel.GetById 34ms RepoModel.GetById 1ms app.codeStats 0ms

/INVA.php

https://bitbucket.org/amorello/changeover
PHP | 288 lines | 244 code | 33 blank | 11 comment | 25 complexity | 8f28040a2b7a18cb664915c340883f3a MD5 | raw file
  1. <?php
  2. session_start();
  3. include 'CSS/templateTop.html';
  4. require_once 'login.php';
  5. if(!isset($_SESSION['changeover_IDutente'])){
  6. header("location: index.php");
  7. }
  8. else
  9. {
  10. /*
  11. /* per far accedere alla pagina solo un amministratore
  12. if($_SESSION['nonconf_DBA']=='Y')
  13. {
  14. */
  15. include 'barramenu.php';
  16. $query = "SELECT * FROM nchange ORDER BY nchange";
  17. $result = mysql_query($query);
  18. if (!$result) die ("Database access failed: " . mysql_error());
  19. $righe = mysql_num_rows($result);
  20. for ($j = 0 ; $j < $righe ; ++$j)
  21. {
  22. $row = mysql_fetch_row($result);
  23. $ID = $row[0];
  24. $nchange = $row[1];
  25. $nomefile = $row[2];
  26. $data = $row[3];
  27. echo <<<_END
  28. CHANGE OVER $nchange <a href="dati\\$nomefile" target="_blank">scarica il file excel</a> data: $data
  29. <br>
  30. _END;
  31. }
  32. echo <<<_END
  33. <form action="creafile.php" method="post" name="form1">
  34. <input type="hidden" name="numero" value="$j">
  35. <input type="submit" name="salva" value="CREA NUOVO FILE"/></td>
  36. _END;
  37. $query = "SELECT * FROM interventi WHERE STATO1='A' && inva='0' ORDER BY datarichiesta";
  38. $result = mysql_query($query);
  39. if (!$result) die ("Database access failed: " . mysql_error());
  40. echo <<<_END
  41. <table border="5" bordercolor= "#6FD1D2" rules="all" cellspacing="5" width="900" >
  42. <tr bgcolor="#6FD1D2" bordercolor= "#6FD1D2" >
  43. <td bgcolor="#000000" bordercolor= "#000000"></td>
  44. <td width="70%">
  45. <table align="left">
  46. <tr>
  47. <td align="left">
  48. <table>
  49. <tr>
  50. <td>PC</td>
  51. </tr>
  52. <tr>
  53. <td>Utente di riferimento &nbsp &nbsp</td>
  54. </tr>
  55. <tr>
  56. <td>Collocazione</td>
  57. </tr>
  58. </table>
  59. </td>
  60. <td></td>
  61. <td></td>
  62. </tr>
  63. </table>
  64. </td>
  65. <td bgcolor="#FFCC33" bordercolor= "#FFCC33" >
  66. SOPRALLUOGO
  67. </td>
  68. </tr>
  69. _END;
  70. $righe = mysql_num_rows($result);
  71. for ($j = 0 ; $j < $righe ; ++$j)
  72. {
  73. $row = mysql_fetch_row($result);
  74. $ID = $row[0];
  75. $tipo = $row[1];
  76. if($tipo=='sost'){
  77. $bene = $row[2];
  78. $query = "SELECT * FROM pc WHERE ID=$bene";
  79. $result2 = mysql_query($query);
  80. if (!$result2) die ("Database access failed: " . mysql_error());
  81. $row2 = mysql_fetch_row($result2);
  82. $ID_bene = $row2[1];
  83. $marcamodello= $row2[2];
  84. $ID_monitor = $row2[3];
  85. $pollici= $row2[4];
  86. }else{
  87. $bene = '';
  88. $ID_bene = '';
  89. $marcamodello= '';
  90. $ID_monitor = '';
  91. $pollici= '';
  92. }
  93. $collocazione= $row[3];
  94. $query = "SELECT * FROM collocazione WHERE ID=$collocazione";
  95. $result2 = mysql_query($query);
  96. if (!$result2) die ("Database access failed: " . mysql_error());
  97. $row2 = mysql_fetch_row($result2);
  98. $ubicazione = $row2[1];
  99. $sc= $row2[2];
  100. $ufficio = $row2[3];
  101. $query = "SELECT * FROM sc WHERE ID=$sc";
  102. $result2 = mysql_query($query);
  103. if (!$result2) die ("Database access failed: " . mysql_error());
  104. $row2 = mysql_fetch_row($result2);
  105. $sc = $row2[1];
  106. $cognome_nome_utente = $row[4];
  107. $telefono = $row[5];
  108. $n1 = $row[8];
  109. $n2 = $row[9];
  110. $n3 = $row[10];
  111. $presadirete=$row[6];
  112. $attiva=$row[7];
  113. $sopralluogo = $row[11];
  114. $esito= $row[13];
  115. $datarichiesta = $row[15];
  116. list($data_a,$data_m,$data_g) = explode("-",$datarichiesta);
  117. $time = mktime(0,0,0, $data_m, $data_g, $data_a);
  118. $datarichiesta= date ('d-m-Y',$time);
  119. echo <<<_END
  120. <tr>
  121. <td bordercolor= "#000000" ><input type="checkbox" name="dainviare[]" value="$ID"/></td>
  122. <td>
  123. <table align="left">
  124. <tr>
  125. <td align="left">
  126. <font class="rosso">$ID &nbsp &nbsp &nbsp</font>
  127. _END;
  128. if($tipo=='sost')
  129. echo "<font class=\"blue\">SOSTITUZIONE</font>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp $datarichiesta";
  130. if($tipo=='nuovo')
  131. echo"<font class=\"blue\">NUOVO</font>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp $datarichiesta";
  132. if($tipo=='sost'){
  133. echo <<<_END
  134. <table>
  135. <tr>
  136. <td>$ID_bene</td>
  137. <td>$marcamodello</td>
  138. <td>&nbsp &nbsp</td>
  139. <td>$ID_monitor</td>
  140. <td>$pollici</td>
  141. </tr>
  142. </table>
  143. _END;
  144. }
  145. echo <<<_END
  146. <table>
  147. <tr>
  148. <td>$cognome_nome_utente &nbsp &nbsp </td>
  149. <td>$telefono</td>
  150. </tr>
  151. </table>
  152. <table>
  153. <tr>
  154. <td>$ubicazione</td>
  155. <td>$sc</td>
  156. <td>$ufficio</td>
  157. </tr>
  158. </table>
  159. _END;
  160. if($n1!=0 || $n2!=0 ||$n3!=0)
  161. {
  162. echo <<<_END
  163. Note:
  164. <table>
  165. _END;
  166. if($n1!=0)
  167. {
  168. $query = "SELECT * FROM note WHERE ID=$n1";
  169. $result2 = mysql_query($query);
  170. if (!$result2) die ("Database access failed: " . mysql_error());
  171. $row2 = mysql_fetch_row($result2);
  172. $nota1 = $row2[1];
  173. echo <<<_END
  174. <tr>
  175. <td>Programmi:</td>
  176. <td>$nota1</td>
  177. </tr>
  178. _END;
  179. }
  180. if($n2!=0)
  181. {
  182. $query = "SELECT * FROM note WHERE ID=$n2";
  183. $result2 = mysql_query($query);
  184. if (!$result2) die ("Database access failed: " . mysql_error());
  185. $row2 = mysql_fetch_row($result2);
  186. $nota2 = $row2[1];
  187. echo <<<_END
  188. <tr>
  189. <td>Orario:</td>
  190. <td>$nota2</td>
  191. </tr>
  192. _END;
  193. }
  194. if($n3!=0)
  195. {
  196. $query = "SELECT * FROM note WHERE ID=$n3";
  197. $result2 = mysql_query($query);
  198. if (!$result2) die ("Database access failed: " . mysql_error());
  199. $row2 = mysql_fetch_row($result2);
  200. $nota3 = $row2[1];
  201. echo <<<_END
  202. <tr>
  203. <td>Varie:</td>
  204. <td>$nota3</td>
  205. </tr>
  206. _END;
  207. }
  208. echo <<<_END
  209. </table>
  210. _END;
  211. }
  212. echo <<<_END
  213. </tr>
  214. </table>
  215. </td>
  216. <td bordercolor= "#FFCC33" >
  217. _END;
  218. $query = "SELECT * FROM sopralluogo WHERE ID=\"$sopralluogo\"";
  219. $result2 = mysql_query($query);
  220. if (!$result2) die ("Database access failed: " . mysql_error());
  221. $row2 = mysql_fetch_row($result2);
  222. $presarete = $row2[1];
  223. $corrente = $row2[2];
  224. $nsop = $row2[3];
  225. if($nsop!=0)
  226. {
  227. $query = "SELECT nota FROM note WHERE ID=\"$nsop\"";
  228. $result2 = mysql_query($query);
  229. if (!$result2) die ("Database access failed: " . mysql_error());
  230. $row2 = mysql_fetch_row($result2);
  231. $notasop = $row2[0];
  232. }
  233. else{
  234. $notasop=' ';
  235. }
  236. echo <<<_END
  237. corrente: $corrente
  238. <br>
  239. presarete: $presarete $presadirete $attiva
  240. <br>
  241. $notasop
  242. </td>
  243. </tr>
  244. _END;
  245. }
  246. echo" </table></form>";
  247. /*
  248. } else
  249. {
  250. echo "protezione pagina - no diritti di amministrazine";
  251. }
  252. */
  253. }
  254. include 'CSS/templateEnd.html';
  255. ?>