Changeset 172 for trunk/admin/modules/Elezioni/ele_gruppo.php
- Timestamp:
- Feb 15, 2013, 10:19:05 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_gruppo.php
r101 r172 41 41 if (isset($param['descr_gruppo'])) get_magic_quotes_gpc() ? $descr_gruppo=$param['descr_gruppo']:$descr_gruppo=addslashes($param['descr_gruppo']); else $descr_gruppo=''; 42 42 if (isset($param['simbolo'])) get_magic_quotes_gpc() ? $simbolo=$param['simbolo']:$simbolo=addslashes($param['simbolo']); else $simbolo=''; 43 if (isset($param['delsimb'])) get_magic_quotes_gpc() ? $delsimb=$param['delsimb']:$delsimb=addslashes($param['delsimb']); 44 if (isset($param['delprog'])) get_magic_quotes_gpc() ? $delprog=$param['delprog']:$delprog=addslashes($param['delprog']); 43 45 /******************************************************/ 44 46 /*Funzione di visualizzazione globale */ 45 47 /*****************************************************/ 46 48 function all() { 47 global $ tipo_cons,$param,$currentlang, $bgcolor1, $bgcolor2, $prefix, $dbi, $offset, $min, $id_cons,$id_cons_gen,$id_comune,$id_circ,$do,$id_gruppo;49 global $delsimb,$delprog,$tipo_cons,$param,$currentlang, $bgcolor1, $bgcolor2, $prefix, $dbi, $offset, $min, $id_cons,$id_cons_gen,$id_comune,$id_circ,$do,$id_gruppo; 48 50 $res = mysql_query("SELECT circo FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons' and lingua='$currentlang'", $dbi); 49 51 list($cons_circ)= mysql_fetch_row($res); … … 63 65 echo "</select></td></tr></table></form>"; 64 66 } 65 echo "<center><font class=\"title\"><b>"._GRUPPO."</b></font><br><table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor1\">" 67 echo "<center><font class=\"title\"><b>"._GRUPPO."</b></font><br>"; 68 69 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor1\"><td colspan=\"5\">"; 70 echo "<form name=\"gruppo2\" enctype=\"multipart/form-data\" action=\"admin.php\" method=\"post\">" 71 ."<input type=\"hidden\" name=\"op\" value=\"gruppo\">"; 72 echo "<table><tr>" 66 73 ."<td align=\"center\"width=\"5%\"><b>"._NUM."</b></td>" 67 74 ."<td align=\"center\"><b>"._DESCR."</b></td>" 68 ."<td align=\"center\"width=\"5%\"><b>"._SIMBOLO."</b></td>"; 69 if ($tipo_cons!=2) 70 echo "<td align=\"center\"width=\"5%\"><b>"._PROGRAM."</b></td>"; 75 ."<td align=\"center\"width=\"5%\"><b>"._SIMBOLO."</b>"; 76 if ($do=='modify') 77 echo "<br><input type=\"checkbox\" name=\"delsimb\" value=\"false\"> "._DELETE; 78 echo "</td>"; 79 80 if ($tipo_cons!=2) { 81 echo "<td align=\"center\"width=\"5%\"><b>"._PROGRAM."</b>"; 82 if ($do=='modify') 83 echo "<br><input type=\"checkbox\" name=\"delprog\" value=\"false\"> "._DELETE; 84 echo "</td>"; 85 } 71 86 echo "<td align=\"center\"><b>"._FUNZIONI."</b></td></tr>"; 72 87 //-----------------------visualizza riga superiore per inserimento - … … 75 90 $max = mysql_num_rows($res); 76 91 $nuovo_gruppo=$max+1; 77 echo "<form name=\"gruppo2\" enctype=\"multipart/form-data\" action=\"admin.php\" method=\"post\">" 78 ."<input type=\"hidden\" name=\"op\" value=\"gruppo\">"; 92 echo "<tr><td>"; 79 93 if ($do=='modify') { 80 94 $resl = mysql_query("SELECT * FROM ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'", $dbi); … … 90 104 echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">" 91 105 ."<input type=\"hidden\" name=\"id_gruppo\" value=\"".$gru['id_gruppo']."\">" 92 ."< tr><td><input type=\"text\" name=\"num_gruppo\" value=\"$nuovo_gruppo\" size=\"5\"></td>"106 ."<input type=\"text\" name=\"num_gruppo\" value=\"$nuovo_gruppo\" size=\"5\"></td>" 93 107 ."<td><input type=\"text\" name=\"descr_gruppo\" value=\"".$gru['descrizione']."\"></td>"; 94 108 echo "<td><input type=\"file\" name=\"stemma\" size=\"5\"></td>"; //file=$gru[simbolo] 95 109 if ($tipo_cons!=2) 96 echo "<td><input type=\"file\" name=\"programma\" size=\"5\"></td>";110 echo "<td><input type=\"file\" name=\"programma\" size=\"5\">"; 97 111 echo "<input type=\"hidden\" name=\"min\" value=\"$min\">"; 98 112 echo "<input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\">"; … … 100 114 echo "<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">" 101 115 ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">" 102 ."<input type=\"hidden\" name=\"min\" value=\"$min\"> ";116 ."<input type=\"hidden\" name=\"min\" value=\"$min\"></td>"; 103 117 if ($do=='modify') 104 118 echo "<td><input type=\"submit\" name=\"add\" value=\""._MODIFY."\"></td>"; 105 119 else 106 120 echo "<td><input type=\"submit\" name=\"add\" value=\""._ADD."\"></td>"; 107 echo "</ form>";108 121 echo "</tr></table></form>"; 122 echo "</td></tr>"; 109 123 110 124 … … 161 175 162 176 function gruppo($ok, $do,$id_gruppo,$num_gruppo,$descr_gruppo, $simbolo,$id_circ) { 163 global $ prefix, $dbi, $id_cons,$simbolo2,$genere,$id_cons_gen,$id_comune,$min;177 global $delsimb,$delprog,$prefix, $dbi, $id_cons,$simbolo2,$genere,$id_cons_gen,$id_comune,$min; 164 178 $aid=$_SESSION['aid']; 165 179 $perms=ChiSei($id_cons_gen); … … 236 250 $prognome=addslashes($nomeprog ); 237 251 $cond=", prognome='$prognome', programma='$progblob'"; 238 } else {$cond='';} 252 } else { 253 if ( $delprog=='false') $cond=", prognome='', programma=''"; 254 else $cond=''; 255 } 239 256 240 257 … … 252 269 $stemmanome=addslashes($nomestemma); 253 270 $cond2=", simbolo='$stemmanome', stemma='$stemmablob'"; 254 } else {$cond2='';} 271 } else { 272 if ( $delsimb=='false') $cond2=", simbolo='', stemma=''"; 273 else $cond2=''; 274 } 255 275 $result = mysql_query("update ".$prefix."_ele_gruppo set num_gruppo='$num_gruppo' , descrizione='$descr_gruppo' $cond $cond2 where id_gruppo='$id_gruppo' ", $dbi) || die("Errore di aggiornamento dei dati!".mysql_error()); 256 276 Header("Location: admin.php?op=gruppo&id_cons_gen=$id_cons_gen&id_circ=$id_circ&min=$min");
Note:
See TracChangeset
for help on using the changeset viewer.