示例#1
0
文件: Login.php 项目: hellocc2/crmht
 public function __construct()
 {
     $tpl = \Lib\common\Template::getSmarty();
     $username = R::getParams('username');
     $password = R::getParams('password');
     //var_dump(R::getParams());exit;
     if (!empty($username)) {
         $db = \Lib\common\Db::get_db();
         $password = md5($password);
         if ($username && $password) {
             $sql = "SELECT * FROM `rmb_money_member` WHERE member_name='" . $username . "' AND member_password='******'";
             $row = $db->getRow($sql);
             //echo '<pre/>';var_dump($row);exit;
             if (empty($row)) {
                 $tpl->assign('error', '登录失败,请重新登陆');
                 $tpl->display('member_login.html');
                 exit;
             }
             $_SESSION[SESSION_PREFIX . "MemberId"] = $row['id'];
             header("Location: index.php");
             exit;
         } else {
             $tpl->assign('error', '登录失败,请重新登陆');
             $tpl->display('member_login.htm');
             exit;
         }
     }
     $tpl->display('member_login.html');
 }
示例#2
0
文件: Logout.php 项目: hellocc2/crmht
 public function __construct()
 {
     $client = \Helper\CheckLogin::sso();
     $tpl = \Lib\common\Template::getSmarty();
     $params_all = R::getParams();
     if (!empty($client['uid'])) {
         $db = \Lib\common\Db::get_db('milanoo');
         $uid = $client['uid'];
         if ($uid) {
             // 				$sql = "SELECT * FROM `milanoo_admin_user` au, milanoo_admin_competence ac WHERE ac.id IN (au.competence_id) AND uid = {$uid} AND FIND_IN_SET  ('1351', competence_menu)";
             // 				$row = $db->getrow ( $sql );
             // 				if (empty ( $row )) {
             // 					$tpl->assign ( 'error', '用户名密码验证成功,但是你没有查看 MA 的权限请找相关人员开通' );
             // 					$tpl->display ( 'member_login.htm' );
             // 					exit ();
             // 				}
             //var_dump($row['realname']);exit;
             $_SESSION[SESSION_PREFIX . "MemberId"] = $client['uid'];
             // setcookie('auth', '1', time() + 60 * 60 * 24 * 30);
             header("Location: index.php");
             exit;
         } else {
             $tpl->assign('error', '登录失败,请使用米兰账号登陆');
             $tpl->display('member_login.htm');
             exit;
         }
     }
     $tpl->display('member_login.htm');
 }
示例#3
0
文件: Index.php 项目: hellocc2/crmht
 public function __construct()
 {
     $tpl = \Lib\common\Template::getSmarty();
     $db = \Lib\common\Db::get_db();
     $action = R::getParams('action');
     $tpl->assign('action', $action);
     $tpl->display('index.html');
 }
示例#4
0
 function ClassDb()
 {
     $db = \Lib\common\Db::get_db('default');
     // $db->debug=1;
     $sql = "SELECT * FROM `milanoo_promotion_category` WHERE `WebsiteId`='" . $this->WebsiteId . "' ORDER BY `PCOriesOrder` ASC";
     $rs = $db->SelectLimit($sql);
     $row = array();
     if ($rs->RecordCount()) {
         while (!$rs->EOF) {
             $row = $rs->fields;
             $promotionurl_all_id[$row["pid"]][] = $row["Id"];
             $promotionurl_all[$row["Id"]] = array('name' => $row['name'], 'id' => $row['Id'], 'pid' => $row['pid'], 'order' => $row['PCOriesOrder']);
             $rs->MoveNext();
         }
     }
     $promotionurl_data = "\$promotionurl_all=array(\r\n";
     $promotionurlId_data = "\$promotionurl_all_id=array(\r\n";
     if (is_array($promotionurl_all_id)) {
         foreach ($promotionurl_all_id as $pid => $id_all) {
             $promotionurlId_data .= "\t\"" . $pid . "\"=>array(\r\n";
             for ($i = 0; $i < sizeof($id_all); $i++) {
                 $promotionurlId_data .= "\t\t\"" . $i . "\"=>\"" . $id_all[$i] . "\",\r\n";
             }
             $promotionurlId_data .= "\t),\r\n";
         }
     }
     $promotionurlId_data .= ");\r\n";
     if (is_array($promotionurl_all)) {
         foreach ($promotionurl_all as $id => $id_all) {
             $promotionurl_data .= "\t\"" . $id . "\"=>array(\r\n";
             foreach ($id_all as $name => $key) {
                 $promotionurl_data .= "\t\t\"" . $name . "\"=>\"" . $key . "\",\r\n";
             }
             $promotionurl_data .= "\t),\r\n";
         }
     }
     $promotionurl_data .= ");\r\n";
     if ($this->WebsiteId == 1) {
         $file = "../data/promotion_category.php";
         $filebak = "../data/promotion_category.bak.php";
     } else {
         $file = "../data/promotion_category_" . $this->WebsiteId . ".php";
         $filebak = "../data/promotion_category_" . $this->WebsiteId . ".bak.php";
     }
     $handle = fopen($filebak, "w");
     fputs($handle, "<?\r\n" . $promotionurlId_data . "\r\n" . $promotionurl_data . "?>");
     fclose($handle);
     @unlink($file);
     rename($filebak, $file);
 }
示例#5
0
 function __construct()
 {
     $this->db = \Lib\common\Db::get_db();
 }
示例#6
0
文件: Index.php 项目: hellocc2/crmht
 function getproductsale($pid)
 {
     $db = \Lib\common\Db::get_db("bi");
     $sql = "select b.time,sum(b.payorder) as payorder,sum(b.paynum) as paynum,sum(b.payamount) as payamount from ma_page_name a,ma_page_visits b where a.id=b.pageid and a.pagepid='{$pid}' and a.pagetype='item'";
     if ($_SESSION["ma_starttime"]) {
         $sql .= " and b.time>='" . $_SESSION["ma_starttime"] . "'";
     }
     if ($_SESSION["ma_endtime"]) {
         $sql .= " and b.time<='" . $_SESSION["ma_endtime"] . "' ";
     }
     if ($_SESSION["ma_lang"]) {
         $sql .= " and lang='" . $_SESSION["ma_lang"] . "'";
     }
     $sql .= " group by b.time order by b.time asc";
     $rs = $db->SelectLimit($sql);
     if ($rs->RecordCount()) {
         $row = $page_list_array = array();
         while (!$rs->EOF) {
             $row = $rs->fields;
             if (!$row["payamount"]) {
                 $row["payamount"] = 0;
             }
             if (!$row["payorder"]) {
                 $row["payorder"] = 0;
             }
             if (!$row["paynum"]) {
                 $row["paynum"] = 0;
             }
             $time = strtotime($row["time"]);
             $row["time"] = date("m-d", $time);
             $page_list_array[] = $row;
             $rs->MoveNext();
         }
     }
     return $page_list_array;
 }