本文整理汇总了PHP中FrontController::process方法的典型用法代码示例。如果您正苦于以下问题:PHP FrontController::process方法的具体用法?PHP FrontController::process怎么用?PHP FrontController::process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrontController
的用法示例。
在下文中一共展示了FrontController::process方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process()
{
parent::process();
$multipleAddressesFormated = array();
$ordered_fields = array();
$customer = new Customer((int) self::$cookie->id_customer);
if (!Validate::isLoadedObject($customer)) {
die(Tools::displayError('Customer not found'));
}
// Retro Compatibility Theme < 1.4.1
self::$smarty->assign('addresses', $customer->getAddresses((int) self::$cookie->id_lang));
$customerAddressesDetailed = $customer->getAddresses((int) self::$cookie->id_lang);
$total = 0;
foreach ($customerAddressesDetailed as $addressDetailed) {
$address = new Address($addressDetailed['id_address']);
$multipleAddressesFormated[$total] = AddressFormat::getFormattedLayoutData($address);
unset($address);
++$total;
// Retro theme < 1.4.2
$ordered_fields = AddressFormat::getOrderedAddressFields($addressDetailed['id_country'], false, true);
}
// Retro theme 1.4.2
if ($key = array_search('Country:name', $ordered_fields)) {
$ordered_fields[$key] = 'country';
}
self::$smarty->assign('addresses_style', array('company' => 'address_company', 'vat_number' => 'address_company', 'firstname' => 'address_name', 'lastname' => 'address_name', 'address1' => 'address_address1', 'address2' => 'address_address2', 'city' => 'address_city', 'country' => 'address_country', 'phone' => 'address_phone', 'phone_mobile' => 'address_phone_mobile', 'alias' => 'address_title'));
self::$smarty->assign(array('multipleAddresses' => $multipleAddressesFormated, 'ordered_fields' => $ordered_fields));
unset($customer);
}
示例2: process
public function process()
{
parent::process();
$this->productSort();
$nbProducts = Product::getPricesDrop((int) self::$cookie->id_lang, NULL, NULL, true);
$this->pagination($nbProducts);
self::$smarty->assign(array('products' => Product::getPricesDrop((int) self::$cookie->id_lang, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize('home')));
}
示例3: process
public function process()
{
parent::process();
//echo "vao day";die;
if (self::$cookie->RoleID == 1) {
Tools::redirect('hotelpage.php?mid=' . self::$cookie->HotelID);
}
$continentCode = Tools::getUserContinentCode(self::$cookie->CompanyID);
$search_form = array();
$search_form['CityId'] = 0;
$search_form['AreaId'] = 0;
if ((self::$cookie->RoleID == 2 || self::$cookie->RoleID == 3) && self::$cookie->OldLoginUserName == NULL) {
$search_form['CheckIn'] = date('Y-m-d', strtotime(date('Y-m-d') . " + 5 days"));
$search_form['Nights'] = 1;
$search_form['CheckOut'] = date('Y-m-d', strtotime($search_form['CheckIn'] . " + {$search_form['Nights']} days"));
}
$search_form['HotelClassId'] = 0;
$search_form['HotelName'] = '';
$search_form['ContinentCode'] = $continentCode;
$roomtype_list = RoomPlan::getRoomTypeList();
$roomtype_form_list = array();
foreach ($roomtype_list as $roomtype) {
$roomTypeId = $roomtype['RoomTypeId'];
$roomtype_form_list[$roomTypeId] = 0;
}
$search_form['RoomTypeVals'] = $roomtype_form_list;
self::$smarty->assign("roomTypeList", $roomtype_list);
self::$smarty->assign("search_form", $search_form);
self::$smarty->assign("classList", Tools::getAllHotelClasses());
self::$smarty->assign("areaList", Tools::getJapanAreas());
//get Hotel List and Promotion List
$promotionList = Promotion::getHomePromotionList(Promotion::$TYPE_PROMOTION);
self::$smarty->assign('homePromotionList', $promotionList);
$eventList = Promotion::getHomePromotionList(Promotion::$TYPE_EVENT);
self::$smarty->assign('homeEventList', $eventList);
// Get Popular Hotel List
$poList = HotelDetail::getPopularHotelList(3);
// 東京・横浜 - 関東 areaid = 3
$popularList = array();
global $cookie;
$iso = Language::getIsoById((int) $cookie->LanguageID);
foreach ($poList as $popular) {
$image = HotelDetail::getFirstFileOfHotel($popular['HotelId'], 150, 150);
if (is_file(_TAS_ROOT_DIR_ . "/asset/" . $image['w5_path'])) {
$popular['HotelFilePath'] = $image['w5_path'];
$popular['w5'] = $image['w5'];
$popular['h5'] = $image['h5'];
}
$popular['LowestPrice'] = HotelDetail::getLowestPriceOfHotel($popular['HotelId']);
$popular['AreaName'] = HotelDetail::getAreaName($popular['HotelArea']);
$HotelNameKey = 'HotelName_' . $iso;
$popular['HotelName'] = $popular[$HotelNameKey];
$popularList[] = $popular;
}
//self::$smarty->assign('homeAreaList', Db::getInstance()->ExecuteS("select *, AreaName_".$this->iso." as AreaName from HT_Area where AreaId in (3, 5, 8, 12)"));
self::$smarty->assign('homeAreaList', Db::getInstance()->ExecuteS('select *, AreaName_' . $this->iso . ' as AreaName from `HT_Area` where isPopular = 1'));
self::$smarty->assign("popularList", $popularList);
}
示例4: process
public function process()
{
parent::process();
if (Tools::isSubmit('SubmitForgotpassword')) {
$email = Tools::getValue("email");
if (!$email) {
$this->errors[] = Tools::displayError('email is required');
} else {
$result = Member::checkReset($email);
if ($result) {
$to = $email;
$headers = 'From: web@tas-agent.com' . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: text/html; charset=utf-8' . "\r\n";
$url = 'http://' . $_SERVER['HTTP_HOST'] . '/resetpassword.php?code=' . base64_encode($result['Password'] . '#_#' . $email);
if ($result['LanguageID'] == 1) {
$subject = 'TAS-Agent - Password reset';
$message = 'Dear ' . $result['Name'] . ":<br/><br/>";
$message .= 'Please click below to reset your password of TAS Agent as requested.' . "<br/>";
$message .= '<a href="' . $url . '">' . $url . "</a><br/>";
$message .= 'Thank you for using TAS-Agent' . "<br/><br/>";
$message .= 'TAS Agent Team';
} else {
if ($result['LanguageID'] == 2) {
$subject = 'TAS-Agent - 重置密码';
$message = '您好:' . $result['Name'] . "<br/><br/>";
$message .= '请点击如下链接重置您的TAS Agent账户信息。' . "<br/>";
$message .= '<a href="' . $url . '">' . $url . "</a><br/>";
$message .= '感谢您使用TAS-Agent' . "<br/><br/>";
$message .= 'TAS Agent 团队';
} else {
if ($result['LanguageID'] == 3) {
$subject = 'TAS-Agent - 重置密碼';
$message = '您好 ' . $result['Name'] . "<br/><br/>";
$message .= '請點擊如下鏈接重置您的TAS Agent帳戶信息。' . "<br/>";
$message .= '感謝您使用TAS-Agent' . "<br/><br/>";
$message .= 'TAS Agent 團隊';
} else {
$subject = 'TAS-Agent - パスワードリセット';
$message = $result['Name'] . " 様<br/><br/>";
$message .= '下記リンクをクリックしTAS Agentのパスワードを再設定してください。' . "<br/>";
$message .= '<a href="' . $url . '">' . $url . "</a><br/><br/>";
$message .= 'TAS-Agentのご利用ありがとうございます。' . "<br/><br/>";
$message .= 'TAS Agent Team';
}
}
}
Tools::sendEmail($to, $subject, $message);
//@mail($to, $subject, $message, $headers);
self::$smarty->assign("LanguageID", $result['LanguageID']);
$this->success = true;
} else {
$this->errors[] = Tools::displayError('Your email address is not registered.');
}
}
}
}
示例5: process
public function process()
{
parent::process();
self::$smarty->assign(array('is_guest' => self::$cookie->is_guest, 'HOOK_ORDER_CONFIRMATION' => Hook::orderConfirmation((int) $this->id_order), 'HOOK_PAYMENT_RETURN' => Hook::paymentReturn((int) $this->id_order, (int) $this->id_module)));
if (self::$cookie->is_guest) {
self::$smarty->assign(array('id_order' => $this->id_order, 'id_order_formatted' => sprintf('#%06d', $this->id_order)));
/* If guest we clear the cookie for security reason */
self::$cookie->mylogout();
}
}
示例6: process
public function process()
{
parent::process();
if ($id_order = Tools::getValue('id_order') and $email = Tools::getValue('email')) {
$order = new Order((int) $id_order);
if (!Validate::isLoadedObject($order)) {
$this->errors[] = Tools::displayError('Invalid order');
} elseif (!$order->isAssociatedAtGuest($email)) {
$this->errors[] = Tools::displayError('Invalid order');
} else {
$customer = new Customer((int) $order->id_customer);
$id_order_state = (int) $order->getCurrentState();
$carrier = new Carrier((int) $order->id_carrier, (int) $order->id_lang);
$addressInvoice = new Address((int) $order->id_address_invoice);
$addressDelivery = new Address((int) $order->id_address_delivery);
$inv_adr_fields = AddressFormat::getOrderedAddressFields($addressInvoice->id_country);
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($addressDelivery->id_country);
$invoiceAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($addressInvoice, $inv_adr_fields);
$deliveryAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($addressDelivery, $dlv_adr_fields);
if ($order->total_discounts > 0) {
self::$smarty->assign('total_old', (double) ($order->total_paid - $order->total_discounts));
}
$products = $order->getProducts();
$customizedDatas = Product::getAllCustomizedDatas((int) $order->id_cart);
Product::addCustomizationPrice($products, $customizedDatas);
$this->processAddressFormat($addressDelivery, $addressInvoice);
self::$smarty->assign(array('shop_name' => Configuration::get('PS_SHOP_NAME'), 'order' => $order, 'return_allowed' => false, 'currency' => new Currency($order->id_currency), 'order_state' => (int) $id_order_state, 'invoiceAllowed' => (int) Configuration::get('PS_INVOICE'), 'invoice' => OrderState::invoiceAvailable((int) $id_order_state) and $order->invoice_number, 'order_history' => $order->getHistory((int) self::$cookie->id_lang, false, true), 'products' => $products, 'discounts' => $order->getDiscounts(), 'carrier' => $carrier, 'address_invoice' => $addressInvoice, 'invoiceState' => (Validate::isLoadedObject($addressInvoice) and $addressInvoice->id_state) ? new State((int) $addressInvoice->id_state) : false, 'address_delivery' => $addressDelivery, 'deliveryState' => (Validate::isLoadedObject($addressDelivery) and $addressDelivery->id_state) ? new State((int) $addressDelivery->id_state) : false, 'is_guest' => true, 'group_use_tax' => Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC, 'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_, 'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_, 'use_tax' => Configuration::get('PS_TAX'), 'customizedDatas' => $customizedDatas, 'invoiceAddressFormatedValues' => $invoiceAddressFormatedValues, 'deliveryAddressFormatedValues' => $deliveryAddressFormatedValues));
if ($carrier->url and $order->shipping_number) {
self::$smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
}
self::$smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order)));
Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
if (Tools::isSubmit('submitTransformGuestToCustomer')) {
$customer = new Customer((int) $order->id_customer);
if (!Validate::isLoadedObject($customer)) {
$this->errors[] = Tools::displayError('Invalid customer');
}
if (!$customer->transformToCustomer(self::$cookie->id_lang, Tools::getValue('password'))) {
$this->errors[] = Tools::displayError('An error occurred while transforming guest to customer.');
}
if (!Tools::getValue('password')) {
$this->errors[] = Tools::displayError('Invalid password');
} else {
self::$smarty->assign('transformSuccess', true);
}
}
}
if (sizeof($this->errors)) {
/* Handle brute force attacks */
sleep(1);
}
}
self::$smarty->assign(array('action' => 'guest-tracking.php', 'errors' => $this->errors));
}
示例7: process
public function process()
{
global $cookie;
parent::process();
$swhere = parent::getSearchWhere();
$featureCount = HotelFeature::getFeatureCount($swhere);
$this->pagination($featureCount);
$hotelList = HotelFeature::getFeatureList($swhere, $this->p, $this->n);
self::$smarty->assign("listData", $hotelList);
self::$smarty->assign("featureList", $this->FeatureType);
}
示例8: process
public function process()
{
parent::process();
//Clean compare product table
CompareProduct::cleanCompareProducts('week');
$hasProduct = false;
if (!Configuration::get('PS_COMPARATOR_MAX_ITEM')) {
return Tools::redirect('404.php');
}
if ($product_list = Tools::getValue('compare_product_list') and $postProducts = isset($product_list) ? rtrim($product_list, '|') : '') {
$ids = array_unique(explode('|', $postProducts));
} elseif (isset(self::$cookie->id_customer)) {
$ids = CompareProduct::getCustomerCompareProducts(self::$cookie->id_customer);
} elseif (isset(self::$cookie->id_guest)) {
$ids = CompareProduct::getGuestCompareProducts(self::$cookie->id_guest);
} else {
$ids = null;
}
if ($ids) {
if (sizeof($ids) > 0) {
if (sizeof($ids) > Configuration::get('PS_COMPARATOR_MAX_ITEM')) {
$ids = array_slice($ids, 0, Configuration::get('PS_COMPARATOR_MAX_ITEM'));
}
$listProducts = array();
$listFeatures = array();
foreach ($ids as $id) {
$curProduct = new Product((int) $id, true, (int) self::$cookie->id_lang);
if (!Validate::isLoadedObject($curProduct)) {
continue;
}
if (!$curProduct->active) {
unset($ids[$k]);
continue;
}
foreach ($curProduct->getFrontFeatures(self::$cookie->id_lang) as $feature) {
$listFeatures[$curProduct->id][$feature['id_feature']] = $feature['value'];
}
$cover = Product::getCover((int) $id);
$curProduct->id_image = Tools::htmlentitiesUTF8(Product::defineProductImage(array('id_image' => $cover['id_image'], 'id_product' => $id), self::$cookie->id_lang));
$curProduct->allow_oosp = Product::isAvailableWhenOutOfStock($curProduct->out_of_stock);
$listProducts[] = $curProduct;
}
if (sizeof($listProducts) > 0) {
$width = 80 / sizeof($listProducts);
$hasProduct = true;
$ordered_features = Feature::getFeaturesForComparison($ids, self::$cookie->id_lang);
self::$smarty->assign(array('ordered_features' => $ordered_features, 'product_features' => $listFeatures, 'products' => $listProducts, 'link' => new Link(), 'width' => $width, 'homeSize' => Image::getSize('home')));
self::$smarty->assign('HOOK_EXTRA_PRODUCT_COMPARISON', Module::hookExec('extraProductComparison', array('list_ids_product' => $ids)));
}
}
}
self::$smarty->assign('hasProduct', $hasProduct);
}
示例9: process
public function process()
{
parent::process();
$discounts = Discount::getCustomerDiscounts((int) self::$cookie->id_lang, (int) self::$cookie->id_customer, true, false);
$nbDiscounts = 0;
foreach ($discounts as $discount) {
if ($discount['quantity_for_user']) {
$nbDiscounts++;
}
}
self::$smarty->assign(array('nbDiscounts' => (int) $nbDiscounts, 'discount' => $discounts));
}
示例10: process
public function process()
{
global $cookie;
parent::process();
$member = new Member();
$member->getByLoginUserName($cookie->LoginUserName);
$swhere = parent::getSearchWhere();
$agentCount = $member->getAdminCount($swhere);
$this->pagination($agentCount);
$hotelList = $member->getAdminList($swhere, $this->p, $this->n);
self::$smarty->assign("listData", $hotelList);
}
示例11: process
public function process()
{
parent::process();
self::$smarty->assign('categoriesTree', Category::getRootCategory()->recurseLiteCategTree(0));
self::$smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory(_USER_ID_LANG_, 1, 1, 1));
self::$smarty->assign('voucherAllowed', (int) Configuration::get('PS_VOUCHERS'));
$blockmanufacturer = Module::getInstanceByName('blockmanufacturer');
$blocksupplier = Module::getInstanceByName('blocksupplier');
self::$smarty->assign('display_manufacturer_link', (int) $blockmanufacturer->id ? true : false);
self::$smarty->assign('display_supplier_link', (int) $blocksupplier->id ? true : false);
self::$smarty->assign('PS_DISPLAY_SUPPLIERS', Configuration::get('PS_DISPLAY_SUPPLIERS'));
self::$smarty->assign('display_store', Configuration::get('PS_STORES_DISPLAY_SITEMAP'));
}
示例12: process
public function process()
{
parent::process();
if ($orders = Order::getCustomerOrders((int) self::$cookie->id_customer)) {
foreach ($orders as &$order) {
$myOrder = new Order((int) $order['id_order']);
if (Validate::isLoadedObject($myOrder)) {
$order['virtual'] = $myOrder->isVirtual(false);
}
}
}
self::$smarty->assign(array('orders' => $orders, 'invoiceAllowed' => (int) Configuration::get('PS_INVOICE'), 'slowValidation' => Tools::isSubmit('slowvalidation')));
}
示例13: process
public function process()
{
parent::process();
if (Tools::isSubmit('email')) {
if (!($email = Tools::getValue('email')) or !Validate::isEmail($email)) {
$this->errors[] = Tools::displayError('Invalid e-mail address');
} else {
$customer = new Customer();
$customer->getByemail($email);
if (!Validate::isLoadedObject($customer)) {
$this->errors[] = Tools::displayError('There is no account registered to this e-mail address.');
} else {
if (strtotime($customer->last_passwd_gen . '+' . (int) ($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')) . ' minutes') - time() > 0) {
$this->errors[] = Tools::displayError('You can regenerate your password only every') . ' ' . (int) $min_time . ' ' . Tools::displayError('minute(s)');
} else {
if (Mail::Send((int) self::$cookie->id_lang, 'password_query', Mail::l('Password query confirmation'), array('{email}' => $customer->email, '{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{url}' => self::$link->getPageLink('password.php', true) . '?token=' . $customer->secure_key . '&id_customer=' . (int) $customer->id), $customer->email, $customer->firstname . ' ' . $customer->lastname)) {
self::$smarty->assign(array('confirmation' => 2, 'email' => $customer->email));
} else {
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
}
}
}
}
} elseif (($token = Tools::getValue('token')) && ($id_customer = (int) Tools::getValue('id_customer'))) {
$email = Db::getInstance()->getValue('SELECT `email` FROM ' . _DB_PREFIX_ . 'customer c WHERE c.`secure_key` = \'' . pSQL($token) . '\' AND c.id_customer = ' . (int) $id_customer);
if ($email) {
$customer = new Customer();
$customer->getByemail($email);
if (strtotime($customer->last_passwd_gen . '+' . (int) ($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')) . ' minutes') - time() > 0) {
Tools::redirect('authentication.php?error_regen_pwd');
} else {
$customer->passwd = Tools::encrypt($password = Tools::passwdGen((int) MIN_PASSWD_LENGTH));
$customer->last_passwd_gen = date('Y-m-d H:i:s', time());
if ($customer->update()) {
if (Mail::Send((int) self::$cookie->id_lang, 'password', Mail::l('Your password'), array('{email}' => $customer->email, '{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{passwd}' => $password), $customer->email, $customer->firstname . ' ' . $customer->lastname)) {
self::$smarty->assign(array('confirmation' => 1, 'email' => $customer->email));
} else {
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
}
} else {
$this->errors[] = Tools::displayError('An error occurred with your account and your new password cannot be sent to your e-mail. Please report your problem using the contact form.');
}
}
} else {
$this->errors[] = Tools::displayError('We cannot regenerate your password with the data you submitted');
}
} elseif (($token = Tools::getValue('token')) || ($id_customer = Tools::getValue('id_customer'))) {
$this->errors[] = Tools::displayError('We cannot regenerate your password with the data you submitted');
}
}
示例14: process
public function process()
{
parent::process();
self::$smarty->assign("code", Tools::getValue("code"));
$code = Tools::getValue("code");
$code = explode('#_#', base64_decode($code));
if (time() > $code[0]) {
$this->expired = true;
}
if (Tools::isSubmit('SubmitResetpassword')) {
$password = Tools::getValue("password");
$confirm = Tools::getValue("confirm");
$code = Tools::getValue("code");
if (!$password) {
$this->errors[] = Tools::displayError('password is required');
} else {
if (!$confirm) {
$this->errors[] = Tools::displayError('confirm password is required');
} else {
if (!$code) {
$this->errors[] = Tools::displayError('Invalid Access!!');
} else {
if ($password != $confirm) {
$this->errors[] = Tools::displayError('Password confirmation is not mismatch');
} else {
$code = explode('#_#', base64_decode($code));
if (time() > $code[0]) {
$this->errors[] = Tools::displayError('Check code has expired!');
$this->expired = true;
} else {
$result = Member::checkReset($code[1]);
if ($result) {
if (Member::resetPassword($code[1], $password)) {
self::$smarty->assign("LanguageID", $result['LanguageID']);
$this->success = true;
} else {
$this->errors[] = Tools::displayError('Invalid Access!!');
}
} else {
$this->errors[] = Tools::displayError('Invalid check code!!');
}
}
}
}
}
}
}
}
示例15: process
public function process()
{
parent::process();
$customer = new Customer((int) self::$cookie->id_customer);
if (!Validate::isLoadedObject($customer)) {
die(Tools::displayError('Customer not found'));
}
self::$smarty->assign('addresses', $customer->getAddresses((int) self::$cookie->id_lang));
$values = array();
$customer_address = $customer->getAddresses((int) self::$cookie->id_lang);
foreach ($customer_address as $addr_item) {
$ordered_fields = AddressFormat::getOrderedAddressFields($addr_item['id_country']);
}
self::$smarty->assign('addresses_style', array('company' => 'address_company', 'vat_number' => 'address_company', 'firstname' => 'address_name', 'lastname' => 'address_name', 'address1' => 'address_address1', 'address2' => 'address_address2', 'city' => 'address_city', 'country' => 'address_country', 'phone' => 'address_phone', 'phone_mobile' => 'address_phone_mobile', 'alias' => 'address_title'));
self::$smarty->assign('ordered_fields', $ordered_fields);
}