Exemple #1
0
 private function dequy_menu_doc($id)
 {
     $vie = new Zend_View();
     $base = $vie->baseurl();
     $cnDB1 = Zend_Registry::get('connectDB');
     $tv = "select * from add_page where cat_page_id='{$id}' and active=1 order by position ASC";
     $stml1 = $cnDB1->prepare($tv);
     $stml1->execute();
     while ($result1 = $stml1->fetch(PDO::FETCH_ASSOC)) {
         $id = $result1['id'];
         $ten = $result1['title'];
         $url = khongdau($ten);
         $link_menu = "{$base}/pages/{$url}-{$id}.html";
         echo "<li>";
         echo "<a href=\"{$link_menu}\">";
         echo $result1['title'];
         echo "</a>";
         $xacdinh_menu_con_doc = $this->xacdinh_menu_con_doc($id);
         if ($xacdinh_menu_con_doc == "co") {
             echo "<ul>";
             $this->dequy_menu_doc($id);
             echo "</ul>";
         } else {
         }
         echo "</li>";
     }
 }
 public function news()
 {
     $view = new Zend_View();
     $base = $view->baseurl();
     try {
         $query = "SELECT * FROM page where menu like '12' ORDER BY id DESC limit 0,4";
         $stml = $this->db->prepare($query);
         $stml->execute();
         while ($result = $stml->fetch(PDO::FETCH_ASSOC)) {
             $id = $result['id'];
             $title = $result['title'];
             $url = khongdau($title);
             $date = $result['date'];
             $menu = $result['menu'];
             $images = $result['images'];
             $link = "{$base}/trang/{$url}-{$id}-{$menu}.html";
             echo "<div class='clear_10'></div>";
             echo "<a href=\"{$url}/pages/tin-tuc-12.html\" title=\"{$ten}\">  <img src=\"{$base}/Upload/{$images}\"> </a>";
             echo "<a href=\"{$link}\"> <h5>  {$title} </h5></a>";
             echo "<span>{$date} <span>";
             echo "<div class='clear'></div>";
             echo "<div class='clear_border'></div>";
         }
     } catch (Exception $exc) {
         echo $exc->getTraceAsString();
     }
 }
Exemple #3
0
 public function menupage()
 {
     $view = new Zend_View();
     $base = $view->baseurl();
     $session = new Zend_Session_Namespace('identity');
     $username = $session->username;
     echo "\n     <link rel=\"stylesheet\" type=\"text/css\" href=\"{$base}/css/bootstrap-cerulean_1.css\" />";
     echo "   <li><a href=\"{$base}\">trang chủ</a> </li>\n                <li><a href=\"{$base}/pages/gioi-tieu-6.html\">GIỚI THIỆU</a> </li>\n                <li><a href=\"{$base}/pages/tin-tuc-12.html\">TIN TỨC</a> </li>\n                <li><a href=\"{$base}/pages/gioi-tieu-16.html\">tuyển dụng </a> </li>\n                <li><a href=\"{$base}/pages/gioi-tieu-19.html\">PHẤN PHỐI </a> </li>\n                <li><a href=\"{$base}/lien-he.html\">LIÊN HỆ</a> </li>\n                <li class=\"search\">\n                    <form action=\"\" enctype='multipart/form-data' >\n                        <input type=\"text\" style=\"margin-left: 101px; width: 252px; margin-top: 5px;\" placeholder=\"Nhập thiết bị cần tìm?\">\n                        <input type=\"image\" src=\"{$base}/template/images/bt_07.jpg\" style=\"width: 25px;margin-left: 365px;margin-top: -88px\">\n                    </form>\n                </li>";
 }
