[*] BO #PSFV-94 : Added AdminCustomerController

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9608 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2011-10-24 16:00:28 +00:00
parent fb601c96f8
commit cdc24e78d3
7 changed files with 1653 additions and 1006 deletions
@@ -0,0 +1,300 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8971 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if $firstCall}
<script type="text/javascript">
var vat_number = {$vat_number};
var module_dir = '{$module_dir}';
var id_language = {$defaultFormLanguage};
var languages = new Array();
$(document).ready(function() {ldelim}
{foreach $languages as $k => $language}
languages[{$k}] = {ldelim}
id_lang: {$language.id_lang},
iso_code: '{$language.iso_code}',
name: '{$language.name}'
{rdelim};
{/foreach}
displayFlags(languages, id_language, {$allowEmployeeFormLang});
{if isset($fields_value.id_state)}
if ($('#id_country') && $('#id_state'))
{ldelim}
ajaxStates({$fields_value.id_state});
$('#id_country').change(function() {ldelim}
ajaxStates();
{rdelim});
{rdelim}
{/if}
{rdelim});
</script>
<script type="text/javascript" src="../js/form.js"></script>
{/if}
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
<form action="{$current}&{$submit_action}=1&token={$token}" method="post" enctype="multipart/form-data">
{if $form_id}
<input type="hidden" name="id_{$table}" value="{$form_id}" />
{/if}
<fieldset>
{foreach $fields as $key => $field}
{if $key == 'legend'}
<legend>
{if isset($field.image)}<img src="{$field.image}" alt="{$field.title}" />{/if}
{$field.title}
</legend>
{elseif $key == 'input'}
{foreach $field as $input}
{if $input.name == 'id_state'}
<div id="contains_states" {if $contains_states}style="display:none;"{/if}>
{/if}
{if isset($input.label)}
<label>{$input.label} </label>
{/if}
{if $input.type == 'hidden'}
<input type="hidden" name="{$input.name}" value="{$fields_value[$input.name]}" />
{else}
<div class="margin-form">
{if $input.type == 'text'}
{if isset($input.lang) && isset($input.attributeLang)}
{foreach $languages as $language}
<div id="{$input.name}_{$language.id_lang}" style="display:{if $language.id_lang == $defaultFormLanguage}block{else}none{/if}; float: left;">
<input type="text"
name="{$input.name}_{$language.id_lang}"
value="{$fields_value[$input.name][$language.id_lang]}"
{if isset($input.size)}size="{$input.size}"{/if}
{if isset($input.maxlength)}maxlength="{$input.maxlength}"{/if}
{if isset($input.class)}class="{$input.class}"{/if}
{if isset($input.readonly) && $input.readonly}readonly="readonly"{/if}
{if isset($input.disabled) && $input.disabled}disabled="disabled"{/if} />
{if isset($input.hint)}<span class="hint" name="help_box">{$input.hint}<span class="hint-pointer">&nbsp;</span></span>{/if}
</div>
{/foreach}
{if count($languages) > 1}
<div class="displayed_flag">
<img src="../img/l/{$defaultFormLanguage}.jpg"
class="pointer"
id="language_current_{$input.name}"
onclick="toggleLanguageFlags(this);" />
</div>
<div id="languages_{$input.name}" class="language_flags">
{l s='Choose language:'}<br /><br />
{foreach $languages as $language}
<img src="../img/l/{$language.id_lang}.jpg"
class="pointer"
alt="{$language.name}"
title="{$language.name}"
onclick="changeLanguage('{$input.name}', '{$input.attributeLang}', {$language.id_lang}, '{$language.iso_code}');" />
{/foreach}
</div>
{/if}
{else}
<input type="text"
name="{$input.name}"
id="{$input.name}"
value="{$fields_value[$input.name]}"
{if isset($input.size)}size="{$input.size}"{/if}
{if isset($input.maxlength)}maxlength="{$input.maxlength}"{/if}
{if isset($input.class)}class="{$input.class}"{/if}
{if isset($input.readonly) && $input.readonly}readonly="readonly"{/if}
{if isset($input.disabled) && $input.disabled}disabled="disabled"{/if} />
{if isset($input.hint)}<span class="hint" name="help_box">{$input.hint}<span class="hint-pointer">&nbsp;</span></span>{/if}
{/if}
{elseif $input.type == 'select'}
{if isset($input.options.query) && !$input.options.query && isset($input.empty_message)}
{$input.empty_message}
{$input.required = false}
{$input.p = null}
{else}
<select name="{$input.name}" id="{$input.name}" {if isset($input.multiple)}multiple="multiple" {/if}{if isset($input.onchange)}onchange="{$input.onchange}"{/if}>
{if isset($input.options.default)}
<option value="{$input.options.default.value}">{$input.options.default.label}</option>
{/if}
{if isset($input.options.optiongroup)}
{foreach $input.options.optiongroup.query AS $optiongroup}
<optgroup label="{$optiongroup[$input.options.optiongroup.label]}">
{foreach $optiongroup[$input.options.options.query] as $option}
<option value="{$option[$input.options.options.id]}"
{if isset($input.multiple)}
{foreach $fields_value[$input.name] as $field_value}
{if $field_value == $option[$input.options.options.id]}selected="selected"{/if}
{/foreach}
{else}
{if $fields_value[$input.name] == $option[$input.options.options.id]}selected="selected"{/if}
{/if}
>{$option[$input.options.options.name]|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</optgroup>
{/foreach}
{else}
{foreach $input.options.query AS $option}
<option value="{$option[$input.options.id]}"
{if isset($input.multiple)}
{foreach $fields_value[$input.name] as $field_value}
{$field_value}
{if $field_value == $option[$input.options.id]}selected="selected"{/if}
{/foreach}
{else}
{if $fields_value[$input.name] == $option[$input.options.id]}selected="selected"{/if}
{/if}
>{$option[$input.options.name]|escape:'htmlall':'UTF-8'}</option>
{/foreach}
{/if}
</select>
{if isset($input.hint)}<span class="hint" name="help_box">{$input.hint}<span class="hint-pointer">&nbsp;</span></span>{/if}
{/if}
{elseif $input.type == 'radio'}
{foreach $input.values as $value}
<input type="radio"
name="{$input.name}"
id="{$value.id}"
value="{$value.value|escape:'htmlall':'UTF-8'}"
{if $fields_value[$input.name] == $value.value}checked="checked"{/if} />
<label {if isset($input.class)}class="{$input.class}"{/if} for="{$value.id}">
{if isset($input.is_bool) && $input.is_bool == true}
{if $value.value == 1}
<img src="../img/admin/enabled.gif" alt="{$value.label}" title="{$value.label}" />
{else}
<img src="../img/admin/disabled.gif" alt="{$value.label}" title="{$value.label}" />
{/if}
{else}
{$value.label}
{/if}
</label>
{if isset($input.br) && $input.br}<br />{/if}
{/foreach}
{elseif $input.type == 'textarea'}
{if isset($input.lang) && isset($input.attributeLang)}
{foreach $languages as $language}
<div id="{$input.name}_{$language.id_lang}" style="display:{if $language.id_lang == $defaultFormLanguage}block{else}none{/if}; float: left;">
<textarea cols="{$input.cols}" rows="{$input.rows}" name="{$input.name}_{$language.id_lang}">{$fields_value[$input.name][$language.id_lang]}</textarea>
</div>
{/foreach}
{if count($languages) > 1}
<div class="displayed_flag">
<img src="../img/l/{$defaultFormLanguage}.jpg"
class="pointer"
id="language_current_{$input.name}"
onclick="toggleLanguageFlags(this);" />
</div>
<div id="languages_{$input.name}" class="language_flags">
{l s='Choose language:'}<br /><br />
{foreach $languages as $language}
<img src="../img/l/{$language.id_lang}.jpg"
class="pointer"
alt="{$language.name}"
title="{$language.name}"
onclick="changeLanguage('{$input.name}', '{$input.attributeLang}', {$language.id_lang}, '{$language.iso_code}');" />
{/foreach}
</div>
{/if}
{else}
<textarea name="{$input.name}" id="{$input.name}" cols="{$input.cols}" rows="{$input.rows}">{$fields_value[$input.name]}</textarea>
{/if}
{elseif $input.type == 'checkbox'}
{foreach $input.values.query as $value}
{assign var=id_checkbox value=$input.name|cat:'_'|cat:$value[$input.values.id]}
<input type="checkbox" name="{$id_checkbox}" id="{$id_checkbox}" {if $fields_value[$id_checkbox]}checked="checked"{/if} />
<label for="{$id_checkbox}" class="t"><strong>{$value[$input.values.name]}</strong></label><br />
{/foreach}
{elseif $input.type == 'file'}
<input type="file" name="{$input.name}" />
<img src="{$fields_value[$input.name]}" />
{elseif $input.type == 'password'}
<input type="password"
name="{$input.name}"
size="{$input.size}"
value="" />
{elseif $input.type == 'birthday'}
{foreach $input.options as $key => $select}
<select name="{$key}">
<option value="">-</option>
{if $key == 'months'}
{foreach $select as $k => $v}
<option value="{$k}" {if $k == $fields_value[$key]}selected="selected"{/if}>{$v}</option>
{/foreach}
{else}
{foreach $select as $v}
<option value="{$v}" {if $v == $fields_value[$key]}selected="selected"{/if}>{$v}</option>
{/foreach}
{/if}
</select>
{/foreach}
{elseif $input.type == 'group'}
{assign var=groups value=$input.values}
{include file='form_group.tpl'}
{elseif $input.type == 'shop' OR $input.type == 'group_shop'}
{include file='form_shop.tpl'}
{elseif $input.type == 'asso_shop' && isset($asso_shop) && $asso_shop}
<label>{l s='Shop association:'}</label>
<div class="margin-form">
{$asso_shop}
</div>
{/if}
{if isset($input.required) && $input.required} <sup>*</sup>{/if}
{if isset($input.p)}
<p class="clear">
{if is_array($input.p)}
{foreach $input.p as $p}
{if is_array($p)}
<span id="{$p.id}">{$p.text}</span><br />
{else}
{$p}<br />
{/if}
{/foreach}
{else}
{$input.p}
{/if}
</p>
{/if}
{if isset($languages)}<div class="clear"></div>{/if}
</div>
{/if}
{if $input.name == 'id_state'}
</div>
{/if}
{/foreach}
{elseif $key == 'submit'}
<div class="margin-form">
<input type="submit" value="{$field.title}" name="{$submit_action}" {if isset($field.class)}class="{$field.class}"{/if} />
</div>
{/if}
{/foreach}
{if $required_fields}
<div class="small"><sup>*</sup> {l s ='Required field'}</div>
{/if}
</fieldset>
</form>
<br /><br />
{if $firstCall && !$no_back}
{if $back}
<a href="{$back}"><img src="../img/admin/arrow2.gif" />{l s='Back'}</a>
{else}
<a href="{$current}&token={$token}"><img src="../img/admin/arrow2.gif" />{l s='Back to list'}</a>
{/if}
<br />
{/if}
@@ -0,0 +1,411 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8971 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<script type="text/javascript">
function saveCustomerNote()
{
$('#note_feedback').html('<img src="../img/loader.gif" />').show();
var noteContent = $('#noteContent').val();
$.ajax({
type: "POST",
url: "ajax.php",
data: "submitCustomerNote=1&id_customer={$customer->id}&note="+noteContent,
async : true,
success: function(r) {
$('#note_feedback').html('').hide();
if (r == 'ok')
{
$('#note_feedback').html("<b style='color:green'>{l s='Your note has been saved'}</b>").fadeIn(400);
$('#submitCustomerNote').attr('disabled', 'disabled');
}
else if (r == 'error:validation')
$('#note_feedback').html("<b style='color:red'>({l s='Error: your note is not valid'}</b>").fadeIn(400);
else if (r == 'error:update')
$('#note_feedback').html("<b style='color:red'>{l s='Error: cannot save your note'}</b>").fadeIn(400);
$('#note_feedback').fadeOut(3000);
}
});
}
</script>
<fieldset style="width:400px;float: left">
<div style="float: right">
<a href="{$current}&addcustomer&id_customer={$customer->id}&token={$token}">
<img src="../img/admin/edit.gif" />
</a>
</div>
<span style="font-weight: bold; font-size: 14px;">
{$customer->firstname} {$customer->lastname}
</span>
<img src="{$gender_image}" style="margin-bottom: 5px" /><br />
<a href="mailto:{$customer->email}" style="text-decoration: underline; color: blue">{$customer->email}</a>
<br /><br />
{l s='ID:'} {$customer->id|string_format:"%06d"}<br />
{l s='Registration date:'} {$registration_date}<br />
{l s='Last visit:'} {if $customer_stats['last_visit']}{$last_visit}{else}{l s='never'}{/if}<br />
{if $count_better_customers != '-'}{l s='Rank: #'} {$count_better_customers}<br />{/if}
{if $shop_is_feature_active}{l s='Shop:'} {$name_shop}<br />{/if}
</fieldset>
<fieldset style="width:300px;float:left;margin-left:50px">
<div style="float: right">
<a href="{$current}&addcustomer&id_customer={$customer->id}&token={$token}">
<img src="../img/admin/edit.gif" />
</a>
</div>
{l s='Newsletter:'} {if $customer->newsletter}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if}<br />
{l s='Opt-in:'} {if $customer->optin}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if}<br />
{l s='Age:'} {$customer_stats['age']} {if isset($customer->birthday['age'])}({$customer_birthday}){else}{l s='unknown'}{/if}<br /><br />
{l s='Last update:'} {$last_update}<br />
{l s='Status:'} {if $customer->active}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if}
{if $customer->isGuest()}
<div>
{l s='This customer is registered as'} <b>{l s='guest'}</b>
{if !$customer_exists}
<form method="POST" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}">
<input type="hidden" name="id_lang" value="{$id_lang}" />
<p class="center"><input class="button" type="submit" name="submitGuestToCustomer" value="{l s='Transform to customer'}" /></p>
{l s='This feature generates a random password and sends an e-mail to the customer'}
</form>
{else}
</div><div><b style="color:red;">{l s='A registered customer account exists with the same email address'}</b>
{/if}
</div>
{/if}
</fieldset>
<div class="clear">&nbsp;</div>
<fieldset style="height:190px">
<legend>
<img src="../img/admin/cms.gif" /> {l s='Add a private note'}
</legend>
<p>{l s='This note will be displayed to all the employees but not to the customer.'}</p>
<form action="ajax.php" method="post" onsubmit="saveCustomerNote();return false;" id="customer_note">
<textarea name="note" id="noteContent" style="width:600px;height:100px" onkeydown="$('#submitCustomerNote').removeAttr('disabled');">{$customer_note}</textarea><br />
<input type="submit" id="submitCustomerNote" class="button" value="{l s=' Save '}" style="float:left;margin-top:5px" disabled="disabled" />
<span id="note_feedback" style="float:left;margin:10px 0 0 10px"></span>
</form>
</fieldset>
<div class="clear">&nbsp;</div>
<h2>{l s='Messages'} ({count($messages)})</h2>
{if count($messages)}
<table cellspacing="0" cellpadding="0" class="table">
<tr>
<th class="center">{l s='Status'}</th>
<th class="center">{l s='Message'}</th>
<th class="center">{l s='Sent on'}</th>
</tr>
{foreach $messages AS $message}
<tr>
<td>{$message['status']}</td>
<td>
<a href="index.php?tab=AdminCustomerThreads&id_customer_thread='$message['id_customer_thread']}&viewcustomer_thread&token={getAdminToken tab='AdminCustomerThreads'}">
{$message['message']}...
</a>
</td>
<td>{$message['date_add']}</td>
</tr>
{/foreach}
</table>
<div class="clear">&nbsp;</div>
{else}
{$customer->firstname} {$customer->lastname} {l s='has never contacted you'}
{/if}
{* display hook specified to this page : AdminCustomers *}
{if $hook !== false}
<div>{$hook}</div>
{/if}
<div class="clear">&nbsp;</div>
<h2>{l s='Groups'} ({count($groups)})</h2>
{if $groups AND count($groups)}
<table cellspacing="0" cellpadding="0" class="table">
<tr>
<th class="center">{l s='ID'}</th>
<th class="center">{l s='Name'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
{foreach $groups AS $key => $group}
<tr {if $key %2}class="alt_row"{/if} style="cursor: pointer" onclick="document.location = '?tab=AdminGroups&id_group={$group['id_group']}&viewgroup&token={getAdminToken tab='AdminGroups'}'">
<td class="center">{$group['id_group']}</td>
<td>{$group['name']}</td>
<td align="center"><a href="?tab=AdminGroups&id_group={$group['id_group']}&viewgroup&token={getAdminToken tab='AdminGroups'}"><img src="../img/admin/details.gif" /></a></td>
</tr>
{/foreach}
</table>
{/if}
<div class="clear">&nbsp;</div>
<h2>{l s='Orders'} ({count($orders)})</h2>
{if $orders AND count($orders)}
{assign var=count_ok value=count($orders_ok)}
{if $count_ok}
<div style="float:left;margin-right:20px">
<h3 style="color:green;font-weight:700">
{l s='Valid orders:'} {$count_ok} {l s='for'} {$total_ok}
</h3>
<table cellspacing="0" cellpadding="0" class="table float">
<tr>
<th class="center">{l s='ID'}</th>
<th class="center">{l s='Date'}</th>
<th class="center">{l s='Products'}</th>
<th class="center">{l s='Total paid'}</th>
<th class="center">{l s='Payment'}</th>
<th class="center">{l s='State'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
{foreach $orders_ok AS $key => $order}
<tr {if $key %2}class="alt_row"{/if} style="cursor: pointer" onclick="document.location = '?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}'">
<td class="center">{$order['id_order']}</td>
<td>{$order['date_add']}</td>
<td align="right">{$order['nb_products']}</td>
<td align="right">{$order['total_paid_real']}</td>
<td>{$order['payment']}</td>
<td>{$order['order_state']}</td>
<td align="center"><a href="?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}"><img src="../img/admin/details.gif" /></a></td>
</tr>
{/foreach}
</table>
</div>
{/if}
{assign var=count_ko value=count($orders_ko)}
{if $count_ko}
<div style="float:left;margin-right:20px">
<h3 style="color:red;font-weight:700">{l s='Invalid orders:'} {$count_ko}</h3>
<table cellspacing="0" cellpadding="0" class="table float">
<tr>
<th class="center">{l s='ID'}</th>
<th class="center">{l s='Date'}</th>
<th class="center">{l s='Products'}</th>
<th class="center">{l s='Total paid'}</th>
<th class="center">{l s='Payment'}</th>
<th class="center">{l s='State'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
{foreach $orders_ko AS $key => $order}
<tr {if $key %2}class="alt_row"{/if} style="cursor: pointer" onclick="document.location = '?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}'">
<td class="center">{$order['id_order']}</td>
<td>{$order['date_add']}</td>
<td align="right">{$order['nb_products']}</td>
<td align="right">{$order['total_paid_real']}</td>
<td>{$order['payment']}</td>
<td>{$order['order_state']}</td>
<td align="center"><a href="?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}"><img src="../img/admin/details.gif" /></a></td>
</tr>
{/foreach}
</table>
</div>
<div class="clear">&nbsp;</div>
{/if}
{else}
{$customer->firstname} {$customer->lastname} {l s='has not placed any orders yet'}
{/if}
{if $products AND count($products)}
<div class="clear">&nbsp;</div>
<h2>{l s='Products'} ({count($products)})</h2>
<table cellspacing="0" cellpadding="0" class="table">
<tr>
<th class="center">{l s='Date'}</th>
<th class="center">{l s='Name'}</th>
<th class="center">{l s='Quantity'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
{foreach $products AS $key => $product}
<tr {if $key %2}class="alt_row"{/if} style="cursor: pointer" onclick="document.location = '?tab=AdminOrders&id_order={$product['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}'">
<td>{$product['date_add']}</td>
<td>{$product['product_name']}</td>
<td align="right">{$product['product_quantity']}</td>
<td align="center"><a href="?tab=AdminOrders&id_order={$product['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}"><img src="../img/admin/details.gif" /></a></td>
</tr>
{/foreach}
</table>
{/if}
<div class="clear">&nbsp;</div>
<h2>{l s='Addresses'} ({count($addresses)})</h2>
{if count($addresses)}
<table cellspacing="0" cellpadding="0" class="table">
<tr>
<th>{l s='Company'}</th>
<th>{l s='Name'}</th>
<th>{l s='Address'}</th>
<th>{l s='Country'}</th>
<th>{l s='Phone number(s)'}</th>
<th>{l s='Actions'}</th>
</tr>
{foreach $addresses AS $key => $address}
<tr {if $key %2}class="alt_row"{/if}>
<td>{if $address['company']}{$address['company']}{else}--{/if}</td>
<td>{$address['firstname']} {$address['lastname']}</td>
<td>{$address['address1']} {if $address['address2']}{$address['address2']}{/if} {$address['postcode']} {$address['city']}</td>
<td>{$address['country']}</td>
<td>
{if $address['phone']}
{$address['phone']}
{if $address['phone_mobile']}<br />{$address['phone_mobile']}{/if}
{else}
{if $address['phone_mobile']}<br />{$address['phone_mobile']}{else}--{/if}
{/if}
</td>
<td align="center">
<a href="?tab=AdminAddresses&id_address={$address['id_address']}&addaddress&token={getAdminToken tab='AdminAddresses'}"><img src="../img/admin/edit.gif" /></a>
<a href="?tab=AdminAddresses&id_address={$address['id_address']}&deleteaddress&token={getAdminToken tab='AdminAddresses'}"><img src="../img/admin/delete.gif" /></a>
</td>
</tr>
{/foreach}
</table>
{else}
{$customer->firstname} {$customer->lastname} {l s='has not registered any addresses yet'}
{/if}
<div class="clear">&nbsp;</div>
<h2>{l s='Discounts'} ({count($discounts)})</h2>
{if count($discounts)}
<table cellspacing="0" cellpadding="0" class="table">
<tr>
<th>{l s='ID'}</th>
<th>{l s='Code'}</th>
<th>{l s='Type'}</th>
<th>{l s='Value'}</th>
<th>{l s='Qty available'}</th>
<th>{l s='Status'}</th>
<th>{l s='Actions'}</th>
</tr>
{foreach $discounts AS $key => $discount}
<tr {if $key %2}class="alt_row"{/if}>
<td align="center">{$discount['id_discount']}</td>
<td>{$discount['name']}</td>
<td>{$discount['type']}</td>
<td align="right">{$discount['value']}</td>
<td align="center">{$discount['quantity_for_user']}</td>
<td align="center"><img src="../img/admin/{if $discount['active']}enabled.gif{else}disabled.gif{/if}" alt="{l s='Status'}" title="{l s='Status'}" /></td>
<td align="center">
<a href="?tab=AdminDiscounts&id_discount={$discount['id_discount']}&adddiscount&token={getAdminToken tab='AdminDiscounts'}"><img src="../img/admin/edit.gif" /></a>
<a href="?tab=AdminDiscounts&id_discount={$discount['id_discount']}&deletediscount&token={getAdminToken tab='AdminDiscounts'}"><img src="../img/admin/delete.gif" /></a>
</td>
</tr>
{/foreach}
</table>
{else}
{$customer->firstname} {$customer->lastname} {l s='has no discount vouchers'}.
{/if}
<div class="clear">&nbsp;</div>
<div style="float:left">
<h2>{l s='Carts'} ({count($carts)})</h2>
{if $carts AND count($carts)}
<table cellspacing="0" cellpadding="0" class="table">
<tr>
<th class="center">{l s='ID'}</th>
<th class="center">{l s='Date'}</th>
<th class="center">{l s='Total'}</th>
<th class="center">{l s='Carrier'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
{foreach $carts AS $key => $cart}
<tr {if $key %2}class="alt_row"{/if} style="cursor: pointer" onclick="document.location = '?tab=AdminCarts&id_cart={$cart['id_cart']}&viewcart&token={getAdminToken tab='AdminCarts'}'">
<td class="center">{$cart['id_cart']}</td>
<td>{$cart['date_add']}</td>
<td align="right">{$cart['total_price']}</td>
<td>{$cart['name']}</td>
<td align="center"><a href="index.php?tab=AdminCarts&id_cart={$cart['id_cart']}&viewcart&token={getAdminToken tab='AdminCarts'}"><img src="../img/admin/details.gif" /></a></td>
</tr>
{/foreach}
</table>
{else}
{l s='No cart available'}.
{/if}
</div>
{if count($interested)}
<div style="float:left;margin-left:20px">
<h2>{l s='Products'} ({count($interested)})</h2>
<table cellspacing="0" cellpadding="0" class="table">
{foreach $interested as $key => $p}
<tr {if $key %2}class="alt_row"{/if} style="cursor: pointer" onclick="document.location = '{$p['url']}'">
<td>{$p['id']}</td>
<td>{$p['name']}</td>
<td align="center"><a href="{$p['url']}"><img src="../img/admin/details.gif" /></a></td>
</tr>
{/foreach}
</table>
</div>
{/if}
<div class="clear">&nbsp;</div>
{* Last connections *}
{if count($connections)}
<h2>{l s='Last connections'}</h2>
<table cellspacing="0" cellpadding="0" class="table">
<tr>
<th style="width: 200px">{l s='Date'}</th>
<th style="width: 100px">{l s='Pages viewed'}</th>
<th style="width: 100px">{l s='Total time'}</th>
<th style="width: 100px">{l s='Origin'}</th>
<th style="width: 100px">{l s='IP Address'}</th>
</tr>
{foreach $connections as $connection}
<tr>
<td>{$connection['date_add']}</td>
<td>{$connection['pages']}</td>
<td>{$connection['time']}</td>
<td>{$connection['http_referer']}</td>
<td>{$connection['ipaddress']}</td>
</tr>
{/foreach}
</table>
<div class="clear">&nbsp;</div>
{/if}
{if count($referrers)}
<h2>{l s='Referrers'}</h2>
<table cellspacing="0" cellpadding="0" class="table">
<tr>
<th style="width: 200px">{l s='Date'}</th>
<th style="width: 200px">{l s='Name'}</th>
{if $shop_is_feature_active}<th style="width: 200px">{l s='Shop'}</th>{/if}
</tr>
{foreach $referrers as $referrer}
<tr>
<td>{$referrer['date_add']}</td>
<td>{$referrer['name']}</td>
{if $shop_is_feature_active}<td>{$referrer['shop_name']}</td>{/if}
</tr>
{/foreach}
</table>
<div class="clear">&nbsp;</div>
{/if}
<a href="{$current}&token={$token}"><img src="../img/admin/arrow2.gif" /> {l s='Back to customer list'}</a><br />
+1 -1
View File
@@ -98,7 +98,7 @@
{/foreach}
{if $shop_link_type}
<td class="center" {if $name != $tr.shop_name}title="$tr.shop_name"{/if}>{$tr.shop_short_name}</td>
<td class="center" {if $name != $tr.shop_name}title="{$tr.shop_name}"{/if}>{if isset($tr.shop_short_name)}{$tr.shop_short_name}{else}{$tr.shop_name}{/if}</td>
{/if}
{if $has_actions}
<td class="center" style="white-space: nowrap;">