Changeset 359 for trunk/admin
- Timestamp:
- Feb 25, 2022, 9:32:36 AM (3 years ago)
- Location:
- trunk/admin
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/admin.php
r358 r359 17 17 #$LIMITE=3; //fascia di separazione del maggioritario (15.000 abitanti) 18 18 # tempo di sessione: ini_set('session.gc_maxlifetime','3600'); 19 global $multicomune,$msglogout ;19 global $multicomune,$msglogout,$language; 20 20 21 21 // Adattamento variabili superglobal … … 307 307 $admincomune=$row[1]; 308 308 $adminop=$row[2]; 309 309 310 310 #if (($adminsuper==1 || $admincomune==1 || $adminop==1)) { 311 311 if ($adminsuper==1) 312 312 return 256; 313 elseif ($admincomune==1) {313 elseif ($admincomune==1) 314 314 return 64; 315 315 # $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='$id_comune'"); 316 }else{ 317 318 319 320 321 322 }316 317 $sth = $dbi->prepare("select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'"); 318 $sth->execute(); 319 $row = $sth->fetch(PDO::FETCH_BOTH); 320 $id_cons=$row[0]; 321 $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'"); 322 323 323 $sth->execute(); 324 324 $row = $sth->fetch(PDO::FETCH_BOTH); … … 405 405 */ 406 406 global $siteistat,$perms,$msglogout; 407 407 $language=$_SESSION['lang']; 408 408 $ref="Location: admin.php?"; 409 409 #$ref="Location: https://www.eleonline.it/adminmob/admin.php?"; … … 415 415 416 416 if (isset($_SESSION['lang'])) 417 $ref=$ref."&language= ".$_SESSION['lang'];417 $ref=$ref."&language=$language"; 418 418 $ref.="&msglogout=$msglogout"; 419 419 $_SESSION=array(); … … 444 444 } 445 445 } 446 447 446 448 #echo "op:".$param['op']." -- aid:".$_SESSION['aid']."remote:".$_SESSION['remote']."REMOTE:".$_SERVER['REMOTE_ADDR']; 447 449 if (isset($param['op'])) $op=addslashes($param['op']); else $op='ele'; … … 451 453 if($tema=='Futura2' and $op!='logout') 452 454 { 453 include("temi/$tema/index.php"); 454 testata(); 455 include("temi/$tema/index.php"); 455 456 }else 456 457 switch($op) { -
trunk/admin/aggiornadb.php
r358 r359 43 43 return $ret; 44 44 } 45 function aggiorna_index($ sql,$dbi,$sql2,$num){45 function aggiorna_index($tab,$ind,$dbi,$sql2,$num){ 46 46 $ret=0; 47 try{ 48 $res = $dbi->prepare("$sql"); 49 $res->execute(); 50 $ret= 1; 51 } 52 catch(PDOException $e) 53 { 54 $ret=0; 55 echo "<br>".$num.") Fallito: $sql"; 56 return $ret; 47 $sqltest="SHOW INDEX FROM `$tab` WHERE KEY_NAME = '$ind'"; 48 $res = $dbi->prepare("$sqltest"); 49 $res->execute(); 50 if($res->rowCount()) { 51 $sql="ALTER TABLE `$tab` DROP INDEX `$ind`"; 52 try{ 53 $res = $dbi->prepare("$sql"); 54 $res->execute(); 55 $ret= 1; 56 } 57 catch(PDOException $e) 58 { 59 $ret=0; 60 echo "<br>".$num.") Fallito: $sql -- $e->getmessage()"; 61 return $ret; 62 } 57 63 } 58 59 64 if("$sql2"!=""){ 60 65 try{ … … 127 132 $ret=aggiorna($sql,$dbi,'',$num); 128 133 } 129 if(!controllo($prefix.'_ele_operatori','id_ circ',++$num))134 if(!controllo($prefix.'_ele_operatori','id_sez',++$num)) 130 135 { 131 136 $sql="ALTER TABLE `".$prefix."_ele_operatori` ADD `id_sez` INT(11) NOT NULL DEFAULT 0 AFTER `id_circ`"; … … 185 190 186 191 $sql="ALTER TABLE `".$prefix."_ele_gruppo` CHANGE `num_circ` `num_circ` INT(2) UNSIGNED NOT NULL DEFAULT '1';"; 192 $ret=aggiorna($sql,$dbi,'',++$num); 193 194 $sql="ALTER TABLE `soraldo_authors` CHANGE `adminsuper` `adminsuper` TINYINT(2) NOT NULL DEFAULT '0';"; 187 195 $ret=aggiorna($sql,$dbi,'',++$num); 188 196 … … 281 289 282 290 283 $sql="ALTER TABLE `".$prefix."_ele_voti_ref` DROP INDEX `id_cons`; ";284 $sql2="ALTER TABLE `".$prefix."_ele_voti_ref` ADD INDEX `id_cons` (`id_cons`, `id_gruppo`) USING BTREE";285 $ret=aggiorna_index($sql,$dbi,$sql2,++$num);286 291 287 292 #if(!$ret) … … 291 296 #else 292 297 # echo "<br>".$num++.") Index aggiunto"; 293 $sql="ALTER TABLE `".$prefix."_ele_voti_lista` DROP INDEX `id_cons`"; 298 #$sql="ALTER TABLE `".$prefix."_ele_voti_lista` DROP INDEX if exists `id_cons`"; 299 300 $tab=$prefix."_ele_voti_ref"; 301 $ind="id_cons"; 302 # $sql="ALTER TABLE `".$prefix."_ele_voti_ref` DROP INDEX `id_cons`; "; 303 $sql2="ALTER TABLE `".$prefix."_ele_voti_ref` ADD INDEX `id_cons` (`id_cons`, `id_gruppo`) USING BTREE"; 304 $ret=aggiorna_index($tab, $ind,$dbi,$sql2,++$num); 305 306 $tab=$prefix."_ele_voti_lista"; 307 $ind="id_cons"; 294 308 $sql2="ALTER TABLE `".$prefix."_ele_voti_lista` ADD INDEX `id_cons` (`id_cons`, `id_sez`, `id_lista`) USING BTREE"; 295 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 296 297 $sql="ALTER TABLE `".$prefix."_ele_voti_gruppo` DROP INDEX `id_cons`"; 309 $ret=aggiorna_index($tab,$ind,$dbi,$sql2,++$num); 310 311 $tab=$prefix."_ele_voti_gruppo"; 312 $ind="id_cons"; 313 #$sql="ALTER TABLE `".$prefix."_ele_voti_gruppo` DROP INDEX if exists `id_cons`"; 298 314 $sql2="ALTER TABLE `".$prefix."_ele_voti_gruppo` ADD INDEX `id_cons` (`id_cons`, `id_sez`, `id_gruppo`) USING BTREE"; 299 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 300 301 $sql="ALTER TABLE `".$prefix."_ele_voti_candidati` DROP INDEX `id_cons`"; 315 $ret=aggiorna_index($tab,$ind,$dbi,$sql2,++$num); 316 317 $tab=$prefix."_ele_voti_candidati"; 318 $ind="id_cons"; 319 #$sql="ALTER TABLE `".$prefix."_ele_voti_candidati` DROP INDEX if exists `id_cons`"; 302 320 $sql2="ALTER TABLE `".$prefix."_ele_voti_candidati` ADD INDEX `id_cons` (`id_cons`, `id_sez`, `id_cand`) USING BTREE"; 303 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 304 305 $sql="ALTER TABLE `".$prefix."_ele_lista` DROP INDEX `id_cons`"; 321 $ret=aggiorna_index($tab,$ind,$dbi,$sql2,++$num); 322 323 $tab=$prefix."_ele_lista"; 324 $ind="id_cons"; 325 #$sql="ALTER TABLE `".$prefix."_ele_lista` DROP INDEX if exists `id_cons`"; 306 326 $sql2="ALTER TABLE `".$prefix."_ele_lista` ADD INDEX `id_cons` (`id_cons`, `id_gruppo`) USING BTREE"; 307 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 308 309 $sql="ALTER TABLE `".$prefix."_ele_lista` DROP INDEX `PRIMARY`"; 327 $ret=aggiorna_index($tab,$ind,$dbi,$sql2,++$num); 328 329 $tab=$prefix."_ele_lista"; 330 $ind="PRIMARY"; 331 #$sql="ALTER TABLE `".$prefix."_ele_lista` DROP INDEX if exists `PRIMARY`"; 310 332 $sql2="ALTER TABLE `".$prefix."_ele_lista` ADD PRIMARY KEY (`id_lista`) USING BTREE"; 311 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 312 313 $sql="ALTER TABLE `".$prefix."_ele_gruppo` DROP INDEX `id_cons`"; 333 $ret=aggiorna_index($tab,$ind,$dbi,$sql2,++$num); 334 335 $tab=$prefix."_ele_gruppo"; 336 $ind="id_cons"; 337 #$sql="ALTER TABLE `".$prefix."_ele_gruppo` DROP INDEX if exists `id_cons`"; 314 338 $sql2="ALTER TABLE `".$prefix."_ele_gruppo` ADD INDEX `id_cons` (`id_cons`, `id_circ`) USING BTREE"; 315 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 316 317 $sql="ALTER TABLE `".$prefix."_ele_gruppo` DROP INDEX `PRIMARY`"; 339 $ret=aggiorna_index($tab,$ind,$dbi,$sql2,++$num); 340 341 $tab=$prefix."_ele_gruppo"; 342 $ind="PRIMARY"; 343 #$sql="ALTER TABLE `".$prefix."_ele_gruppo` DROP INDEX if exists `PRIMARY`"; 318 344 $sql2="ALTER TABLE `".$prefix."_ele_gruppo` ADD PRIMARY KEY (`id_gruppo`) USING BTREE"; 319 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 320 321 $sql="ALTER TABLE `".$prefix."_ele_candidati` DROP INDEX `id_cons`"; 345 $ret=aggiorna_index($tab,$ind,$dbi,$sql2,++$num); 346 347 $tab=$prefix."_ele_candidati"; 348 $ind="id_cons"; 349 #$sql="ALTER TABLE `".$prefix."_ele_candidati` DROP INDEX if exists `id_cons`"; 322 350 $sql2="ALTER TABLE `".$prefix."_ele_candidati` ADD INDEX `id_cons` (`id_cons`, `id_lista`) USING BTREE"; 323 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 324 325 $sql="ALTER TABLE `".$prefix."_ele_candidati` DROP INDEX `PRIMARY`"; 351 $ret=aggiorna_index($tab,$ind,$dbi,$sql2,++$num); 352 353 $tab=$prefix."_ele_candidati"; 354 $ind="PRIMARY"; 355 #$sql="ALTER TABLE `".$prefix."_ele_candidati` DROP INDEX if exists `PRIMARY`"; 326 356 $sql2="ALTER TABLE `".$prefix."_ele_candidati` ADD PRIMARY KEY (`id_cand`) USING BTREE"; 327 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 328 329 $sql="ALTER TABLE `".$prefix."_ele_consultazione` ADD UNIQUE `descrizione` (`descrizione`(100))"; 330 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 357 $ret=aggiorna_index($tab,$ind,$dbi,$sql2,++$num); 358 359 $tab=$prefix."_ele_consultazione"; 360 $ind="descrizione"; 361 #$sql="ALTER TABLE `".$prefix."_ele_consultazione` DROP INDEX if exists `descrizione`"; 362 $sql2="ALTER TABLE `".$prefix."_ele_consultazione` ADD UNIQUE `descrizione` (`descrizione`(100))"; 363 $ret=aggiorna_index($tab,$ind,$dbi,$sql2,++$num); 364 331 365 332 366 ?> -
trunk/admin/footer.php
r323 r359 20 20 /* LE SEGUENTI LINEE DI PROGRAMMA NON DEVONO ESSERE MODIFICATE */ 21 21 /************************************************************************/ 22 echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> 23 <tr bgcolor=\"#000000\"><td align=\"right\"> 24 <b><font color=\"#ffffff\"><a href=\"http://www.eleonline.it\" target=\"eleonline\"> 25 26 $version - <img src=\"modules/Elezioni/images/ico.jpg\" border=\"0\" alt=\"Eleonline\" align=\"middle\"></a> "._GESTIONE." by robertogigli & luciano apolito</font></b></td></tr></table>"; 22 echo "<table width=\"100%\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\"> 23 <tr><td align=\"right\"> 24 <a href=\"http://www.eleonline.it\" target=\"eleonline\"> 25 $version - <img src=\"modules/Elezioni/images/ico.jpg\" border=\"0\" alt=\"Eleonline\" align=\"middle\"></a></td><td bgcolor=\"grey\"<b><font color=\"#ffffff\"> "._GESTIONE." by robertogigli & luciano apolito</font></b></td></tr></table>"; 27 26 echo "</td></tr></table></div>"; 28 27 echo "</body>\n" -
trunk/admin/header.php
r358 r359 13 13 if(isset($_SESSION['aid'])){ 14 14 include_once("modules/Elezioni/query.sql"); 15 15 global $language; 16 16 $row=setconsultazione(); 17 17 if(isset($row[0])) { … … 27 27 } 28 28 } 29 if (isset($param['language'])) { 29 if(!isset($language) or strlen($language)!=2) 30 $language='it'; 31 if (isset($param['language']) and strlen($param['language']==2)) { 30 32 $_SESSION['lang']=substr($param['language'],0,2); 31 33 $lang=$_SESSION['lang']; 32 34 } 33 35 elseif (strlen($_SESSION['lang'])==2) $lang=$_SESSION['lang']; 34 else $lang=$language;36 else {$lang=$language; $_SESSION['lang']=$lang;} 35 37 include_once("modules/Elezioni/language/lang-$lang.php"); 36 37 38 38 39 ############### -
trunk/admin/modules/Elezioni/ele_permessi.php
r358 r359 85 85 } 86 86 } 87 88 87 if (!$listmp) $listmp="''"; 89 88 $sql="select aid from ".$prefix."_authors where id_comune=$id_comune and (admincomune=0 and adminop=0 and aid not in ($listmp)) order by aid"; // operatori registrati ma non ancora autorizzati -
trunk/admin/temi/Futura2/index.php
r358 r359 15 15 if($key=='id_lista') $id_lista=$val; 16 16 } 17 17 18 include("header.php"); 18 19 $nometema=$tema; … … 49 50 50 51 list($descr_com) = $res->fetch(PDO::FETCH_NUM); 51 52 include_once("header.php"); 53 testata(); 52 54 53 55 #################################### … … 56 58 57 59 global $op,$tema,$dbi,$nometema,$file,$bgcolor,$sitename,$prefix,$blocco,$lang,$siteistat,$id_cons_gen,$descr_cons,$minsez,$offsetsez,$multicomune,$id_comune,$multicomune,$rss,$colortheme,$descr_com; 58 global $id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av,$votog,$genere,$aid,$bgcolor1 ;60 global $id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av,$votog,$genere,$aid,$bgcolor1,$language; 59 61 include("temi/$tema/function_theme.php"); 60 62 #$op='informazioni'; … … 730 732 // if ($genere<4 or $votoc){ 731 733 // } 732 734 $sql="select t1.* from ".$prefix."_ele_voti_candidati as t1, ".$prefix."_ele_candidati as t2 where t1.id_cand=t2.id_cand and t1.id_sez='$id_sez' and t2.id_lista='$id_lista3' limit 0,1"; 735 $rese = $dbi->prepare("$sql"); 736 $rese->execute(); 737 if($rese->rowCount()) $segna="style=\"background-color: #99CC33;\""; else $segna=''; 733 738 $sql="select * from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' and id='$id_lista3'"; 734 739 $rese = $dbi->prepare("$sql"); 735 740 $rese->execute(); 736 if($rese->rowCount()) $segna="style=\"background-color: #dd0000;\""; else $segna=''; 741 if($rese->rowCount()) $segna="style=\"background-color: #dd0000;\""; 742 list($sezcol)=$rese->fetch(PDO::FETCH_NUM); 737 743 $errcolor=''; 738 744 if(isset($errgrulis[$rifgruppo])) $errcolor="style=\"background-color: rgb(255, 0, 0);\""; … … 743 749 #funzione non ritenuta utile 744 750 # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19) { echo "</td><td align=\"right\"><input name=\"vnpl$i\" value=\"".$vnpl."\" size=\"7\" style=\"text-align:right\">"; $tvnpl+=$vnpl;} 745 if($disgiunto) {echo "</td><td align=\"right\"><input name=\"slpl$i\" value=\"".$slpl."\" size=\"7\" style=\"text-align:right\">"; $tslpl+= $slpl;}751 if($disgiunto) {echo "</td><td align=\"right\"><input name=\"slpl$i\" value=\"".$slpl."\" size=\"7\" style=\"text-align:right\">"; $tslpl+=intval($slpl);} 746 752 echo "<input type=\"hidden\" name=\"id_lista$i\" value=\"$id_lista3\"></td>"; 747 753 // echo "<td align=\"right\">$sgpl"; -
trunk/admin/versione.php
r358 r359 1 1 <?php 2 2 3 $versione = "3.0 rev 35 8";3 $versione = "3.0 rev 359"; 4 4 $version_number = $versione; 5 $datarel = "2 3febbraio 2022";5 $datarel = "24 febbraio 2022"; 6 6 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)"; 7 7
Note:
See TracChangeset
for help on using the changeset viewer.