Exemple #4
0
 public function linkuser()
 {
     $view = new Zend_View();
     $base = $view->baseurl();
     $session = new Zend_Session_Namespace('identity');
     $username = $session->username;
     $query = "SELECT * FROM users where username like '{$username}' ";
     $stml = $this->db->prepare($query);
     $stml->execute();
     while ($result = $stml->fetch(PDO::FETCH_ASSOC)) {
         $id = $result['id'];
         echo "<li><a href=\"{$base}/user/user-{$id}.html\">Sửa thông tin cá nhân</a></li>";
     }
 }
 function menu_doc()
 {
     $vi = new Zend_View();
     $base = $vi->baseurl();
     echo "<div class=\"title\">\n<div style=\"padding-top:10px;\" align=\"center\">Quảng lý đăng tin</div>\n</div>\n\n<div class=\"menu_doc\" id=\"menu_doc\">\n\t  <ul>";
     echo "<li><a href=\"{$base}/dang-tin.html\">Đăng tin </a></li>";
     echo "<li><a href=\"{$base}/thanh-vien.html\">Tin đã đăng</a></li>";
     echo "<li><a href=\"javascript:void(0)\">Tin hết hạn</a></li>";
     echo "<li><a href=\"javascript:void(0)\">Tin chờ duyệt</a></li>";
     echo "</ul>\n\t</div>";
     echo "<div class=\"title\">\n<div style=\"padding-top:10px;\" align=\"center\">Quảng lý cá nhân</div>\n</div>\n\n<div class=\"menu_doc\" id=\"menu_doc\">\n\t  <ul>";
     $link = new Default_Model_User();
     $link->linkuser();
     echo "<li><a href=\"javascript:void(0)\">Đổi password</a></li>";
     echo "</ul>\n\t</div>";
 }
