예제 #1
0
 function show_edit_m01()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     //加入麵包屑
     $func_Cname = "變更口碑文章";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     $sel_sql = "SELECT DISTINCT kw_id, kw_content FROM plu_keywords";
     $sel_result = $db->get_results($sel_sql, ARRAY_A);
     $tpl->assign("sel_data", $sel_result);
     $m01_id = isset($_GET['m01_id']) ? $_GET['m01_id'] : "";
     $sql = "SELECT * FROM plu_mobile01 WHERE m01_id='{$m01_id}'";
     $result = $db->get_results($sql, ARRAY_A);
     $tpl->assign("m01_data", $result);
     $tpl->assign("kw_ids", explode(",", str_replace(array("[", "]"), "", $result[0]['kw_ids'])));
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("css_path", WEBROOT . $this->css_path);
     $tpl->assign("jq_multi_select_path", WEBROOT . "/cms/lib/jquery/multiSelect/");
     $tpl->assign("plu_header_path", $plu_header);
     $tpl->assign("do_edit_m01_url", $this->plu_path . "&func=do_edit_m01&m01_id=" . $m01_id);
     $tpl->assign("cancel_edit_url", $this->plu_path . "&func=show_m01_list");
     return $tpl->fetch("show_edit_m01.tpl");
 }
예제 #2
0
 function show_pricing_list()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     //加入麵包屑
     $func_Cname = "法拍價量資訊";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 1);
     $thisMonth = date("m");
     $thisYear = date("Y");
     $opt = 0;
     $filter;
     if (isset($_GET['opt'])) {
         $opt = $_GET['opt'];
     }
     if ($opt == 1) {
         if (isset($_POST['taipeicityOpt']) && is_numeric($_POST['taipeicityOpt'])) {
             $filter = $_POST['taipeicityOpt'];
             $tpl->assign("taipeicity", $_POST['taipeicityOpt']);
         } else {
             if (isset($_POST['taipeicity']) && is_numeric($_POST['taipeicity'])) {
                 $filter = $_POST['taipeicity'];
             } else {
                 $filter = 1;
             }
         }
     } else {
         $filter = 1;
     }
     $sql = $this->generateSql(1, $thisYear, $thisMonth, 'taipeicity_building', 'taipeicity_apartment', '', $filter);
     $result = $db->get_results($sql, ARRAY_A);
     if (count($result) > 0) {
         $taipeibuildingArr = array();
         $taipeiapartmentArr = array();
         $idx;
         foreach ($result as $key => &$value) {
             $idx = (12 + $thisMonth - $value["M"]) % 12;
             if ($value["item"] == 'taipeicity_building') {
                 $taipeibuildingArr[$idx][0] = $value["M"];
                 $taipeibuildingArr[$idx][1] = $value["value"];
             } else {
                 $taipeiapartmentArr[$idx][0] = $value["M"];
                 $taipeiapartmentArr[$idx][1] = $value["value"];
             }
         }
         $tpl->assign("taipeicity_building", $taipeibuildingArr);
         $tpl->assign("taipeicity_apartment", $taipeiapartmentArr);
     }
     if ($opt == 2) {
         if (isset($_POST['taipeicountyOpt']) && is_numeric($_POST['taipeicountyOpt'])) {
             $filter = $_POST['taipeicountyOpt'];
             $tpl->assign("taipeicounty", $_POST['taipeicountyOpt']);
         } else {
             if (isset($_POST['taipeicounty']) && is_numeric($_POST['taipeicounty'])) {
                 $filter = $_POST['taipeicounty'];
             } else {
                 $filter = 3;
             }
         }
     } else {
         $filter = 3;
     }
     $sql = $this->generateSql(2, $thisYear, $thisMonth, 'taipeicounty_building', 'taipeicounty_apartment', '', $filter);
     $result = $db->get_results($sql, ARRAY_A);
     if (count($result) > 0) {
         $taipeibuildingArr = array();
         $taipeiapartmentArr = array();
         $idx;
         foreach ($result as $key => &$value) {
             $idx = (12 + $thisMonth - $value["M"]) % 12;
             if ($value["item"] == 'taipeicounty_building') {
                 $taipeibuildingArr[$idx][0] = $value["M"];
                 $taipeibuildingArr[$idx][1] = $value["value"];
             } else {
                 $taipeiapartmentArr[$idx][0] = $value["M"];
                 $taipeiapartmentArr[$idx][1] = $value["value"];
             }
         }
         $tpl->assign("taipeicounty_building", $taipeibuildingArr);
         $tpl->assign("taipeicounty_apartment", $taipeiapartmentArr);
     }
     $sql = $this->generateSql(3, $thisYear, $thisMonth, 'taipeicity_issue', 'taipeicounty_issue');
     $result = $db->get_results($sql, ARRAY_A);
     if (count($result) > 0) {
         $taipeibuildingArr = array();
         $taipeiapartmentArr = array();
         $idx;
         foreach ($result as $key => &$value) {
             $idx = (12 + $thisMonth - $value["M"]) % 12;
             if ($value["item"] == 'taipeicity_issue') {
                 $taipeibuildingArr[$idx] = $value["value"];
             } else {
                 $taipeiapartmentArr[$idx] = $value["value"];
             }
         }
         $tpl->assign("taipeicity_issue", $taipeibuildingArr);
         $tpl->assign("taipeicounty_issue", $taipeiapartmentArr);
     }
     $sql = $this->generateSql(4, $thisYear, $thisMonth, 'taipeicity_bidding', 'taipeicounty_bidding');
     $result = $db->get_results($sql, ARRAY_A);
     if (count($result) > 0) {
         $taipeibuildingArr = array();
         $taipeiapartmentArr = array();
         $idx;
         foreach ($result as $key => &$value) {
             $idx = (12 + $thisMonth - $value["M"]) % 12;
             if ($value["item"] == 'taipeicity_bidding') {
                 $taipeibuildingArr[$idx] = $value["value"];
             } else {
                 $taipeiapartmentArr[$idx] = $value["value"];
             }
         }
         $tpl->assign("taipeicity_bidding", $taipeibuildingArr);
         $tpl->assign("taipeicounty_bidding", $taipeiapartmentArr);
     }
     $sql = $this->generateSql(5, $thisYear, $thisMonth, 'auction_amount');
     $result = $db->get_results($sql, ARRAY_A);
     if (count($result) > 0) {
         $houseAmountArr = array();
         $idx = 0;
         foreach ($result as $key => &$value) {
             $houseAmountArr[$idx][0] = $value["pricing_date"];
             $houseAmountArr[$idx][1] = $value["value"];
             $idx++;
         }
         $tpl->assign("auction_amount", $houseAmountArr);
     }
     $sql = $this->generateSql(6, $thisYear, $thisMonth, 'leading', 'simultaneous', 'prosperity');
     $result = $db->get_results($sql, ARRAY_A);
     if (count($result) > 0) {
         $analysis = array();
         $idx = 0;
         $item;
         foreach ($result as $key => &$value) {
             $idx = $idx % 4;
             if ($value['item'] == 'leading') {
                 $item = 0;
             } else {
                 if ($value['item'] == 'simultaneous') {
                     $item = 1;
                 } else {
                     $item = 2;
                 }
             }
             $analysis[$item][$idx] = $value['value'];
             $idx++;
         }
         $tpl->assign("analysis", $analysis);
     }
     $thisQuarter = floor(date('m') / 4) * 3 + 1;
     $sql = $this->generateSql(7, $thisYear, $thisQuarter, 'leading_return', 'simultaneous_return', 'prosperity_return');
     $result = $db->get_results($sql, ARRAY_A);
     if (count($result) > 0) {
         foreach ($result as $key => $value) {
             $tpl->assign($value['item'], $value['value']);
         }
     }
     $sql = "SELECT * FROM plu_pricing_desc WHERE pricing_date='" . $thisYear . "-" . $thisMonth . "-1' OR (item='analysis_desc' AND pricing_date='" . $thisYear . "-" . $thisQuarter . "-1')";
     $result = $db->get_results($sql, ARRAY_A);
     if (count($result) > 0) {
         foreach ($result as $key => $value) {
             $tpl->assign($value['item'], $value['memo']);
         }
     }
     $orderMonth = array();
     $orderQuarter = array();
     for ($i = 1; $i <= 12; $i++) {
         $orderMonth[$i - 1] = (12 + $thisMonth - $i) % 12 + 1;
     }
     for ($i = 0; $i < 4; $i++) {
         $quarter = floor(date('m', strtotime(-($i * 3) . " Month")) / 4) + 1;
         $orderQuarter[$i] = date('y', strtotime(-($i * 3) . " Month")) . 'Q' . (string) $quarter;
     }
     $tpl->assign("show_pricing_list_url", $this->plu_path . "&func=show_pricing_list");
     $tpl->assign("do_edit_pricing_url", $this->plu_path . "&func=do_pricing_list");
     $tpl->assign("datepicker_url", WEBROOT . '/cms/lib/js/chineseDatepicker.js');
     $tpl->assign("orderMonth", $orderMonth);
     $tpl->assign("orderQuarter", $orderQuarter);
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("plu_header_path", $plu_header);
     return $tpl->fetch("show_pricing_list.tpl");
 }
예제 #3
0
 function show_edit_dist()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     /*require_once(SRVROOT.FCK.'fckeditor.php');
     		$fckeditor = new FCKeditor('content');
     		$fckeditor->Width  = '100%' ;
     		$fckeditor->Height = '400px' ;
     		$fckeditor->BasePath = WEBROOT.FCK;  //3.重要參數: 以 url路徑指定 FCKeditor 主程式所在位置*/
     //加入麵包屑
     $func_Cname = "變更據點";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     $sel_sql = "SELECT DISTINCT place_id, place_name FROM plu_dist_place";
     $sel_result = $db->get_results($sel_sql, ARRAY_A);
     $tpl->assign("sel_data", $sel_result);
     $dist_id = isset($_GET['dist_id']) ? $_GET['dist_id'] : "";
     $sql = "SELECT UNIX_TIMESTAMP(PublishDate) as t,plu_distributor.* FROM plu_distributor WHERE dist_id={$dist_id}";
     $result = $db->get_row($sql, ARRAY_A);
     if (isset($result)) {
         foreach ($result as $key => $value) {
             if ($key == "img_name" || $key == "movie_name") {
                 $tpl->assign($key, WEBROOT . $this->upload_path . $value);
             } else {
                 $tpl->assign($key, $value);
             }
         }
     }
     $tpl->assign("validate_url", WEBROOT . '/cms/lib/jquery/jquery.validate.js');
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("plu_header_path", $plu_header);
     $tpl->assign("do_edit_dist_url", $this->plu_path . "&func=do_edit_dist&dist_id=" . $dist_id);
     $tpl->assign("cancel_edit_url", $this->plu_path . "&func=show_dist_list");
     //$tpl->assign("content_editor", $fckeditor->CreateHtml());
     return $tpl->fetch("show_edit_dist.tpl");
 }
예제 #4
0
 function show_reply_contact()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     require_once SRVROOT . FCK . 'fckeditor.php';
     $fckeditor = new FCKeditor('content');
     $fckeditor->Width = '100%';
     $fckeditor->Height = '400px';
     $fckeditor->BasePath = WEBROOT . FCK;
     //3.重要參數: 以 url路徑指定 FCKeditor 主程式所在位置
     //加入麵包屑
     $func_Cname = "回覆表單";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     $con_id = isset($_GET['con_id']) ? $_GET['con_id'] : "";
     if (!(isset($_GET['con_id']) && preg_match("/^[0-9]*\$/", $_GET['con_id']))) {
         redirect($this->plu_path . "&func=show_contact_list", 0, "你所要刪除的表單不合法");
         exit;
     }
     $sql = "SELECT con.con_id, con.con_name, con.con_title, con.con_time, con.con_phone, con.con_email, con.con_ip, con.con_content,cate.Ccate_name AS cate_name  FROM plu_contact AS con,plu_contact_category AS cate WHERE con.Ccate_id = cate.Ccate_id AND con.con_id = '{$con_id}'";
     //echo $sql;
     $contact_data = $db->get_results($sql, ARRAY_A);
     //print_r($contact_data);
     $tpl->assign("contact_data", $contact_data);
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("plu_header_path", $plu_header);
     $tpl->assign("do_reply_contact_url", $this->plu_path . "&func=do_reply_contact&con_id=" . $con_id);
     $tpl->assign("cancel_add_url", $this->plu_path . "&func=show_contact_list");
     $tpl->assign("content_editor", $fckeditor->CreateHtml());
     return $tpl->fetch("show_reply_contact.tpl");
 }
예제 #5
0
 function show_edit_news()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     require_once SRVROOT . FCK . 'fckeditor.php';
     $fckeditor = new FCKeditor('content');
     $fckeditor->Width = '100%';
     $fckeditor->Height = '400px';
     $fckeditor->BasePath = WEBROOT . FCK;
     //3.重要參數: 以 url路徑指定 FCKeditor 主程式所在位置
     //加入麵包屑
     $func_Cname = "變更最新消息";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     $sel_sql = "SELECT DISTINCT cate_id, cate_name FROM plu_news_category";
     $sel_result = $db->get_results($sel_sql, ARRAY_A);
     $tpl->assign("sel_data", $sel_result);
     $news_id = isset($_GET['news_id']) ? $_GET['news_id'] : "";
     $sql = "SELECT UNIX_TIMESTAMP(PublishDate) as t,plu_news.* FROM plu_news WHERE news_id={$news_id}";
     $result = $db->get_row($sql, ARRAY_A);
     if (isset($result)) {
         $fckeditor->Value = $result['content'];
         $tpl->assign('publish_date', substr($result['PublishDate'], 0, 10));
         $tpl->assign('publish_hour', substr($result['PublishDate'], 11, 2));
         $tpl->assign('publish_minutes', substr($result['PublishDate'], 14, 2));
         foreach ($result as $key => $value) {
             if ($key == "img_name" || $key == "movie_name") {
                 $tpl->assign($key, WEBROOT . $this->upload_path . $value);
             } else {
                 $tpl->assign($key, $value);
             }
         }
     }
     $tpl->assign("validate_url", WEBROOT . '/cms/lib/jquery/jquery.validate.js');
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("plu_header_path", $plu_header);
     $tpl->assign("do_edit_news_url", $this->plu_path . "&func=do_edit_news&nid=" . $news_id);
     $tpl->assign("cancel_edit_url", $this->plu_path . "&func=show_news_list");
     $tpl->assign("content_editor", $fckeditor->CreateHtml());
     $tpl->assign("meta_field", is_maintainer());
     return $tpl->fetch("show_edit_news.tpl");
 }
예제 #6
0
 function show_edit_member()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     //加入麵包屑
     $func_Cname = "更新會員資料";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     $sel_sql = "SELECT DISTINCT group_id, group_name FROM plu_member_group";
     $sel_result = $db->get_results($sel_sql, ARRAY_A);
     $tpl->assign("sel_data", $sel_result);
     $member_id = isset($_GET['member_id']) ? $_GET['member_id'] : "";
     $sql = "SELECT plu_member.* FROM plu_member WHERE member_id={$member_id}";
     $result = $db->get_row($sql, ARRAY_A);
     if (isset($result)) {
         foreach ($result as $key => $value) {
             $tpl->assign($key, $value);
         }
     }
     $tpl->assign("validate_url", WEBROOT . '/cms/lib/jquery/jquery.validate.js');
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("plu_header_path", $plu_header);
     $tpl->assign("do_edit_member_url", $this->plu_path . "&func=do_edit_member&uid=" . $member_id);
     $tpl->assign("cancel_edit_url", $this->plu_path . "&func=show_member_list");
     return $tpl->fetch("show_edit_member.tpl");
 }
예제 #7
0
 function show_edit_orders()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     //加入麵包屑
     $func_Cname = "訂單明細";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     $order_id = isset($_GET['order_id']) ? $_GET['order_id'] : "";
     $sql = "SELECT a.*,b.account,b.birth,SUM(qty*unit_price) as subtotal FROM plu_orders a JOIN plu_member b ON a.member_id=b.member_id ";
     $sql .= "JOIN plu_orders_detail c ON a.order_id=c.order_id WHERE a.order_id={$order_id} GROUP BY a.order_id";
     $result = $db->get_row($sql, ARRAY_A);
     foreach ($result as $key => $value) {
         $tpl->assign($key, $value);
     }
     if (isset($result)) {
         $sql = "SELECT b.name as prod_name, a.qty,a.unit_price FROM plu_orders_detail a JOIN plu_product b ON a.prod_id=b.prod_id WHERE order_id={$order_id}";
         $sel_result = $db->get_results($sql, ARRAY_A);
         $tpl->assign("orders_data", $sel_result);
     }
     $tpl->assign("validate_url", WEBROOT . '/cms/lib/jquery/jquery.validate.js');
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("plu_header_path", $plu_header);
     $tpl->assign("do_edit_orders_url", $this->plu_path . "&func=do_edit_orders&order_id=" . $order_id);
     $tpl->assign("cancel_add_url", $this->plu_path . "&func=show_orders_list");
     return $tpl->fetch("show_edit_order.tpl");
 }
예제 #8
0
 function show_user_pri()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     //加入麵包屑
     $func_Cname = "使用者對應身分列表";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     $sel_data = array();
     $site_data = array();
     $count = 0;
     $sel_sql = "SELECT DISTINCT pri_name,pri_id FROM sys_privileges";
     $sel_result = $db->get_results($sel_sql);
     if (isset($sel_result)) {
         foreach ($sel_result as $rows) {
             $sel_data[] = array('pri_name' => $rows->pri_name, 'pri_id' => $rows->pri_id);
         }
     }
     $sql = "SELECT user_id,user_pri,user_nickname FROM sys_user WHERE user_id != 'awoo_maintainer'";
     $result = $db->get_results($sql);
     if (isset($result)) {
         foreach ($result as $rows) {
             $site_data[] = array('count' => $count + 1, 'user_id' => $rows->user_id, 'user_pri' => $rows->user_pri, 'user_nickname' => $rows->user_nickname, 'do_edit_user_pri_link' => $this->plu_path . "&func=do_edit_user_pri");
             $count++;
         }
     }
     $tpl->assign("count", $count);
     $tpl->assign("sel_data", $sel_data);
     $tpl->assign("site_data", $site_data);
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("do_edit_user_pri_url", $this->plu_path . "&func=do_edit_user_pri");
     $tpl->assign("show_pri_list_url", $this->plu_path . "&func=show_pri_list");
     $tpl->assign("show_add_pri_url", $this->plu_path . "&func=show_add_pri");
     $tpl->assign("plu_header_path", $plu_header);
     return $tpl->fetch("show_user_pri.tpl");
 }
예제 #9
0
 function show_edit_category()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     //加入麵包屑
     $func_Cname = "變更分類";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     if (!(isset($_GET['cate_id']) && preg_match("/^[0-9]*\$/", $_GET['cate_id']))) {
         redirect($this->plu_path . "&func=show_category_list", 0, "你所要變更的分類不存在");
         exit;
     }
     $cate_id = $_GET['cate_id'];
     $sel_sql = "SELECT DISTINCT cate_id, cate_name FROM plu_product_category WHERE parent_id=-1";
     $sel_result = $db->get_results($sel_sql, ARRAY_A);
     $tpl->assign("sel_data", $sel_result);
     $sel_sql = "SELECT * FROM plu_product_category WHERE cate_id=" . $cate_id;
     $result = $db->get_row($sel_sql, ARRAY_A);
     foreach ($result as $key => $value) {
         $tpl->assign($key, $value);
     }
     $tpl->assign("validate_url", WEBROOT . '/cms/lib/jquery/jquery.validate.js');
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("plu_header_path", $plu_header);
     $tpl->assign("do_add_category_url", $this->plu_path . "&func=do_edit_category&cid=" . $cate_id);
     $tpl->assign("cancel_add_url", $this->plu_path . "&func=show_category_list");
     return $tpl->fetch("show_add_category.tpl");
 }
