die; } if ($argv[1] == '--checks') { checks(); die; } if ($argv[1] == '--maintenance') { maintenance(); die; } if (!Build_pid_func(__FILE__, "MAIN")) { writelogs(basename(__FILE__) . ":Already executed.. aborting the process", basename(__FILE__), __FILE__, __LINE__); die; } if ($argv[1] == '--tables') { checks(); die; } if ($argv[1] == '--imapsync') { rebuild_imapsync(); die; } if ($argv[1] == '--rebuild-zarafa') { rebuild_zarafa(); die; } if ($argv[1] == '--squid-events-purge') { squid_events_purge(); die; } if ($argv[1] == '--mysqlcheck') {
<select name="MPAA"> <option value="G">G</option> <option value="NC-17">NC-17</option> <option value="PG">PG</option> <option value="PG-13">PG-13</option> <option value="R">R</option> </select></p><br/> Genre (check all that apply): <br/> <?php $genres = array("Action", "Adult", "Adventure", "Animation", "Comedy", "Crime", "Documentary", "Drama", "Family", "Fantasy", "Horror", "Musical", "Mystery", "Romance", "Sci-Fi", "Short", "Thriller", "War", "Western"); function checks($val) { echo "<input type=\"checkbox\" name=\"genre[]\" value=\"{$val}\"/>" . $val . "<br/> "; } foreach ($genres as $gen) { checks($gen); } ?> <?php if ($type == "4" && $_GET["did"]) { // only show submit button after a director is chosen ?> <p><input type="submit" value="Add Movie"/></p> <?php } ?> </form> </p> <?php
include_once(dirname(__FILE__)."/framework/frame.class.inc"); if(preg_match("#--verbose#",implode(" ",$argv))){$GLOBALS["DEBUG"]=true;$GLOBALS["VERBOSE"]=true;} if(posix_getuid()<>0){die("Cannot be used in web server mode\n\n");} $unix=new unix(); $unix->events("Executing ".@implode(" ",$argv)); if($argv[1]=='--execute'){execute_sql($argv[2],$argv[3]);die();} if($argv[1]=='--database-exists'){execute_database_exists($argv[2]);die();} if($argv[1]=='--table-exists'){execute_table_exists($argv[2],$argv[3]);die();} if($argv[1]=='--rownum'){execute_rownum($argv[2],$argv[3]);die();} if($argv[1]=='--GetAsSQLText'){GetAsSQLText($argv[2]);die();} if($argv[1]=='--backup'){Backup($argv[2]);die();} if($argv[1]=='--checks'){checks();die();} if($argv[1]=='--maintenance'){maintenance();die();} if(!Build_pid_func(__FILE__,"MAIN")){ writelogs(basename(__FILE__).":Already executed.. aborting the process",basename(__FILE__),__FILE__,__LINE__); die(); } if($argv[1]=='--tables'){$mysql=new mysql();$mysql->BuildTables();die();} if($argv[1]=='--imapsync'){rebuild_imapsync();die();} if($argv[1]=='--rebuild-zarafa'){rebuild_zarafa();die();} if($argv[1]=='--squid-events-purge'){squid_events_purge();die();} if($argv[1]=='--mysqlcheck'){mysqlcheck($argv[2],$argv[3]);die();}
function checks($nodestroy = false) { $GLOBALS["DEBUG"] = true; $GLOBALS["VERBOSE"] = true; ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); ini_set('error_prepend_string', null); ini_set('error_append_string', null); $q = new mysql(); $q->BuildTables(); $execute = false; $unix = new unix(); $MYSQL_DATA_DIR = $unix->MYSQL_DATA_DIR(); $rm = $unix->find_program("rm"); $tableEngines = array("hardware" => "InnoDB", "accesslog" => "InnoDB", "bios" => "InnoDB", "memories" => "InnoDB", "slots" => "InnoDB", "registry" => "InnoDB", "monitors" => "InnoDB", "ports" => "InnoDB", "storages" => "InnoDB", "drives" => "InnoDB", "inputs" => "InnoDB", "modems" => "InnoDB", "networks" => "InnoDB", "printers" => "InnoDB", "sounds" => "InnoDB", "videos" => "InnoDB", "softwares" => "InnoDB", "accountinfo" => "InnoDB", "netmap" => "InnoDB", "devices" => "InnoDB", "locks" => "HEAP"); if (is_file("/usr/share/artica-postfix/bin/install/ocsbase_new.sql")) { if (!$q->DATABASE_EXISTS("ocsweb")) { $execute = true; } if (!$execute) { while (list($table, $ligne) = each($tableEngines)) { if (!$q->TABLE_EXISTS($table, "ocsweb")) { if ($GLOBALS["VERBOSE"]) { echo "{$table} does not exists...\n"; } $execute = true; break; } else { if ($GLOBALS["VERBOSE"]) { echo "ocsweb/{$table} OK...\n"; } } } } } reset($tableEngines); if ($execute) { $results = array(); while (list($table, $ligne) = each($tableEngines)) { if (!$q->TABLE_EXISTS($table, "ocsweb")) { repairocsweb(); if ($GLOBALS["VERBOSE"]) { echo "Unable to create OCS table (missing {$table}) table\n"; } return; } } } $sql = "SELECT COUNT(networks.HARDWARE_ID),networks.*,hardware.* FROM networks,hardware WHERE networks.HARDWARE_ID=hardware.ID"; $q->QUERY_SQL($sql, "ocsweb"); if (!$q->ok) { if (preg_match("#Table '(.*?)' doesn't exist#", $q->mysql_error)) { if (!$nodestroy) { $q->DELETE_DATABASE("ocsweb"); if (is_dir("{$MYSQL_DATA_DIR}/ocsweb")) { echo "Starting......: " . date("H:i:s") . " OCS removing {$MYSQL_DATA_DIR}/ocsweb\n"; shell_exec("{$rm} -rf {$MYSQL_DATA_DIR}/ocsweb"); } checks(true); } } } }
<html> <head> <meta charset="utf-8"> <title>Bingo</title> <link href="style.css" rel="stylesheet" sizes="any" type="text/css"> </head> <body> <div class="container" style="height: 100%;"> <?php if (!checks() || isset($_POST['newGame'])) { echo "<form method='post'>"; echo "<button type='submit' name='generar'>Generar</button>"; echo "</form>"; } else { echo "<form method='post'>"; echo "<button type='submit' name='newGame'>Nueva Partida</button>"; echo "</form>"; } if (isset($_POST['generar'])) { if (!checks()) { followGame(); } else { echo "<span class='mensaje-end'>¡El cartón " . checks() . " ha cantado bingo!</span>"; } } else { newGame(); } ?> </div> </body> </html>