PageRenderTime 42ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/admin/view/template/sale/return_form.tpl

https://bitbucket.org/sandeepbhaskar/inspiredliving
Smarty Template | 236 lines | 229 code | 7 blank | 0 comment | 20 complexity | 699d8d4df3d839d97781399105500c65 MD5 | raw file
  1. <?php echo $header; ?>
  2. <div id="content">
  3. <div class="breadcrumb">
  4. <?php foreach ($breadcrumbs as $breadcrumb) { ?>
  5. <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
  6. <?php } ?>
  7. </div>
  8. <?php if ($error_warning) { ?>
  9. <div class="warning"><?php echo $error_warning; ?></div>
  10. <?php } ?>
  11. <div class="box">
  12. <div class="heading">
  13. <h1><img src="view/image/customer.png" alt="" /> <?php echo $heading_title; ?></h1>
  14. <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><?php echo $button_cancel; ?></a></div>
  15. </div>
  16. <div class="content">
  17. <div class="htabs"><a href="#tab-return"><?php echo $tab_return; ?></a><a href="#tab-product"><?php echo $tab_product; ?></a></div>
  18. <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
  19. <div id="tab-return">
  20. <table class="form">
  21. <tr>
  22. <td><span class="required">*</span> <?php echo $entry_order_id; ?></td>
  23. <td><input type="text" name="order_id" value="<?php echo $order_id; ?>" />
  24. <?php if ($error_order_id) { ?>
  25. <span class="error"><?php echo $error_order_id; ?></span>
  26. <?php } ?></td>
  27. </tr>
  28. <tr>
  29. <td><?php echo $entry_date_ordered; ?></td>
  30. <td><input type="text" name="date_ordered" value="<?php echo $date_ordered; ?>" class="date" /></td>
  31. </tr>
  32. <tr>
  33. <td><?php echo $entry_customer; ?></td>
  34. <td><input type="text" name="customer" value="<?php echo $customer; ?>" />
  35. <input type="hidden" name="customer_id" value="<?php echo $customer_id; ?>" /></td>
  36. </tr>
  37. <tr>
  38. <td><span class="required">*</span> <?php echo $entry_firstname; ?></td>
  39. <td><input type="text" name="firstname" value="<?php echo $firstname; ?>" />
  40. <?php if ($error_firstname) { ?>
  41. <span class="error"><?php echo $error_firstname; ?></span>
  42. <?php } ?></td>
  43. </tr>
  44. <tr>
  45. <td><span class="required">*</span> <?php echo $entry_lastname; ?></td>
  46. <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" />
  47. <?php if ($error_lastname) { ?>
  48. <span class="error"><?php echo $error_lastname; ?></span>
  49. <?php } ?></td>
  50. </tr>
  51. <tr>
  52. <td><span class="required">*</span> <?php echo $entry_email; ?></td>
  53. <td><input type="text" name="email" value="<?php echo $email; ?>" />
  54. <?php if ($error_email) { ?>
  55. <span class="error"><?php echo $error_email; ?></span>
  56. <?php } ?></td>
  57. </tr>
  58. <tr>
  59. <td><span class="required">*</span> <?php echo $entry_telephone; ?></td>
  60. <td><input type="text" name="telephone" value="<?php echo $telephone; ?>" />
  61. <?php if ($error_telephone) { ?>
  62. <span class="error"><?php echo $error_telephone; ?></span>
  63. <?php } ?></td>
  64. </tr>
  65. </table>
  66. </div>
  67. <div id="tab-product">
  68. <table class="form">
  69. <tr>
  70. <td><span class="required">*</span> <?php echo $entry_product; ?></td>
  71. <td><input type="text" name="product" value="<?php echo $product; ?>" />
  72. <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
  73. <?php if ($error_product) { ?>
  74. <span class="error"><?php echo $error_product; ?></span>
  75. <?php } ?></td>
  76. </tr>
  77. <tr>
  78. <td><?php echo $entry_model; ?></td>
  79. <td><input type="text" name="model" value="<?php echo $model; ?>" /></td>
  80. </tr>
  81. <tr>
  82. <td><?php echo $entry_quantity; ?></td>
  83. <td><input type="text" name="quantity" value="<?php echo $quantity; ?>" size="3" /></td>
  84. </tr>
  85. <tr>
  86. <td><?php echo $entry_reason; ?></td>
  87. <td><select name="return_reason_id">
  88. <?php foreach ($return_reasons as $return_reason) { ?>
  89. <?php if ($return_reason['return_reason_id'] == $return_reason_id) { ?>
  90. <option value="<?php echo $return_reason['return_reason_id']; ?>" selected="selected"><?php echo $return_reason['name']; ?></option>
  91. <?php } else { ?>
  92. <option value="<?php echo $return_reason['return_reason_id']; ?>"><?php echo $return_reason['name']; ?></option>
  93. <?php } ?>
  94. <?php } ?>
  95. </select></td>
  96. </tr>
  97. <tr>
  98. <td><?php echo $entry_opened; ?></td>
  99. <td><select name="opened">
  100. <?php if ($opened) { ?>
  101. <option value="1" selected="selected"><?php echo $text_opened; ?></option>
  102. <option value="0"><?php echo $text_unopened; ?></option>
  103. <?php } else { ?>
  104. <option value="1"><?php echo $text_opened; ?></option>
  105. <option value="0" selected="selected"><?php echo $text_unopened; ?></option>
  106. <?php } ?>
  107. </select></td>
  108. </tr>
  109. <tr>
  110. <td><?php echo $entry_comment; ?></td>
  111. <td><textarea name="comment" cols="40" rows="5"><?php echo $comment; ?></textarea></td>
  112. </tr>
  113. <tr>
  114. <td><?php echo $entry_action; ?></td>
  115. <td><select name="return_action_id">
  116. <option value="0"></option>
  117. <?php foreach ($return_actions as $return_action) { ?>
  118. <?php if ($return_action['return_action_id'] == $return_action_id) { ?>
  119. <option value="<?php echo $return_action['return_action_id']; ?>" selected="selected"> <?php echo $return_action['name']; ?></option>
  120. <?php } else { ?>
  121. <option value="<?php echo $return_action['return_action_id']; ?>"><?php echo $return_action['name']; ?></option>
  122. <?php } ?>
  123. <?php } ?>
  124. </select></td>
  125. </tr>
  126. <tr>
  127. <td><?php echo $entry_return_status; ?></td>
  128. <td><select name="return_status_id">
  129. <?php foreach ($return_statuses as $return_status) { ?>
  130. <?php if ($return_status['return_status_id'] == $return_status_id) { ?>
  131. <option value="<?php echo $return_status['return_status_id']; ?>" selected="selected"><?php echo $return_status['name']; ?></option>
  132. <?php } else { ?>
  133. <option value="<?php echo $return_status['return_status_id']; ?>"><?php echo $return_status['name']; ?></option>
  134. <?php } ?>
  135. <?php } ?>
  136. </select></td>
  137. </tr>
  138. </table>
  139. </div>
  140. </form>
  141. </div>
  142. </div>
  143. </div>
  144. <script type="text/javascript"><!--
  145. $.widget('custom.catcomplete', $.ui.autocomplete, {
  146. _renderMenu: function(ul, items) {
  147. var self = this, currentCategory = '';
  148. $.each(items, function(index, item) {
  149. if (item.category != currentCategory) {
  150. ul.append('<li class="ui-autocomplete-category">' + item.category + '</li>');
  151. currentCategory = item.category;
  152. }
  153. self._renderItem(ul, item);
  154. });
  155. }
  156. });
  157. $('input[name=\'customer\']').catcomplete({
  158. delay: 0,
  159. source: function(request, response) {
  160. $.ajax({
  161. url: 'index.php?route=sale/customer/autocomplete&token=<?php echo $token; ?>&filter_name=' + encodeURIComponent(request.term),
  162. dataType: 'json',
  163. success: function(json) {
  164. response($.map(json, function(item) {
  165. return {
  166. category: item.customer_group,
  167. label: item.name,
  168. value: item.customer_id,
  169. firstname: item.firstname,
  170. lastname: item.lastname,
  171. email: item.email,
  172. telephone: item.telephone
  173. }
  174. }));
  175. }
  176. });
  177. },
  178. select: function(event, ui) {
  179. $('input[name=\'customer\']').attr('value', ui.item.label);
  180. $('input[name=\'customer_id\']').attr('value', ui.item.value);
  181. $('input[name=\'firstname\']').attr('value', ui.item.firstname);
  182. $('input[name=\'lastname\']').attr('value', ui.item.lastname);
  183. $('input[name=\'email\']').attr('value', ui.item.email);
  184. $('input[name=\'telephone\']').attr('value', ui.item.telephone);
  185. return false;
  186. },
  187. focus: function(event, ui) {
  188. return false;
  189. }
  190. });
  191. //--></script>
  192. <script type="text/javascript"><!--
  193. $('input[name=\'product\']').autocomplete({
  194. delay: 0,
  195. source: function(request, response) {
  196. $.ajax({
  197. url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_name=' + encodeURIComponent(request.term),
  198. dataType: 'json',
  199. success: function(json) {
  200. response($.map(json, function(item) {
  201. return {
  202. label: item.name,
  203. value: item.product_id,
  204. model: item.model
  205. }
  206. }));
  207. }
  208. });
  209. },
  210. select: function(event, ui) {
  211. $('input[name=\'product_id\']').attr('value', ui.item.value);
  212. $('input[name=\'product\']').attr('value', ui.item.label);
  213. $('input[name=\'model\']').attr('value', ui.item.model);
  214. return false;
  215. },
  216. focus: function(event, ui) {
  217. return false;
  218. }
  219. });
  220. //--></script>
  221. <script type="text/javascript"><!--
  222. $(document).ready(function() {
  223. $('.date').datepicker({dateFormat: 'yy-mm-dd'});
  224. });
  225. //--></script>
  226. <script type="text/javascript"><!--
  227. $('.htabs a').tabs();
  228. //--></script>
  229. <?php echo $footer; ?>