$this->make_hook('submit', AUTH_MDP), ); } function handler_submit(&$page) { global $globals; $page->changeTpl('evenements.tpl'); $titre = Post::get('titre'); $texte = Post::get('texte'); $promo_min = Post::getInt('promo_min'); $promo_max = Post::getInt('promo_max'); $peremption = Post::getInt('peremption'); $valid_mesg = Post::get('valid_mesg'); $action = Post::get('action'); $page->assign('titre', $titre); $page->assign('texte', $texte); $page->assign('promo_min', $promo_min); $page->assign('promo_max', $promo_max); $page->assign('peremption', $peremption); $page->assign('valid_mesg', $valid_mesg); $page->assign('action', strtolower($action)); if ($action == 'Confirmer') { $texte = preg_replace('/((http|ftp)+(s)?:\/\/[^<>\s]+)/i', '\\0', $texte); $texte = preg_replace('/([^,\s]+@[^,\s]+)/i', '\\0', $texte); require_once 'validations.inc.php'; $evtreq = new EvtReq($titre, $texte, $promo_min, $promo_max, $peremption, $valid_mesg, Session::getInt('uid')); $evtreq->submit(); $page->assign('ok', true); } $select = ''; for ($i = 1 ; $i < 30 ; $i++) { $time = time() + 3600 * 24 * $i; $p_stamp = date('Ymd', $time); $year = date('Y', $time); $month = date('m', $time); $day = date('d', $time); $select .= "\n"; } $page->assign('select',$select); return PL_OK; } } ?>