index.php 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * FecShop file.
  4. *
  5. * @link http://www.fecshop.com/
  6. * @copyright Copyright (c) 2016 FecShop Software LLC
  7. * @license http://www.fecshop.com/license/
  8. */
  9. use fec\helpers\CRequest;
  10. ?>
  11. <div class="account-ds">
  12. <div class="bar bar-nav account-top-m">
  13. <a external class="button button-link button-nav pull-left" href="<?= Yii::$service->url->getUrl('customer/account/index'); ?>">
  14. <span class="icon icon-left"></span>
  15. </a>
  16. <h1 class='title'><?= Yii::$service->page->translate->__('Customer Address'); ?></h1>
  17. </div>
  18. </div>
  19. <?= Yii::$service->page->widget->render('flashmessage'); ?>
  20. <div class="main container two-columns-left">
  21. <div class="col-main account_center">
  22. <div class="std">
  23. <div style="margin:4px 0 0">
  24. <table class="addressbook" width="100%" cellspacing="0" cellpadding="0" border="0">
  25. <thead>
  26. <tr class="ress_tit">
  27. <th width="76" valign="middle" align="center" height="31"><?= Yii::$service->page->translate->__('Name');?></th>
  28. <th width="67" valign="middle" align="center"><?= Yii::$service->page->translate->__('Address');?></th>
  29. <th class="th3" width="71" valign="middle" align="center"><?= Yii::$service->page->translate->__('Operation');?></th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. <?php if(is_array($coll) && !empty($coll)): ?>
  34. <?php foreach($coll as $one): ?>
  35. <tr class="">
  36. <td valign="top" align="center"><?= $one['first_name'].' '.$one['last_name'] ?></td>
  37. <td valign="top" align="center">
  38. <?= $one['street1'].' '.$one['street2'] ?><br>
  39. <?= $one['city'] ?>
  40. <?= Yii::$service->helper->country->getStateByContryCode($one['country'],$one['state']); ?>
  41. <?= Yii::$service->helper->country->getCountryNameByKey($one['country']); ?>
  42. <?php if($one['is_default'] == 1): ?>
  43. <br/><span style=" color:#cc0000"><?= Yii::$service->page->translate->__('Default Address');?></span>
  44. <?php endif; ?>
  45. </td>
  46. <td class="ltp" valign="top ltp" align="center">
  47. <a external href="<?= Yii::$service->url->getUrl('customer/address/edit',['address_id' => $one['address_id']]); ?>">
  48. <span class="icon icon-edit"></span>
  49. </a>
  50. <a external href="javascript:deleteAddress(<?= $one['address_id'] ?>)">
  51. <span class="icon icon-remove"></span>
  52. </a>
  53. </td>
  54. </tr>
  55. <?php endforeach; ?>
  56. <?php endif; ?>
  57. </tbody>
  58. </table>
  59. <div class="add_new_address">
  60. <a external href="<?= Yii::$service->url->getUrl('customer/address/edit') ?>" class="button button-light"><?= Yii::$service->page->translate->__('Add New Address');?></a>
  61. </div>
  62. </div>
  63. </div>
  64. <script>
  65. function deleteAddress(address_id){
  66. var r=confirm("<?= Yii::$service->page->translate->__('do you readly want delete this address?') ?>");
  67. if (r==true){
  68. url = "<?= Yii::$service->url->getUrl('customer/address') ?>";
  69. doPost(url, {"method": "remove", "address_id": address_id, "<?= CRequest::getCsrfName() ?>": "<?= CRequest::getCsrfValue() ?>" });
  70. }
  71. }
  72. </script>
  73. </div>
  74. <div class="clear"></div>
  75. </div>