Exemple #6
0
 public function list_category()
 {
     $view = new Zend_View();
     $base = $view->baseurl();
     $query = "SELECT * FROM category order by id ASC ";
     $stml = $this->db->prepare($query);
     $stml->execute();
     echo "<select name=\"category_id\" id='category_id' class='form_tk' style=\"float: left;margin: 2px 10px 0px 0px\">";
     echo "<option value=\"\">\n\t\t\t\t------ Chọn danh mục gốc ------\n\t\t\t</option>";
     while ($result = $stml->fetch(PDO::FETCH_ASSOC)) {
         $title = $result['title'];
         $id = $result['id'];
         echo "<option value=\"{$id}\">\n\t\t\t\t{$title}\n\t\t\t</option>";
     }
     echo "</select>";
 }
 function logoutAction()
 {
     $vi = new Zend_View();
     $base = $vi->baseurl();
     Zend_Session::namespaceUnset('identity');
     chuyentrang($base);
 }
 function tab_2()
 {
     $page = new Default_Model_Page();
     $vie = new Zend_View();
     $base = $vie->baseurl();
     echo "\n        \n\n\n<ul id=\"countrytabs1\" class=\"shadetabs\">\n<li><a href=\"#\" rel=\"country3\" class=\"selected\">Tin Hot Nhất</a></li>\n<li><a href=\"#\" rel=\"country4\">Tin Khuyến Mãi </a></li>\n\n</ul>\n\n<div style=\"border:1px solid gray; width:218px; margin-bottom: 1em; \">\n\n<div id=\"country3\" class=\"tabcontent\">";
     $page->top_hot();
     echo "</div>\n\n<div id=\"country4\" class=\"tabcontent\">";
     $page->top_km();
     echo "</div>\n\n\n\n</div>\n\n<script type=\"text/javascript\">\n\nvar countries=new ddtabcontent(\"countrytabs1\")\ncountries.setpersist(true)\ncountries.setselectedClassTarget(\"link\") \ncountries.init()\n\n</script>";
 }
 function orderAction()
 {
     $yourCart = new Zend_Session_Namespace('cart');
     if ($this->_request->isPost()) {
         $itemProduct = $this->_arrParam['itemProduct'];
         if (count($itemProduct) > 0) {
             foreach ($itemProduct as $key => $val) {
                 if ($val == 0) {
                     unset($itemProduct[$key]);
                 }
             }
         }
         $yourCart->cart = $itemProduct;
     }
     //echo count ($yourCart->cart);
     $ssInfo = $yourCart->getIterator();
     //var_dump($ssInfo);
     $tblProduct = new Default_Model_Cart();
     $this->_arrParam['cart'] = $ssInfo['cart'];
     if (count($this->_arrParam['cart']) > 0) {
         $this->view->Items = $tblProduct->listcart($this->_arrParam);
         $this->view->cart = $ssInfo['cart'];
         $buy = "";
         foreach ($ssInfo['cart'] as $key => $val) {
             $item[] = $key;
             $demo[] = $val;
             //  echo $key;
             //  echo $val;
         }
         for ($i = 0; $i < count($ssInfo['cart']); $i++) {
             $id = $item[$i];
             $sl = $demo[$i];
             $buy = $buy . "{$id}" . "___" . "{$sl}" . "______";
         }
         $buy = substr($buy, 0, -6);
         // thanh toan
         $muser = new Default_Model_Cart();
         $captcha = new Zend_Captcha_Image();
         $vi = new Zend_View();
         $base = $vi->baseurl();
         if (!$this->_request->isPost()) {
             $captcha->setTimeout('300')->setWordLen('4')->setHeight('50')->setWidth('320')->setImgDir(APPLICATION_PATH . '/../public_html/captcha/images/')->setImgUrl($base . '/captcha/images/')->setFont(APPLICATION_PATH . '/../public_html/font/UTM-Avo.ttf');
             $captcha->generate();
             $this->view->captcha = $captcha->render($this->view);
             $this->view->captchaID = $captcha->getId();
             // Dua chuoi Captcha vao session
             $captchaSession = new Zend_Session_Namespace('Zend_Form_Captcha_' . $captcha->getId());
             $captchaSession->word = $captcha->getWord();
         } else {
             $captchaID = $this->_request->captcha_id;
             $captchaSession = new Zend_Session_Namespace('Zend_Form_Captcha_' . $captchaID);
             $captchaIterator = $captchaSession->getIterator();
             $captchaWord = $captchaIterator['word'];
             if ($this->_request->captcha == $captchaWord) {
                 $session = new Zend_Session_Namespace('identity');
                 $username = $session->username;
                 $this->view->purifier = Zend_Registry::get('purifier');
                 $conf = HTMLPurifier_Config::createDefault();
                 $purifier = new HTMLPurifier($conf);
                 $fullname = $purifier->purify($this->_request->getParam('fullname'));
                 $address = $purifier->purify($this->_request->getParam('address'));
                 $phone = $purifier->purify($this->_request->getParam('phone'));
                 $email = $purifier->purify($this->_request->getParam('email'));
                 $coment = $purifier->purify($this->_request->getParam('coment'));
                 $title = $purifier->purify($this->_request->getParam('title'));
                 $emaillh = "*****@*****.**";
                 $tinnhan = "\n\t\t\tHọ tên : {$fullname} <br>\n\t\t\tEmail : {$email}<br>\n\t\t\tĐịa chỉ : {$address}<br>\n\t\t\tĐiện thoại : {$phone}<br>\n\t\t\t\n\t\t\tNội dung : {$coment}<br>";
                 $to = $emaillh;
                 $subject = $title;
                 $message = $tinnhan;
                 $headers = 'Content-type: text/html;charset=utf-8';
                 mail($to, $subject, $message, $headers);
                 // Thiết lập SMTP Server
                 require 'ham/class.phpmailer.php';
                 require 'ham/class.pop3.php';
                 // nạp thư viện
                 $mailer = new PHPMailer();
                 // khởi tạo đối tượng
                 $mailer->IsSMTP();
                 // gọi class smtp để đăng nhập
                 $mailer->CharSet = "utf-8";
                 // bảng mã unicode
                 //Đăng nhập Gmail
                 $mailer->SMTPAuth = true;
                 // Đăng nhập
                 $mailer->SMTPSecure = "ssl";
                 // Giao thức SSL
                 $mailer->Host = "smtp.gmail.com";
                 // SMTP của GMAIL
                 $mailer->Port = 465;
                 // cổng SMTP
                 // Phải chỉnh sửa lại
                 $mailer->Username = "******";
                 // GMAIL username
                 $mailer->Password = "******";
                 // GMAIL password
                 $mailer->AddAddress("{$emaillh}", 'Recipient Name');
                 //email người nhận
                 // Chuẩn bị gửi thư nào
                 $mailer->FromName = "{$fullname}";
                 // tên người gửi
                 $mailer->From = "{$email}";
                 // mail người gửi
                 $mailer->Subject = "{$base}";
                 $mailer->IsHTML(true);
                 //Bật HTML không thích thì false
                 // Nội dung lá thư
                 $mailer->Body = "{$tinnhan}";
                 // Gửi email
                 if (!$mailer->Send()) {
                     // Gửi không được, đưa ra thông báo lỗi
                     echo "Không gửi được ";
                     echo "Lỗi: " . $mailer->ErrorInfo;
                 } else {
                     $muser->insert_order($address, $email, $phone, $coment, $username, $fullname, $buy);
                     Zend_Session::namespaceUnset('cart');
                     thongbao("Cảm ơn bạn đã liên hệ cho chúng tôi");
                     chuyen_trang($base);
                 }
             } else {
                 thongbao('Bạn nhập sai chuỗi Captcha');
                 trang_truoc();
             }
             $this->_helper->viewRenderer->setNoRender();
             $mask = APPLICATION_PATH . "/../public_html/captcha/images/*.png";
             array_map("unlink", glob($mask));
         }
     } else {
         //echo "Bạn chưa mua hàng";
     }
 }
