Example #1
0
<?php

require_once SITE_PATH . DS . 'include' . DS . 'bridge.php';
$hero = new hero();
$request = $_SERVER['QUERY_STRING'];
$parsed = explode('&', $request);
$page = array_shift($parsed);
$page == "" ? $page = "Home" : ($page = $page);
$getVars = array();
foreach ($parsed as $argument) {
    list($variable, $value) = @split('=', $argument);
    $getVars[$variable] = $value;
}
$target = SITE . DS . 'page' . DS . $page . '.php';
$GLOBALS['page'] = $page;
/**
 * Pagine per il quale NON si deve caricare header e footer
 */
$exclude = array("dispatch", "Login", "Javascript", "Logout");
if (!in_array($page, $exclude) && @$getVars['action'] != 'dispatch') {
    include_once SITE . DS . 'include' . DS . 'header.php';
    if (file_exists($target)) {
        $hero->checkModule($page, $getVars['action']);
        include_once $target;
    } else {
        include_once SITE . DS . 'page' . DS . 'Home.php';
    }
    include_once SITE . DS . 'include' . DS . 'footer.php';
} else {
    if (file_exists($target)) {
        $hero->checkModule($page, $getVars['action']);
Example #2
0
 /**
  * @TODO I HAVE TO END THIS !!!!
  * @global object $mysqli
  * @global string $page
  * @param type $tbl
  * @param type $ids
  * @param type $formID
  * @param type $btnID
  * @param type $funcName
  * @param type $method
  */
 function formITrev($tbl, $ids, $formID, $btnID, $funcName, $method)
 {
     global $mysqli;
     global $page;
     $columns = array();
     $query = "SELECT * FROM {$tbl} LIMIT 1";
     echo "<form id=\"{$formID}\" >";
     if ($result = $mysqli->query($query)) {
         // Get field information for all columns
         while ($column_info = $result->fetch_field()) {
             $columns[$column_info->name] = $column_info->type;
         }
     }
     foreach ($columns as $fieldName => $fieldType) {
         if ($fieldName != $ids) {
             echo '<div class="form-group">
                   <label>' . $fieldName . '</label>
                   <input name="assistiti[' . $fieldName . ']" type="' . $this->_convertTypeField($fieldType) . '" class="form-control" placeholder="' . $fieldName . '">
                 </div>';
         }
     }
     echo '<div class="form-group">
                   <button id="' . $btnID . '" type="button" onclick="' . $onclick . '" class="btn btn-success">Inserisci</button>
                 </div> </form>';
     $hero = new hero();
     $hero->creaFormJS($formID, $btnID, $page);
 }