本文整理汇总了PHP中Tools::getAdminToken方法的典型用法代码示例。如果您正苦于以下问题:PHP Tools::getAdminToken方法的具体用法?PHP Tools::getAdminToken怎么用?PHP Tools::getAdminToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tools
的用法示例。
在下文中一共展示了Tools::getAdminToken方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderForm
public function renderForm()
{
$this->fields_form = array('legend' => array('title' => $this->l('Return Merchandise Authorization (RMA)'), 'image' => '../img/admin/return.gif'), 'input' => array(array('type' => 'hidden', 'name' => 'id_order'), array('type' => 'hidden', 'name' => 'id_customer'), array('type' => 'text_customer', 'label' => $this->l('Customer'), 'name' => '', 'size' => '', 'required' => false), array('type' => 'text_order', 'label' => $this->l('Order'), 'name' => '', 'size' => '', 'required' => false), array('type' => 'free', 'label' => $this->l('Customer explanation'), 'name' => 'question', 'size' => '', 'required' => false), array('type' => 'select', 'label' => $this->l('Status'), 'name' => 'state', 'required' => false, 'options' => array('query' => OrderReturnState::getOrderReturnStates($this->context->language->id), 'id' => 'id_order_return_state', 'name' => 'name'), 'desc' => $this->l('Merchandise return (RMA) status.')), array('type' => 'list_products', 'label' => $this->l('Products'), 'name' => '', 'size' => '', 'required' => false, 'desc' => $this->l('List of products in return package.')), array('type' => 'pdf_order_return', 'label' => $this->l('Return slip'), 'name' => '', 'size' => '', 'required' => false, 'desc' => $this->l('The link is only available after validation and before the parcel gets delivered.'))), 'submit' => array('title' => $this->l('Save')));
$order = new Order($this->object->id_order);
$quantity_displayed = array();
// Customized products */
if ($returned_customizations = OrderReturn::getReturnedCustomizedProducts((int) $this->object->id_order)) {
foreach ($returned_customizations as $returned_customization) {
$quantity_displayed[(int) $returned_customization['id_order_detail']] = isset($quantity_displayed[(int) $returned_customization['id_order_detail']]) ? $quantity_displayed[(int) $returned_customization['id_order_detail']] + (int) $returned_customization['product_quantity'] : (int) $returned_customization['product_quantity'];
}
}
// Classic products
$products = OrderReturn::getOrdersReturnProducts($this->object->id, $order);
// Prepare customer explanation for display
$this->object->question = '<span class="normal-text">' . nl2br($this->object->question) . '</span>';
$this->tpl_form_vars = array('customer' => new Customer($this->object->id_customer), 'url_customer' => 'index.php?tab=AdminCustomers&id_customer=' . (int) $this->object->id_customer . '&viewcustomer&token=' . Tools::getAdminToken('AdminCustomers' . (int) Tab::getIdFromClassName('AdminCustomers') . (int) $this->context->employee->id), 'text_order' => sprintf($this->l('Order #%1$d from %2$s'), $order->id, Tools::displayDate($order->date_upd)), 'url_order' => 'index.php?tab=AdminOrders&id_order=' . (int) $order->id . '&vieworder&token=' . Tools::getAdminToken('AdminOrders' . (int) Tab::getIdFromClassName('AdminOrders') . (int) $this->context->employee->id), 'picture_folder' => _THEME_PROD_PIC_DIR_, 'returnedCustomizations' => $returned_customizations, 'customizedDatas' => Product::getAllCustomizedDatas((int) $order->id_cart), 'products' => $products, 'quantityDisplayed' => $quantity_displayed, 'id_order_return' => $this->object->id, 'state_order_return' => $this->object->state);
return parent::renderForm();
}
示例2: hookDisplayBackOfficeTop
public function hookDisplayBackOfficeTop()
{
$today = date('Ymd');
$validation_token = Tools::getAdminToken('riskifiedAjax' . $today);
$this->smarty->assign(array('order_id' => Tools::getValue('id_order'), 'base_url' => _PS_BASE_URL_, 'base_uri' => __PS_BASE_URI__, 'ps_version' => _PS_VERSION_, 'token' => $validation_token));
return $this->display(__FILE__, './views/templates/admin/riskified.tpl');
}
示例3: init
/**
* Initialize cms controller
* @see FrontController::init()
*/
public function init()
{
if ($id_cms = (int) Tools::getValue('id_cms')) {
$this->cms = new CMS($id_cms, $this->context->language->id);
} elseif ($id_cms_category = (int) Tools::getValue('id_cms_category')) {
$this->cms_category = new CMSCategory($id_cms_category, $this->context->language->id);
}
if (Configuration::get('PS_SSL_ENABLED') && Tools::getValue('content_only') && Tools::getValue('id_cms') == (int) Configuration::get('PS_CONDITIONS_CMS_ID') && Validate::isLoadedObject($this->cms)) {
$this->ssl = true;
}
parent::init();
$this->canonicalRedirection();
// assignCase (1 = CMS page, 2 = CMS category)
if (Validate::isLoadedObject($this->cms)) {
$adtoken = Tools::getAdminToken('AdminCmsContent' . (int) Tab::getIdFromClassName('AdminCmsContent') . (int) Tools::getValue('id_employee'));
if (!$this->cms->isAssociatedToShop() || !$this->cms->active && Tools::getValue('adtoken') != $adtoken) {
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
} else {
$this->assignCase = 1;
}
} elseif (Validate::isLoadedObject($this->cms_category)) {
$this->assignCase = 2;
} else {
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
}
}
示例4: postProcess
public function postProcess()
{
global $currentIndex, $cookie, $smarty;
if (Tools::getValue('getReferrerData')) {
$id_referrer = Tools::getValue('referrer');
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS("\n\t\t select o.id_order, concat(c.firstname, ' ', c.lastname) as 'name', concat(a.`address1`, a.`address2`) as 'address', a.`phone_mobile`, o.`total_paid`, date(c.date_add) as 'date_register'\n from ps_orders o \n inner join ps_customer c on o.id_customer = c.id_customer\n inner join ps_address a on a.`id_address` = o.`id_address_delivery`\n where o.id_customer in (select id_customer from ps_customer where id_referrer = " . $id_referrer . ")\n\t\t ");
$smarty->assign('referredOrders', $res);
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS("\n\t\t select id_customer, concat(firstname, ' ', lastname) as 'name', date(date_add) as 'date_add' from ps_customer where id_referrer = " . $id_referrer);
$smarty->assign('referredCustomers', $res);
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS("\r\n\t\t select concat(c.firstname, ' ', c.lastname) as 'name', count(*) as 'total_orders', sum(o.total_paid) as 'total_paid' from ps_orders o \n inner join `ps_order_history` oh on oh.id_order = o.id_order\n inner join ps_customer c on c.id_customer = o.id_customer\n where o.id_customer = " . $id_referrer . "\n and oh.id_order_history = (select max(id_order_history) from ps_order_history where id_order = o.id_order)\n and oh.id_order_state not in (6, 14, 20)\n\t\t ");
$smarty->assign('referrer_details', $res[0]);
$smarty->assign('orderToken', Tools::getAdminToken('AdminOrders' . (int) Tab::getIdFromClassName('AdminOrders') . (int) $cookie->id_employee));
}
$date_from = Tools::getValue('date_from', date('Y-n-j'));
$date_to = Tools::getValue('date_to', date('Y-n-j'));
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS("\n\t\t select c.id_customer `customerID`, concat(c.firstname, ' ', c.lastname) as `name`, \n count(distinct(c2.id_customer)) as 'total_registered',\n count(o.id_order) as 'total_orders',\n count(distinct(o.id_customer)) as 'total_friends_orders',\n round(coalesce(avg(o.total_paid), 0)) as 'avg_order'\n from ps_customer c\n inner join ps_customer c2 on c.id_customer = c2.id_referrer\n left join ps_orders o on o.id_customer = c2.id_customer\n\t\t inner join `ps_order_history` oh on oh.id_order = o.id_order\n where date(c2.`date_add`) between '" . $date_from . "' and '" . $date_to . "'\n\t\t and oh.id_order_history = (SELECT MAX(`id_order_history`) FROM `ps_order_history` moh WHERE moh.`id_order` = o.`id_order` GROUP BY moh.`id_order`)\n\t\t\t\tand oh.id_order_state not in (6,8,20)\n group by c.id_customer \n\t\t ");
$friends_shopped = array();
$avg_order = array();
foreach ($res as $key => $row) {
$friends_shopped[$key] = $row['total_friends_orders'];
$avg_order[$key] = $row['avg_order'];
}
array_multisort($friends_shopped, SORT_DESC, $avg_order, SORT_ASC, $res);
$smarty->assign('date_from', $date_from);
$smarty->assign('date_to', $date_to);
$smarty->assign('referrals', $res);
$smarty->assign('token', $this->token);
$smarty->assign('customerToken', Tools::getAdminToken('AdminCustomers' . (int) Tab::getIdFromClassName('AdminCustomers') . (int) $cookie->id_employee));
}
示例5: __construct
public function __construct($catalogInstance = null)
{
$this->_adminCatalogInstance = $catalogInstance;
global $cookie;
parent::__construct();
$this->token = Tools::getAdminToken("AdminCatalogExFeatures" . (int) $this->id . (int) $cookie->id_employee);
}
示例6: postProcess
public function postProcess()
{
global $currentIndex, $cookie, $smarty;
$product_ids = Tools::getValue('product_ids');
$group_id = 0;
if ($product_ids) {
$group_id = Tools::getValue('group_id');
$ids = explode(",", $product_ids);
//update previous curated products
$sql = "SELECT group_concat(id_product) FROM vb_product_groups WHERE id_group_type = 1 AND id_group = 1";
$res = Db::getInstance()->ExecuteS($sql);
$productIds = array();
foreach ($res as $row) {
$productIds[] = $row['id_product'];
}
SolrSearch::updateProducts($productIds);
Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute("\r\n\t\t delete from vb_product_groups where id_group_type = 1 and id_group = " . $group_id);
Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute("\r\n\t\t \t\tdelete from ps_category_product where id_category = " . CAT_CURATED);
foreach ($ids as $product_id) {
if (!$product_id) {
continue;
}
Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute("\n\t\t insert into vb_product_groups (id_group_type, id_group, id_product)\n\t\t values (1, " . $group_id . ", " . $product_id . ")\n\t\t ");
Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute("\r\n\t\t \t\tinsert into ps_category_product (id_category, id_product, position)\r\n\t\t \t\tvalues (" . CAT_CURATED . ", " . $product_id . ", 1)\r\n\t\t \t\t");
SolrSearch::updateProduct($product_id);
}
}
//home products
$product_ids = $this->assign_products('curated_products', 'curated_product_ids', 1);
$smarty->assign('productToken', Tools::getAdminToken('AdminCatalog' . (int) Tab::getIdFromClassName('AdminCatalog') . (int) $cookie->id_employee));
}
示例7: renderForm
public function renderForm()
{
$this->fields_form = array('legend' => array('title' => $this->l('Addresses'), 'icon' => 'icon-envelope-alt'), 'input' => array(array('type' => 'text_customer', 'label' => $this->l('Customer'), 'name' => 'id_customer', 'required' => false), array('type' => 'text', 'label' => $this->l('Identification Number'), 'name' => 'dni', 'required' => false, 'col' => '4', 'hint' => $this->l('DNI / NIF / NIE')), array('type' => 'text', 'label' => $this->l('Address alias'), 'name' => 'alias', 'required' => true, 'col' => '4', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'textarea', 'label' => $this->l('Other'), 'name' => 'other', 'required' => false, 'cols' => 15, 'rows' => 3, 'hint' => $this->l('Forbidden characters:') . ' <>;=#{}')), 'submit' => array('title' => $this->l('Save')));
$id_customer = (int) Tools::getValue('id_customer');
if (!$id_customer && Validate::isLoadedObject($this->object)) {
$id_customer = $this->object->id_customer;
}
if ($id_customer) {
$customer = new Customer((int) $id_customer);
$token_customer = Tools::getAdminToken('AdminCustomers' . (int) Tab::getIdFromClassName('AdminCustomers') . (int) $this->context->employee->id);
}
$this->tpl_form_vars = array('customer' => isset($customer) ? $customer : null, 'tokenCustomer' => isset($token_customer) ? $token_customer : null);
// Order address fields depending on country format
$addresses_fields = $this->processAddressFormat();
// we use delivery address
$addresses_fields = $addresses_fields['dlv_all_fields'];
// get required field
$required_fields = AddressFormat::getFieldsRequired();
// Merge with field required
$addresses_fields = array_unique(array_merge($addresses_fields, $required_fields));
$temp_fields = array();
foreach ($addresses_fields as $addr_field_item) {
if ($addr_field_item == 'company') {
$temp_fields[] = array('type' => 'text', 'label' => $this->l('Company'), 'name' => 'company', 'required' => in_array('company', $required_fields), 'col' => '4', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}');
$temp_fields[] = array('type' => 'text', 'label' => $this->l('VAT number'), 'col' => '2', 'name' => 'vat_number', 'required' => in_array('vat_number', $required_fields));
} elseif ($addr_field_item == 'lastname') {
if (isset($customer) && !Tools::isSubmit('submit' . strtoupper($this->table)) && Validate::isLoadedObject($customer) && !Validate::isLoadedObject($this->object)) {
$default_value = $customer->lastname;
} else {
$default_value = '';
}
$temp_fields[] = array('type' => 'text', 'label' => $this->l('Last Name'), 'name' => 'lastname', 'required' => true, 'col' => '4', 'hint' => $this->l('Invalid characters:') . ' 0-9!&lt;&gt;,;?=+()@#"�{}_$%:', 'default_value' => $default_value);
} elseif ($addr_field_item == 'firstname') {
if (isset($customer) && !Tools::isSubmit('submit' . strtoupper($this->table)) && Validate::isLoadedObject($customer) && !Validate::isLoadedObject($this->object)) {
$default_value = $customer->firstname;
} else {
$default_value = '';
}
$temp_fields[] = array('type' => 'text', 'label' => $this->l('First Name'), 'name' => 'firstname', 'required' => true, 'col' => '4', 'hint' => $this->l('Invalid characters:') . ' 0-9!&lt;&gt;,;?=+()@#"�{}_$%:', 'default_value' => $default_value);
} elseif ($addr_field_item == 'address1') {
$temp_fields[] = array('type' => 'text', 'label' => $this->l('Address'), 'name' => 'address1', 'col' => '6', 'required' => true);
} elseif ($addr_field_item == 'address2') {
$temp_fields[] = array('type' => 'text', 'label' => $this->l('Address') . ' (2)', 'name' => 'address2', 'col' => '6', 'required' => in_array('address2', $required_fields));
} elseif ($addr_field_item == 'postcode') {
$temp_fields[] = array('type' => 'text', 'label' => $this->l('Zip/Postal Code'), 'name' => 'postcode', 'col' => '2', 'required' => true);
} elseif ($addr_field_item == 'city') {
$temp_fields[] = array('type' => 'text', 'label' => $this->l('City'), 'name' => 'city', 'col' => '4', 'required' => true);
} elseif ($addr_field_item == 'country' || $addr_field_item == 'Country:name') {
$temp_fields[] = array('type' => 'select', 'label' => $this->l('Country'), 'name' => 'id_country', 'required' => in_array('Country:name', $required_fields) || in_array('country', $required_fields), 'col' => '4', 'default_value' => (int) $this->context->country->id, 'options' => array('query' => Country::getCountries($this->context->language->id), 'id' => 'id_country', 'name' => 'name'));
$temp_fields[] = array('type' => 'select', 'label' => $this->l('State'), 'name' => 'id_state', 'required' => false, 'col' => '4', 'options' => array('query' => array(), 'id' => 'id_state', 'name' => 'name'));
} elseif ($addr_field_item == 'phone') {
$temp_fields[] = array('type' => 'text', 'label' => $this->l('Home phone'), 'name' => 'phone', 'required' => in_array('phone', $required_fields) || Configuration::get('PS_ONE_PHONE_AT_LEAST'), 'col' => '4', 'hint' => Configuration::get('PS_ONE_PHONE_AT_LEAST') ? sprintf($this->l('You must register at least one phone number.')) : '');
} elseif ($addr_field_item == 'phone_mobile') {
$temp_fields[] = array('type' => 'text', 'label' => $this->l('Mobile phone'), 'name' => 'phone_mobile', 'required' => in_array('phone_mobile', $required_fields) || Configuration::get('PS_ONE_PHONE_AT_LEAST'), 'col' => '4', 'hint' => Configuration::get('PS_ONE_PHONE_AT_LEAST') ? sprintf($this->l('You must register at least one phone number.')) : '');
}
}
// merge address format with the rest of the form
array_splice($this->fields_form['input'], 3, 0, $temp_fields);
return parent::renderForm();
}
示例8: displaySettings
public function displaySettings($post_action)
{
$curr_order_state = new OrderState((int) $this->mondialrelay->account_shop['MR_ORDER_STATE']);
$order_state = array('id_order_state' => $this->mondialrelay->account_shop['MR_ORDER_STATE'], 'name' => $curr_order_state->name[$this->context->language->id]);
$this->context->smarty->assign(array('MR_token_admin_mondialrelay' => Tools::getAdminToken('AdminMondialRelay' . (int) Tab::getIdFromClassName('AdminMondialRelay') . (int) $this->context->employee->id), 'MR_account_set' => MondialRelay::isAccountSet(), 'MR_order_state' => $order_state, 'MR_orders_states_list' => OrderState::getOrderStates($this->context->language->id), 'MR_form_action' => $post_action, 'MR_error_list' => $this->post_errors));
echo $this->mondialrelay->fetchTemplate('/tpl/admintab/', 'settings');
}
示例9: __construct
public function __construct()
{
global $cookie;
parent::__construct();
$this->is_seller = $cookie->profile == (int) Configuration::get('AGILE_MS_PROFILE_ID');
Shop::$id_shop_owner = $this->is_seller ? $cookie->id_employee : 0;
if (Module::isInstalled('agilemultipleseller') and !isset($_GET['logout']) and $this->is_seller and (Tools::getValue("controller") == "" or Tools::getValue("controller") == "adminhome")) {
$tid = Tab::getIdFromClassName('AdminProducts');
$token = Tools::getAdminToken('AdminProducts' . intval($tid) . intval($cookie->id_employee));
Tools::redirectAdmin("./index.php?controller=AdminProducts&token=" . $token);
}
if (Module::isInstalled('agilesellerlistoptions')) {
require_once _PS_ROOT_DIR_ . '/modules/agilesellerlistoptions/agilesellerlistoptions.php';
$aslo_module = new AgileSellerListOptions();
$msg = $aslo_module->hookAgileAdminTop(null);
if (!empty($msg)) {
$this->displayWarning($msg);
}
}
$tab = Tab::getInstanceFromClassName('AdminShopGroup');
if (Module::isInstalled('agilemultipleshop')) {
$tab->active = 1;
} else {
$tab->active = 0;
}
$tab->update();
}
示例10: renderForm
public function renderForm()
{
if (!($obj = $this->loadObject(true))) {
return;
}
$post = new BlogPost($obj->id_blog_post);
$obj->post_title = $post->title;
if (!is_null($obj->id_customer) && !empty($obj->id_customer)) {
$tokenCustomer = Tools::getAdminToken('AdminCustomers' . (int) Tab::getIdFromClassName('AdminCustomers') . (int) $this->context->employee->id);
$linkCustomer = '?tab=AdminCustomers&id_customer=' . $obj->id_customer . '&viewcustomer&token=' . $tokenCustomer;
$obj->customer_name_label = '<a href="' . $linkCustomer . '"><strong>' . $obj->customer_name . '</strong></a>';
} else {
$obj->customer_name_label = $obj->customer_name;
}
$iso = $this->context->language->getIsoById($obj->id_lang);
$obj->iso_code = $iso ? $iso : ' ';
$shop = $this->context->shop->getShop($obj->id_shop);
$obj->shop_name = $shop ? $shop['name'] : ' ';
$this->fields_form = array('legend' => array('title' => '<img src="../img/admin/comment.gif"> ' . $this->l('Comment')), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'));
$this->fields_form['input'][] = array('type' => 'text_label', 'label' => $this->l('Date :'), 'name' => 'date_add');
$this->fields_form['input'][] = array('type' => 'text_label', 'label' => $this->l('Post title :'), 'name' => 'post_title');
$this->fields_form['input'][] = array('type' => 'text_label', 'label' => $this->l('Customer :'), 'name' => 'customer_name_label');
$this->fields_form['input'][] = array('type' => 'text_label', 'label' => $this->l('Shop :'), 'name' => 'shop_name');
$this->fields_form['input'][] = array('type' => 'text_label', 'label' => $this->l('Lang :'), 'name' => 'iso_code');
$this->fields_form['input'][] = array('type' => 'hidden', 'name' => 'customer_name');
$this->fields_form['input'][] = array('type' => 'hidden', 'name' => 'id_blog_post');
$this->fields_form['input'][] = array('type' => 'textarea', 'label' => $this->l('Message :'), 'rows' => 4, 'cols' => 92, 'id' => 'comment_content', 'name' => 'content');
$this->fields_form['input'][] = array('type' => 'radio', 'label' => $this->l('Active :'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled'))));
$this->tpl_form_vars = array('comment' => $obj);
return parent::renderForm();
}
示例11: getContent
public function getContent()
{
global $cookie;
$tab = 'AdminModuleMenu';
$token = Tools::getAdminToken($tab . (int) Tab::getIdFromClassName($tab) . (int) $cookie->id_employee);
Tools::redirectAdmin('index.php?tab=' . $tab . '&token=' . $token);
}
示例12: viewsupplier
public function viewsupplier()
{
global $cookie;
$supplier = $this->loadObject();
echo '<h2>' . $supplier->name . '</h2>';
$products = $supplier->getProductsLite(intval($cookie->id_lang));
echo '<h3>' . $this->l('Total products:') . ' ' . sizeof($products) . '</h3>';
foreach ($products as $product) {
$product = new Product($product['id_product'], false, intval($cookie->id_lang));
echo '<hr />';
if (!$product->hasAttributes()) {
echo '
<table border="0" cellpadding="0" cellspacing="0" class="table width3">
<tr>
<th><a href="index.php?tab=AdminCatalog&id_product=' . $product->id . '&addproduct&token=' . Tools::getAdminToken('AdminCatalog' . intval(Tab::getIdFromClassName('AdminCatalog')) . intval($cookie->id_employee)) . '" target="_blank">' . $product->name . '</a></th>
' . (!empty($product->reference) ? '<th width="150">' . $this->l('Ref:') . ' ' . $product->reference . '</th>' : '') . '
' . (!empty($product->ean13) ? '<th width="120">' . $this->l('EAN13:') . ' ' . $product->ean13 . '</th>' : '') . '
' . (Configuration::get('PS_STOCK_MANAGEMENT') ? '<th class="right" width="50">' . $this->l('Qty:') . ' ' . $product->quantity . '</th>' : '') . '
</tr>
</table>';
} else {
echo '
<h3><a href="index.php?tab=AdminCatalog&id_product=' . $product->id . '&addproduct&token=' . Tools::getAdminToken('AdminCatalog' . intval(Tab::getIdFromClassName('AdminCatalog')) . intval($cookie->id_employee)) . '" target="_blank">' . $product->name . '</a></h3>
<table border="0" cellpadding="0" cellspacing="0" class="table" style="width: 600px;">
<tr>
<th>' . $this->l('Attribute name') . '</th>
<th width="80">' . $this->l('Reference') . '</th>
<th width="80">' . $this->l('EAN13') . '</th>
' . (Configuration::get('PS_STOCK_MANAGEMENT') ? '<th class="right" width="40">' . $this->l('Quantity') . '</th>' : '') . '
</tr>';
/* Build attributes combinaisons */
$combinaisons = $product->getAttributeCombinaisons(intval($cookie->id_lang));
foreach ($combinaisons as $k => $combinaison) {
$combArray[$combinaison['id_product_attribute']]['reference'] = $combinaison['reference'];
$combArray[$combinaison['id_product_attribute']]['ean13'] = $combinaison['ean13'];
$combArray[$combinaison['id_product_attribute']]['quantity'] = $combinaison['quantity'];
$combArray[$combinaison['id_product_attribute']]['attributes'][] = array($combinaison['group_name'], $combinaison['attribute_name'], $combinaison['id_attribute']);
}
$irow = 0;
foreach ($combArray as $id_product_attribute => $product_attribute) {
$list = '';
foreach ($product_attribute['attributes'] as $attribute) {
$list .= $attribute[0] . ' - ' . $attribute[1] . ', ';
}
$list = rtrim($list, ', ');
echo '
<tr' . ($irow++ % 2 ? ' class="alt_row"' : '') . ' >
<td>' . stripslashes($list) . '</td>
<td>' . $product_attribute['reference'] . '</td>
' . (Configuration::get('PS_STOCK_MANAGEMENT') ? '<td>' . $product_attribute['ean13'] . '</td>' : '') . '
<td class="right">' . $product_attribute['quantity'] . '</td>
</tr>';
}
unset($combArray);
echo '</table>';
echo '</td></tr></table>';
}
}
}
示例13: display
public function display()
{
global $cookie;
if (isset($_GET['view' . $this->table])) {
Tools::redirectAdmin('index.php?tab=AdminOrders&id_order=' . intval($_GET['id_order']) . '&vieworder' . '&token=' . Tools::getAdminToken('AdminOrders' . intval(Tab::getIdFromClassName('AdminOrders')) . intval($cookie->id_employee)));
} else {
$this->displayList();
$this->displayOptionsList();
}
}
示例14: checkToken
public function checkToken()
{
global $cookie;
if ($parentCheck = parent::checkToken()) {
return $parentCheck;
} else {
$token = Tools::getValue('token');
return !empty($token) and $token === Tools::getAdminToken('AdminCatalog' . (int) Tab::getIdFromClassName('AdminCatalog') . (int) $cookie->id_employee);
}
}
示例15: hookAdminStatsModules
public function hookAdminStatsModules($params)
{
global $cookie;
$customers = $this->getCustomersOnline();
$totalCustomers = Db::getInstance()->NumRows();
$visitors = $this->getVisitorsOnline();
$totalVisitors = Db::getInstance()->NumRows();
$irow = 0;
echo '<script type="text/javascript" language="javascript">openCloseLayer(\'calendar\');</script>
<fieldset class="width3"><legend><img src="../modules/' . $this->name . '/logo.gif" /> ' . $this->l('Customers online') . '</legend>';
if ($totalCustomers) {
echo $this->l('Total:') . ' ' . intval($totalCustomers) . '
<table cellpadding="0" cellspacing="0" class="table space">
<tr><th>' . $this->l('ID') . '</th><th>' . $this->l('Name') . '</th><th>' . $this->l('Current Page') . '</th><th>' . $this->l('View') . '</th></tr>';
foreach ($customers as $customer) {
echo '
<tr' . ($irow++ % 2 ? ' class="alt_row"' : '') . '>
<td>' . $customer['id_customer'] . '</td>
<td style="width: 200px;">' . $customer['firstname'] . ' ' . $customer['lastname'] . '</td>
<td style="width: 200px;">' . $customer['page'] . '</td>
<td style="text-align: right; width: 25px;">
<a href="index.php?tab=AdminCustomers&id_customer=' . $customer['id_customer'] . '&viewcustomer&token=' . Tools::getAdminToken('AdminCustomers' . intval(Tab::getIdFromClassName('AdminCustomers')) . intval($cookie->id_employee)) . '" target="_blank">
<img src="../modules/' . $this->name . '/logo.gif" />
</a>
</td>
</tr>';
}
echo '</table>';
} else {
echo $this->l('There is no customer online now.');
}
echo '</fieldset>
<fieldset class="width3 space"><legend><img src="../modules/' . $this->name . '/logo.gif" /> ' . $this->l('Visitors online') . '</legend>';
if ($totalVisitors) {
echo $this->l('Total:') . ' ' . intval($totalVisitors) . '
<div style="overflow-y: scroll; height: 600px;">
<table cellpadding="0" cellspacing="0" class="table space">
<tr><th>' . $this->l('Guest') . '</th><th>' . $this->l('IP') . '</th><th>' . $this->l('Since') . '</th><th>' . $this->l('Current page') . '</th><th>' . $this->l('Referrer') . '</th></tr>';
foreach ($visitors as $visitor) {
echo '
<tr' . ($irow++ % 2 ? ' class="alt_row"' : '') . '>
<td>' . $visitor['id_guest'] . '</td>
<td style="width: 80px;">' . long2ip($visitor['ip_address']) . '</td>
<td style="width: 100px;">' . substr($visitor['date_add'], 11) . '</td>
<td style="width: 200px;">' . $visitor['page'] . '</td>
<td style="width: 200px;">' . (empty($visitor['http_referer']) ? $this->l('none') : parse_url($visitor['http_referer'], PHP_URL_HOST)) . '</td>
</tr>';
}
echo '</table>
</div>';
} else {
echo $this->l('There is no visitor online now.');
}
echo '</fieldset>';
}