public function renderView() { if (!isset($_SESSION['cart'])) { $cart = new Cart(); $_SESSION['cart'] = serialize($cart); } foreach ($this->model->getUris() as $key => $value) { if (preg_match("#^{$value}\$#", $this->uriView)) { if ($this->model->getView($key) === "PageView") { $pagecontroller = new PageController($this->additionalParam); $pagecontroller->renderView(); } else { if ($this->model->getView($key) === "ProductView") { $productscontroller = new ProductsController(); $productscontroller->renderView(); } else { if ($this->model->getView($key) === "SingleProductView") { $singleproductcontroller = new SingleProductController($this->additionalParam); $singleproductcontroller->renderView(); } else { if ($this->model->getView($key) === "LoginView") { $logincontroller = new LoginController($this->additionalParam); $logincontroller->renderView(); } else { if ($this->model->getView($key) === "CustomerView") { $customercontroller = new CustomerController(); $customercontroller->renderView(); } else { if ($this->model->getView($key) === "CartView") { $cartcontroller = new CartController($this->additionalParam); $cartcontroller->renderView(); } else { if ($this->model->getView($key) === "ContactView") { $contactcontroller = new ContactController($this->additionalParam); $contactcontroller->renderView(); } else { if ($this->model->getView($key) === "RegisterView") { $registrationcontroller = new RegistrationController($this->additionalParam); $registrationcontroller->renderView(); } else { if ($this->model->getView($key) === "CheckoutView") { $checkoutcontroller = new CheckoutController($this->additionalParam); $checkoutcontroller->renderView(); } else { $useView = $this->model->getView($key); $view = new $useView(); $view->render(); } } } } } } } } } } } }
public function index() { // echo "hii";die; $this->layout = ""; $data = $this->RestData(); $this->autoRender = false; $myObj = CJSON::decode($data, $useArray = false); $requested_service = $myObj->{"request_type_sent"}; $this->log("REQUEST:===>" . $data); // $this->log("Data Sent by User===>".$data); // echo $requested_service;die; switch ($requested_service) { case 'SMS_VERIFICATION': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->smsVerification($this->make_safe($myObj->{"mobile_no"}))); unset($userObj); break; case 'POST_INSTALLATION': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->postInstallation($this->make_safe($myObj->{"device_id"}), $this->make_safe($myObj->{"email_id"}), $this->make_safe($myObj->{"android_id"}), $this->make_safe($myObj->{"google_ad_id"}))); unset($userObj); break; case 'LOGIN_SERVICE': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->registerCustomer($this->make_safe($myObj->{"customer_id"}), $this->make_safe($myObj->{"mobile_no"}), $this->make_safe($myObj->{"device_id"}), $this->make_safe($myObj->{"referrer"}))); unset($userObj); break; case 'GET_CAMPAIGNS': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->getCampaignList($this->make_safe($myObj->{"customer_id"}))); unset($userObj); break; case 'GET_CUSTOMER_DETAILS': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->getCustomerDetails($this->make_safe($myObj->{"customer_id"}))); unset($userObj); break; case 'TEST_SERVICE': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->test()); unset($userObj); break; default: $data = "405"; $this->SetLog($data); break; } }
private function handleCustomerOperations($request) { //include_once data handling class include_once __DIR__ . '/../dataController/CustomerController.php'; //create a new customer object which carries out the further operations $customerController = new CustomerController(); //set data and header if (isset($request[1])) { $this->setResponseCodesAndData($customerController->getById($request[1]), 1); } else { $this->setResponseCodesAndData($customerController->getAll(), 1); } }
/** * Initialize the ModifyController class and their parents */ public function init() { try { parent::init(); } catch (Exception $e) { throw new Exception('Une erreur est survenue durant le chargement du module: ' . $e->getMessage()); } if (file_exists(_CONTROLLERS_DIR_ . '/Tools.php')) { $url = Tools::getInstance()->request_url; $controller = Tools::getInstance()->getUrl_controller($url); if ($controller == 'ModifyController') { if (file_exists(_CUSTOMERS_MODELS_ . '/' . $this->model_name . 'Model.php')) { if (file_exists(_CUSTOMERS_VIEWS_ . '/' . $this->view_name . '.tpl')) { try { require_once _CUSTOMERS_MODELS_ . '/' . $this->model_name . 'Model.php'; $id = Tools::getInstance()->getUrl_id($url); $data = \Customer\DisplayModel::getInstance()->display_customer($id); echo $this->twig->render($this->view_name . '.tpl', array('customer' => $data[0], 'bootstrapPath' => _BOOTSTRAP_FILE_)); } catch (Exception $e) { throw new Exception('Une erreur est survenue durant la récupération des données: ' . $e->getMessage()); } } else { throw new Exception('Le template "' . $this->view_name . '" n\'existe pas dans "' . _CUSTOMERS_VIEWS_ . '"!'); } } else { throw new Exception('Le modèle "' . $this->model_name . '" n\'existe pas dans "' . _CUSTOMERS_MODELS_ . '"!'); } } else { throw new Exception('Une erreur est survenue durant la phase de routage!'); } } else { throw new Exception('L\'URL n\'est pas évaluable!'); } }
/** * Initialize the ConfirmAddController class and their parents */ public function init() { try { parent::init(); } catch (Exception $e) { throw new Exception('Une erreur est survenue durant le chargement du module: ' . $e->getMessage()); } if (file_exists(_CONTROLLERS_DIR_ . '/Tools.php')) { $url = Tools::getInstance()->request_url; $url .= '&id=ukn'; $controller = Tools::getInstance()->getUrl_controller($url); if ($controller == 'ConfirmAddController') { if (file_exists(_CUSTOMERS_MODELS_ . '/' . $this->model_name . 'Model.php')) { try { require_once _CUSTOMERS_MODELS_ . '/' . $this->model_name . 'Model.php'; Tools::getInstance()->createPost($_POST); if (!empty($_POST['firstName']) && !empty($_POST['lastName']) && !empty($_POST['adress']) && !empty($_POST['zipCode']) && !empty($_POST['city']) && !empty($_POST['telephone'])) { \Customer\AddModel::getInstance()->add_customer($_POST['lastName'], $_POST['adress'], $_POST['zipCode'], $_POST['city'], $_POST['telephone'], $_POST['firstName']); header('Location: /Cas-M-Ping/customers/show/all'); } else { header('Location: /Cas-M-Ping/customers/add'); } } catch (Exception $e) { throw new Exception('Une erreur est survenue durant la modification des données: ' . $e->getMessage()); } } else { throw new Exception('Le modèle "' . $this->model_name . '" n\'existe pas dans "' . _CUSTOMERS_MODELS_ . '"!'); } } else { throw new Exception('Une erreur est survenue durant la phase de routage!'); } } else { throw new Exception('L\'URL n\'est pas évaluable!'); } }
/** * Initialize the AddController class and their parents */ public function init() { try { parent::init(); } catch (Exception $e) { throw new Exception('Une erreur est survenue durant le chargement du module: ' . $e->getMessage()); } if (file_exists(_CONTROLLERS_DIR_ . '/Tools.php')) { $url = Tools::getInstance()->request_url; $url .= '&id=ukn'; $controller = Tools::getInstance()->getUrl_controller($url); if ($controller == 'AddController') { if (file_exists(_CUSTOMERS_VIEWS_ . '/' . $this->view_name . '.tpl')) { try { echo $this->twig->render($this->view_name . '.tpl', array('bootstrapPath' => _BOOTSTRAP_FILE_)); } catch (Exception $e) { throw new Exception('Une erreur est survenue durant l\'affichage des données: ' . $e->getMessage()); } } else { throw new Exception('Le template "' . $this->view_name . '" n\'existe pas dans "' . _CUSTOMERS_VIEWS_ . '"!'); } } else { throw new Exception('Une erreur est survenue durant la phase de routage!'); } } else { throw new Exception('L\'URL n\'est pas évaluable!'); } }
public function __construct($registry) { parent::__construct($registry); if (!$this->getCurrentCustomer()->isLogged()) { $this->session->data['redirect'] = $this->selfUrl; $this->redirect($this->url->link('account/login', '', 'SSL')); throw new \Exception('Not logged in'); } }
public static function isLoginSuccessful() { $data = filter_input_array(INPUT_POST, CustomerController::getLoginRules()); if (CustomerController::checkValues($data)) { $username = $data["uname"]; $result = UsersDB::getPassword(["uporabnisko_ime" => $username]); if ($result != null && password_verify($data["password"], $result["geslo"]) && UsersDB::isCustomer(["uporabnik_id" => $result["id"]]) && UsersDB::isactivate(["id" => $result["id"]])) { session_start(); $_SESSION["active"] = TRUE; $_SESSION["role"] = "customer"; $_SESSION["id"] = $result["id"]; return true; } } return false; }
/** * Initialize the CustomerController class */ public function init() { if (self::$initialized) { return; } self::$initialized = true; if (file_exists(_TWIG_AUTOLOADER_)) { try { require_once _TWIG_AUTOLOADER_; Twig_Autoloader::register(); $loader = new Twig_Loader_Filesystem(array(_DEPENDENCIES_DIR_, _CUSTOMERS_VIEWS_)); $this->twig = new Twig_Environment($loader, array('cache' => _TWIG_CACHE_)); } catch (Exception $e) { throw new Exception('Le fichier de démarrage Twig ne peut pas s\'executer!'); } } else { throw new Exception('Il n\'existe pas le fichier de démarrage Twig à cet emplacement "' . _TWIG_AUTOLOADER_ . '"!'); } }
/** * Initialize the DeleteController class and their parents */ public function init() { try { parent::init(); } catch (Exception $e) { throw new Exception('Une erreur est survenue durant le chargement du module: ' . $e->getMessage()); } if (file_exists(_CONTROLLERS_DIR_ . '/Tools.php')) { $url = Tools::getInstance()->request_url; $controller = Tools::getInstance()->getUrl_controller($url); if ($controller == 'DeleteController') { if (file_exists(_CUSTOMERS_MODELS_ . '/' . $this->model_name . 'Model.php')) { try { require_once _CUSTOMERS_MODELS_ . '/' . $this->model_name . 'Model.php'; $id = Tools::getInstance()->getUrl_id($url); switch ($id) { case 'all': \Customer\DeleteModel::getInstance()->delete_Customers(); break; default: if (\Customer\DeleteModel::getInstance()->has_customer($id) == 1) { \Customer\DeleteModel::getInstance()->delete_Customer($id); } else { header('Location: /Cas-M-Ping/errors/404'); } break; } header('Location: /Cas-M-Ping/customers/show/all'); } catch (Exception $e) { throw new Exception('Une erreur est survenue durant la supression des données: ' . $e->getMessage()); } } else { throw new Exception('Le modèle "' . $this->model_name . '" n\'existe pas dans "' . _CUSTOMERS_MODELS_ . '"!'); } } else { throw new Exception('Une erreur est survenue durant la phase de routage!'); } } else { throw new Exception('L\'URL n\'est pas évaluable!'); } }
echo '<a href="SearchCustomers.php">بحث</a>'; ?> </td> </tr> <tr> <td> الزبائن الحاليين </td> </tr> <tr> <td height="150" valign="top" align="center"> <?php $AllCustomers = new CustomerController(); $AllCustomers->invoke(""); ?> </td> </tr> </table> </td> <td style="width:25%;" valign="top"> <?php $loginCtrl->LoggedOrNot(); ?> </td> </tr> </table> </td>
// echo json response echoRespnse(200, $response); }); $app->get('/merchant/:id/order/:id2', function ($id, $id2) use($app) { // check for required params $request = array(); $response = array(); $apiKey = array(); $headers = $app->request->headers->all(); verifyHeaders(array('Key')); // reading request params $apiKey = $headers['Key']; $request['apiKey'] = $apiKey; $request['restaurantID'] = $id; $request["orderID"] = $id2; $controller = new CustomerController(); // Call controller function $response = $controller->getOrder($request); // echo json response echoRespnse(200, $response); }); ///////////////////////////////////////////////////////////////////////////////// /* Should return CSV. Write a function that returns CSV instead of JSON $app->get('/merchant/:id/customersCSV', function($id) use ($app){ // check for required params $request = array(); $response = array(); $apiKey = array(); $headers = $app->request->headers->all();
public function screen_customer_modify_or_delete() { $CustomerController = new CustomerController($this->is_system); if (isset($_POST['submit1']) && $_POST['submit1'] == "更新") { $CustomerController->screen_company($this->auth); } else { if (isset($_POST['submit2']) && $_POST['submit2'] == "削除") { $this->screen_customer_delete(); } } }
<b><span class="pozdrav">Spremeni svoje podatke</span></b> </div> </div> </div> <div class="panel-body"> <div class="container-fluid"> <div class="row-fluid"> <div class="col-lg-12 col-md-12 col-sm-12"> <?php if ($form->isSubmitted() && $form->validate()) { try { $data = $form->getValue(); CustomerController::profile($data); } catch (PDOException $exc) { CustomerController::profile(); } } else { echo $form; } ?> </div> </div> </div> </div> </div> </div> </div> </div> </div> </body>
$custId = null; $personId = null; $addressId = null; $firstName = null; $surname = null; $phoneNumber = null; $mobileNumber = null; $emailAddress = null; $mailingList = null; $streetAddress = null; $suburb = null; $city = null; $postcode = null; $state = null; $addressDate = null; $custCon = new CustomerController(); $personCon = new PersonController(); $addressCon = new AddressController(); function checkSelected($id1, $id2) { if ($id1 == $id2) { echo 'selected'; } } if (isset($_GET['id'])) { $custId = $_GET['id']; $buyer = $custCon->getCustomer($custId); if ($buyer->errorInfo()[2] == null) { $row = $buyer->fetch(); $rowCount = count($row); if ($rowCount > 0) {
<?php /** * Backend page for administrators and Staff of Cyril's Classic Cars to add and view models */ require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'config/config.php'; if (isset($_SESSION['authenticated'])) { if ($_SESSION['authenticated'] == true) { $editResult = null; $custId = null; $personId = null; $firstName = null; $surname = null; $emailAddress = null; $mailingList = null; $custCon = new CustomerController(); $personCon = new PersonController(); $addressCon = new AddressController(); function checkSelected($id1, $id2) { if ($id1 == $id2) { echo 'selected'; } } if (isset($_GET['id'])) { $custId = $_GET['id']; $buyer = $custCon->getCustomer($custId); if ($buyer->errorInfo()[2] == null) { $row = $buyer->fetch(); $rowCount = count($row); if ($rowCount > 0) {
}); //Vastaanottajat $routes->post('/receiver', function () { ReceiverController::store(); }); $routes->get('/receiver/new', function () { ReceiverController::create(); }); $routes->get('/receiver', 'check_logged_in', function () { ReceiverController::index(); }); // Lähettäjät $routes->post('/customer', function () { CustomerController::store(); }); $routes->get('/customer/new', function () { CustomerController::create(); }); $routes->get('/customer', 'check_logged_in', function () { CustomerController::index(); }); // Listaa kaikki rahtikirjat $routes->get('/waybill', 'check_logged_in', function () { WaybillController::index(); }); $routes->get('/', 'check_logged_in', function () { HelloWorldController::index(); }); $routes->get('/hiekkalaatikko', function () { HelloWorldController::sandbox(); });
<?php /* * ----------------------------- * entrance of customer component/客户管理组件入口程序 * ----------------------------- * @author HollenMok * @date 2015/09/05 * */ require 'controller.php'; $controller = new CustomerController(); if ($task) { $controller->{$task}(); } else { $controller->display(); }
<?php class CustomerController { public function __construct() { } public function index() { include ROOT_PATH . "/views/customer/index.php"; } } $customercontroller = new CustomerController(); if (isset($_GET['m'])) { $method = $_GET['m']; } else { $method = "index"; } switch ($method) { case 'index': $customercontroller->index(); break; default: $customercontroller->index(); }
ViewHelper::redirect(BASE_URL); } }, "customer/checkout" => function () { if (isset($_SESSION["active"]) && $_SESSION["role"] == "customer") { if ($_SERVER["REQUEST_METHOD"] == "POST") { CustomerController::order(); } else { ViewHelper::redirect(BASE_URL . "customer/cart"); } } else { ViewHelper::redirect(BASE_URL); } }, "customer/checkout/order" => function () { if (isset($_SESSION["active"]) && $_SESSION["role"] == "customer") { if ($_SERVER["REQUEST_METHOD"] == "POST") { CustomerController::saveOrder(); } else { ViewHelper::redirect(BASE_URL . "customer/cart"); } } else { ViewHelper::redirect(BASE_URL); } }]; try { if (isset($urls[$path])) { $urls[$path](); } else { echo "No controller for '{$path}'"; } } catch (InvalidArgumentException $e) { var_dump($urls, $path);
/** * 公共数据 * @return string */ public function publicdata() { // $color = $this->changeCss(); // DB::table('color') // dd($color); $customer_info = CustomerInfo::where('cus_id', $this->cus_id)->first(); //===显示版本切换链接=== $templatesC = new TemplatesController(); $tempname = $templatesC->getTemplatesName($this->type); $flagPlatform = substr($tempname, 0, 2); $flagLanguage = substr($tempname, 2, 1); $tempscript = ''; $customerC = new CustomerController(); $domain = $customerC->getSwitchCustomer(); //双站用户 $current_url = '#'; $language_url = '#'; $tempscript_star = '<script>$(function(){'; $tempscript_end = '});</script>'; if (!empty($domain)) { if ($flagPlatform == 'GM') { //===手机 $language_url = $domain['switch_mobile_domain']; $current_url = $domain['current_mobile_domain']; } elseif ($flagPlatform == 'GP') { //===PC $language_url = $domain['switch_pc_domain']; $current_url = $domain['current_pc_domain']; } if ($flagLanguage == 9) { //===英文 $language = '<li><a href="' . $language_url . '">中文版</a></li>'; $language .= '<li><a href="' . $current_url . '">English</a></li>'; } elseif ($flagLanguage == 0) { //===中文 $language = '<li><a href="' . $current_url . '">中文版</a></li>'; $language .= '<li><a href="' . $language_url . '">English</a></li>'; } $language_div = '<div class="language_div">' . '<ul>' . $language . '</ul>' . '</div>'; // $tempscript = '$("#header").prepend(\'' . $language_div . '\');' // . '$("#header").css("position","relative");'; } $language_css = '<link rel="stylesheet" href="http://swap.5067.org/css/language.css">'; //===显示版本切换链接-end=== $formC = new FormController(); $formJS = $this->insetForm(); //===表单嵌入=== if ($this->type == 'pc') { $stylecolor = websiteInfo::leftJoin('color', 'color.id', '=', 'website_info.pc_color_id')->where('cus_id', $this->cus_id)->pluck('color_en'); $logo = $this->showtype == 'preview' ? '/customers/' . $this->customer . '/images/l/common/' . $customer_info->logo : $this->domain . '/images/l/common/' . $customer_info->logo; //'preview' ? asset('customers/' . $this->customer . '/images/l/common/' . $customer_info->logo) : $this->domain . '/images/l/common/' . $customer_info->logo; $floatadv = json_decode($customer_info->floatadv); //===浮动类型=== if (!empty($floatadv)) { foreach ((array) $floatadv as $key => $val) { if (!isset($val->type) || $val->type == 'adv') { if ($this->showtype == 'preview') { $floatadv[$key]->url = '/customers/' . $this->customer . '/images/l/common/' . $val->adv; //asset('customers/' . $this->customer . '/images/l/common/' . $val->adv); } else { $floatadv[$key]->url = $this->domain . '/images/l/common/' . $val->adv; } } elseif ($val->type == 'form') { $form_id = $val->adv; $formCdata = $formC->getFormdataForPrint($form_id); if (!empty($formCdata)) { $form_content = $formC->showFormHtmlForPrint($formCdata, 'float'); $floatadv[$key]->content = $form_content; $floatadv[$key]->cssjs = $formC->assignFormCSSandJSForPrint(); } } } } if (count($floatadv)) { $url = "http://swap.5067.org/floatadv_new.php"; // $url = "http://swap.5067.org/floatadv.php"; $post_data = json_encode($floatadv); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, array("data" => $post_data)); $floatadvprint = curl_exec($ch); curl_close($ch); } $headscript = $customer_info->pc_header_script; // $headscript .= $language_css; //===版权选择=== switch ($customer_info->copyright) { case 'en_xiamen': $_href = 'http://www.12t.cn/'; $_copyright = 'XIAMEN 12t NETWORK TECHNOLOGY CO., LTD.'; break; case 'en_huizhou': $_href = 'http://www.ydbaidu.net/'; $_copyright = 'HUIZHOU YIRUITONG NETWORK TECHNOLOGY CO., LTD.'; break; case 'cn_xiamen': $_href = 'http://www.12t.cn/'; $_copyright = '厦门易尔通网络科技有限公司'; break; case 'cn_huizhou': $_href = 'http://www.ydbaidu.net/'; $_copyright = '惠州易瑞通网络科技有限公司'; break; default: $_href = 'http://www.12t.cn/'; $_copyright = '厦门易尔通网络科技有限公司'; break; } switch ($customer_info->talent_support) { case 'en_rencai': $talent_support = 'Talent support:<a href="http://www.xgzrc.com/">www.xgzrc.com</a>'; break; case 'en_null': $talent_support = ''; break; case 'cn_rencai': $talent_support = '人才支持:<a href="http://www.xgzrc.com/">厦门人才网</a>'; break; case 'cn_null': $talent_support = ''; break; default: $talent_support = '人才支持:<a href="http://www.xgzrc.com/">厦门人才网</a>'; break; } if ($customer_info->lang == 'en') { $footprint = $customer_info->footer . '<p>Technology support:<a href="' . $_href . '">' . $_copyright . '</a> ' . $talent_support . '</p>'; } else { $footprint = $customer_info->footer . '<p>技术支持:<a href="' . $_href . '">' . $_copyright . '</a> ' . $talent_support . '</p>'; } //===版权选择_end=== $footscript = $customer_info->pc_footer_script; $footscript .= $formJS; $footscript .= '<script type="text/javascript" src="/quickbar/js/quickbar.js?' . $this->cus_id . 'pc"></script>'; // $footscript .= '<script type="text/javascript" src="http://swap.5067.org/admin/statis.php?cus_id=' . $this->cus_id . '&platform=pc"></script>'; //===添加统计代码PC=== if ($customer_info->background_music) { $bgm = str_replace('"', "", $customer_info->background_music); $footscript .= '<script type="text/javascript">$("body").append("<div id=\\"bg-music\\">' . $bgm . '</div>") $("#bg-music").css("display","none"); </script>'; } // $footscript .= $tempscript_star . $tempscript . $tempscript_end; // $footscript .= $language_css; $site_another_url = $this->showtype == 'preview' ? '' : $customer_info->mobile_domain; } else { $logo = $this->showtype == 'preview' ? '/customers/' . $this->customer . '/images/l/common/' . $customer_info->logo_small : $this->domain . '/images/l/common/' . $customer_info->logo_small; //'preview' ? asset('customers/' . $this->customer . '/images/l/common/' . $customer_info->logo_small) : $this->domain . '/images/l/common/' . $customer_info->logo_small; $stylecolor = websiteInfo::leftJoin('color', 'color.id', '=', 'website_info.mobile_color_id')->where('cus_id', $this->cus_id)->pluck('color_en'); $headscript = $customer_info->mobile_header_script; // $headscript .= $language_css; $footprint = $customer_info->mobile_footer; $footscript = $customer_info->mobile_footer_script; // $footscript .= $formJS; $footscript .= '<script type="text/javascript" src="/quickbar/js/quickbar.js?' . $this->cus_id . 'mobile"></script>'; // $footscript .= '<script type="text/javascript" src="http://swap.5067.org/admin/statis.php?cus_id=' . $this->cus_id . '&platform=mobile"></script>'; //===添加统计代码MOBILE=== // $footscript .= $tempscript; $site_another_url = $this->showtype == 'preview' ? '' : $customer_info->pc_domain; $config_arr = parse_ini_file(public_path('/templates/' . $this->themename) . '/config.ini', true); if (!is_array($config_arr)) { dd('【config.ini】文件不存在!文件格式说明详见:http://pme.eexx.me/doku.php?id=ued:template:config'); } } //获取global信息 if ($this->type == 'pc') { $global_data = $this->pagedata('global'); $global_data = $this->detailList($global_data); } else { $global_data = WebsiteConfig::where('cus_id', $this->cus_id)->where('type', 2)->where('template_id', $this->tpl_id)->pluck('value'); if ($global_data) { $global_data = unserialize($global_data); } else { $global_data = $this->mobilePageList('global', true); } //===对多图进行排序=== if (is_array($global_data)) { foreach ($global_data as $key => &$value) { if ($key == 'slidepics') { $slidepics_data = $value['value']; if (is_array($slidepics_data)) { foreach ($slidepics_data as $k => $v) { if (isset($v['sort'])) { $sort[$k] = is_numeric($v['sort']) ? $v['sort'] : 100; $value['value'][$k]['sort'] = is_numeric($v['sort']) ? $v['sort'] : 100; } else { $sort[$k] = 100; $value['value'][$k]['sort'] = 100; } } } array_multisort($sort, $slidepics_data); $value['value'] = $slidepics_data; } } } //===对多图进行排序_end=== if (count($global_data) > 0) { $quickbarKey = false; foreach ($global_data as $gkey => $gval) { if ($global_data[$gkey]['type'] == 'quickbar') { $quickbar = WebsiteConfig::where('cus_id', $this->cus_id)->where('key', 'quickbar')->pluck('value'); if ($quickbar) { $quickbar = unserialize($quickbar); foreach ($quickbar as $key => $val) { $quickbar[$key]['enable'] = intval($quickbar[$key]['enable_mobile']); if ($quickbar[$key]['type'] == 'tel') { $quickbar[$key]['link'] = "tel:" . $quickbar[$key]['data']; } elseif ($quickbar[$key]['type'] == 'sms') { $quickbar[$key]['link'] = "sms:" . $quickbar[$key]['data']; } elseif ($quickbar[$key]['type'] == 'im') { $qq = explode('|', $quickbar[$key]['data']); $qq = explode(':', $qq[0]); $qq = explode('@', $qq[1]); $quickbar[$key]['link'] = 'http://wpd.b.qq.com/cgi/get_m_sign.php?uin=' . $qq[0]; } elseif ($quickbar[$key]['type'] == 'map') { if ($quickbar[$key]['data'] != null) { $location = explode('|', $quickbar[$key]['data']); $address = explode(',', $location[1]); $quickbar[$key]['link'] = 'http://api.map.baidu.com/marker?location=' . $address[1] . ',' . $address[0] . '&title=目标位置&content=' . $location[0] . '&output=html'; } else { $address = CustomerInfo::where('cus_id', $this->cus_id)->pluck('address'); $quickbar[$key]['link'] = 'http://api.map.baidu.com/geocoder?address=' . $address . '&output=html'; } } elseif ($quickbar[$key]['type'] == 'link') { if ($quickbar[$key]['data'] != null) { $url_arr = explode('|', $quickbar[$key]['data']); $quickbar[$key]['link'] = $url_arr[0]; } } //TODO:删除enable_pc/enable_mobile键值 unset($quickbar[$key]['enable_pc']); unset($quickbar[$key]['enable_mobile']); } $quickbarKey = $gkey; } else { foreach ($global_data[$gkey]['value'] as $key => $val) { if ($global_data[$gkey]['value'][$key]['type'] == 'tel') { $global_data[$gkey]['value'][$key]['link'] = "tel:" . $global_data[$gkey]['value'][$key]['data']; } elseif ($global_data[$gkey]['value'][$key]['type'] == 'sms') { $global_data[$gkey]['value'][$key]['link'] = "sms:" . $global_data[$gkey]['value'][$key]['data']; } elseif ($global_data[$gkey]['value'][$key]['type'] == 'im') { $qq = explode('|', $global_data[$gkey]['value'][$key]['data']); $qq = explode(':', $qq[0]); $qq = explode('@', $qq[1]); $global_data[$gkey]['value'][$key]['link'] = 'http://wpd.b.qq.com/cgi/get_m_sign.php?uin=' . $qq[0]; } elseif ($global_data[$gkey]['value'][$key]['type'] == 'link') { $address = CustomerInfo::where('cus_id', $this->cus_id)->pluck('address'); $global_data[$gkey]['value'][$key]['link'] = 'http://api.map.baidu.com/geocoder?address=' . $address . '&output=html'; } } $quickbarKey = $gkey; $quickbar = $global_data[$gkey]['value']; } } elseif ($global_data[$gkey]['type'] == 'images' or $global_data[$gkey]['type'] == 'image') { $img = 1; foreach ($global_data[$gkey]['value'] as $img_key => $img_value) { if ($img_value) { $img = 0; } } if ($img) { $global_data[$gkey]['value'] = array(); } } } } $global_data = $this->detailList($global_data); $this->replaceUrl($global_data); if (!empty($quickbarKey)) { $global_data[$quickbarKey] = $quickbar; } } $contact = CustomerInfo::where('cus_id', $this->cus_id)->select('company', 'contact_name as name', 'mobile', 'telephone', 'fax', 'email as mail', 'qq', 'address')->first()->toArray(); if ($this->showtype == 'preview') { if ($this->type == 'pc') { $pc_domain = 'http://' . $_SERVER['HTTP_HOST'] . '/search-preview'; } else { $pc_domain = 'http://' . $_SERVER['HTTP_HOST'] . '/mobile/search-preview'; } } else { $pc_domain = $this->domain . '/search.php'; } $result = ['stylecolor' => $stylecolor, 'favicon' => $customer_info->favicon ? rtrim($this->source_dir, 'images/') . '/images/l/common/' . $customer_info->favicon : '', 'logo' => $logo, 'floatadvprint' => isset($floatadvprint) ? $floatadvprint : '', 'headscript' => $headscript, 'footprint' => $footprint, 'footscript' => $footscript, 'global' => $global_data, 'site_url' => $this->site_url, 'site_another_url' => str_replace('http://', '', $site_another_url) ? $site_another_url : '', 'contact' => $contact, 'search_action' => $pc_domain]; if ($this->type == 'pc') { $footer_navs = Classify::where('cus_id', $this->cus_id)->where('footer_show', 1)->select('id', 'type', 'img', 'icon', 'name', 'url', 'p_id', 'en_name', 'meta_description as description', 'open_page')->OrderBy('sort', 'asc')->get()->toArray(); $footer_navs = $this->toFooter($footer_navs, 0); $result['footer_navs'] = $footer_navs; $result['type'] = 'pc'; } return $result; }
</tr> <tr> <td> <form method="post" action="../View/Customers/SearchCustomers.php"> <input type="text" name="value" /> <input type="submit" name="search" value="بحث"/> </td> </tr> <tr> <td height="150" width="450" valign="top" align="center"> <?php $AllCustomers = new CustomerController(); if (isset($_POST['value']) && !$_POST['value'] == "") { $AllCustomers->invoke($_POST['value']); } ?> </td> </tr> </table> </td> <td style="width:25%;" valign="top"> <?php $loginCtrl->LoggedOrNot(); ?> </td>
public function printSales() { $sales = $this->getSales(); $offerCon = new OfferController(); $sellerCon = new SellerController(); $custCon = new CustomerController(); $personCon = new PersonController(); $carCon = new CarController(); if ($sales->errorInfo()[2] == null) { $rows = $sales->fetchAll(); $rowCount = count($rows); if ($rowCount > 0) { ?> <table class="table table-responsive table-hover"> <tr> <th>Sale Date</th><th>Car Rego</th><th>Seller</th><th>Buyer</th><th>Sold Price</th><th>Actions</th> </tr> <?php foreach ($rows as $row) { $offer = $offerCon->getOffer($row['offer_id']); $offerRow = $offer->fetch(); if (count($offerRow) > 0) { $buyer = $custCon->getCustomer($row['customer_id']); $buyerRow = $buyer->fetch(); if (count($buyerRow) > 0) { $person = $personCon->getPerson($buyerRow['person_id']); $personRow = $person->fetch(); $buyerName = $personRow['first_name'] . ' ' . $personRow['surname']; $seller = $sellerCon->getSeller($offerRow['seller_id']); $sellerRow = $seller->fetch(); if (count($sellerRow) > 0) { $person = $personCon->getPerson($sellerRow['person_id']); $personRow = $person->fetch(); if (count($personRow) > 0) { $car = $carCon->getCar($offerRow['car_id']); $carRow = $car->fetch(); if (count($carRow) > 0) { ?> <tr> <td><?php echo $row['sale_date']; ?> </td><td><?php echo $carRow['rego_number']; ?> </td><td><?php echo $personRow['first_name'] . ' ' . $personRow['surname']; ?> </td><td><?php echo $buyerName; ?> </td><td>$<?php echo ucfirst($row['total_price']); ?> </td><td><a href="./edit.php?id=<?php echo $row['sale_id']; ?> " class="btn btn-primary"><span class="glyphicon glyphicon-edit"></span> Edit</a> <a href="./delete.php?id=<?php echo $row['sale_id']; ?> " class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span> Delete</a></td> </tr> <?php } else { ?> <div class="alert alert-danger" role="alert"> <strong>Uh oh!</strong> The database returned the following error:<br/> <em><?php echo $carRow->errorInfo()[2]; ?> </em> </div> <?php } } else { ?> <div class="alert alert-danger" role="alert"> <strong>Uh oh!</strong> The database returned the following error:<br/> <em><?php echo $personRow->errorInfo()[2]; ?> </em> </div> <?php } } else { ?> <div class="alert alert-danger" role="alert"> <strong>Uh oh!</strong> The database returned the following error:<br/> <em><?php echo $sellerRow->errorInfo()[2]; ?> </em> </div> <?php } } else { ?> <div class="alert alert-danger" role="alert"> <strong>Uh oh!</strong> The database returned the following error:<br/> <em><?php echo $buyerRow->errorInfo()[2]; ?> </em> </div> <?php } } else { ?> <div class="alert alert-danger" role="alert"> <strong>Uh oh!</strong> The database returned the following error:<br/> <em><?php echo $offerRow->errorInfo()[2]; ?> </em> </div> <?php } } ?> </table> <?php } else { ?> <div class="alert alert-info" role="alert"> <strong>No results.</strong> There are no sales to display<br/> Use the form above to add some. </div> <?php } } else { ?> <div class="alert alert-danger" role="alert"> <strong>Uh oh!</strong> The database returned the following error:<br/> <em><?php echo $sales->errorInfo()[2]; ?> </em> </div> <?php } $sales->closeCursor(); }
include ROOT_PATH . "/views/customer/index.php"; } public function elex() { include ROOT_PATH . "/views/customer/electronics.php"; } public function clothes() { include ROOT_PATH . "/views/customer/clothes.php"; } public function mobile() { include ROOT_PATH . "/views/customer/mobile.php"; } } $customercontroller = new CustomerController(); if (isset($_GET['m'])) { $method = $_GET['m']; } else { $method = "index"; } switch ($method) { case 'index': $customercontroller->index(); break; case 'elex': $customercontroller->elex(); break; case 'clothes': $customercontroller->clothes(); break;
include_once 'controller/UserController.php'; include_once 'controller/ShoppingCartController.php'; include_once 'controller/ProductController.php'; include_once 'controller/CustomerController.php'; include_once 'controller/OrderController.php'; //Session wird gestartet session_start(); //op = operation, Server übergibt den wert von 'op', von allen Server Variablen($_POST,$_GET,usw.) @($op = $_REQUEST['op']); //pr = productnummer die vom Shop ausgewählt wird, -1 weil Index bei 0 anfängt @($pr = $_REQUEST['pr'] - 1); //Controllers werden instanziert, damit wir ihre Funktionen im index brauchen können $user_controller = new UserController(); $cart_controller = new ShoppingCartController(); $prod_controller = new ProductController(); $cust_controller = new CustomerController(); $order_controller = new orderController(); /******************************* Anhand des Wertes von op, also der gesuchten Funktion im Index, werden auf verschiedene Seiten gezeigt und /oder verschiedene Funktionen eines Controllers durchgeführt. z.B versucht der User einzuloggen wird im Forumular über $_POST login button (mit name "op"!)die login Funktion des Indexes aufgerufen. Ist die Authentifizierung erfolgreich wird der User auf den Shop (ShopView.php) verlinkt. Alle Verlinkungen verlaufen durch den Index. ******************************/ switch ($op) { //verweist einen leeren op an die Loginseite (erste Ladung des Shops) case "": header("Location:./view/LoginView.php"); break;
<?php /** * Created by PhpStorm. * User: roessler * Date: 16/09/15 * Time: 1:22 PM */ /** * Backend page for administrators and Staff of Cyril's Classic Cars to add and view buyers */ require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'config/config.php'; if (isset($_SESSION['authenticated'])) { if ($_SESSION['authenticated'] == true) { $addResult = null; $custCon = new CustomerController(); $personCon = new PersonController(); $addressCon = new AddressController(); if (isset($_POST['hdnAction'])) { if ($_POST['hdnAction'] == 'insert') { if (!isset($_POST['chkMailingList'])) { $chkMailingList = 0; } else { $chkMailingList = $_POST['chkMailingList']; } $result = $personCon->insertPerson($_POST['txtFirstName'], $_POST['txtSurname'], $_POST['txtPhone'], $_POST['txtMobile'], $_POST['txtEmail'], $chkMailingList); $personId = $result['personId']; if ($result['stmt']->errorInfo()[2] == null) { $custResult = $custCon->insertCustomer($personId); if ($custResult->errorInfo()[2] == null) { $addressResult = $addressCon->insertAddress($_POST['txtStreetAddress'], $_POST['txtSuburb'], $_POST['txtCity'], $_POST['txtPostcode'], $_POST['txtState'], $personId);
<?php /** * Created by IntelliJ IDEA. * User: Pranav * Date: 27-03-2016 * Time: 16:03 */ require_once 'CustomerController.php'; $data = json_decode($_GET['data']); if (!isset($_SESSION['token'])) { session_start(); } $userId = $_SESSION['token']; $opt = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC); //echo json_encode($data); switch ($data->operation) { case 'addCustomer': CustomerController::saveCustomer(null, $data->data); break; case 'getCustomerDetails': CustomerController::getAllCustomerBySearch($data->searchKeyword, $data->searchBy); break; case 'modifyCustomer': //echo(json_encode($data->custId)); CustomerController::updateCustomer($data->data->customer_id, $data->data); break; case "getCustomerList": CustomerController::getCustomerList(); break; }
<?php /************************************************* * 募集企業実行スクリプト * */ define('_ROOT_DIR', __DIR__ . '/'); require_once _ROOT_DIR . '../php_lib/init.php'; $controller = new CustomerController(); $controller->run(); exit;
/** * Created by PhpStorm. * User: roessler * Date: 16/09/15 * Time: 1:22 PM */ /** * Backend page for administrators and Staff of Cyril's Classic Employees to edit employees */ require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'config/config.php'; if (isset($_SESSION['authenticated'])) { if ($_SESSION['authenticated'] == true) { $editResult = null; $sellerCon = new SellerController(); $custCon = new CustomerController(); $personCon = new PersonController(); $offerCon = new OfferController(); $featureCon = new FeatureController(); $foCon = new Feature_OfferController(); $mediaCon = new MediaController(); $carCon = new CarController(); $makeCon = new MakeController(); $modelCon = new ModelController(); $saleCon = new SaleController(); $empCon = new EmployeeController(); $saleId = null; $offerId = null; $buyerId = null; $empId = null; $carId = null;
<?php require 'Controller/CustomerController.php'; $customerController = new CustomerController(); if (isset($_POST['types'])) { $customerTables = $customerController->CreateCustomerTables($_POST['types']); } else { $customerTables = $customerController->CreatecustomerTables('%'); } $title = 'Customer overview'; $content = $customerController->CreatecustomerDropdownList() . $customerTables; include 'CustomerInfo.php';