// some changes on admin customer view

This commit is contained in:
Rémi Gaillard committed 2013-02-22 14:16:49 +01:00
1 parent eab9204c84
commit 0a716e03c5
1 file changed
+218 -201
@@ -121,67 +121,70 @@
<div class="clear"></div> <div class="clear"></div>
<div class="separation"></div> <div class="separation"></div>
<div style="width:50%;float:left;">
<h2>{l s='Messages'} ({count($messages)})</h2> <h2>{l s='Messages'} ({count($messages)})</h2>
{if count($messages)} {if count($messages)}
<table cellspacing="0" cellpadding="0" class="table" style="width:100%;"> <table cellspacing="0" cellpadding="0" class="table" style="width:100%;">
<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> <tr>
<td>{$message['status']}</td> <th class="left">{l s='Status'}</th>
<td> <th class="left">{l s='Message'}</th>
<a href="index.php?tab=AdminCustomerThreads&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread&token={getAdminToken tab='AdminCustomerThreads'}"> <th class="left">{l s='Sent on'}</th>
{$message['message']}...
</a>
</td>
<td>{$message['date_add']}</td>
</tr> </tr>
{/foreach} {foreach $messages AS $message}
</table> <tr>
<div class="clear">&nbsp;</div> <td class="left">{$message['status']}</td>
{else} <td class="left">
{l s='%1$s %2$s has never contacted you' sprintf=[$customer->firstname, $customer->lastname]} <a href="index.php?tab=AdminCustomerThreads&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread&token={getAdminToken tab='AdminCustomerThreads'}">
{/if} {$message['message']}...
</a>
</td>
<td class="left">{$message['date_add']}</td>
</tr>
{/foreach}
</table>
<div class="clear">&nbsp;</div>
{else}
{l s='%1$s %2$s has never contacted you' sprintf=[$customer->firstname, $customer->lastname]}
{/if}
</div>
<div style="width:50%;float:left;">
<div style="margin-left:15px;"
<h2>{l s='Vouchers'} ({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='Name'}</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_cart_rule']}</td>
<td>{$discount['code']}</td>
<td>{$discount['name']}</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=AdminCartRules&id_cart_rule={$discount['id_cart_rule']}&addcart_rule&token={getAdminToken tab='AdminCartRules'}"><img src="../img/admin/edit.gif" /></a>
<a href="?tab=AdminCartRules&id_cart_rule={$discount['id_cart_rule']}&deletecart_rule&token={getAdminToken tab='AdminCartRules'}"><img src="../img/admin/delete.gif" /></a>
</td>
</tr>
{/foreach}
</table>
{else}
{l s='%1$s %2$s has no discount vouchers' sprintf=[$customer->firstname, $customer->lastname]}.
{/if}
</div>
</div>
{* display hook specified to this page : AdminCustomers *} {* display hook specified to this page : AdminCustomers *}
<div>{hook h="displayAdminCustomers" id_customer=$customer->id}</div> <div>{hook h="displayAdminCustomers" id_customer=$customer->id}</div>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
<h2> <div style="width:50%;float:left;">
{l s='Groups'} ({count($groups)})
<a href="{$current}&updatecustomer&id_customer={$customer->id}&token={$token}">
<img src="../img/admin/edit.gif" />
</a>
</h2>
{if $groups AND count($groups)}
<table cellspacing="0" cellpadding="0" class="table" style="width:100%;">
<colgroup>
<col width="10px">
<col width="">
<col width="70px">
</colgroup>
<tr>
<th height="39px" class="right">{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> <h2>{l s='Orders'} ({count($orders)})</h2>
{if $orders AND count($orders)} {if $orders AND count($orders)}
{assign var=count_ok value=count($orders_ok)} {assign var=count_ok value=count($orders_ok)}
@@ -205,16 +208,16 @@
<th class="left">{l s='Date'}</th> <th class="left">{l s='Date'}</th>
<th class="left">{l s='Payment: '}</th> <th class="left">{l s='Payment: '}</th>
<th class="left">{l s='State'}</th> <th class="left">{l s='State'}</th>
<th class="left">{l s='Products:'}</th> <th class="right">{l s='Products'}</th>
<th class="left">{l s='Total spent'}</th> <th class="right">{l s='Total spent'}</th>
<th class="center">{l s='Actions'}</th> <th class="center">{l s='Actions'}</th>
</tr> </tr>
{foreach $orders_ok AS $key => $order} {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'}'"> <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 class="left">{$order['id_order']}</td>
<td>{$order['date_add']}</td> <td class="left">{$order['date_add']}</td>
<td>{$order['payment']}</td> <td class="left">{$order['payment']}</td>
<td>{$order['order_state']}</td> <td class="left">{$order['order_state']}</td>
<td align="right">{$order['nb_products']}</td> <td align="right">{$order['nb_products']}</td>
<td align="right">{$order['total_paid_real']}</td> <td align="right">{$order['total_paid_real']}</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> <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>
@@ -226,7 +229,6 @@
{assign var=count_ko value=count($orders_ko)} {assign var=count_ko value=count($orders_ko)}
{if $count_ko} {if $count_ko}
<div> <div>
<h3 style="color:red;font-weight:normal;">{l s='Invalid orders:'} {$count_ko}</h3>
<table cellspacing="0" cellpadding="0" class="table" style="width:100%;"> <table cellspacing="0" cellpadding="0" class="table" style="width:100%;">
<colgroup> <colgroup>
<col width="10px"> <col width="10px">
@@ -238,33 +240,70 @@
<col width="52px"> <col width="52px">
</colgroup> </colgroup>
<tr> <tr>
<th height="39px" class="center">{l s='ID'}</th> <th height="39px" class="left">{l s='ID'}</th>
<th class="center">{l s='Date'}</th> <th class="left">{l s='Date'}</th>
<th class="center">{l s='Payment: '}</th> <th class="left">{l s='Payment: '}</th>
<th class="center">{l s='State'}</th> <th class="left">{l s='State'}</th>
<th class="center">{l s='Products:'}</th> <th class="right">{l s='Products'}</th>
<th class="center">{l s='Total spent'}</th> <th class="right">{l s='Total spent'}</th>
<th class="center">{l s='Actions'}</th> <th class="center">{l s='Actions'}</th>
</tr> </tr>
{foreach $orders_ko AS $key => $order} {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'}'"> <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 class="left">{$order['id_order']}</td>
<td>{$order['date_add']}</td> <td class="left">{$order['date_add']}</td>
<td>{$order['payment']}</td> <td class="left">{$order['payment']}</td>
<td>{$order['order_state']}</td> <td class="left">{$order['order_state']}</td>
<td align="right">{$order['nb_products']}</td> <td align="right">{$order['nb_products']}</td>
<td align="right">{$order['total_paid_real']}</td> <td align="right">{$order['total_paid_real']}</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> <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> </tr>
{/foreach} {/foreach}
</table> </table>
<h3 style="color:red;font-weight:normal;">{l s='Invalid orders:'} {$count_ko}</h3>
</div> </div>
<div class="clear">&nbsp;</div>
{/if} {/if}
{else} {else}
{l s='%1$s %2$s has not placed any orders yet' sprintf=[$customer->firstname, $customer->lastname]} {l s='%1$s %2$s has not placed any orders yet' sprintf=[$customer->firstname, $customer->lastname]}
{/if} {/if}
</div>
<div style="float:left;width:50%">
<div style="margin-left:15px;">
<h2>{l s='Carts'} ({count($carts)})</h2>
{if $carts AND count($carts)}
<table cellspacing="0" cellpadding="0" class="table" style="width:100%">
<colgroup>
<col width="50px">
<col width="150px">
<col width="">
<col width="70px">
<col width="50px">
</colgroup>
<tr>
<th height="39px" class="left">{l s='ID'}</th>
<th class="left">{l s='Date'}</th>
<th class="left">{l s='Carrier'}</th>
<th class="right">{l s='Total'}</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="left">{$cart['id_cart']}</td>
<td class="left">{$cart['date_add']}</td>
<td class="left">{$cart['name']}</td>
<td align="right">{$cart['total_price']}</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 is available'}.
{/if}
</div>
</div>
<div class="clear">&nbsp;</div>
{if $products AND count($products)} {if $products AND count($products)}
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
<h2>{l s='Products:'} ({count($products)})</h2> <h2>{l s='Products:'} ({count($products)})</h2>
@@ -292,113 +331,87 @@
</table> </table>
{/if} {/if}
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
<h2>{l s='Addresses'} ({count($addresses)})</h2> <div style="float:left;width:50%">
{if count($addresses)} <h2>{l s='Addresses'} ({count($addresses)})</h2>
<table cellspacing="0" cellpadding="0" class="table" style="width:100%;"> {if count($addresses)}
<colgroup> <table cellspacing="0" cellpadding="0" class="table" style="width:100%;">
<col width="120px"> <colgroup>
<col width="120px"> <col width="120px">
<col width=""> <col width="120px">
<col width="100px"> <col width="">
<col width="170px"> <col width="100px">
<col width="70px"> <col width="170px">
</colgroup> <col width="70px">
<tr> </colgroup>
<th height="39px">{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 class="right">
{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}
{l s='%1$s %2$s has not registered any addresses yet' sprintf=[$customer->firstname, $customer->lastname]}
{/if}
<div class="clear">&nbsp;</div>
<h2>{l s='Vouchers'} ({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='Name'}</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_cart_rule']}</td>
<td>{$discount['code']}</td>
<td>{$discount['name']}</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=AdminCartRules&id_cart_rule={$discount['id_cart_rule']}&addcart_rule&token={getAdminToken tab='AdminCartRules'}"><img src="../img/admin/edit.gif" /></a>
<a href="?tab=AdminCartRules&id_cart_rule={$discount['id_cart_rule']}&deletecart_rule&token={getAdminToken tab='AdminCartRules'}"><img src="../img/admin/delete.gif" /></a>
</td>
</tr>
{/foreach}
</table>
{else}
{l s='%1$s %2$s has no discount vouchers' sprintf=[$customer->firstname, $customer->lastname]}.
{/if}
<div class="clear">&nbsp;</div>
<div>
<h2>{l s='Carts'} ({count($carts)})</h2>
{if $carts AND count($carts)}
<table cellspacing="0" cellpadding="0" class="table" style="width:100%">
<colgroup>
<col width="50px">
<col width="150px">
<col width="">
<col width="70px">
<col width="50px">
</colgroup>
<tr> <tr>
<th height="39px" class="center">{l s='ID'}</th> <th class="left" height="39px">{l s='Company'}</th>
<th class="center">{l s='Date'}</th> <th class="left">{l s='Name'}</th>
<th class="center">{l s='Carrier'}</th> <th class="left">{l s='Address'}</th>
<th class="center">{l s='Total'}</th> <th class="left">{l s='Country'}</th>
<th class="right">{l s='Phone number(s)'}</th>
<th class="center">{l s='Actions'}</th> <th class="center">{l s='Actions'}</th>
</tr> </tr>
{foreach $carts AS $key => $cart} {foreach $addresses AS $key => $address}
<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'}'"> <tr {if $key %2}class="alt_row"{/if}>
<td class="center">{$cart['id_cart']}</td> <td class="left">{if $address['company']}{$address['company']}{else}--{/if}</td>
<td>{$cart['date_add']}</td> <td class="left">{$address['firstname']} {$address['lastname']}</td>
<td>{$cart['name']}</td> <td class="left">{$address['address1']} {if $address['address2']}{$address['address2']}{/if} {$address['postcode']} {$address['city']}</td>
<td align="right">{$cart['total_price']}</td> <td class="left">{$address['country']}</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> <td class="right">
{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 class="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> </tr>
{/foreach} {/foreach}
</table> </table>
{else} {else}
{l s='No cart is available'}. {l s='%1$s %2$s has not registered any addresses yet' sprintf=[$customer->firstname, $customer->lastname]}
{/if} {/if}
</div> </div>
<div style="float:left;width:50%">
<div style="margin-left:15px">
<h2>
{l s='Groups'} ({count($groups)})
<a href="{$current}&updatecustomer&id_customer={$customer->id}&token={$token}">
<img src="../img/admin/edit.gif" />
</a>
</h2>
{if $groups AND count($groups)}
<table cellspacing="0" cellpadding="0" class="table" style="width:100%;">
<colgroup>
<col width="10px">
<col width="">
<col width="70px">
</colgroup>
<tr>
<th height="39px" class="left">{l s='ID'}</th>
<th class="left">{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="left">{$group['id_group']}</td>
<td class="left">{$group['name']}</td>
<td class="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>
</div>
<div class="clear">&nbsp;</div>
{if count($interested)} {if count($interested)}
<div> <div>
<h2>{l s='Products:'} ({count($interested)})</h2> <h2>{l s='Products:'} ({count($interested)})</h2>
@@ -418,9 +431,9 @@
</table> </table>
</div> </div>
{/if} {/if}
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
<div style="float:left;width:50%">
{* Last connections *} {* Last connections *}
{if count($connections)} {if count($connections)}
<h2>{l s='Last connections'}</h2> <h2>{l s='Last connections'}</h2>
@@ -433,42 +446,46 @@
<col width="150px"> <col width="150px">
</colgroup> </colgroup>
<tr> <tr>
<th height="39px;">{l s='Date'}</th> <th class="left" height="39px;">{l s='Date'}</th>
<th>{l s='Pages viewed'}</th> <th class="left">{l s='Pages viewed'}</th>
<th>{l s='Total time'}</th> <th class="left">{l s='Total time'}</th>
<th>{l s='Origin'}</th> <th class="left">{l s='Origin'}</th>
<th>{l s='IP Address'}</th> <th class="left">{l s='IP Address'}</th>
</tr> </tr>
{foreach $connections as $connection} {foreach $connections as $connection}
<tr> <tr>
<td>{$connection['date_add']}</td> <td class="left">{$connection['date_add']}</td>
<td>{$connection['pages']}</td> <td class="left">{$connection['pages']}</td>
<td>{$connection['time']}</td> <td class="left">{$connection['time']}</td>
<td>{$connection['http_referer']}</td> <td class="left">{$connection['http_referer']}</td>
<td>{$connection['ipaddress']}</td> <td class="left">{$connection['ipaddress']}</td>
</tr> </tr>
{/foreach} {/foreach}
</table> </table>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
{/if} {/if}
</div>
{if count($referrers)} <div style="float:left;width:50%">
<h2>{l s='Referrers'}</h2> <div style="margin-left:15px">
<table cellspacing="0" cellpadding="0" class="table"> {if count($referrers)}
<tr> <h2>{l s='Referrers'}</h2>
<th style="width: 200px">{l s='Date'}</th> <table cellspacing="0" cellpadding="0" class="table" style="width:100%">
<th style="width: 200px">{l s='Name'}</th> <tr>
{if $shop_is_feature_active}<th style="width: 200px">{l s='Shop'}</th>{/if} <th class="left">{l s='Date'}</th>
</tr> <th class="left">{l s='Name'}</th>
{foreach $referrers as $referrer} {if $shop_is_feature_active}<th class="left">{l s='Shop'}</th>{/if}
<tr> </tr>
<td>{$referrer['date_add']}</td> {foreach $referrers as $referrer}
<td>{$referrer['name']}</td> <tr>
{if $shop_is_feature_active}<td>{$referrer['shop_name']}</td>{/if} <td class="left">{$referrer['date_add']}</td>
</tr> <td class="left">{$referrer['name']}</td>
{/foreach} {if $shop_is_feature_active}<td class="left">{$referrer['shop_name']}</td>{/if}
</table> </tr>
{/if} {/foreach}
</table>
{/if}
</div>
</div>
{/block} {/block}
</div> </div>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>