Beispiel #1
0
 public function testLogin()
 {
     $email = '*****@*****.**';
     $password = '******';
     $user = new UserLoginModel($email, $password);
     $user->init($email, $password);
     $result = $user->CheckLogin();
     $check = isset($result);
     if ($check) {
         $user->setAdminUserLoginSession($result);
     }
     echo json_encode($check);
 }
Beispiel #2
0
 public function Index()
 {
     $checkLogin = new UserLoginModel();
     if (!$checkLogin->checkUserIsLogined()) {
         $this->load->helper('url');
         redirect(site_url(array('AdminLogin')));
     }
     $temp['title'] = "Trang chủ quản trị";
     $temp['content_view'] = 'Admin/AdminHome/Index';
     $data = new AdminMasterModel();
     $data->Init(null, adminParentMenuEnum::Home, null);
     $temp['data'] = $data;
     $this->load->view("Admin/Shared/_Layout", $temp);
 }
Beispiel #3
0
 public function AddBanner()
 {
     $checkLogin = new UserLoginModel();
     if (!$checkLogin->checkUserIsLogined()) {
         $this->load->helper('url');
         redirect(site_url(array('AdminLogin')));
     }
     $temp['title'] = "Thêm mới banner";
     $temp['content_view'] = 'Admin/AdminBanner/AddBanner';
     $content = null;
     $data = new AdminMasterModel();
     $data->Init($content, adminParentMenuEnum::Banner, adminChildMenuEnum::Add);
     $temp['data'] = $data;
     $this->load->view("Admin/Shared/_Layout", $temp);
 }
Beispiel #4
0
 public function Index()
 {
     $checkLogin = new UserLoginModel();
     if (!$checkLogin->checkUserIsLogined()) {
         $this->load->helper('url');
         redirect(site_url(array('AdminLogin')));
     }
     $temp['title'] = "Danh sách sản phẩm";
     $temp['content_view'] = 'Admin/AdminProduct/Index';
     $content = new AdminProductModel();
     $content->Init();
     $data = new AdminMasterModel();
     $data->Init($content, adminParentMenuEnum::Product, adminChildMenuEnum::ListManagement);
     $temp['data'] = $data;
     $this->load->view("Admin/Shared/_Layout", $temp);
 }
Beispiel #5
0
 public function Index()
 {
     //check admin login
     $checkLogin = new UserLoginModel();
     if (!$checkLogin->checkUserIsLogined()) {
         $this->load->helper('url');
         redirect(site_url(array('AdminLogin')));
     }
     //end check
     $temp['title'] = "Danh sách thuộc tính";
     $temp['content_view'] = 'Admin/AdminAttribute/Index';
     $data = new AdminMasterModel();
     $content = null;
     $data->Init($content, adminParentMenuEnum::Attribute, adminChildMenuEnum::ListManagement);
     $temp['data'] = $data;
     $this->load->view("Admin/Shared/_Layout", $temp);
 }
Beispiel #6
0
 public function EditProvider($proId)
 {
     $checkLogin = new UserLoginModel();
     if (!$checkLogin->checkUserIsLogined()) {
         $this->load->helper('url');
         redirect(site_url(array('AdminLogin')));
     }
     $temp['title'] = "Sửa thông tin nhà cung cấp sản phẩm";
     $temp['content_view'] = 'Admin/AdminProvider/EditProvider';
     $data = new AdminMasterModel();
     $content = $proId;
     $data->Init($content, null, adminChildMenuEnum::ListManagement);
     $temp['data'] = $data;
     $this->load->view("Admin/Shared/_Layout", $temp);
 }
Beispiel #7
0
 static function LoginToday($id)
 {
     $userlogin = new UserLoginModel();
     $fqy = $userlogin->fRow("select fqy, updated from {$userlogin->table} where uid={$id} order by id desc");
     $time = strtotime(date('Y-m-d', time()) . " 00:00:00");
     if (!empty($fqy)) {
         if ($time > $fqy['updated'] && $time - 3600 * 24 < $fqy['updated']) {
             //连续天数
             $fqy['s'] = 1;
             return $fqy;
         } elseif ($time < $fqy['updated'] && $time + 3600 * 24 > $fqy['updated']) {
             //同一天
             $fqy['s'] = 0;
             return $fqy;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }