PluginProbe
Welcart e-Commerce / 1.3.17
Welcart e-Commerce v1.3.17
2.12.4 2.12.3 2.11.35 2.12.2 2.12.1 2.11.34 2.11.33 2.11.32 2.11.31 2.11.30 1.3.16 1.3.17 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 292 releases
usc-e-shop / includes / admin_setup.php

admin_setup.php in Welcart e-Commerce 1.3.17, at includes/admin_setup.php

354 lines 25.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 $status = $this->action_status;
3 $message = $this->action_message;
4 $this->action_status = 'none';
5 $this->action_message = '';
6 ?>
7 <script type="text/javascript">
8 jQuery(function($){
9 <?php if($status == 'success'){ ?>
10 $("#anibox").animate({ backgroundColor: "#ECFFFF" }, 2000);
11 <?php }else if($status == 'caution'){ ?>
12 $("#anibox").animate({ backgroundColor: "#FFF5CE" }, 2000);
13 <?php }else if($status == 'error'){ ?>
14 $("#anibox").animate({ backgroundColor: "#FFE6E6" }, 2000);
15 <?php } ?>
16
17 $("#aAdditionalURLs").click(function () {
18 $("#AdditionalURLs").toggle();
19 });
20
21 $(".num").bind("change", function(){ usces_check_num($(this)); });
22 });
23
24 function toggleVisibility(id) {
25 var e = document.getElementById(id);
26 if(e.style.display == 'block')
27 e.style.display = 'none';
28 else
29 e.style.display = 'block';
30 }
31 </script>
32 <div class="wrap">
33 <div class="usces_admin">
34 <h2>Welcart Shop <?php _e('General Setting','usces'); ?></h2>
35 <div id="aniboxStatus" class="<?php echo $status; ?>">
36 <div id="anibox" class="clearfix">
37 <img id="info_image" src="<?php echo USCES_PLUGIN_URL; ?>/images/list_message_<?php echo $status; ?>.gif" />
38 <div class="mes" id="info_massage"><?php echo $message; ?></div>
39 </div>
40 </div>
41 <form action="" method="post" name="option_form" id="option_form">
42 <input name="usces_option_update" type="submit" class="button" value="<?php _e('change decision','usces'); ?>" />
43 <div id="poststuff" class="metabox-holder">
44
45 <div class="postbox">
46 <h3 class="hndle"><span><?php _e('Business settings','usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('business_setting');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
47 <div class="inside">
48 <table class="form_table">
49 <?php
50 if($this->display_mode) :
51 ?>
52 <tr height="50">
53 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_display_mode');"><?php _e('Display Modes','usces'); ?></a></th>
54 <?php
55 foreach( (array)$this->display_mode as $key => $label ) {
56 if($key == 'Promotionsale')
57 continue;
58 $checked = $this->options['display_mode'] == $key ? ' checked="checked"' : '';
59 ?>
60 <td width="10"><input name="display_mode" type="radio" id="<?php echo $key; ?>" value="<?php echo $key; ?>"<?php echo $checked; ?> /></td>
61 <td width="100"><label for="<?php echo $key; ?>"><?php echo $label; ?></label></td>
62 <?php
63 }
64 ?>
65 <td><div id="ex_display_mode" class="explanation">
66 <?php _e('<strong>Normal operating</strong> -Normal display', 'usces'); ?><br />
67 <?php //_e('<strong>Campaign</strong>--Showing the campaige mode', 'usces'); ?><br />
68 <?php _e('<strong>Maintenance</strong> ---Showing maintenance page. Administrater is able to see the page with normal display.', 'usces'); ?></div>
69 </td>
70 </tr>
71 <?php endif; ?>
72 </table>
73 <table class="form_table">
74 <tr>
75 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_cat');"><?php _e('Campaign target items', 'usces'); ?></a></th>
76 <td>
77 <?php
78 $dropdown_selected = (USCES_ITEM_CAT_PARENT_ID == $this->options['campaign_category']) ? 0 : $this->options['campaign_category'];
79 $dropdown_options = array('show_option_all' => __('all the items', 'usces'), 'hide_empty' => 0, 'hierarchical' => 1, 'orderby' => 'name', 'child_of' => USCES_ITEM_CAT_PARENT_ID, 'selected' => $dropdown_selected);
80 wp_dropdown_categories($dropdown_options);
81 ?>
82 </td>
83 <td><div id="ex_cat" class="explanation"><?php _e("This is a category of the objects to add a privilege to in the case of a campaign mode. You can choose a campaign object article freely by installing a 'campaign' category for an article.", 'usces'); ?></div></td>
84 </tr>
85 </table>
86 <table class="form_table">
87 <tr>
88 <th rowspan="2"><a style="cursor:pointer;" onclick="toggleVisibility('ex_cat_privilege');"><?php _e('Campaign Award', 'usces'); ?></a></th>
89 <td><input name="cat_privilege" type="radio" id="privilege_point" value="point"<?php if($this->options['campaign_privilege'] == 'point') echo 'checked="checked"'; ?> /></td><td><label for="privilege_point"><?php _e('Points', 'usces'); ?></label></td><td><input name="point_num" type="text" class="short_str num" value="<?php echo esc_attr($this->options['privilege_point']); ?>" /><?php _e('times', 'usces'); ?></td>
90 <td rowspan="2"><div id="ex_cat_privilege" class="explanation"><?php _e("'Points' award applies only for monmbers. You specify the ratio of rate points. <br />'Discount'is specified in the discount rate applies to all buyers.", 'usces'); ?></div></td>
91 </tr>
92 <tr>
93 <td><input name="cat_privilege" type="radio" id="privilege_discount" value="discount"<?php if($this->options['campaign_privilege'] == 'discount') echo 'checked="checked"'; ?> /></td><td><label for="privilege_discount"><?php _e('Disnount', 'usces'); ?></label></td><td><input name="discount_num" type="text" class="short_str num" value="<?php echo esc_attr($this->options['privilege_discount']); ?>" />%</td>
94 </tr>
95 </table>
96 <hr size="1" color="#CCCCCC" />
97 <div id="business_setting" class="explanation"><?php _e('Configuration of management and display mode of shop.', 'usces'); ?></div>
98 </div>
99 </div><!--postbox-->
100
101 <div class="postbox">
102 <h3 class="hndle"><span><?php _e('Shop setting', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('shop_setting');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
103 <div class="inside">
104 <table class="form_table">
105 <tr>
106 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_company_name');"><?php _e('The company name', 'usces'); ?></a></th>
107 <td><input name="company_name" type="text" class="long_str" value="<?php echo esc_attr($this->options['company_name']); ?>" /></td>
108 <td><div id="ex_company_name" class="explanation"><?php _e('Fill out this if you are a corporation.', 'usces'); ?></div></td>
109 </tr>
110 <tr>
111 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_zip_code');"><?php _e('Zip/Postal Code', 'usces'); ?></a></th>
112 <td><input name="zip_code" type="text" class="short_str" value="<?php echo esc_attr($this->options['zip_code']); ?>" /></td>
113 <td><div id="ex_zip_code" class="explanation"><?php _e('Example)', 'usces'); ?><?php _e('100-1001', 'usces'); ?></div></td>
114 </tr>
115 <tr>
116 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_address1');"><?php _e('Address', 'usces'); ?>1</a></th>
117 <td><input name="address1" type="text" class="long_str" value="<?php echo esc_attr($this->options['address1']); ?>" /></td>
118 <td><div id="ex_address1" class="explanation"><?php _e('Example)', 'usces'); ?></div></td>
119 </tr>
120 <tr>
121 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_address2');"><?php _e('Address', 'usces'); ?>2</a></th>
122 <td><input name="address2" type="text" class="long_str" value="<?php echo esc_attr($this->options['address2']); ?>" /></td>
123 <td><div id="ex_address2" class="explanation"><?php _e('Example)', 'usces'); ?></div></td>
124 </tr>
125 <tr>
126 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_tel_number');"><?php _e('Phone number', 'usces'); ?></a></th>
127 <td><input name="tel_number" type="text" class="long_str" value="<?php echo esc_attr($this->options['tel_number']); ?>" /></td>
128 <td><div id="ex_tel_number" class="explanation"><?php _e('Example)', 'usces'); ?><?php _e('100-100-10000', 'usces'); ?></div></td>
129 </tr>
130 <tr>
131 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_fax_number');"><?php _e('FAX number', 'usces'); ?></a></th>
132 <td><input name="fax_number" type="text" class="long_str" value="<?php echo esc_attr($this->options['fax_number']); ?>" /></td>
133 <td><div id="ex_fax_number" class="explanation"><?php _e('Example)', 'usces'); ?><?php _e('100-100-10000', 'usces'); ?></div></td>
134 </tr>
135 <tr>
136 <th><em><?php _e('*', 'usces'); ?> </em><a style="cursor:pointer;" onclick="toggleVisibility('ex_order_mail');"><?php _e('E-mail address for ordering', 'usces'); ?></a></th>
137 <td><input name="order_mail" type="text" class="long_str" value="<?php echo esc_attr($this->options['order_mail']); ?>" /></td>
138 <td><div id="ex_order_mail" class="explanation"><?php _e("<em>[Required]</em> the administrator's e-mail address to receive the order", 'usces'); ?></div></td>
139 </tr>
140 <tr>
141 <th><em><?php _e('*', 'usces'); ?> </em><a style="cursor:pointer;" onclick="toggleVisibility('ex_inquiry_mail');"><?php _e('Contact e-mail address', 'usces'); ?></a></th>
142 <td><input name="inquiry_mail" type="text" class="long_str" value="<?php echo esc_attr($this->options['inquiry_mail']); ?>" /></td>
143 <td><div id="ex_inquiry_mail" class="explanation"><?php _e("<em>[Required]</em> the administrator's e-mail address to receive the contact meils.", 'usces'); ?></div></td>
144 </tr>
145 <tr>
146 <th><em><?php _e('*', 'usces'); ?> </em><a style="cursor:pointer;" onclick="toggleVisibility('ex_sender_mail');"><?php _e("Sender's e-mail address", 'usces'); ?></a></th>
147 <td><input name="sender_mail" type="text" class="long_str" value="<?php echo esc_attr($this->options['sender_mail']); ?>" /></td>
148 <td><div id="ex_sender_mail" class="explanation"><?php _e("<em>[Required]</em> the sender's e-mail address to send 'thank you e-mail' to cuscomers.", 'usces'); ?></div></td>
149 </tr>
150 <tr>
151 <th><em><?php _e('*', 'usces'); ?> </em><a style="cursor:pointer;" onclick="toggleVisibility('ex_error_mail');"><?php _e('Address for Error mail', 'usces'); ?></a></th>
152 <td><input name="error_mail" type="text" class="long_str" value="<?php echo esc_attr($this->options['error_mail']); ?>" /></td>
153 <td><div id="ex_error_mail" class="explanation"><?php _e("<em>[Required]</em>The transmission of a message ahead of the error email.", 'usces'); ?></div></td>
154 </tr>
155 <tr>
156 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_copyright');"><?php _e('copy rights', 'usces'); ?></a></th>
157 <td><input name="copyright" type="text" class="long_str" value="<?php echo esc_attr($this->options['copyright']); ?>" /></td>
158 <td><div id="ex_copyright" class="explanation"><?php _e('Example)', 'usces'); ?>Copyright(c) 2009 Welcart.inc All Rights Reserved.</div></td>
159 </tr>
160 </table>
161 <table class="form_table">
162 <tr>
163 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_postage_privilege');"><?php _e('Conditions for free shipping', 'usces'); ?></a></th>
164 <td><input name="postage_privilege" type="text" class="short_str num" value="<?php echo esc_attr($this->options['postage_privilege']); ?>" /><?php _e('Above', 'usces'); ?></td>
165 <td><div id="ex_postage_privilege" class="explanation"><?php _e('Total purchase prise to have free shipping. Leave it blank if it is not necessary.', 'usces'); ?></div></td>
166 </tr>
167 </table>
168 <table class="form_table">
169 <tr>
170 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_purchase_limit');"><?php _e('default limitation number of purchase', 'usces'); ?></a></th>
171 <td><input name="purchase_limit" type="text" class="short_str num" value="<?php echo esc_attr($this->options['purchase_limit']); ?>" /><?php _e('maximum amount', 'usces'); ?></td>
172 <td><div id="ex_purchase_limit" class="explanation"><?php _e('initial value at registration of items. Leave it blank if it is not necessary.', 'usces'); ?></div></td>
173 </tr>
174 <tr>
175 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_rule');"><?php _e('initial value of date of sending out.', 'usces'); ?></a></th>
176 <td><select name="shipping_rule" class="short_select">
177 <?php foreach( (array)$this->shipping_rule as $key => $label){ $selected = $key == $this->options['shipping_rule'] ? ' selected="selected"' : ''; ?>
178 <option value="<?php echo $key; ?>"<?php echo $selected; ?>><?php echo $label; ?></option>
179 <?php } ?>
180 </select></td>
181 <td><div id="ex_shipping_rule" class="explanation"><?php _e('initial value at registration of items. Do not chose this if it does not apply to you.', 'usces'); ?></div></td>
182 </tr>
183 <tr>
184 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_tax_rate');"><?php _e('Percentage of Consumption tax', 'usces'); ?></a></th>
185 <td><input name="tax_rate" type="text" class="short_str num" value="<?php echo esc_attr($this->options['tax_rate']); ?>" />%</td>
186 <td><div id="ex_tax_rate" class="explanation"><?php _e('Leave it as blank if tax is included', 'usces'); ?></div></td>
187 </tr>
188 </table>
189 <table class="form_table">
190 <tr>
191 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_tax_method');"><?php _e('method of Calculation of the tax', 'usces'); ?></a></th>
192 <td width="10"><input name="tax_method" id="tax_method_cutting" type="radio" value="cutting"<?php if($this->options['tax_method'] == 'cutting') echo 'checked="checked"'; ?> /></td><td width="60"><label for="tax_method_cutting"><?php _e('drop fractions', 'usces'); ?></label></td>
193 <td width="10"><input name="tax_method" id="tax_method_bring" type="radio" value="bring"<?php if($this->options['tax_method'] == 'bring') echo 'checked="checked"'; ?> /></td><td width="60"><label for="tax_method_bring"><?php _e('raise to a unit', 'usces'); ?></label></td>
194 <td width="10"><input name="tax_method" id="tax_method_rounding" type="radio" value="rounding"<?php if($this->options['tax_method'] == 'rounding') echo 'checked="checked"'; ?> /></td><td width="60"><label for="tax_method_rounding"><?php _e('round up numbers of five and above and round down anything under', 'usces'); ?></label></td>
195 <td><div id="ex_tax_method" class="explanation"><?php _e('Leave it as blank if tax is included', 'usces'); ?></div></td>
196 </tr>
197 </table>
198 <table class="form_table">
199 <tr>
200 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_cod_fee');"><?php _e('C.O.D', 'usces'); ?></a></th>
201 <td id="cod_type_field"></td><td><input type="button" name="button_cod_detail" value="<?php _e('Detailed setting', 'usces'); ?>" id="detailed_setting" /></td>
202 <td><div id="ex_cod_fee" class="explanation"><?php _e('Cost for C.O.D. leave it blank if it in not necessary.', 'usces'); ?></div></td>
203 </tr>
204 </table>
205 <table class="form_table">
206 <tr>
207 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_transferee');"><?php _e('Account information for transfer', 'usces'); ?></a></th>
208 <td><textarea name="transferee" class="long_txt"><?php echo esc_html($this->options['transferee']); ?></textarea></td>
209 <td><div id="ex_transferee" class="explanation"><?php _e('The acount number for bank transfer. You can enter the information as you wish. The contents will apear in the mail.', 'usces'); ?></div></td>
210 </tr>
211 </table>
212 <table class="form_table">
213 <tr>
214 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_membersystem_state');"><?php _e('membership syetem', 'usces'); ?></a></th>
215 <td width="10"><input name="membersystem_state" id="membersystem_state_activate" type="radio" value="activate"<?php if($this->options['membersystem_state'] == 'activate') echo 'checked="checked"'; ?> /></td><td width="60"><label for="membersystem_state_activate"><?php _e('to use', 'usces'); ?></label></td>
216 <td width="10"><input name="membersystem_state" id="membersystem_state_deactivate" type="radio" value="deactivate"<?php if($this->options['membersystem_state'] == 'deactivate') echo 'checked="checked"'; ?> /></td><td width="60"><label for="membersystem_state_deactivate"><?php _e('not to use', 'usces'); ?></label></td>
217 <td><div id="ex_membersystem_state" class="explanation"><?php _e('Would you like to use membership system or not?', 'usces'); ?></div></td>
218 </tr>
219 <tr>
220 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_membersystem_point');"><?php _e('membership points', 'usces'); ?></a></th>
221 <td width="10"><input name="membersystem_point" id="membersystem_point_activate" type="radio" value="activate"<?php if($this->options['membersystem_point'] == 'activate') echo 'checked="checked"'; ?> /></td><td width="60"><label for="membersystem_point_activate"><?php _e('to grant', 'usces'); ?></label></td>
222 <td width="10"><input name="membersystem_point" id="membersystem_point_deactivate" type="radio" value="deactivate"<?php if($this->options['membersystem_point'] == 'deactivate') echo 'checked="checked"'; ?> /></td><td width="60"><label for="membersystem_point_deactivate"><?php _e('not to grant', 'usces'); ?></label></td>
223 <td><div id="ex_membersystem_point" class="explanation"><?php _e("Would you like to use 'points granting syetem' when you choose to use membership system?", 'usces'); ?></div></td>
224 </tr>
225 </table>
226 <table class="form_table">
227 <tr>
228 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_point_rate');"><?php _e('The initial value of point rate', 'usces'); ?></a></th>
229 <td colspan="2"><input name="point_rate" type="text" class="short_str num" value="<?php echo esc_attr($this->options['point_rate']); ?>" />%</td>
230 <td><div id="ex_point_rate" class="explanation"><?php _e('initial value at registration of items. Leave it blank if it is not necessary.', 'usces'); ?></div></td>
231 </tr>
232 <tr>
233 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_start_point');"><?php _e('Point at the registration of membership', 'usces'); ?></a></th>
234 <td colspan="2"><input name="start_point" type="text" class="short_str num" value="<?php echo esc_attr($this->options['start_point']); ?>" />pt</td>
235 <td><div id="ex_start_point" class="explanation"><?php _e('Points granted at the first membersip registration.', 'usces'); ?></div></td>
236 </tr>
237 <tr>
238 <th rowspan="2"><a style="cursor:pointer;" onclick="toggleVisibility('ex_point_coverage');"><?php _e('Areas of Point Redemption', 'usces'); ?></a></th>
239 <td><input name="point_coverage" type="radio" id="point_coverage0" value="0"<?php if( !$this->options['point_coverage'] ) echo 'checked="checked"'; ?> /></td><td width="220"><label for="point_coverage0"><?php _e('Limited Only to Total Merchandise Price', 'usces'); ?></label></td>
240 <td rowspan="2"><div id="ex_point_coverage" class="explanation"><?php _e("Select the scope of the point that customers can use.<br />Default is 'Limited Only to Total Merchandise Price'. 'Applicable to Total Merchandise Price and Handling Fee' If you choose, you can pay shipping and COD fee in points.", 'usces'); ?></div></td>
241 </tr>
242 <tr>
243 <td><input name="point_coverage" type="radio" id="point_coverage1" value="1"<?php if( $this->options['point_coverage'] ) echo 'checked="checked"'; ?> /></td><td width="220"><label for="point_coverage1"><?php _e('Applicable to Total Merchandise Price and Handling Fee', 'usces'); ?></label></td>
244 </tr>
245 </table>
246 <table class="form_table">
247 <tr>
248 <th><a style="cursor:pointer;" onclick="toggleVisibility('ex_point_assign');"><?php _e('Timing point of grant', 'usces'); ?></a></th>
249 <td width="10"><input name="point_assign" id="point_assign_receipt" type="radio" value="1"<?php if($this->options['point_assign'] == 1) echo 'checked="checked"'; ?> /></td><td width="60"><label for="point_assign_receipt"><?php _e('Payment at the time', 'usces'); ?></label></td>
250 <td width="10"><input name="point_assign" id="point_assign_immediately" type="radio" value="0"<?php if( WCUtils::is_zero($this->options['point_assign']) ) echo 'checked="checked"'; ?> /></td><td width="60"><label for="point_assign_immediately"><?php _e('Immediately', 'usces'); ?></label></td>
251 <td><div id="ex_point_assign" class="explanation"><?php _e("The 'immediate', points are given to the shopping upon completion. In the 'payment at the time', bank transfer, or convenience store settlement, points will not be given to the shopping upon completion, grant the point when it becomes a pre-payment.", "usces"); ?></div></td>
252 </tr>
253 </table>
254 <?php do_action( 'usces_action_amdin_setup' ); ?>
255 <hr size="1" color="#CCCCCC" />
256 <div id="shop_setting" class="explanation"><?php _e('the initial rate of the shop', 'usces'); ?></div>
257 </div>
258 </div><!--postbox-->
259
260 <div class="postbox">
261 <h3 class="hndle"><span><?php _e('payment method', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('payment_setting');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
262 <div class="inside">
263 <div id="postpayment"><div id="payment-response"></div>
264 <?php
265 $option_value = usces_get_system_option('usces_payment_method', 'sort');
266 payment_list($option_value);
267 payment_form();
268 ?>
269 <hr size="1" color="#CCCCCC" />
270 <div id="Commonoption" class="explanation"><?php _e('<em>[Required]</em>possible payment method', 'usces'); ?></div>
271 <div id="payment_setting" class="explanation"><?php _e("If you 'Deactivate', it does not appear in the payment method of site.", 'usces'); ?></div>
272 </div>
273 </div>
274 </div><!--postbox-->
275
276 <div class="postbox">
277 <h3 class="hndle"><span><?php _e('Common Options', 'usces'); ?></span></h3>
278 <div class="inside">
279 <div id="postoptcustomstuff"><div id="ajax-response"></div>
280 <?php
281 $opts = usces_get_opts(USCES_CART_NUMBER);
282 list_item_option_meta($opts);
283 common_option_meta_form();
284 ?>
285 <hr size="1" color="#CCCCCC" />
286 <div id="Commonoption" class="explanation"><?php _e("Conditions which will be selected at the purchase. You can use the options which you hve registered here, as an option in the master items.", 'usces'); ?></div>
287 </div>
288 </div>
289 </div><!--postbox-->
290
291 </div><!--poststuff-->
292
293
294
295 <input name="usces_option_update" type="submit" class="button" value="<?php _e('change decision','usces'); ?>" />
296 <input type="hidden" id="post_ID" name="post_ID" value="<?php echo USCES_CART_NUMBER ?>" />
297
298
299 <?php
300 if( 'change' == $this->options['cod_type'] ) {
301 $cod_type = 'change';
302 }else{
303 $cod_type = 'fix';
304 }
305 ?>
306 <div id="cod_dialog" title="<?php _e('C.O.D. Detailed setting', 'usces'); ?>">
307 <p id="cod-response"><?php _e('Please be settled for a fee in spite of Update.', 'usces'); ?></p>
308
309 <fieldset>
310 <table id="cod_type_table">
311 <tr><th><?php _e('Type of the fee', 'usces'); ?></th><td class="radio"><input name="cod_type" id="cod_type_fix" type="radio" value="fix"<?php if( 'fix' == $cod_type) echo ' checked="checked"'; ?> /></td><td><label for="cod_type_fix"><?php _e('Fixation C.O.D.', 'usces'); ?></label></td><td class="radio"><input name="cod_type" id="cod_type_change" type="radio" value="change"<?php if( 'change' == $cod_type) echo ' checked="checked"'; ?> /></td><td><label for="cod_type_change"><?php _e('Variable C.O.D.', 'usces'); ?></label></td></tr>
312 </table>
313 <table id="cod_fix_table">
314 <tr><th><?php _e('Fee', 'usces'); ?></th><td><input name="cod_fee" type="text" class="short_str ui-widget-content ui-corner-all num" value="<?php echo (isset($this->options['cod_fee']) ? $this->options['cod_fee'] : ''); ?>" /><?php usces_crcode(); ?></td></tr>
315 <tr><th><?php _e('The upper limit of the C.O.D.', 'usces'); ?></th><td><input name="cod_limit_amount" id="cod_limit_amount_fix" type="text" class="short_str ui-widget-content ui-corner-all num" value="<?php echo (isset($this->options['cod_limit_amount']) ? $this->options['cod_limit_amount'] : ''); ?>" /><?php usces_crcode(); ?></td></tr>
316 </table>
317 <div id="cod_change_table">
318 <input name="addrow" id="add_row" type="button" value="<?php _e('Add row', 'usces'); ?>" /><input name="delrow" type="button" id="del_row" value="<?php _e('Delete row', 'usces'); ?>" />
319 <table>
320 <thead>
321 <tr><th colspan="3"><?php _e('A purchase amount', 'usces'); ?>(<?php usces_crcode(); ?>)</th><th><?php _e('Fee', 'usces'); ?>(<?php usces_crcode(); ?>)</th></tr>
322 <tr><td class="cod_f">0</td><td class="cod_m"></td><td class="cod_e"><input name="cod_first_amount" type="text" class="short_str ui-widget-content ui-corner-all num" value="<?php echo esc_attr((isset($this->options['cod_first_amount']) ? $this->options['cod_first_amount'] : '')); ?>" /></td><td class="cod_cod"><input name="cod_first_fee" type="text" class="short_str num" value="<?php echo esc_attr((isset($this->options['cod_first_fee']) ? $this->options['cod_first_fee'] : '')); ?>" /></td></tr>
323 </thead>
324 <tbody id="cod_change_field">
325 <?php
326 if( isset($this->options['cod_amounts']) && isset($this->options['cod_fees']) ){
327 foreach ( (array)$this->options['cod_amounts'] as $key => $value ){
328 ?>
329 <tr id="tr_<?php echo esc_attr($key); ?>"><td class="cod_f"><span id="amount_<?php echo esc_attr($key); ?>"><?php if( $key === 0 ){echo ((isset($this->options['cod_first_amount']) ? $this->options['cod_first_amount'] : 0) + 1);}else{echo ($this->options['cod_amounts'][($key-1)] + 1);} ?></span></td><td class="cod_m"></td><td class="cod_e"><input name="cod_amounts[<?php echo esc_attr($key); ?>]" type="text" class="short_str ui-widget-content ui-corner-all num" value="<?php echo esc_attr($value); ?>" /></td><td class="cod_cod"><input name="cod_fees[<?php echo esc_attr($key); ?>]" type="text" class="short_str num" value="<?php echo esc_attr($this->options['cod_fees'][$key]); ?>" /></td></tr>
330 <?php
331 }
332 }
333 if( !isset($this->options['cod_amounts']) || empty($this->options['cod_amounts']) ){
334 $end_amount = (isset($this->options['cod_first_amount']) ? $this->options['cod_first_amount'] : 0) + 1;
335 }else{
336 $cod_last = count($this->options['cod_amounts']) - 1;
337 $end_amount = $this->options['cod_amounts'][$cod_last] + 1;
338 }
339 ?>
340 </tbody>
341 <tfoot>
342 <tr><td class="cod_f"><span id="end_amount"><?php echo esc_attr($end_amount); ?></span></td><td class="cod_m"></td><td class="cod_e"><input name="cod_limit_amount" id="cod_limit_amount_change" type="text" class="short_str ui-widget-content ui-corner-all num" value="<?php echo esc_attr((isset($this->options['cod_limit_amount']) ? $this->options['cod_limit_amount'] : '')); ?>" /></td><td class="cod_cod"><input name="cod_end_fee" type="text" class="short_str num" value="<?php echo esc_attr((isset($this->options['cod_end_fee']) ? $this->options['cod_end_fee'] : '')); ?>" /></td></tr>
343 </tfoot>
344 </table>
345 </div>
346 </fieldset>
347 </div>
348
349
350 </form>
351 </div><!--usces_admin-->
352 </div><!--wrap-->
353
354