Пример #1
0
 public static function ScanTables()
 {
     self::$Tables = array();
     foreach (glob(PathDriver::$ROOT_DIR . PathDriver::TABLES . "*[A-Za-z]Table.php") as $value) {
         $name = str_replace(PathDriver::$ROOT_DIR . PathDriver::TABLES, "", str_replace(".php", "", $value));
         self::$Tables[] = $name;
     }
 }
Пример #2
0
 public function Save($params)
 {
     $Story = TableController::StoryTable();
     $new_story = new stdClass();
     $new_story->TestField1 = $this->GetSafeString($_POST['Field1']);
     $new_story->TestField2 = false;
     $Story->Set($new_story);
     return $this->GetBuilder()->PrepareWithMerge("save.html", $content);
 }
Пример #3
0
 public function __construct($id, $module = null)
 {
     $request = Yii::app()->getRequest();
     $this->view = $request->getParam('view');
     $this->schema = $request->getParam('schema');
     parent::__construct($id, $module);
     $this->table = $this->view;
     $this->connectDb($this->schema);
 }
Пример #4
0
<?php

include_once "Drivers/PathDriver.php";
$configuration = (include_once "config.php");
PathDriver::Using(array(PathDriver::TABLES => array("TableController")));
$res = TableController::InstallTables();
if (!$res[0]) {
    echo $res[1];
}
Пример #5
0
    $url_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
    // Разбиваем виртуальный URL по символу "/"
    $uri_parts = explode('/', trim($url_path, ' /'));
    switch ($uri_parts[0]) {
        case 'push':
            $form = new TableController();
            $form->actionIndex();
            break;
        case 'check':
            $form = new TableController();
            $form->actionCheck();
            break;
        case 'update':
            $form = new TableController();
            $form->actionUpdate();
            break;
        case 'add':
            $form = new TableController();
            $form->actionAdd();
            break;
        default:
            header('HTTP/1.0 404 Not Found');
            die;
            break;
    }
} else {
    $form = new TableController();
    $form->actionView();
}
mysql_close($dbh);
ob_flush();