Changeset 79 for trunk/admin/modules/Elezioni/ele_consultazioni.php
- Timestamp:
- Apr 25, 2010, 9:11:27 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_consultazioni.php
r45 r79 71 71 $language=$_SESSION['lang']; 72 72 if (($perms>64)) { 73 if (isset($help)) include("language/$language/ele_consultazioni.html"); 73 ############# Controllo flag per cancellazione consultazione 74 echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n" 75 ."//-->\n"; 76 echo "function del_cons() {\n"; 77 echo "if (document.consultazione.pwd3.checked==false) {\n"; 78 echo "document.consultazione.update.value=\""._MODIFY."\" \n"; 79 echo "document.consultazione.do.value=\"update\" \n"; 80 echo "}else{\n"; 81 echo "document.consultazione.update.value=\""._DELETE."\" \n"; 82 echo "document.consultazione.do.value=\"delete\" \n"; 83 echo "} \n"; 84 echo "} \n"; 85 echo "</script>\n"; 86 ######################### 87 if (isset($help)) include("language/$language/ele_consultazioni.html"); 74 88 75 89 if ($do == "modify") { … … 85 99 ."<input type=\"hidden\" name=\"do\" value=\"update\">" 86 100 ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"".$pro['id_cons_gen']."\">" 87 ."<table width=\"100%\"> "._MODIFY." ".$pro['descrizione']." <br><br>";101 ."<table width=\"100%\"><tr><td>"._MODIFY." ".$pro['descrizione']." <br><br>"; 88 102 switch ($genere) { 89 103 case "0" : $gencons=_GENCONS0;break; … … 99 113 default :$gencons=""; 100 114 } 101 echo "< tr><td>"._TIPO."</td><td>$gencons</td></tr>";115 echo "</td></tr><tr><td>"._TIPO."</td><td>$gencons</td></tr>"; 102 116 echo "<tr bgcolor=\"$bgcolor2\"><td>"._DESCR. "</td><td><input name=\"descr_cons2\" value=\"".$pro['descrizione']."\" size=\"15\"></td></tr>"; 103 117 echo "<tr><td>"._DATAIN." :</td><td>"; 104 118 echo "<select name=\"dig\" >"; 105 echo "<option value=\"$dig1\" selected>$dig1</option>";giorno( );119 echo "<option value=\"$dig1\" selected>$dig1</option>";giorno(0,0); 106 120 echo "<select name=\"dim\" >"; 107 121 echo "<option value= \"$dim1\" selected>$dim1</option>"; mese(); … … 111 125 echo "<tr><td>"._DATAFINE." :</td><td>"; 112 126 echo "<select name=\"dfg\" >"; 113 echo "<option value=\"$dfg1\" selected>$dfg1</option>";giorno( );127 echo "<option value=\"$dfg1\" selected>$dfg1</option>";giorno(0,0); 114 128 echo "<select name= \"dfm\" >"; 115 129 echo "<option value= \"$dfm1\" selected>$dfm1</option>"; mese(); 116 130 echo "<select name= \"dfa\" >"; 117 131 echo "<option value=\"$dfa1\" selected>$dfa1</option>"; anno(); 118 echo "</td></tr><tr><td>" 119 ."<input type=\"submit\" name=\"update\" value=\""._MODIFY."\">" 132 echo "</td></tr><tr>"; 133 $resdel = mysql_query("SELECT * FROM ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen'", $dbi); 134 if(mysql_num_rows($resdel)==0) 135 echo "<td><fieldset><legend>Abilita la cancellazione</legend><label id=\"prov\">"._SPUNTAELIMINA." <input type=\"checkbox\" name=\"pwd3\" value=\"\" onchange=\"del_cons()\"></label></fieldset></td>"; 136 else echo "<td></td>"; 137 echo "<td><input type=\"submit\" name=\"update\" value=\""._MODIFY."\">" 120 138 ."</td></tr></table></form>"; 121 139 } else { … … 126 144 ."<hr><h6>" 127 145 ._ADD." "._CONSULTA."<br><br>"; 128 echo _DEFCONS.":< br><table whidth=\"100%\">";146 echo _DEFCONS.":</h6><br><table width=\"100%\">"; 129 147 130 148 $res=mysql_query("SELECT * FROM ".$prefix."_ele_tipo where lingua='$language'", $dbi); … … 143 161 echo "<tr><td><b>"._DESCR. "</b></td><td><input type=\"text\" name=\"descr_cons2\" maxlength=\"100\"></td></tr>" 144 162 ."<tr><td><b>"._DATAIN. "</b></td><td>"; 145 echo "<select name= \"dig\" ><option value=\"$dig\" selected>$dig</option>"; giorno( );163 echo "<select name= \"dig\" ><option value=\"$dig\" selected>$dig</option>"; giorno(0,0); 146 164 echo "<select name= \"dim\" ><option value=\"$dim\" selected>$dim</option>"; mese(); 147 165 echo "<select name= \"dia\" ><option value=\"$dia\" selected>$dia</option>"; anno() ; … … 149 167 150 168 ."<tr><td><b>"._DATAFINE. "</b></td><td>"; 151 echo "<select name= \"dfg\" ><option value=\"$dfg\" selected>$dfg</option>"; giorno( );169 echo "<select name= \"dfg\" ><option value=\"$dfg\" selected>$dfg</option>"; giorno(0,0); 152 170 echo "<select name= \"dfm\" ><option value=\"$dfm\" selected>$dfm</option>"; mese(); 153 171 echo "<select name= \"dfa\" ><option value=\"$dfa\" selected>$dfa</option>"; anno() ; … … 173 191 ."</td><td align=\"center\" nowrap bgcolor=\"$bgcolor1\">[<a 174 192 href=\"admin.php?op=consultazione&do=modify&id_cons_gen=$id\"><img src=\"modules/Elezioni/images/edit.gif\" 175 border=\"0\" align=\"middle\" > "._EDIT."</a>]"193 border=\"0\" align=\"middle\" alt=\"Edit\"> "._EDIT."</a>]" 176 194 ."</td></tr>"; 177 195 } … … 203 221 204 222 if ($perms>=128) { 205 // LA CANCELLAZIONE VA EVITATA, se interessa va garantita l'integrità referenziale 206 /* if ($do == "delete") { 207 if ($ok !="1") { 208 echo "<center><br><br>"._DOMCANCELLA." $descr ?<br>"; 209 echo "[ <a href=\"admin.php?op=consultazione\">"._NO."</a> ] - [<a href=\"admin.php?op=consultazione&do=delete&id_cons=$id_cons&ok=1\">"._YES."</a> ]"; 210 }else{ 211 $result = sql_query("delete from ".$prefix."_ele_consultazione where id_cons='$id_cons'", $dbi); 223 if ($do == "delete") { 224 $result = mysql_query("delete from ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'", $dbi); 212 225 if (!$result) return; 213 226 Header("Location: admin.php?op=consultazione"); 214 } 215 }*/ 227 } 216 228 if ($do == "add") { 217 229 if ($descr_cons2) { … … 261 273 } 262 274 if ($op=="consultazione") 263 if (isset($param['do']) )275 if (isset($param['do']) and $do!='modify') 264 276 consultazione($ok, $id_cons_gen,$tipocons, $data_in, $data_fine,$do, $dig, $dim, $dia, $dfg, $dfm, $dfa, $duplica,$referendum,$liste,$gruppi,$ballo,$votigruppo); 265 else consultazione('', $id_cons_gen,'','','','','','','','','','','','','','','','','');277 # else consultazione('', $id_cons_gen,'','','','','','','','','','','','','','','','',''); 266 278 ele(); 267 279 all(); 268 echo"</td></tr></table> ";280 echo"</td></tr></table></div>"; 269 281 include("footer.php"); 270 282
Note:
See TracChangeset
for help on using the changeset viewer.