Пример #1
0
 public static function GetInstance()
 {
     if (self::$instance == null) {
         self::$instance = new model_some();
     }
     return self::$instance;
 }
Пример #2
0
            $data = $model->select($table, $id_name, $id);
            print_r(json_encode($data));
            exit;
        }
    }
    if ($count == 'all') {
        if (isset($table)) {
            $model = model::GetInstance();
            $data = $model->get_all($table);
            print_r(json_encode($data));
            exit;
        }
    }
    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)) {