function developer_index() { //Securité : sortir les gens malhonnêtes if (isset($_REQUEST['appli'])) { modexec('syscore', 'forbidden'); } $cli = new Modele('api_clients'); if (hasAcl(ACL_SUPERUSER)) { $cli->find(); } else { $cli->find(array('ac_owner' => $_SESSION['user']['user_id'])); } $cli->appendTemplate('clients'); display(); }
function admin_note_addbulletin() { global $pdo, $root, $tpl; if (isset($_REQUEST['period'])) { $mdl = new Modele("periods"); $mdl->fetch($_REQUEST['period']); $_REQUEST['generator'] = basename($_REQUEST['generator']); require $root . 'libs' . DS . 'bulletins' . DS . $_REQUEST['generator'] . DS . 'bulletin.php'; bulletin_add($mdl->period_id); $mdl->period_state = 'DRAFT'; $mdl->period_generator = $_REQUEST['generator']; redirect('admin_note', 'bulletin', array('hsuccess' => 1)); } $mdl = new Modele("periods"); $mdl->find(array("period_state" => "ACTIVE")); $mdl->appendTemplate('periods'); foreach (scandir($root . 'libs' . DS . 'bulletins') as $generator) { if (is_dir($root . 'libs' . DS . 'bulletins' . DS . $generator) && $generator[0] != '.') { $tpl->append('generators', $generator); } } display(); }
function event_bocal_list() { global $tpl, $pdo; $sql = $pdo->prepare('SELECT * FROM events LEFT JOIN users ON event_owner = user_id LEFT JOIN sections ON section_id = event_section WHERE event_id = ?'); $sql->bindValue(1, $_GET['event']); $sql->execute(); $event = $sql->fetch(); if (!$event) { modexec('syscore', 'notfound'); } $tpl->assign('event', $event); $mdl = new Modele('event_bocal'); $mdl->find(array('eb_event' => $event['event_id'])); $mdl->appendTemplate('tickets'); display(); }
function trip_opt_list() { global $tpl; $mod = new Modele('trip_options'); $mod->fetch($_GET['option']); $mod->assignTemplate('option'); $mdl = $mod->topt_trip; $mdl->assignTemplate('trip'); $opt = new Modele('trip_option_options'); $opt->find(array('too_option' => $mod->getKey())); $opt->appendTemplate('ooptions'); display(); }
function tripusr_step4() { global $tpl; $ufile = _tripusr_load(); if ($ufile->tu_step != 4) { redirect('tripusr', 'continue', array('file' => $ufile->getKey())); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (isset($_POST["next"])) { $bill = new Modele('trip_types'); $bill->fetch($_POST['ticket']); switch ($bill->raw_tt_restriction) { case 'ALL': $ufile->tu_type = $bill->getKey(); $ufile->tu_price = $bill->tt_price; $ufile->tu_step = 5; redirect('tripusr', 'step5', array('file' => $ufile->getKey())); break; case 'USER': $ufile->tu_type = $bill->getKey(); if (aclFromText($_SESSION['user']['user_role']) >= ACL_USER) { $ufile->tu_price = $bill->tt_price; $ufile->tu_step = 5; redirect('tripusr', 'step5', array('file' => $ufile->getKey())); } break; default: echo 'ERROR: not implemented'; quit(); break; } } /* else { $questions = new Modele('trip_options'); $questions->find(array('topt_trip' => $ufile->raw_tu_trip)); // Pas de complements, go back etape 2 if ($questions->count() == 0) { $ufile->tu_step = 2; redirect('tripusr', 'step2', array('file' => $ufile->getKey())); } else { $ufile->tu_step = 3; redirect('tripusr', 'step3', array('file' => $ufile->getKey())); } } */ } $tickets = new Modele('trip_types'); $tickets->find(array('tt_trip' => $ufile->raw_tu_trip)); $tickets->appendTemplate('tickets'); display(); }