public function save() { if ($this->_data && $this->DAO) { $this->DAO->updateByPK($this->_pk, $this->_data); $this->_dirty = false; } }
<?php include '../../../classes/baseDAO.php'; // include '../classes/extractiveCompany.php'; session_start(); // $_user = $_SESSION['user']; // $_entityObj = $_user->entityObject; $action = $_REQUEST["action"]; $dao = new baseDAO(); if ($action == "get") { //echo "We are here: initTemplates"; //we get the user then get the entity object $_user = $_SESSION['user']; //get id $id = $_GET["id"]; //get TPIN //$id = $_user->TPIN; $obj = $dao->getBeneficiary($id); // header("content-type:application/json"); // // echo json_encode($list_templates); // // exit(); } ?> <html> <head> <meta charset="UTF-8"> <title>Templates</title> <script src="../../../scripts/jquery-1.11.2.js"></script> <link rel="stylesheet" type="text/css" href="../../../css/main.css">
/** * 登录 */ public function login() { $this->DAO->updateByPk($this->_pk, ['loginTime' => time()]); TXApp::$base->session->userId = $this->_pk; }
<?php session_start(); /* * To change this license header, choose License Headers in Project Properties. * To change this templates file, choose Tools | Templates * and open the templates in the editor. */ //this file will receive and respond to general requests from the browser include_once 'classes/baseDAO.php'; include 'classes/json.php'; //create daoObject $dao = new baseDAO(); //get action or command to execute $action = $_REQUEST["action"]; if ($action == "login") { $username = trim($_POST["username"]); $password = trim($_POST["password"]); //call login dao $user = $dao->login($username, $password); //check user type and take user to correct page $role = $user->role; $url = ""; if ($role == "su" || $role == "mu") { //header('location:entities/index.php'); $url = "./entities/index.php"; } else { if ($role == "zsu" || $role == "re" || $role == "ad") { $url = "./secretariat/"; } }