예제 #10
0
 function show_edit_doc()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     //加入麵包屑
     $func_Cname = "更新文件";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     $sel_sql = "SELECT DISTINCT cate_id, cate_name FROM plu_document_category";
     $sel_result = $db->get_results($sel_sql, ARRAY_A);
     $tpl->assign("sel_data", $sel_result);
     $doc_id = isset($_GET['doc_id']) ? $_GET['doc_id'] : "";
     $sql = "SELECT * FROM plu_document WHERE doc_id={$doc_id}";
     $result = $db->get_row($sql, ARRAY_A);
     if (isset($result)) {
         foreach ($result as $key => $value) {
             if ($key == 'name') {
                 $tpl->assign($key, substr($value, 0, strrpos($value, ".")));
                 $tpl->assign('doc_type', substr($value, strrpos($value, ".")));
             } else {
                 $tpl->assign($key, $value);
             }
         }
     }
     $tpl->assign("validate_url", WEBROOT . '/cms/lib/jquery/jquery.validate.js');
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("plu_header_path", $plu_header);
     $tpl->assign("uploadPath", WEBROOT . $this->upload_path);
     $tpl->assign("do_edit_doc_url", $this->plu_path . "&func=do_edit_doc&did=" . $doc_id);
     $tpl->assign("cancel_edit_url", $this->plu_path . "&func=show_doc_list");
     return $tpl->fetch("show_edit_doc.tpl");
 }
예제 #11
0
 function show_edit_product()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     require_once SRVROOT . FCK . 'fckeditor.php';
     $fckeditor = new FCKeditor('content');
     $fckeditor->Width = '100%';
     $fckeditor->Height = '400px';
     $fckeditor->BasePath = WEBROOT . FCK;
     //3.重要參數: 以 url路徑指定 FCKeditor 主程式所在位置
     //加入麵包屑
     $func_Cname = "變更商品";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     $sel_sql = "SELECT DISTINCT cate_id, cate_name FROM plu_product_category WHERE parent_id=-1";
     $sel_result = $db->get_results($sel_sql, ARRAY_A);
     $tpl->assign("sel_data", $sel_result);
     $prod_id = isset($_GET['prod_id']) ? $_GET['prod_id'] : "";
     $sql = "SELECT UNIX_TIMESTAMP(PublishDate) as t,plu_product.* FROM plu_product WHERE prod_id={$prod_id}";
     $result = $db->get_row($sql, ARRAY_A);
     if (isset($result)) {
         $sel_sql = "SELECT DISTINCT cate_id, cate_name, parent_id FROM plu_product_category WHERE parent_id<>-1 AND parent_id=(SELECT parent_id FROM plu_product_category WHERE cate_id=" . $result['cate_id'] . ")";
         $sel_result = $db->get_results($sel_sql, ARRAY_A);
         $tpl->assign("sec_sel_data", $sel_result);
         $row = $sel_result[0];
         if ($sel_result != NULL && $row['parent_id'] != $result['cate_id']) {
             $tpl->assign('cate_id', $row['parent_id']);
             $tpl->assign('sec_cate_id', $result['cate_id']);
         } else {
             $tpl->assign('cate_id', $result['cate_id']);
         }
         $fckeditor->Value = $result['content'];
         $tpl->assign('publish_date', substr($result['PublishDate'], 0, 10));
         $tpl->assign('publish_hour', substr($result['PublishDate'], 11, 2));
         $tpl->assign('publish_minutes', substr($result['PublishDate'], 14, 2));
         foreach ($result as $key => $value) {
             if ($key == "img_name" || $key == "movie_name") {
                 $tpl->assign("img_path", WEBROOT . $this->upload_path);
                 $tpl->assign($key, explode('|', $value));
             } else {
                 if ($key != "cate_id") {
                     $tpl->assign($key, $value);
                 }
             }
         }
     }
     $tpl->assign("multiFile_url", WEBROOT . '/cms/lib/jquery/ui/jquery.multifile.js');
     $tpl->assign("validate_url", WEBROOT . '/cms/lib/jquery/jquery.validate.js');
     $tpl->assign("meta_field", is_maintainer());
     $tpl->assign("second_cate", $this->get_subcategory_script());
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("plu_header_path", $plu_header);
     $tpl->assign("do_edit_product_url", $this->plu_path . "&func=do_edit_product&prod_id=" . $prod_id);
     $tpl->assign("cancel_edit_url", $this->plu_path . "&func=show_product_list");
     $tpl->assign("content_editor", $fckeditor->CreateHtml());
     return $tpl->fetch("show_edit_product.tpl");
 }