Exemple #10
0
 function hot_product()
 {
     $vie = new Zend_View();
     $base = $vie->baseurl();
     echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$base}/template/css/sagscroller.css\" />\n<script src=\"{$base}/template/js/sagscroller.js\"></script><script src=\"{$base}/template/js/jquery-1.7.2.min.js\"></script>";
     echo "<script>\n\n                \n\n                var sagscroller1=new sagscroller({\n                id:'mysagscroller',\n                mode: 'auto', //<--no comma following last option\n                pause: 1000,\n                animatespeed: 3000\n                })\n\n               \n\n                </script>\n                ";
     echo " <div class=\"title1\">\n        <div style=\"padding-top:10px;\" align=\"center\">Liên kết</div>\n        </div>";
     echo "<div class=\"hotro\">\n              \n            <div id=\"mysagscroller\" class=\"sagscroller\">\n<ul>\n            ";
     $cndb = $this->_db;
     $tv = "select * from page  where menu=57 and active=1 order by id";
     $stml = $cndb->prepare($tv);
     $stml->execute();
     // echo 123; die;
     while ($tv_2 = $stml->fetch(PDO::FETCH_ASSOC)) {
         $id = $tv_2['id'];
         $title = $tv_2['title'];
         $images = $tv_2['images'];
         $url = khongdau($title);
         $mask = APPLICATION_PATH . "/../Upload/{$images}";
         if (file_exists($mask)) {
             $images = $tv_2['images'];
         } else {
             $images = "no-img.png";
         }
         $link = "{$base}/chi-tiet/{$url}-{$id}.html";
         echo "<li><a href=\"{$link}\" title='{$title}'><img src=\"{$base}/Upload/{$images}\" title='{$title}' alt='{$title}' /><br />{$title}</a></li>";
     }
     echo "</ul></div></div>";
     echo " <script type=\"text/javascript\" src=\"{$base}/template/js_side/jquery-1.4.3.min.js\"></script>";
     echo " <script type=\"text/javascript\" src=\"{$base}/template/js_side/jquery.nivo.slider.pack.js\"></script>";
     echo "<script type=\"text/javascript\">\n                    \$(window).load(function() {\n                    \$('#slider').nivoSlider();\n                    });\n                </script>";
 }
 function contactAction()
 {
     $muser = new Default_Model_System();
     $conten = $muser->list_system();
     $this->view->book = $conten;
     $captcha = new Zend_Captcha_Image();
     $vi = new Zend_View();
     $base = $vi->baseurl();
     if (!$this->_request->isPost()) {
         $captcha->setTimeout('300')->setWordLen('4')->setHeight('50')->setWidth('320')->setImgDir(APPLICATION_PATH . '/../captcha/images/')->setImgUrl($base . '/captcha/images/')->setFont(APPLICATION_PATH . '/../font/UTM-Avo.ttf');
         $captcha->generate();
         $this->view->captcha = $captcha->render($this->view);
         $this->view->captchaID = $captcha->getId();
         // Dua chuoi Captcha vao session
         $captchaSession = new Zend_Session_Namespace('Zend_Form_Captcha_' . $captcha->getId());
         $captchaSession->word = $captcha->getWord();
     } else {
         $captchaID = $this->_request->captcha_id;
         $captchaSession = new Zend_Session_Namespace('Zend_Form_Captcha_' . $captchaID);
         $captchaIterator = $captchaSession->getIterator();
         $captchaWord = $captchaIterator['word'];
         if ($this->_request->captcha == $captchaWord) {
             $this->view->purifier = Zend_Registry::get('purifier');
             $conf = HTMLPurifier_Config::createDefault();
             $purifier = new HTMLPurifier($conf);
             $fullname = $purifier->purify($this->_request->getParam('fullname'));
             $address = $purifier->purify($this->_request->getParam('address'));
             $phone = $purifier->purify($this->_request->getParam('phone'));
             $email = $purifier->purify($this->_request->getParam('email'));
             $content = $purifier->purify($this->_request->getParam('content'));
             $title = $purifier->purify($this->_request->getParam('title'));
             $emaillh = $purifier->purify($this->_request->getParam('emaillh'));
             $tinnhan = "\n\t\t\tHọ tên : {$fullname} <br>\n\t\t\tEmail : {$email}<br>\n\t\t\tĐịa chỉ : {$address}<br>\n\t\t\tĐiện thoại : {$phone}<br>\n\t\t\t\n\t\t\tNội dung : {$content}<br>";
             $to = $emaillh;
             $subject = $title;
             $message = $tinnhan;
             $headers = 'Content-type: text/html;charset=utf-8';
             // mail($to, $subject, $message, $headers);
             //$html ="<img title=\"夕食:ル・バンドーム(フランス料理)\" alt=\"夕食:ル・バンドーム(フランス料理)\" src=\"http://toursystem.biz/uploads/product/1378725993LE_VENDOME_12.jpg\">";
             //         $mail = new Zend_Mail('UTF-8');
             //          $mail->setBodyHtml("$tinnhan");
             //          $mail->setFrom("$email", "$title");
             //          $mail->addTo("*****@*****.**", 'Ly Le');
             //          $mail->addTo("$emaillh", "$fullname");
             //          $mail->setSubject("Thông tin liên hệ  ngày  : ".date("F j, Y"));
             //          $mail->send();
             // Thiết lập SMTP Server
             require 'ham/class.phpmailer.php';
             require 'ham/class.pop3.php';
             // nạp thư viện
             $mailer = new PHPMailer();
             // khởi tạo đối tượng
             $mailer->IsSMTP();
             // gọi class smtp để đăng nhập
             $mailer->CharSet = "utf-8";
             // bảng mã unicode
             //Đăng nhập Gmail
             $mailer->SMTPAuth = true;
             // Đăng nhập
             $mailer->SMTPSecure = "ssl";
             // Giao thức SSL
             $mailer->Host = "smtp.gmail.com";
             // SMTP của GMAIL
             $mailer->Port = 465;
             // cổng SMTP
             // Phải chỉnh sửa lại
             $mailer->Username = "******";
             // GMAIL username
             $mailer->Password = "******";
             // GMAIL password
             $mailer->AddAddress("{$emaillh}", 'Recipient Name');
             //email người nhận
             // Chuẩn bị gửi thư nào
             $mailer->FromName = "{$fullname}";
             // tên người gửi
             $mailer->From = "{$email}";
             // mail người gửi
             $mailer->Subject = "{$base}";
             $mailer->IsHTML(true);
             //Bật HTML không thích thì false
             // Nội dung lá thư
             $mailer->Body = "{$tinnhan}";
             // Gửi email
             if (!$mailer->Send()) {
                 // Gửi không được, đưa ra thông báo lỗi
                 echo "Không gửi được ";
                 echo "Lỗi: " . $mailer->ErrorInfo;
             } else {
                 $muser->contact($fullname, $address, $phone, $email, $title, $content);
                 thongbao("Cảm ơn bạn đã liên hệ cho chúng tôi");
                 trangtruoc();
             }
         } else {
             thongbao('Bạn nhập sai chuỗi Captcha');
             trang_truoc();
         }
         $this->_helper->viewRenderer->setNoRender();
         $mask = APPLICATION_PATH . "/../captcha/images/*.png";
         array_map("unlink", glob($mask));
     }
 }