예제 #1
0
파일: form.php 프로젝트: nephie/AZL-website
 public function confirmed($controller, $title = '')
 {
     $this->id .= '_confirm';
     $this->addField(new hiddenField('confirmed', 'confirmed'));
     if ($this->sentdata['confirmed'] == 'confirmed') {
         $popup = new popupController();
         $popup->destroy(array('name' => 'confirm'));
         foreach ($this->sentdata as $key => $value) {
             $this->sentdata[$key] = stripslashes($value);
         }
         return true;
     } else {
         $this->confirm($controller, $title);
     }
     return false;
 }
 public function deletegast($parameters)
 {
     $gastid = $parameters['gastid'];
     $popupcontroller = new popupController();
     $gastModel = new ingeschrevenModel();
     $gast = $gastModel->getfromId($gastid);
     if (count($gast) == 1) {
         $gast = $gast[0];
     } else {
         return;
     }
     $sure = $parameters['sure'];
     if ($sure != 'sure') {
         $template = new ui($this);
         $template->assign('gast', $gast);
         $ja = new ajaxrequest('myvoorinschrijving', 'deletegast', array('gastid' => $gastid, 'sure' => 'sure'));
         $template->assign('ja', $ja);
         $popupcontroller->create(array('name' => 'confirm', 'content' => $template->fetch('myvoorinschrijving_confirmdelete.tpl')));
     } elseif (myacl::isAllowed(myauth::getCurrentuser(), $gast, 'delete')) {
         $popupcontroller->destroy(array('name' => 'confirm'));
         $gastModel->deletebyId($gastid);
         $this->response->remove($gastid . '_rij');
     }
 }
예제 #3
0
 public function reprint($parameters = array())
 {
     $sure = $parameters['sure'];
     $popupcontroller = new popupController();
     $model = new mealorderModel();
     $order = $model->getfromId($parameters['id']);
     if (count($order) == 1) {
         $order = $order[0];
         if ($order->getPrinted()) {
             if ($sure != 'sure') {
                 $template = new ui($this);
                 $ja = new ajaxrequest('mycafetaria', 'reprint', array('id' => $parameters['id'], 'sure' => 'sure'));
                 $template->assign('ja', $ja);
                 $popupcontroller->create(array('name' => 'confirm', 'content' => $template->fetch('mycafetaria_confirmreprint.tpl')));
             } else {
                 $popupcontroller->destroy(array('name' => 'confirm'));
                 $order->setPrinted(0);
                 $model->save($order);
                 $this->listallorders();
             }
         }
     }
 }