Example #1
0
 public function run()
 {
     parent::run();
     $this->tableName = \Request::SimpletextRequired('table');
     if (!array_key_exists($this->tableName, $this->validColumnsTables)) {
         throw new \Exception("Table '{$this->tableName}' is invalid.");
     }
     $this->getInputJson();
     if (isset($this->input['delimiter'])) {
         $this->delimiter = $this->input['delimeter'];
     }
     if (isset($this->input['format'])) {
         $this->format = $this->input['format'];
     }
     $this->columns = $this->input['columns'];
     switch ($this->tableName) {
         case 'templomok':
             $this->prepareTemplomokQuery();
             $this->runQuery();
             $this->mapTemplomok();
             break;
         default:
             throw new \Exception("Table '{$this->tableName}' is accepted, but we cannot process.");
             break;
     }
     if ($this->format == 'text') {
         $this->format = 'csv';
     }
     $this->return[$this->tableName] = $this->table;
     return;
 }
Example #2
0
 public function __construct()
 {
     $this->setTitle('Súgó');
     $this->content = '';
     $idT = explode('-', \Request::SimpletextRequired('id'));
     foreach ($idT as $id) {
         $help = new \Help($id);
         $this->content .= $help->html;
     }
     $this->template = 'help.twig';
 }
Example #3
0
 public function __construct()
 {
     ini_set('memory_limit', '256M');
     try {
         $action = \Request::SimpletextRequired('action');
     } catch (\Exception $e) {
         $this->error = $e->getMessage();
     }
     try {
         switch ($action) {
             case 'signup':
                 $this->api = new \Api\Signup();
                 break;
             case 'login':
                 $this->api = new \Api\Login();
                 break;
             case 'user':
                 $this->api = new \Api\User();
                 break;
             case 'favorites':
                 $this->api = new \Api\Favorites();
                 break;
             case 'report':
                 $this->api = \Api\Report::factoryCreate();
                 break;
             case 'updated':
                 $this->api = new \Api\Updated();
                 break;
             case 'table':
                 $this->api = new \Api\Table();
                 break;
             case 'sqlite':
                 $this->api = new \Api\Sqlite();
                 break;
             default:
                 throw new \Exception("API action '{$action}' is not supported.");
         }
         $this->api->run();
     } catch (\Exception $e) {
         $this->error = $e->getMessage();
     }
 }
Example #4
0
 public function __construct()
 {
     $action = \Request::SimpletextRequired('op');
     switch ($action) {
         case 'list':
             $this->tid = \Request::IntegerRequired('tid');
             $church = new \Church($this->tid);
             $this->listOfChurch($church);
             break;
         case 'addform':
             $this->tid = \Request::IntegerRequired('tid');
             $church = new \Church($this->tid);
             $this->newForm($church);
             break;
         case 'add':
             $this->tid = \Request::IntegerRequired('tid');
             $church = new \Church($this->tid);
             $this->add($church);
             break;
         case 'modify':
             $this->template = 'remark_list.twig';
             $rid = \Request::IntegerRequired('rid');
             $remark = new \Remark($rid);
             $state = \Request::Simpletext('state');
             $remark->changeState($state);
             $comment = \Request::Text('adminmegj');
             if ($comment != '') {
                 $remark->addComment($comment);
             }
             $this->tid = $remark->tid;
             $church = new \Church($this->tid);
             $this->listOfChurch($church);
             break;
         case 'add':
             break;
     }
 }
 public function __construct()
 {
     $name = \Request::SimpletextRequired('name');
     $this->template = 'staticpage_' . $name . '.twig';
 }