1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
|
<?php $page_settings = array( 'formid' => 'Supplier', // for permission 'section' => 'Supplier', // parent/page title 'subsection' => 'Supplier', // page title 'domain' => 'supplier', // table/model name 'access' => 'GNr', // for permission ); require_once "check_login.php";
$action = 'Modify'; // Add or Modify
$row = Supplier::find((int)$_GET["id"]);
$currencies = Currency::whereDeleted(0)->orderBy('iso_code', 'ASC')->get(); ?> <!DOCTYPE html> <html> <head> <?php require_once "_html_head.php"; ?> </head> <body class="hold-transition skin-blue sidebar-mini"> <div class="wrapper">
<?php require_once "_header.php"; ?>
<?php require_once "_menu.php"; ?>
<!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header">
<h1> <?= _lang($page_settings['subsection']) ?> <small><?= _lang($action == "Add" ? "Create" : "Update") ?></small> </h1>
<ol class="breadcrumb"> <li><?= _lang("Home") ?></li> <li> <a href="<?= $page_settings['domain'] ?>_index.php"><i class="fa"></i> <?= _lang($page_settings['subsection']) ?> </a></li> <li class="active"><?= $row['code'] ?></li> </ol>
</section>
<!-- Main content --> <section class="content">
<!-- Your Page Content Here -->
<!-- main form --> <form action="<?= $page_settings['domain'] ?>_modify.php" class="myform" method="POST" enctype="multipart/form-data"> <input type="hidden" name="id" value="<?= _h($row['id']) ?>"/>
<div class="row"> <div class="col-xs-12"> <div class="box">
<div class="box-header"> <div class="row col-md-12" data-spy="affix" data-offset="200" style="z-index: 20;"> <div class="col-md-3"> <div class="btn-group"> <a href="<?= $page_settings['domain'] ?>_index.php" class="btn btn-default"><i class="fa fa-chevron-left" aria-hidden="true"></i> <?= _lang('Cancel') ?> </a>
<button type="submit" class="btn btn-primary"> <i class="fa fa-floppy-o" aria-hidden="true"></i> <?= _lang('Save') ?> </button>
</div> </div> <div class="col-md-6"> <h3 class="box-title"><?= _h($row["name_{$_SESSION["wlangcode"]}"]) ?> (<?= _h($row["code"]) ?>)</h3> </div> <div class="col-md-3"> <em><?= _lang('Updated') ?>: <time><?= _h($row["lastupdate"]) ?></time> (<?= _h($row->updater_name()) ?>)</em> </div> </div> </div>
<!-- /.box-header --> <div class="box-body">
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?= _lang("Code") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="code" value="<?= $row['code'] ?>" placeholder="" autofocus="" readonly>
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<?php foreach ($arraylangcode as $langcode => $langname) { ?> <div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?= lang("Name") ?> <br>[<?= $langname; ?>]</label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="name_<?= $langcode ?>" value="<?= $row["name_" . $langcode] ?>" placeholder="" autofocus="" required>
<p class="help-block"></p> </div> </div> <!-- /.form-group --> <?php } ?>
<?php foreach ($arraylangcode as $langcode => $langname) { ?> <div class="col-md-12 form-group"> <label for="" class="col-md-12 control-label"><?= lang("Description") ?> [<?= $langname; ?>]</label>
<div class="col-md-12"> <textarea name="desc_<?= $langcode ?>" class="form-control input-sm editor" style="height: 150px;"><?= _h($row['desc_' . $langcode]) ?></textarea> <!-- <input type="text" class="form-control input-sm" name="desc_<?= $langcode ?>" value="<?= $row["desc_" . $langcode] ?>" placeholder="" autofocus=""> -->
<p class="help-block"></p> </div> </div> <!-- /.form-group --> <?php } ?>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?= _lang("Receive Order Email") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="receive_order_email" value="<?= $row['receive_order_email'] ?>" placeholder="" autofocus="">
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?= _lang("Email Language") ?></label>
<div class="col-md-8"> <select name="email_langcode" class="form-control input-sm"> <?php foreach ($arraylangcode as $langcode => $langname) { echo '<option value="'.$langcode.'" '.($row["email_langcode"] == $langcode?"selected":"").'>'.$langname.'</option>'; } ?> </select> <p class="help-block"></p> </div> </div>
<div class="clearfix"></div>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?=_lang("Live Chat")?></label>
<div class="col-md-4"> <select name="livechat_type" class="form-control input-sm"> <option value=""></option> <?=select_options(MasterTypeCode::where('typeid', 'LIVECHAT_TYPE')->get(), $row["livechat_type"])?> </select> </div> <div class="col-md-4"> <input type="text" class="form-control input-sm" name="livechat_id" value="<?=$row["livechat_id"]?>" placeholder="ID"> </div> </div>
<div class="clearfix"></div>
<hr/> <!-- <div class="col-md-12 form-group"> <h3>Payment</h3> </div> --> <div class="clearfix"></div>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?= _lang("PayEase Account Code") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="payease_account_code" value="<?= $row['payease_account_code'] ?>" placeholder="" autofocus="" required>
<!-- <p class="help-block"><?=_lang('v_mid')?></p> --> </div> </div> <!-- /.form-group -->
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?= _lang("PayEase Sub Merchant Number") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="payease_sub_merchant_number" value="<?= $row['payease_sub_merchant_number'] ?>" placeholder="" autofocus="" required>
<p class="help-block"></p> </div> </div> <!-- /.form-group --> <div class="clearfix"></div>
<!-- <div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?= _lang("PayEase Refund Operator") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="payease_v_refoprt" value="<?= $row['payease_v_refoprt'] ?>" placeholder="" autofocus="" required>
<p class="help-block"><?=_lang('v_refoprt')?></p> </div> </div> --> <!-- /.form-group -->
<div class="clearfix"></div>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?= _lang("Bank Account Number") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="payease_bank_client_accountcode" value="<?= $row['payease_bank_client_accountcode'] ?>" placeholder="" autofocus="">
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?= _lang("Bank Account Name") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="payease_bank_client_name" value="<?= $row['payease_bank_client_name'] ?>" placeholder="" autofocus="">
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<div class="clearfix"></div>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?= _lang("Bank Name") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="payease_bank_name" value="<?= $row['payease_bank_name'] ?>" placeholder="" autofocus="">
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?= _lang("Bank Province") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="payease_bank_province" value="<?= $row['payease_bank_province'] ?>" placeholder="" autofocus="">
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<div class="clearfix"></div>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?= _lang("Bank City") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="payease_bank_city" value="<?= $row['payease_bank_city'] ?>" placeholder="" autofocus="">
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?= _lang("Bank Code") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="payease_bank_code" value="<?= $row['payease_bank_code'] ?>" placeholder="" autofocus="">
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?= _lang("Platform Commission Value") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="platform_commission_value" value="<?= $row['platform_commission_value'] ?>" placeholder="" autofocus="" required>
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?= _lang("Platform Commission Method") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="" value="<?= lang("Percentage") ?>" readonly="readonly">
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<!-- <div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?= _lang("Notification Callback URL") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="notification_callback_url" value="<?= $row['notification_callback_url'] ?>" placeholder="" autofocus="">
<p class="help-block"></p> </div> </div> --> <!-- /.form-group -->
<!-- <div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?= _lang("Currency") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="currency_code" value="<?= $row['currency_code'] ?>" placeholder="" autofocus="" readonly="readonly">
<p class="help-block"></p> </div> </div> --> <!-- /.form-group -->
<div class="col-md-6 form-group"> <label for="" class="col-sm-4 control-label required_field"><?= _lang("Currency") ?></label>
<div class="col-sm-8"> <select class="form-control input-sm select2 readonly" name="currency_code" id="currency_code" value="<?= $row['currency_code'] ?>" style="width:100%;" readonly="readonly" disabled> <option value=""></option> <?php foreach ($currencies as $currency) { ?> <option value="<?= $currency['iso_code'] ?>" <?= $currency['iso_code'] == $row['currency_code'] ? 'selected="selected"' : '' ?> ><?= $currency['iso_code'] ?> - <?= $currency['name_en'] ?></option> <?php } ?> </select>
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<div class="col-md-6 form-group"> <label for="" class="col-sm-4 control-label"><?=lang("Payment Type");?></label> <div class="col-sm-8"> <select name="settlement_payment_type" class="form-control" style="width: 100%" data-allow-clear="true" data-placeholder=""> <option value=""></option> <?=select_options(MasterTypeCode::where('typeid', 'PAYMENT_TYPE')->whereDeleted(0)->get(), $row['settlement_payment_type']);?> </select> </div> </div>
<!-- <div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?= _lang("Currency Rate") ?> (CNY/<span class="curcode"><?= $row['currency_code'] ?></span>)</label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="currency_rate" value="<?= $row['currency_rate'] ?>" placeholder="" autofocus="">
<p class="help-block"></p> </div> </div> --> <!-- /.form-group --> <div class="clearfix"></div>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?=_lang("Settlement Type")?></label>
<div class="col-md-8"> <?php if($_SESSION['is_agent'] == 1){ ?> <?=_lang("Agent")?> <input type="hidden" name="settlement_type" value="AGENT" /> <?php } else { ?> <select class="form-control" name="settlement_type" id="settlement_type" required> <?=select_options(MasterTypeCode::where('typeid', 'SETTLEMENT_TYPE')->get(), $row['settlement_type'])?> </select> <?php } ?> </div> </div>
<div class="col-md-6 form-group" data-visible-settlementType="AGENT"> <label for="" class="col-md-4 control-label required_field"><?=_lang("Agent")?></label>
<div class="col-md-8"> <?php if ($_SESSION['is_agent'] == 1) { $agent = Agent::find($_SESSION['agent_id']); echo $agent["name_" . $_SESSION["wlangcode"]]; echo '<input type="hidden" name="agent_id" value="'.$_SESSION['agent_id'].'" />'; } else { ?> <select class="form-control" name="agent_id" required=""> <?= select_options(Agent::whereDeleted(0)->get(), $row['agent_id'], ['value_field' => 'id']) ?> </select> <?php } ?> </div> </div> <!-- /.form-group --> <div class="clearfix"></div>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?=_lang("Threshold Type")?></label>
<div class="col-md-8"> <label class="radio-inline"> <input type="radio" name="billing_method" value="T+n" <?=($row["billing_method"] == "T+n"?"checked":"");?>> <?=_lang("T+n")?> </label> <label class="radio-inline"> <input type="radio" name="billing_method" value="AMOUNT" <?=($row["billing_method"] == "AMOUNT"?"checked":"");?>> <?=_lang("Amount")?> </label> </div> </div>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?=_lang("Threshold Value")?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="billing_value" value="<?=$row["billing_value"]?>" required> </div> </div>
<!-- <div class="col-md-12 form-group"> <h3>Customs</h3> </div> --> <div class="clearfix"></div> <hr/>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?= _lang("Customs Case Number") ?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="case_number" value="<?= $row['case_number'] ?>" placeholder="" autofocus="">
<p class="help-block"></p> </div> </div> <!-- /.form-group -->
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?=_lang("Enterprise Customs Registration Code")?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="ebccode" value="<?=$row["ebccode"]?>"> </div> </div>
<div class="clearfix"></div>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?=_lang("Enterprise Customs Registration Name")?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="ebcname" value="<?=$row["ebcname"]?>"> </div> </div>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label required_field"><?=_lang("Maximum Idle Days From Shipped to Completed")?></label>
<div class="col-md-8"> <input type="text" class="form-control input-sm" name="max_idle_day_from_shipped_to_completed" value="<?=$row["max_idle_day_from_shipped_to_completed"]?>" required> </div> </div>
<div class="clearfix"></div>
<div class="col-md-6 form-group"> <label for="" class="col-md-4 control-label"><?=_lang("Active Product Quota")?></label>
<div class="col-md-8"> <input type="number" class="form-control input-sm" name="active_product_quota" value="<?=$row["active_product_quota"]?>"> </div> </div>
</div> <!-- /.box-body --> </div> <!-- /.box --> </div> <!-- /.col --> </div> <!-- /.row --> </form>
<!-- End of Your Page Content Here -->
</section><!-- /.content --> </div><!-- /.content-wrapper -->
<?php require_once "_footer.php"; ?>
<?php require_once "_aside.php"; ?>
</div><!-- ./wrapper -->
<!-- REQUIRED JS SCRIPTS --> <?php require_once "_html_script.php"; ?> </body> <script type="text/javascript"> $(document).ready(function () { $('#currency_code').on('change', function (e) { $('span.curcode').html($(this).val()); }).change();
$('#settlement_type').on('change', function (e) { // console.log('div[data-visible-settlementType=' + $(this).val() + ']'); $('div[data-visible-settlementType]').hide(); $('div[data-visible-settlementType="' + $(this).val() + '"]').show(); }).change(); }); </script> </html>
|