Example #1
0
* 登陆页面
*
* @author    indraw <*****@*****.**>
* @version   1.0
* @copyright 商业软件,受著作权保护
* @link      http://***
* @create     2007/2/9 下午
*/
//包含配置
include_once 'includes/LibConfig.inc.php';
$oApp->setMySQL();
$oApp->loadClass("PageMaker");
//$oMySQL->debug_all = true;
$oMySQL->show_errors = true;
/*--------------------------------------------------------*/
//简单流程
$oPage = new PageMaker();
$oPage->Page = $_GET['page'];
$oPage->PerPage = 5;
//$oPage->Condition = "&sortid=".$iSortid; //分页传送条件
$oLogicUser = new Logic_Demo_User();
$aListUser = $oLogicUser->listUser($oPage);
//_dump($aListUser);
//调试信息
$oSmarty->assign("user", $aListUser);
$oSmarty->assign("page", $oPage->getPage());
//可以使用三种分页方法,基本囊括了所有分页实现
$oSmarty->display("list.htm");
//调试信息
//_dump($_SESSION);
/*--------------------------------------------------------*/
Example #2
0
* 注册页面
*
* @author    indraw <*****@*****.**>
* @version   1.0
* @copyright 商业软件,受著作权保护
* @link      http://***
* @create     2007/2/9 下午
*/
//包含配置
include_once 'includes/LibConfig.inc.php';
$oApp->setMySQL();
//$oMySQL->debug_all = true;
/*--------------------------------------------------------*/
//简单流程
if ($_GET['action'] == "do") {
    $oLogicUser = new Logic_Demo_User();
    //php5官方用法,以及现在的c#用法,应该是趋势
    try {
        $oUser = new DTO_Demo_User();
        $oUser->username = $_POST['username'];
        $oUser->passwd = $_POST['passwd'];
        $oUser->email = $_POST['email'];
        $oLogicUser->createUser($oUser);
    } catch (MyException $e) {
        $oApp->error($e, "register.php");
    }
    //最新潮的写法,完全发挥自己的创造性,表示层程序可以用合理的任意写法,因为逻辑层已经做好了安全限制。
    /*
    try{
    	$oLogicUser->createUser(new DTO_Demo_User($_POST));
    }
Example #3
0
<?php

/**
* 登陆页面
*
* @author    indraw <*****@*****.**>
* @version   1.0
* @copyright 商业软件,受著作权保护
* @link      http://***
* @create     2007/2/9 下午
*/
//包含配置
include_once 'includes/LibConfig.inc.php';
$oApp->setMySQL();
$oApp->loadClass("PageMaker");
//$oMySQL->debug_all = true;
$oMySQL->show_errors = true;
/*--------------------------------------------------------*/
//简单流程
$oLogicUser = new Logic_Demo_User();
$aListUser = $oLogicUser->topUser();
//_dump($aListUser);
//调试信息
$oSmarty->assign("user", $aListUser);
$oSmarty->display("list_all.htm");
//调试信息
//_dump($_SESSION);
/*--------------------------------------------------------*/
Example #4
0
$oMySQL->debug_all = true;
$oMySQL->show_errors = true;
/*--------------------------------------------------------*/
//
if ($_GET['action'] == "do") {
    try {
        $oUser = new DTO_Demo_User();
        $oUser->username = $_POST['username'];
        $oUser->passwd = $_POST['passwd'];
        $oUser->email = $_POST['email'];
        //$oUser->id = $_POST['id'];
        $oLogicUser = new Logic_Demo_User();
        $oLogicUser->modifyUser($oUser);
    } catch (MyException $e) {
        $oApp->error($e, "admin.php");
    }
    $oApp->success("修改信息成功", "admin.php");
} else {
    try {
        $oUser = new DTO_Demo_User(array("username" => $_SESSION['username']));
        //_dump($oUser);
        $oLogicUser = new Logic_Demo_User();
        $oLogicUser->getBy($oUser, "username");
    } catch (MyException $e) {
        $oApp->error($e, "admin.php");
    }
}
//_dump($oUser);
$oSmarty->assign("user", $oUser);
$oSmarty->display("self.htm");
/*--------------------------------------------------------*/
Example #5
0
*
* @author    indraw <*****@*****.**>
* @version   1.0
* @copyright 商业软件,受著作权保护
* @link      http://***
* @create     2007/2/9 下午
*/
//包含配置
include_once 'includes/LibConfig.inc.php';
$oApp->setMySQL();
//$oMySQL->debug_all = true;
//$oMySQL->show_errors = true;
//echo "abc";
/*--------------------------------------------------------*/
//简单流程
if ($_GET['action'] == "do") {
    try {
        $oLogicUser = new Logic_Demo_User();
        $oUser = $oLogicUser->loginUser($_POST['username'], $_POST['passwd']);
        $_SESSION['username'] = $oUser->username;
    } catch (MyException $e) {
        //_dump(get_included_files() );
        $oApp->error($e);
    }
    $oApp->success("登陆成功", "index.php");
}
//调试信息
$oSmarty->display("login.htm");
//调试信息
//_dump($_SESSION);
/*--------------------------------------------------------*/