示例#1
0
文件: coreds.php 项目: Eteng/lorb
 function insert()
 {
     pitch("Dodeye.core.db.Insert");
     $data = $this->request->getParam($this->type);
     $xml = simplexml_load_string($data);
     $array_val = ToArray($xml);
     $row_key = key($array_val);
     $row1_key = key($array_val[$row_key]);
     $Insert = new Insert();
     $Insert->into($this->table);
     //@NOTE: peple might send multiple insert
     if (is_numeric($row1_key)) {
         //there are may rows
         $tbl_cols = array_keys($array_val[$row_key][$row1_key]);
         $Insert->columns($tbl_cols);
         $sql = $this->dbcon->prepare($Insert->bindable_sql());
         // foreach ($tbl_cols as $key =>$val)
         // $sql->bindParam($key,$val);
     } else {
         //single entry
         $tbl_cols = array_keys($array_val[$row_key]);
         $Insert->columns($tbl_cols);
         $sql = $this->dbcon->prepare($Insert->bindable_sql());
         foreach ($tbl_cols as $key => $val) {
             $sql->bindParam($key + 1, $array_val[$row_key][$val]);
         }
         //$rs = $sql->execute();
         if ($rs) {
             print "true";
         } else {
             print "false";
         }
     }
     //$sql
     exit;
 }
示例#2
0
文件: comp.php 项目: Eteng/lorb
<?php

pitch('Dodeye.core.Response');
pitch('Dodeye.core.Request');
pitch('Dodeye.util.basic');
/** the abstract component class to which other component
 * extend to.
 * @author Eteng Omini <*****@*****.**> 
 */
abstract class Comp
{
    protected $reg;
    private $nav_com;
    private $nav_name;
    protected $response;
    protected $request;
    private $urlStrng;
    private $my;
    private $next = "";
    private $error = array();
    //Error occurrable
    const ROUT_MISSING = 1;
    //constructor
    final function __construct(&$reg)
    {
        $this->reg = $reg;
        $this->response = new Response();
        $this->request = new Request();
    }
    function pre_init()
    {
示例#3
0
<?php

pitch("Dodeye.core.dataAccess.Alice");
/**
 * Description of AbstractTpl
 * @author Eteng Omini <*****@*****.**> 
 */
class AbstractTpl extends Alice
{
    private $name;
    function getDefaultTpl()
    {
    }
}
示例#4
0
文件: Login.php 项目: Eteng/lorb
<?php

pitch("Dodeye.core.Request");
pitch("Dodeye.util.basic");
/**
 * this is a plugin class used in the system
 * @author Eteng
 */
class Login
{
    const USER = "******";
    const TOGO = "tempurl";
    function requireLogin()
    {
        //        if(isBarren(Request::getSessionParam(self::USER))){
        //            $this->getRequestedURL();
        //            redirect_to($this->getToGoUrl());
        //        }
    }
    private function getRequestedURL()
    {
        global $registry;
        $sand = $registry->cfg->config("domain");
        if (isset($_SERVER['HTTP_REFERER'])) {
            $sand = $_SERVER['HTTP_REFERER'];
        }
        $_SESSION[self::TOGO] = $sand;
    }
    private function getToGoUrl()
    {
        return strval($_SESSION[self::TOGO]);
示例#5
0
<?php

pitch("Dodeye.util.basic");
//pitch in basic file.
pitch("Dodeye.util.ArrayHelpers");
//pitch in the ArrayHelpers
/**
 * Description of FrontController
 * @author eteng omini
 * <e-t-e-n-g@hotmail.com
 */
class FrontController
{
    protected $controller;
    protected $process;
    protected $url;
    private $route;
    private $nav_name;
    private $request_url;
    private $raw_url;
    /*
     * @the registry
     */
    private $reg;
    //@TODO: coupling to tight need to release;
    public function __construct($registry)
    {
        $this->reg = $registry;
    }
    private function Halt()
    {
示例#6
0
<?php

require_once 'sys/comp.php';
pitch('Dodeye.core.Request');
//require_once 'sys/Template.php';
/* 
 * this is the administrator component...
 * @author Eteng
 */
class Administrator extends Comp
{
    public function init()
    {
        $dodeye = $this->reg->dodeye;
        $user = $dodeye->login->requireLogin();
    }
    public function index()
    {
        //$data = file_get_contents('php://input');
        //print_r($data);
        $x = new Request();
        $p = $x->getParam('POST');
        print_r($p);
        //print_r();
        $favicon = $this->reg->cfg->config('domain') . "/favicon.ico";
        Template::setBaseDir('views');
        Template::display('AdminLogin.php', array('favicon' => $favicon, 'css' => function ($csls) {
            print "http://localhost/lorb/lorb/mxfactory/css/" . $csls;
        }, 'url_login' => $this->reg->front->getRawURL()));
    }
    public function comps()
示例#7
0
文件: Template.php 项目: Eteng/lorb
<?php

pitch("Dodeye.html.TemplateExcep");
/**
 * the template class 
 * @author Eteng
 */
class Template
{
    private static $baseDir = "";
    public static function getBaseDir()
    {
        return self::$baseDir;
    }
    public static function setBaseDir($dir = "sys/template")
    {
        self::$baseDir = $dir;
    }
    public static function display($_path, $vars = array())
    {
        print self::getPayLoad($_path, $vars);
    }
    public static function getPayLoad($_path, $vars = array())
    {
        $rut = self::getBaseDir();
        $t_path = $rut . DIRECTORY_SEPARATOR . $_path;
        //validations here
        if (!file_exists($t_path)) {
            throw new TemplateExcep(TemplateExcep::FileNotFound . $_path, TemplateExcep::NotFound);
        }
        return self::prcessTempFile($t_path, $vars);