PageRenderTime 26ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/home/administrator/components/com_hikashop/extensions/plg_hikashopshipping_canadapost/canadapost_configuration.php

https://bitbucket.org/rubbystar/carimod
PHP | 229 lines | 220 code | 2 blank | 7 comment | 7 complexity | b97907aefab84984b1e4b598073af503 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, GPL-3.0
  1. <?php
  2. /**
  3. * @package HikaShop for Joomla!
  4. * @version 3.0.0
  5. * @author hikashop.com
  6. * @copyright (C) 2010-2017 HIKARI SOFTWARE. All rights reserved.
  7. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
  8. */
  9. defined('_JEXEC') or die('Restricted access');
  10. ?> <script type="text/javascript">
  11. function addRow(){
  12. var count = parseInt(document.getElementById('count_warehouse').value);
  13. document.getElementById('count_warehouse').value=count+1;
  14. var theTable = document.getElementById('warehouse_listing');
  15. var oldRow = document.getElementById('warehouse_##');
  16. var rowData = oldRow.cloneNode(true);
  17. rowData.id = rowData.id.replace(/##/g,count);
  18. theTable.appendChild(rowData);
  19. for (var c = 0,m=oldRow.cells.length;c<m;c++){
  20. rowData.cells[c].innerHTML = rowData.cells[c].innerHTML.replace(/##/g,count);
  21. }
  22. <?php if(HIKASHOP_BACK_RESPONSIVE) { ?>
  23. try {
  24. jQuery('#warehouse_'+count+'_units_input').removeClass("chzn-done").chosen();
  25. }catch(e){}
  26. <?php } ?>
  27. return false;
  28. }
  29. </script>
  30. <tr>
  31. <td class="key">
  32. <label for="data[shipping][shipping_params][merchant_ID]">
  33. <?php echo JText::_( 'ATOS_MERCHANT_ID' ); ?>
  34. </label>
  35. </td>
  36. <td>
  37. <input type="text" name="data[shipping][shipping_params][merchant_ID]" value="<?php echo @$this->element->shipping_params->merchant_ID; ?>" />
  38. </td>
  39. </tr>
  40. <tr>
  41. <td class="key">
  42. <label for="data[shipping][shipping_params][turnaround_time]">
  43. <?php echo JText::_( 'CANADAPOST_TURNAROUND' ); ?>
  44. </label>
  45. </td>
  46. <td>
  47. <input type="text" name="data[shipping][shipping_params][turnaround_time]" value="<?php echo @$this->element->shipping_params->turnaround_time; ?>" />
  48. </td>
  49. </tr>
  50. <tr>
  51. <td colspan="2">
  52. <fieldset>
  53. <legend><?php echo JText::_( 'WAREHOUSE' ); ?></legend>
  54. <div style="text-align:right;">
  55. <button class="btn" type="button" onclick="return addRow();">
  56. <img src="<?php echo HIKASHOP_IMAGES; ?>add.png"/><?php echo JText::_('ADD');?>
  57. </button>
  58. </div>
  59. <table class="adminlist table table-striped" cellpadding="1" width="100%" id="warehouse_listing_table">
  60. <thead>
  61. <tr>
  62. <th class="title">
  63. <?php echo JText::_( 'HIKA_NAME' ); ?>
  64. </th>
  65. <th class="title">
  66. <?php echo JText::_( 'POST_CODE' ); ?>
  67. </th>
  68. <th class="title">
  69. <?php echo JText::_( 'ZONE' ); ?>
  70. </th>
  71. <th class="title">
  72. <?php echo JText::_( 'DELETE_ZONE' ); ?>
  73. </th>
  74. <th class="title">
  75. <?php echo JText::_( 'UNITS' ); ?>
  76. </th>
  77. <th class="title">
  78. <?php echo JText::_( 'HIKA_DELETE' ); ?>
  79. </th>
  80. </tr>
  81. </thead>
  82. <tbody id="warehouse_listing">
  83. <?php
  84. $a = @count($this->element->shipping_params->warehouse);
  85. if(!$a){ $a++; }
  86. for($i = 0;$i<$a;$i++){
  87. $row =@$this->element->shipping_params->warehouse[$i];
  88. ?>
  89. <tr class="row0" id="warehouse_<?php echo $i;?>">
  90. <td>
  91. <input size="10" type="text" id="warehouse_<?php echo $i;?>_name" name="warehouse[<?php echo $i;?>][name]" value="<?php echo @$row->name; ?>"/>
  92. </td>
  93. <td>
  94. <div id="warehouse_<?php echo $i;?>_zip">
  95. <input size="10" type="text" id="warehouse_<?php echo $i;?>_zip_input" name="warehouse[<?php echo $i;?>][zip]" value="<?php echo @$row->zip; ?>"/>
  96. </div>
  97. </td>
  98. <td class="hk_center">
  99. <span id="warehouse_<?php echo $i;?>_zone">
  100. <?php if(!empty($row->zone_name)){ echo $row->zone_name;} ?>
  101. <input type="hidden" name="warehouse[<?php echo $i;?>][zone]" value="<?php echo @$row->zone ?>"/>
  102. </span>
  103. <a class="modal" rel="{handler: 'iframe', size: {x: 760, y: 480}}" href="<?php echo hikashop_completeLink("zone&task=selectchildlisting&type=shipping&subtype=warehouse_".$i."_zone&map=warehouse[".$i."][zone]&tmpl=component"); ?>" >
  104. <img src="<?php echo HIKASHOP_IMAGES; ?>edit.png"/>
  105. </a>
  106. </td>
  107. <td class="hk_center">
  108. <a href="#" onclick="return deleteZone('warehouse_<?php echo $i;?>_zone');">
  109. <img src="../media/com_hikashop/images/delete.png"/>
  110. </a>
  111. </td>
  112. <td>
  113. <select id="warehouse_<?php echo $i;?>_units" name="warehouse[<?php echo $i;?>][units]">
  114. <option <?php if(@$row->units=='lb') echo "selected=\"selected\""; ?> value="lb">LB/IN</option>
  115. <option <?php if(@$row->units=='kg') echo "selected=\"selected\""; ?> value="kg">KG/CM</option>
  116. </select>
  117. </td>
  118. <td class="hk_center">
  119. <a href="#" onclick="return deleteRow('warehouse_<?php echo $i;?>_zip','warehouse_<?php echo $i;?>_zip_input','warehouse_<?php echo $i;?>');">
  120. <img src="../media/com_hikashop/images/delete.png"/>
  121. </a>
  122. </td>
  123. </tr>
  124. <?php
  125. }
  126. ?>
  127. </tbody>
  128. </table>
  129. <input type="hidden" name="count_warehouse" value="<?php echo $a;?>" id="count_warehouse" />
  130. <div style="display:none">
  131. <table class="adminlist table table-striped" cellpadding="1" width="100%" id="warehouse_listing_table_row">
  132. <tr class="row0" id="warehouse_##">
  133. <td>
  134. <input size="10" type="text" id="warehouse_##_name" name="warehouse[##][name]" value="-"/>
  135. </td>
  136. <td>
  137. <div id="warehouse_##_zip">
  138. <input size="10" type="text" id="warehouse_##_zip_input" name="warehouse[##][zip]" value="-"/>
  139. </div>
  140. </td>
  141. <td class="hk_center">
  142. <span id="warehouse_##_zone">
  143. <input type="hidden" name="warehouse[##][zone]" value=""/>
  144. </span>
  145. <a class="modal" rel="{handler: 'iframe', size: {x: 760, y: 480}}" href="<?php echo hikashop_completeLink("zone&task=selectchildlisting&type=shipping&subtype=warehouse_##_zone&map=warehouse[##][zone]&tmpl=component"); ?>" onclick="SqueezeBox.fromElement(this,{parse: 'rel'});return false;" >
  146. <img src="<?php echo HIKASHOP_IMAGES; ?>edit.png"/>
  147. </a>
  148. </td>
  149. <td class="hk_center">
  150. <a href="#" onclick="return deleteZone('warehouse_##_zone');">
  151. <img src="../media/com_hikashop/images/delete.png"/>
  152. </a>
  153. </td>
  154. <td>
  155. <select class="chzn-done" id="warehouse_##_units_input" name="warehouse[##][units]">
  156. <option value="lb">LB/IN</option>
  157. <option value="kg">KG/CM</option>
  158. </select>
  159. </td>
  160. <td class="hk_center">
  161. <a href="#" onclick="return deleteRow('warehouse_##_zip','warehouse_##_zip_input','warehouse_##');">
  162. <img src="../media/com_hikashop/images/delete.png"/>
  163. </a>
  164. </td>
  165. </tr>
  166. </table>
  167. </div>
  168. </fieldset>
  169. </td>
  170. </tr>
  171. <tr>
  172. <td class="key">
  173. <label for="data[shipping][shipping_params][services]">
  174. <?php echo JText::_( 'SHIPPING_SERVICES' ); ?>
  175. </label>
  176. </td>
  177. <td id="shipping_services_list">
  178. <?php
  179. echo '<a style="cursor: pointer;" onclick="checkAllBox(\'shipping_services_list\',\'check\');">'.JText::_('SELECT_ALL').'</a> / <a style="cursor: pointer;" onclick="checkAllBox(\'shipping_services_list\',\'uncheck\');">'.JText::_('UNSELECT_ALL').'</a><br/>';
  180. $i=-1; foreach($this->data['canadapost_methods'] as $method){
  181. $i++;
  182. $varName=$method['name'];
  183. ?>
  184. <input name="data[shipping_methods][<?php echo $varName;?>][name]" type="checkbox" value="<?php echo $varName;?>" <?php echo (isset($this->element->shipping_params->methods[$varName])?'checked="checked"':''); ?>/><?php echo $method['name'].' ('.$method['countries'].')'; ?><br/>
  185. <?php } ?>
  186. </td>
  187. </tr>
  188. <tr>
  189. <td class="key">
  190. <label for="data[shipping][shipping_params][group_package]">
  191. <?php echo JText::_( 'GROUP_PACKAGE' ); ?>
  192. </label>
  193. </td>
  194. <td>
  195. <?php echo JHTML::_('hikaselect.booleanlist', "data[shipping][shipping_params][group_package]" , '',@$this->element->shipping_params->group_package ); ?>
  196. </td>
  197. </tr>
  198. <tr>
  199. <td class="key">
  200. <label for="data[shipping][shipping_params][readyToShip]">
  201. <?php echo JText::_( 'CANADAPOST_READYTOSHIP' ); ?>
  202. </label>
  203. </td>
  204. <td>
  205. <?php echo JHTML::_('hikaselect.booleanlist', "data[shipping][shipping_params][readyToShip]" , '',@$this->element->shipping_params->readyToShip ); ?>
  206. </td>
  207. </tr>
  208. <tr>
  209. <td class="key">
  210. <label for="data[shipping][shipping_params][weight_approximation]">
  211. <?php echo JText::_( 'UPS_WEIGHT_APPROXIMATION' ); ?>
  212. </label>
  213. </td>
  214. <td>
  215. <input size="5" type="text" name="data[shipping][shipping_params][weight_approximation]" value="<?php echo @$this->element->shipping_params->weight_approximation; ?>" />%
  216. </td>
  217. </tr>
  218. <tr>
  219. <td class="key">
  220. <label for="data[shipping][shipping_params][dim_approximation]">
  221. <?php echo JText::_( 'DIMENSION_APPROXIMATION' ); ?>
  222. </label>
  223. </td>
  224. <td>
  225. <input size="5" type="text" name="data[shipping][shipping_params][dim_approximation]" value="<?php echo @$this->element->shipping_params->dim_approximation; ?>" />%
  226. </td>
  227. </tr>