public function indexAction() { $this->view->Title = 'Đặt hàng'; $this->view->headTitle($this->view->Title); $id = $this->getRequest()->getParam("id_product"); $Product = Product::getById($id); if ($this->getRequest()->isPost()) { $request = $this->getRequest()->getParams(); $error = $this->_checkForm($request); if (count($error) == 0) { $Contact = new Contact(); $Contact->merge($request); $Contact->created_date = date("Y-m-d H:i:s"); $Contact->save(); //$_SESSION['msg'] = "Yêu cầu đặt hàng của bạn đã được gửi, xin trân thành cảm ơn!"; My_Plugin_Libs::setSplash('<b>Yêu cầu đặt hàng của bạn đã được gửi, xin trân thành cảm ơn!</b>'); $this->_redirect($this->_helper->url('index', 'contact', 'default')); } if (count($error)) { $this->view->error = $error; } } $this->view->Product = $Product; $this->view->Contact = $Contact; }
public function deleteAction() { $contactObj = Contact::getById($this->getRequest()->getParam('id')); if ($this->getRequest()->isPost()) { $contactObj->delete(); $this->Member->log('Đặt hàng: ' . $contactObj->full_name . '(' . $this->getRequest()->getParam('id') . ')', 'Xóa đơn hàng'); My_Plugin_Libs::setSplash('Đơn hàng của: <b>' . $contactObj->full_name . '</b> đã xóa khỏi hệ thống.'); $this->_redirect($this->_helper->url('index', 'contact', 'admin')); } $this->view->Contact = $contactObj; }
public function deleteAction() { $Product = ProductGroup::getById($this->getRequest()->getParam('id')); if ($Product) { if ($this->getRequest()->isPost()) { $Product->delete(); $this->Member->log('Nhóm sản phẩm: ' . $Product->name . '(' . $this->getRequest()->getParam('id') . ')', 'Xóa'); My_Plugin_Libs::setSplash('Nhóm sản phẩm: <b>' . $Product->name . '</b> đã được xóa khỏi hệ thống.'); $this->_redirect($this->_helper->url('index', 'productgroup', 'admin')); } $this->view->Product = $Product; } }
/** * Delete a Country */ public function deleteAction() { $Content = Content::getById($this->getRequest()->getParam('id')); if ($Content) { if ($this->getRequest()->isPost()) { $Content->delete(); $this->Member->log('Delete: ' . $Content->content_title . '(' . $this->getRequest()->getParam('id') . ')', 'Content'); My_Plugin_Libs::setSplash('Posts: <b>' . $Content->content_title . '</b> have been delete.'); $this->_redirect($this->_helper->url('index', 'content', 'admin')); } $this->view->Content = $Content; } }
public function deleteAction() { $Group = Groups::getById($this->getRequest()->getParam('id')); if ($Group) { if ($this->getRequest()->isPost()) { $Group->delete(); My_Plugin_Libs::setSplash('Delete:<b>' . $Group->name . '</b> have been completed.'); $this->Member->log('Member group:' . $Group->name . '(' . $this->getRequest()->getParam('id') . ')', 'Delete'); $this->_redirect($this->_helper->url('index', 'Group', 'admin')); } $this->view->Group = $Group; } }
/** * Delete a Country */ public function deleteAction() { $Content = NewGroup::getById($this->getRequest()->getParam('id')); if ($Content) { if ($this->getRequest()->isPost()) { $Content->delete(); $this->Member->log('Nhóm tin: ' . $Content->name . '(' . $this->getRequest()->getParam('id') . ')', 'Xóa'); My_Plugin_Libs::setSplash('Nhóm tin: <b>' . $Content->name . '</b> đã được xóa khỏi hệ thống.'); $this->_redirect($this->_helper->url('index', 'newgroup', 'admin')); } $this->view->Newgroup = $Content; } }
/** * Delete a Country */ public function deleteAction() { $Video = Video::getById($this->getRequest()->getParam('id')); if ($Video) { if ($this->getRequest()->isPost()) { $Video->delete(); $this->Member->log('Video: ' . $Video->name . '(' . $this->getRequest()->getParam('id') . ')', 'Xóa'); My_Plugin_Libs::setSplash('Video: <b>' . $Video->name . '</b> đã được xóa khỏi hệ thống.'); $this->_redirect($this->_helper->url('index', 'video', 'admin')); } $this->view->Video = $Video; } }
public function deleteAction() { $contactObj = Contact::getById($this->getRequest()->getParam('id')); if ($contactObj) { if ($this->getRequest()->isPost()) { $contactObj->delete(); $this->Member->log('Delete: ' . $contactObj->contact_first_name . " " . $contactObj->contact_last_name . '(' . $this->getRequest()->getParam('id') . ')', 'Contact'); My_Plugin_Libs::setSplash('Contact by: <b>' . $contactObj->contact_first_name . " " . $contactObj->contact_last_name . '</b> have been delete.'); $this->_redirect($this->_helper->url('index', 'contact', 'admin')); } $this->view->Contact = $contactObj; } }
/** * Delete a Country */ public function deleteAction() { $trainers = Trainer::getById($this->getRequest()->getParam('id')); if ($trainers) { if ($this->getRequest()->isPost()) { $trainers->delete(); $this->Member->log('Delete: ' . $trainers->first_name . ' ' . $trainers->last_name . '(' . $this->getRequest()->getParam('id') . ')', 'Trainers'); My_Plugin_Libs::setSplash('Posts: <b>' . $trainers->first_name . ' ' . $trainers->last_name . '</b> have been delete.'); $this->_redirect($this->_helper->url('index', 'trainers', 'admin')); } $this->view->trainers = $trainers; } }
/** * Delete a Country */ public function deleteAction() { $Content = Content::getById($this->getRequest()->getParam('id')); if ($Content) { if ($this->getRequest()->isPost()) { $Content->delete(); $this->Member->log('Bài viết: ' . $Content->content_title . '(' . $this->getRequest()->getParam('id') . ')', 'Xóa'); My_Plugin_Libs::setSplash('Bài viết: <b>' . $Content->content_title . '</b> đã được xóa khỏi hệ thống.'); $this->_redirect($this->_helper->url('index', 'content', 'admin')); } $this->view->Content = $Content; } }
public function deleteAction() { $Product = Setions::getById($this->getRequest()->getParam('id')); if ($Product) { if ($this->getRequest()->isPost()) { $Product->delete(); $this->Member->log('Setions: ' . $Product->name . '(' . $this->getRequest()->getParam('id') . ')', 'Xóa'); My_Plugin_Libs::setSplash('Delete: <b>' . $Product->name . '</b> have been completed.'); $this->_redirect($this->_helper->url('index', 'setions', 'admin')); } $this->view->Setions = $Product; } }
public function deleteAction() { $Group = Groups::getById($this->getRequest()->getParam('id')); if ($Group) { if ($this->getRequest()->isPost()) { $Group->delete(); My_Plugin_Libs::setSplash('Nhóm thành viên:<b>' . $Group->name . '</b> đã được xóa khổi hệ thống.'); $this->Member->log('Xóa nhóm thành viên:' . $Group->name . '(' . $this->getRequest()->getParam('id') . ')', 'Groups'); $this->_redirect($this->_helper->url('index', 'Group', 'admin')); } $this->view->Group = $Group; } }
public function indexAction() { $this->view->Title = 'Contact form'; $this->view->headTitle($this->view->Title); $captcha = new My_Plugin_Image(); $this->view->captcha = $captcha->render($this->view); $this->view->captcha_id = $captcha->getId(); if ($this->getRequest()->isPost()) { $request = $this->getRequest()->getParams(); $error = $this->_checkForm($request); if (count($error) == 0) { $Contact = new Contact(); $Contact->merge($request); $Contact->save(); /** * Check server mail valid * @var unknown_type */ $check_mail_server = array('username' => Zend_Registry::get('Setting')->EMAIL_SMTP_USER, 'password' => Zend_Registry::get('Setting')->EMAIL_SMTP_PASS, 'port' => Zend_Registry::get('Setting')->EMAIL_SMTP_PORT); if (!$check_mail_server['username'] || !$check_mail_server['password'] || !$check_mail_server['port']) { /** * Not send mail to admin */ My_Plugin_Libs::setSplash('<b>Your feedback have been send to us. Thank you very much!</b>'); $this->_redirect($this->_helper->url('index', 'contact', 'default')); } else { /** * Send mail to admin */ if ($request['contact_type'] == "Contact") { $subject = "[" . Zend_Registry::get('Setting')->DOMAIN . "][Contact] From : " . $request['contact_first_name'] . " " . $request['contact_last_name']; } else { $subject = "[" . Zend_Registry::get('Setting')->DOMAIN . "][Get listed] - From: " . $request['contact_first_name'] . " " . $request['contact_last_name']; } $email = Zend_Registry::get('Setting')->webmaster_email; $name = "Administrator"; $message = $request['message']; $sendmail = new My_Plugin_Email(); $sendmail->send($subject, $email, $name, $message, $type = 'html'); My_Plugin_Libs::setSplash('<b>Your feedback have been send to us. Thank you very much!</b>'); $this->_redirect($this->_helper->url('index', 'contact', 'default')); } } if (count($error)) { $this->view->error = $error; } } $this->view->Contact = $Contact; }
public function __construct($request) { if (count($request->getParams()) == 0) { return; } $controller = strtolower($request->controller); $action = strtolower($request->action); if ($_SESSION['Role'][$controller][$action] != 1) { if ($_SESSION['Member']) { $_SESSION['Member']->log('Access denied: ' . $controller . '-' . $action, $controller); } My_Plugin_Libs::setSplash('Bạn không đươc quyền truy cập phân mục đó. Hay liên hệ người quản lý cao nhất', 'error'); header('location: /admin/'); } }
public function editAction() { $this->view->Title = "Chỉnh sửa nhóm thành viên"; $this->view->headTitle($this->view->Title); $Group = Groups::getById($this->getRequest()->getParam('id')); $Resources = new Zend_Config_Xml(APPLICATION_PATH . '/configs/resources.xml', 'admin'); if ($this->getRequest()->isPost()) { $Role = $this->getRequest()->getParam('Role'); $Group->merge($_POST); $Group->role = Zend_Json::encode($Role); $Group->save(); $this->Member->log('Chỉnh sửa nhóm thành viên: ' . $Group->name . ' (' . $Group->id . ')', 'Groups'); My_Plugin_Libs::setSplash('Nhóm thành viên:<b>' . $Group->name . '</b> đã được sửa.'); $this->_redirect($this->_helper->url('index', 'Group')); } $this->view->Resources = $Resources; $Group->role = Zend_Json::decode($Group->role); $this->view->Group = $Group; }
/** * The default action - show the home page */ public function indexAction() { $this->view->Title = 'Get Listed Form'; $this->view->headTitle($this->view->Title); $captcha = new My_Plugin_Image(); $this->view->captcha = $captcha->render($this->view); $this->view->captcha_id = $captcha->getId(); if ($this->getRequest()->isPost()) { $request = $this->getRequest()->getParams(); $error = $this->_checkForm($request); if (count($error) == 0) { $Contact = new Contact(); $Contact->merge($request); $Contact->save(); My_Plugin_Libs::setSplash('<b>Your request have been send to us. Thank you very much!</b>'); $this->_redirect($this->_helper->url('index', 'trainers', 'default')); } if (count($error)) { $this->view->error = $error; } } $this->view->Contact = $Contact; }
/** * Delete a Country */ public function deleteAction() { $Banner = Banner::getById($this->getRequest()->getParam('id')); if ($Banner) { if ($this->getRequest()->isPost()) { $Banner->delete(); $this->Member->log('Quảng cáo: ' . $Banner->name . '(' . $this->getRequest()->getParam('id') . ')', 'Xóa'); My_Plugin_Libs::setSplash('Quảng cáo: <b>' . $Banner->name . '</b> đã được xóa khỏi hệ thống.'); $this->_redirect($this->_helper->url('index', 'banner', 'admin')); } $this->view->Banner = $Banner; } }
public function profileAction() { $this->view->Title = "Edit personal information"; $this->view->headTitle($this->view->Title); $id = $this->Member->id; $Member = Members::getById($id); if ($this->getRequest()->isPost()) { $request = $this->getRequest()->getParams(); unset($request['id']); if ($request['password'] == '' || $request['password'] != $request['confirmpassword'] || $request['confirmpassword'] == '') { unset($request['password'], $request['confirmpassword']); $Member->merge($request); $Member->username = $Member->email; $Member->save(); } else { $Member->merge($request); $Member->username = $Member->email; $Member->encodePassword(); $Member->save(); } $this->Member->log('Edit member:' . $Member->getName() . '(' . $Member->id . ')', 'Member'); My_Plugin_Libs::setSplash('Member: <b>' . $Member->getName() . '</b> have successfull changed'); $this->_redirect($this->_helper->url('index', 'index', 'admin')); } $this->view->Member = $Member; }
public function deleteAction() { $Product = Color::getById($this->getRequest()->getParam('id')); if ($Product) { if ($this->getRequest()->isPost()) { $dir = new My_Plugin_Libs(); $name = $dir->trimSpacer($request['car_paint_color']); $dirname = "uploads/color/" . $name . "/" . $Product->image; if (is_file($dirname)) { @chmod($dirname, 0666); @unlink($dirname); } $Product->delete(); $this->Member->log('Phong thủy xe: ' . $Product->car_paint_color . '(' . $this->getRequest()->getParam('id') . ')', 'Xóa'); My_Plugin_Libs::setSplash('Phong thủy xe: <b>' . $Product->car_paint_color . '</b> đã được xóa khỏi hệ thống.'); $this->_redirect($this->_helper->url('index', 'color', 'admin')); } $this->view->Color = $Product; } }
public function deleteAction() { $Product = Product::getById($this->getRequest()->getParam('id')); if ($Product) { if ($this->getRequest()->isPost()) { $filename = "uploads/" . str_replace("", "-", $Product->product_name) . "/" . $Product->product_images; if (is_file($filename)) { chmod($filename, 0777); @unlink($filename); } $Product->delete(); $this->Member->log('Sản phẩm: ' . $Product->product_name . '(' . $this->getRequest()->getParam('id') . ')', 'Xóa'); My_Plugin_Libs::setSplash('Sản phẩm: <b>' . $Product->product_name . '</b> đã được xóa khỏi hệ thống.'); $this->_redirect($this->_helper->url('index', 'product', 'admin')); } $this->view->Product = $Product; } }
/** * Delete a news */ public function deleteAction() { $Content = News::getById($this->getRequest()->getParam('id')); if ($Content) { if ($this->getRequest()->isPost()) { $Content->delete(); $this->Member->log('News: ' . $Content->title . '(' . $this->getRequest()->getParam('id') . ')', 'Delete'); My_Plugin_Libs::setSplash('Delete: <b>' . $Content->title . '</b> have been completed.'); $this->_redirect($this->_helper->url('index', 'news', 'admin')); } $this->view->News = $Content; } }
public function advAction() { $this->view->Title = "Manage ads"; $this->view->headTitle($this->view->Title); if ($this->getRequest()->isPost()) { $rows = $this->getRequest()->getParam('adv'); //print_r($rows);die; $xml = '<?xml version="1.0" encoding="UTF-8"?>'; $xml .= "\n<xml>\n\t<data>"; foreach ($rows as $i => $row) { $xml .= "\n\t\t<{$i} limit=\"{$row['limit']}\" name=\"" . htmlspecialchars($row['name']) . "\">"; unset($row['name']); unset($row['limit']); foreach ($row as $item) { $xml .= "\n\t\t\t<adv>"; foreach ($item as $key => $value) { $xml .= "\n\t\t\t\t<{$key}><![CDATA[" . trim($value) . "]]></{$key}>"; } if (substr($item['file'], -3) == 'swf') { $xml .= "\n\t\t\t\t<type><![CDATA[swf]]></type>"; } else { $xml .= "\n\t\t\t\t<type><![CDATA[image]]></type>"; } $xml .= "\n\t\t\t</adv>"; } $xml .= "\n\t\t</{$i}>"; } $xml .= "\n\t</data>\n</xml>"; $fp = fopen(APPLICATION_PATH . 'data/adv.xml', 'w'); fwrite($fp, $xml); fclose($fp); My_Plugin_Libs::setSplash('Ads have been saved'); $this->Member->log('Change ads', 'Settings'); } $dir = ROOT_DIR . DATA_DIR . '/adv'; $this->view->Data = new Zend_Config_Xml(APPLICATION_PATH . 'data/adv.xml', 'data'); $this->view->Adv = self::getFileDir($dir); }
public function editcategoryAction() { $this->view->Title = "Sửa nhóm link"; $this->view->headTitle($this->view->Title); $ExchangeCategories = ExchangeCategories::getById($this->getRequest()->getParam('id')); if ($this->getRequest()->isPost()) { $ExchangeCategories->merge($_POST); echo $ExchangeCategories->save(); $this->Member->log('Create exchange categories:' . $ExchangeCategories->name . '(' . $ExchangeCategories->id . ')', 'Exchange'); My_Plugin_Libs::setSplash('Exchange categories: <b>' . $ExchangeCategories->name . '</b> đã được sửa. '); $this->_redirect($this->_helper->url('category', 'exchange', 'admin')); } $this->view->edit = $ExchangeCategories; }