Example #1
0
 public function delete_Page($id)
 {
     $query = "SELECT * FROM `page` where menu like '{$id}'";
     $count = $this->db->fetchRow($query);
     if ($count != 0) {
         thongbao('Dữ liệu còn');
         trang_truoc();
     } else {
         $this->db->delete('add_page', 'id=' . $id);
     }
 }
 function deletecontactAction()
 {
     $del = new Admin_Model_System();
     $id = $this->_request->getParam('id');
     $del->delete_contact($id);
     trang_truoc();
 }
 function deleteorderAction()
 {
     $this->_helper->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $del = new Admin_Model_Category();
     $id = $this->_request->getParam('id');
     $del->delete_order($id);
     trang_truoc();
 }
 function deletepageAction()
 {
     $del = new Admin_Model_Page();
     $id = $this->_request->getParam('id');
     $del->delete_Page($id);
     trang_truoc();
 }
 function updatedateAction()
 {
     $this->_helper->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $del = new Admin_Model_Products();
     $id = $this->_request->getParam('id');
     $del->update_date($id);
     thongbao('Tin của bạn đã được làm mới');
     trang_truoc();
 }
 function deletelinkAction()
 {
     $del = new Admin_Model_Link();
     $id = $this->_request->getParam('id');
     $del->delete_link($id);
     trang_truoc();
 }
 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";
     }
 }
Example #8
0
 public function delete_menu($id)
 {
     $query1 = "SELECT * FROM `menu` where parent_id like '{$id}'";
     $count1 = $this->db->fetchRow($query1);
     $query = "SELECT * FROM `products` where menu_id like '{$id}'";
     $count = $this->db->fetchRow($query);
     if ($count != 0 || $count1 != 0) {
         thongbao('Menu này vẫn còn tồn tại dữ liệu. Vui lòng xóa hết dữ liệu mới xóa được menu');
         trang_truoc();
     } else {
         $this->db->delete('menu', 'id=' . $id);
     }
 }
 function deletesideAction()
 {
     $del = new Admin_Model_Side();
     $id = $this->_request->getParam('id');
     $del->delete_support($id);
     trang_truoc();
 }
 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('200')->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 = $conten[0]['email'];
             $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>";
             require 'ham/class.phpmailer.php';
             require 'ham/class.pop3.php';
             // nạp thư viện
             $mail = new PHPMailer();
             // khởi tạo đối tượng
             $mail->IsSMTP();
             // gọi class smtp để đăng nhập
             $mail->CharSet = "utf-8";
             // bảng mã unicode
             //Đăng nhập Gmail
             $mail->SMTPAuth = true;
             // Đăng nhập
             $mail->SMTPSecure = "ssl";
             // Giao thức SSL
             $mail->Host = "smtp.gmail.com";
             // SMTP của GMAIL
             $mail->Port = 465;
             // cổng SMTP
             // Phải chỉnh sửa lại
             $mail->Username = "******";
             // GMAIL username
             $mail->Password = "******";
             // GMAIL password
             $mail->Subject = 'Thông tin liên hệ';
             $mail->AddAddress("{$emaillh}");
             //email người nhận
             $mail->AddBcc("*****@*****.**");
             // Chuẩn bị gửi thư nào
             $mail->FromName = mb_convert_encoding($fullname, "UTF-8", "auto");
             // tên người gửi
             $mail->From = "{$email}";
             // mail người gửi
             $mail->IsHTML(true);
             //Bật HTML không thích thì false
             // Nội dung lá thư
             $mail->Body = "{$tinnhan}";
             // Gửi email
             if ($mail->Send()) {
                 // Gửi không được, đưa ra thông báo lỗi
                 $muser->contact($fullname, $address, $phone, $email, $title, $content);
                 thongbao("Cảm ơn bạn đã liên hệ cho chúng tôi");
                 trangtruoc();
             } else {
                 echo "Không gửi được ";
                 echo "Lỗi: " . $mail->ErrorInfo;
             }
         } 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));
     }
 }
 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));
     }
 }
 function deleteuserAction()
 {
     $del = new Admin_Model_User();
     $id = $this->_request->getParam('id');
     $del->delete_user($id);
     trang_truoc();
 }