예제 #12
0
 function show_edit_user()
 {
     $db = init_db();
     $func_Cname = "修改使用者";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     $site_data = array();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("plu_header_path", $plu_header);
     $user_id = isset($_GET['user_id']) ? $_GET['user_id'] : "";
     $sql = "SELECT user_nickname,user_email FROM sys_user WHERE user_id = '{$user_id}'";
     $result = $db->get_results($sql);
     if (isset($result)) {
         foreach ($result as $row) {
             $site_data[] = array('user_id' => $user_id, 'user_nickname' => $row->user_nickname, 'user_email' => $row->user_email);
         }
     }
     $tpl->assign("site_data", $site_data);
     $tpl->assign("cancel_edit_url", $this->plu_path . "&func=show_user_list");
     $tpl->assign("do_edit_user_url", $this->plu_path . "&func=do_edit_user");
     return $tpl->fetch("show_edit_user.tpl");
 }
예제 #13
0
 function show_edit_objects()
 {
     $db = init_db();
     $tpl = init_tpl(SRVROOT . $this->tmpl_path);
     $plu_header = SRVROOT . $this->plu_header_path;
     //加入麵包屑
     $func_Cname = "變更物件";
     $trail = new Breadcrumb();
     $trail->add($func_Cname, $_SERVER['REQUEST_URI'], 2);
     $object_id = isset($_GET['object_id']) ? $_GET['object_id'] : "";
     $sql = "SELECT * FROM plu_objects a WHERE a.object_id={$object_id}";
     $result = $db->get_row($sql, ARRAY_A);
     require_once SRVROOT . FCK . 'fckeditor.php';
     $fckeditor = new FCKeditor('obj[memo]');
     $fckeditor->Width = '100%';
     $fckeditor->Height = '400px';
     $fckeditor->BasePath = WEBROOT . FCK;
     //3.重要參數: 以 url路徑指定 FCKeditor 主程式所在位置
     $fckeditor->Value = htmlspecialchars_decode($result["memo"]);
     $tpl->assign("content_editor", $fckeditor->CreateHtml());
     foreach ($result as $key => $value) {
         $tpl->assign($key, htmlspecialchars_decode($value));
     }
     $sql = "SELECT * FROM plu_objects_household a WHERE a.object_id={$object_id}";
     $result = $db->get_row($sql, ARRAY_A);
     foreach ($result as $key => $value) {
         if ($key == "object_id") {
             continue;
         }
         $tpl->assign($key, htmlspecialchars_decode($value));
     }
     $sql = "SELECT * FROM plu_objects_pic a WHERE a.object_id={$object_id}";
     $result = $db->get_results($sql, ARRAY_A);
     $tpl->assign("file_path", WEBROOT . $this->upload_path);
     for ($i = 0; $i < count($result); $i++) {
         $tpl->assign($result[$i]['item'], $result[$i]['filename']);
     }
     $tpl->assign("validate_url", WEBROOT . '/cms/lib/jquery/jquery.validate.js');
     $tpl->assign("wizard_url", WEBROOT . '/cms/lib/jquery/jquery.form.wizard.js');
     $tpl->assign("history_url", WEBROOT . '/cms/lib/jquery/jquery.history.js');
     $tpl->assign("mrt_url", WEBROOT . '/cms/lib/js/MRT.js');
     $tpl->assign("form_url", WEBROOT . '/cms/lib/jquery/jquery.form.js');
     $tpl->assign("datepicker_url", WEBROOT . '/cms/lib/js/chineseDatepicker.js');
     $tpl->assign("func_Cname", $func_Cname);
     $tpl->assign("plu_header_path", $plu_header);
     $tpl->assign("check_address_url", $this->plu_path . "&cmsroot=get_data&func=check_address&object_id=" . $object_id);
     $tpl->assign("check_auction_url", $this->plu_path . "&cmsroot=get_data&func=check_auction&object_id=" . $object_id);
     $tpl->assign("do_edit_objects_url", $this->plu_path . "&func=do_edit_objects&object_id=" . $object_id);
     $tpl->assign("cancel_add_url", $this->plu_path . "&func=show_objects_list");
     return $tpl->fetch("show_edit_objects.tpl");
 }