Exemplo n.º 1
0
 public function action_open()
 {
     $pageName = $this->params[2];
     $model = model::GetInstance();
     $params = $model->get_all($pageName);
     $this->content = $this->template("view/{$pageName}.php", ["params" => $params]);
 }
Exemplo n.º 2
0
 public function action_delete()
 {
     $idName = $this->params[3];
     $id = $this->params[4];
     $pageName = $this->params[2];
     if ($id != NULL) {
         $model = model::GetInstance();
         $model->delete($pageName, $idName, $id);
         $this->action_open($pageName);
     }
 }
Exemplo n.º 3
0
    }
    if ($count == 'many') {
        if (isset($table) && isset($id_name) && isset($id)) {
            $model = model_some::GetInstance();
            $data = $model->select_some($table, $id_name, $id);
            print_r(json_encode($data));
            exit;
        }
    }
}
if (isset($action) && $action == 'add') {
    if (isset($table) && isset($params)) {
        $model = model::GetInstance();
        $idNew = $model->add($table, $params);
        print_r($idNew);
    }
}
if (isset($action) && $action == 'edit') {
    if (isset($table) && isset($id_name) && isset($id) && isset($params)) {
        $model = model::GetInstance();
        $rows = $model->edit($table, $id_name, $id, $params);
        print_r($rows);
    }
}
if (isset($action) && $action == 'delete') {
    if (isset($table) && isset($id_name) && isset($id)) {
        $model = model::GetInstance();
        $rows = $model->delete($table, $id_name, $id);
        print_r($rows);
    }
}