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
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
|
<?php include('_init.php');
if ($_SESSION["is_student"] != 1) { header("Location: index.php"); exit; }
$sql = "select profile_id,(select id from `student_main` where cmsloginid = tb.user_id LIMIT 1) as id from `profile_user` as tb where user_id = ? and deleted = ? LIMIT 1"; $parameters = array($_SESSION['cmsloginid'], 0); $row_profile = bind_pdo($sql, $parameters, "selectone");
$row = get_student($row_profile['id']);
if ($row) { $action = 'Modify'; // Add or Modify
$sql99 = "SELECT * FROM sys_cms_login WHERE cmsloginid=?"; $parameters99 = array((int)$row{'cmsloginid'}); $row_user = bind_pdo($sql99, $parameters99, "selectone");
$sql = "select * from `student_instrumentquali` where studentmain_id = ? and deleted = ?"; $parameters = array($row['id'], 0); $count_instrumentquali = bind_pdo($sql, $parameters, "selectall");
} else { $action = 'Add'; // Add or Modify }
$sql = "select * from master_type_code where typeid = ? and deleted = ?"; $parameters = array('RESIDENCE_CODE', 0); $rows_area = bind_pdo($sql, $parameters, "selectall");
$sql = "select * from master_type_code where typeid = ? and deleted = ?"; $parameters = array('CONTACTSTUDENT_REL', 0); $rows_contactstudentrel = bind_pdo($sql, $parameters, "selectall");
$sql = "select * from master_type_code where typeid = ? and deleted = ?"; $parameters = array('CONTACT_TIMERANGE', 0); $rows_contacttimerange = bind_pdo($sql, $parameters, "selectall");
$sql = "select * from master_type_code where typeid = ? and deleted = ? order by sort asc"; $parameters = array('INSTRUMENT_TYPE', 0); $rows_instrument_type = bind_pdo($sql, $parameters, "selectall");
$sql = "select * from master_type_code where typeid = ? and deleted = ? order by sort asc"; $parameters = array('EXPSTUDENTAGE', 0); $rows_yearrange = bind_pdo($sql, $parameters, "selectall"); ?> <!DOCTYPE html> <html lang="en"> <head> <?php include('_head.php'); ?> <script type="text/javascript" src="js/facebook.js"></script> <link href="css/style_k.css?v=<?= time(); ?>" type="text/css" rel="stylesheet">
<style> label { font-weight: 100; margin-right: 10px; }
label input[type="checkbox"] { margin-right: 3px; }
label.col-sm-2 { margin-right: 0px; font-weight: bold; }
.LiTutorCertClass, .LiInstrumentqualiClass { margin-bottom: 5px; }
.LiInstrumentqualiClass .form-control { margin-right: 3px; }
input[type=file] { margin-right: 3px; width: 80%; }
.form-del { height: 30px; width: auto; }
input[type=file], .form-del { display: inline-block; }
.box-header .col-md-12 { padding: 0; }
.box-body .col-sm-2, .box-body .col-sm-10 { padding: 0; } </style>
</head>
<body> <?php include('_header.php') ?>
<?php include('_dialog.php') ?>
<div class="ProfileContent"> <div class="Profilecontainer"> <div class="row"> <div class="col-md-12"> <?php if (!empty($_GET["update"])) { echo '<div class="tc msg_text">' . _lang("Updated") . '</div>'; } ?>
<form action="student_process.php" id="myform" class="myform" method="POST" enctype="multipart/form-data"> <? if ($row['id']) { ?> <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="col-md-10">
</div>
</div>
<!-- /.box-header --> <div class="box-body"> <br> <? if ($row["student_no"]) { ?> <div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label"> <?= _lang("Code") ?> </label> <div class="col-sm-10"> <?= $row["student_no"] ?> </div> </div> </div> <? } ?>
<?php /* ?> <div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label"> <?= lang('Facebook') ?> </label> <div class="col-sm-10"> <? if ($row['facebook_id']) { ?> <input type="button" value="已連結" id="LiConnectFB" class="btn" style="width:200px;"> <? } else { ?> <input type="button" value="連結" id="LiConnectFB" class="btn" style="width:200px;" onclick="statusChangeCallback()"> <div style="color:#F00; display:none;" class="error" id="fbError"> <?= _lang('Your facebook acc. have been used') ?> </div> <? } ?> </div> </div> </div> <?php */ ?>
<div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label"> <?= _lang('Profile Picture') ?> </label> <div class="col-sm-10"> <div id="image_container" style="width: 100%;"> <span style="font-size: 12px; color: #0012ff;">請先選擇圖片,在畫板中可移動選擇範圍,選擇合適的範圍後按"確定"裁剪,圖片必須裁剪,否則無法保存</span> <div id="image"></div> </div>
<?php for ($i = 1; $i <= 1; $i++) { ?> <div class="crop_image_container" style="margin-bottom: 10px;"> <? if (!empty($row['profile_pic' . $i])) { ?> <div style="margin-bottom:5px;" class="img ori_image"> <img src="<?= $site_info["url"] ?>file/student_profile_pic/<?= $row['profile_pic' . $i] ?>" width="150"/> <input type="hidden" name="profile_pic<?= $i ?>_on" value="1" class="existed_image"/> </div> <? } ?>
<div id="cropped_img_container" style="display: none; margin-bottom: 5px;"> <img src="" id="cropped_img" style="width: 200px;margin-top: 10px; border: 1px #ccc solid;"/> <input type="hidden" name="base64_profile_pic<?= $i ?>" id="base64_img" class="base64_img" value=""> </div>
<input type="file" class="" id="inputImage_<?= $i ?>" name="profile_pic<?= $i ?>" accept="image/*" style="width: 75px;"> <? if ($row['profile_pic' . $i]) { ?> <input type="button" value="刪除圖片" onclick="delphoto(this)" style="margin-left: 10px;"/><? } ?>
<button type="button" class="crop_image btn btn-primary" style="margin-left: 15px;"> 確定 </button>
<div id="profile_pic_Error" style="color:#F00; display:none;" class="error"> 請上載最少一張圖片及按確定 </div> <div style="color:#F00; display:none;" class="error" id="upload<?= $i ?>Error"> <?= _lang("Size Limit: 1mb, Format: jpeg, jpg, png, pdf") ?> </div> <div style="color:#F00; display:none;" class="error" id="upload<?= $i ?>Error2"> <?= _lang("Uploaded file size cannot over 1 MB.") ?> </div> </div> <?php } ?> </div> </div> </div>
<div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label required_field"> <?= _lang('Contact Name') ?> </label> <div class="col-sm-10"> <input type="text" class="form-control" name="contactname" size="50" maxlength="255" value="<?= $row['contactname'] ?>"> <div style="color:#F00; display:none;" class="error" id="contactnameError"><?= html_entity_decode(_lang('Please Input Your ')) . _lang('Contact Name') ?></div> </div> </div> </div> <div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label required_field"> <?= _lang('Email') ?> </label> <div class="col-sm-10"><? if ($row['email']) { ?> <div style="margin-bottom:7px;"><?= aes_crypt($row['email'], 2) ?></div> <? } else { ?> <input type="text" class="form-control" name="email" size="50" maxlength="255" value="<?= aes_crypt($row['email'], 2) ?>"> <div style="color:#F00; display:none;" class="error" id="emailError"><?= _lang("Please enter email.") ?></div> <div style="color:#F00; display:none;" class="error" id="emailError2"><?= _lang("Please check email format.") ?></div> <div style="color:#F00; display:none;" class="error" id="emailError3"><?= _lang("This email has used by someone.") ?></div> <? } ?> </div> </div> </div>
<div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label required_field"> <?= _lang("Password") ?> </label> <div class="col-sm-10"> <input type="password" class="form-control" name="password" size="50" maxlength="255" value=""> <div style="color:#0012ff;" id="passwordBox"><?= _lang('Password should include lower letter, upper letter, number and special characters.'); ?></div> <div style="color:#F00; display:none;" class="error" id="passwordError"><?= _lang("Please enter password.") ?></div> <div style="color:#F00; display:none;" class="error" id="passwordError3"><?= _lang("Password must contain at least 8 characters.") ?></div> <div style="color:#F00; display:none;" class="error" id="passwordError2"><?= _lang("Password and confirm password should be same.") ?></div> <div style="color:#F00; display:none;" class="error" id="passwordError4"><?= _lang("Password strength is not enough. Password should include lower letter, upper letter, number and special characters.") ?></div> </div> </div> </div>
<div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label required_field"> <?= _lang("Confirm Password") ?> </label> <div class="col-sm-10"> <input type="password" class="form-control" name="repassword" size="50" maxlength="255" value=""> <div style="color:#F00; display:none;" class="error" id="repasswordError"><?= _lang("Please enter confirm password.") ?></div> </div> </div> </div>
<div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label required_field"> <?= _lang('Mobile') ?> </label> <div class="col-sm-10"><? if ($row['mobno']) { ?> <div style="margin-bottom:7px;"><?= aes_crypt($row['mobno'], 2) ?></div> <? } else { ?> <input type="text" class="form-control" name="mobno" size="50" maxlength="8" value="<?= aes_crypt($row['mobno'], 2) ?>"> <div style="color:#F00; display:none;" class="error" id="mobnoError"><?= _lang("Please enter mobile number.") ?></div> <div style="color:#F00; display:none;" class="error" id="mobnoError2"><?= _lang("Mobile number should be digital number.") ?></div> <div style="color:#F00; display:none;" class="error" id="mobnoError3"><?= _lang("Mobile number has used by someone.") ?></div> <? } ?></div> </div> </div> <div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label"> <?= _lang('Home Tel') ?> </label> <div class="col-sm-10"> <input type="text" class="form-control" name="hometelno" size="50" maxlength="8" value="<?= aes_crypt($row['restelno'], 2) ?>"> <div style="color:#F00; display:none;" class="error" id="hometelnoError2"><?= _lang("Home telephone number should be digital number.") ?></div> </div> </div> </div> <div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label required_field"> <?= lang('Gender') ?> </label> <div class="col-sm-10"><label> <input type="radio" name="gender" value="m" <? if ($row['gender'] == 'm') { ?> checked<? } ?>/> <?= lang('Male') ?> </label> <label> <input type="radio" name="gender" value="f" <? if ($row['gender'] == 'f') { ?> checked<? } ?>/> <?= lang('Female') ?> </label> <div style="color:#F00; display:none;" class="error" id="genderError"><?= _lang("Please select gender.") ?></div> </div> </div> </div> <?php /* ?> <div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label required_field"> <?= _lang('With Student Relationship') ?> </label> <div class="col-sm-10"> <select class="form-control" id="sel1" name="mas_contactstudentrel"> <option value="">- <?= _lang('Please Select') ?> - </option> <? foreach ($rows_contactstudentrel as $row_contactstudentrel) { ?> <option value="<?= $row_contactstudentrel['id'] ?>" <? if ($row_contactstudentrel['id'] == $row['mas_contactstudentrel']){ ?>selected<? } ?>> <?= $row_contactstudentrel['name_' . get_langcode()] ?> </option> <? } ?> </select> <div style="color:#F00; display:none;" class="error" id="contactstudentrelError"><?= html_entity_decode(_lang('Please Input Your ')) . _lang('Contact Time Range') ?></div> </div> </div> </div>
<div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label required_field"> <?= _lang('Student Range') ?> </label> <div class="col-sm-10"> <select class="form-control" id="sel1" name="mas_yearrange"> <option value="">- <?= _lang('Please Select') ?> - </option> <? foreach ($rows_yearrange as $row_yearrange) { ?> <option value="<?= $row_yearrange['id'] ?>" <? if ($row_yearrange['id'] == $row['mas_yearrange']){ ?>selected<? } ?>> <?= $row_yearrange['name_' . get_langcode()] ?> </option> <? } ?> </select> <div style="color:#F00; display:none;" class="error" id="yearrangeError"><?= html_entity_decode(_lang('Please Input Your ')) . _lang('Student Range') ?></div> </div> </div> </div> <?php */ ?> <div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label required_field"> <?= _lang('Residence') ?> </label> <div class="col-sm-10"> <select class="form-control" id="sel1" name="mas_residencecode"> <option value="">- <?= _lang('Please Select') ?> - </option> <? foreach ($rows_area as $row_area) { ?> <? $sql = "select * from master_type_code where typeid = ? and extra1 = ? and deleted = ?"; $parameters = array('RESIDENCE_POSITIONCODE', $row_area['code'], 0); $rows_position = bind_pdo($sql, $parameters, "selectall"); ?> <optgroup label="<?= $row_area['name_' . get_langcode()] ?>"> <? foreach ($rows_position as $row_position) { ?> <option value="<?= $row_position['id'] ?>" <? if ($row_position['id'] == $row['mas_residencecode']){ ?>selected<? } ?>> <?= $row_position['name_' . get_langcode()] ?> </option> <? } ?> </optgroup> <? } ?> </select> <div style="color:#F00; display:none;" class="error" id="residencecodeError"><?= html_entity_decode(_lang('Please Input Your ')) . _lang('Residence') ?></div> </div> </div> </div> <div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label"> <?= _lang('Address') ?> </label> <div class="col-sm-10"> <input class="form-control" placeholder="<?= _lang('Address') ?>" name="address" value="<?= $row['address'] ?>"> </div> </div> </div> <div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label required_field"> <?= _lang('Contact Time Range') ?> </label> <div class="col-sm-10"> <select class="form-control" id="sel1" name="mas_contacttimerange"> <option value="">- <?= _lang('Please Select') ?> - </option> <? foreach ($rows_contacttimerange as $row_contacttimerange) { ?> <option value="<?= $row_contacttimerange['id'] ?>" <? if ($row_contacttimerange['id'] == $row['mas_contacttimerange']){ ?>selected<? } ?>> <?= $row_contacttimerange['name_' . get_langcode()] ?> </option> <? } ?> </select> <div style="color:#F00; display:none;" class="error" id="contacttimerangeError"><?= html_entity_decode(_lang('Please Input Your ')) . _lang('Contact Time Range') ?></div> </div> </div> </div> <div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label"> <?= lang('Musical Instruments Curriculum Vitae') ?> </label> <div class="col-sm-10"> <div id="LiInstrumentqualiBox"> <? if (is_array($count_instrumentquali)) { ?> <? foreach ($count_instrumentquali as $res_instrumentquali) { ?> <div class="row row_container"> <div class="LiInstrumentqualiClass" style="margin-bottom: 10px;"> <div class="col-md-4"> <select class="form-control input-sm" name="instrumentquali[mas_instrument][]" data-value="" style="width:100%; display:inline-block;"> <option value="">-樂器-</option> <? foreach ($rows_instrument_type as $row_instrument_type) { ?> <? $sql = "select * from master_type_code where typeid = ? and extra1 = ? and deleted = ? order by sort asc"; $parameters = array('INSTRUMENT', $row_instrument_type['code'], 0); $rows_instrument = bind_pdo($sql, $parameters, "selectall"); ?> <optgroup label="<?= $row_instrument_type['name_' . get_langcode()] ?>"> <? foreach ($rows_instrument as $row_instrument) { ?> <option value="<?= $row_instrument['id'] ?>" <? if ($row_instrument['id'] == $res_instrumentquali['mas_instrument']){ ?>selected<? } ?>> <?= str_replace('\n', '', $row_instrument['name_' . get_langcode()]) ?> </option> <? } ?> </optgroup> <? } ?> </select> </div>
<div class="col-md-4"> <select class="form-control input-sm" name="instrumentquali[grade][]" data-value="" style="width:100%; display:inline-block;"> <option value=""></option> <? for ($i = 1; $i <= 9; $i++) { ?> <option value="<?= $i ?>" <? if ($i == $res_instrumentquali['grade']){ ?>selected<? } ?>> <?= $i ?></option> <? } ?> </select> </div>
<div class="col-md-4"> <div class="row"> <div class="col-md-9 col-xs-9"> <select class="form-control input-sm" name="instrumentquali[year][]" data-value="" style="width:100%; display:inline-block;"> <option value=""></option> <? for ($i = date('Y'); $i >= date('Y') - 100; $i--) { ?> <option value="<?= $i ?>" <? if ($i == $res_instrumentquali['year']){ ?>selected<? } ?>> <?= $i ?> </option> <? } ?> </select> </div>
<div class="col-md-3 col-xs-3" style="text-align: right;"> <input type="button" value="X" onClick="del(this)" class="form-del"> </div> </div> </div>
</div> </div>
<? } ?> <? } ?> </div> <div> <input type="button" value="+" class="form-del" onClick="add_instrumentquali()"> </div> <div style="color:#F00; display:none;" class="error" id="instrumentError"><?= _lang("Please fill musical instruments resume.") ?></div> </div> </div> </div> <div class="row"> <div class="col-md-10 form-group"> <label for="" class="col-sm-2 control-label"> <?= _lang("Registraion Date") ?> </label> <div class="col-md-10 form-group"> <?= $row['createdate'] ?> </div> </div> </div> <div class="row"> <div class="col-md-10 form-group" style="color: #F00;"> <label for="" class="col-sm-2 control-label"><?= lang("* Required Field") ?></label> <br><br><br> </div> </div>
<div class="row"> <div class="col-md-12 tc form-group"> <div class="btn-group"><? /* if ($row_profile['profile_id'] != 4) { ?> <? if ($row['isemailverified'] == 0 && $row['email']) { $status = 3; } else if ($row['status'] > 2) { $status = 2; } else if ($row['status'] <= 2) { $status = 1; } ?> <a href="<?= $page_settings['domain'] ?>_index.php?status=<?= $status ?>&msg=4" class="btn btn-default"><i class="fa fa-chevron-left" aria-hidden="true"></i> <?= _lang('Back') ?> </a> <? $show = '&type=detail"'; ?> <?php if ($row['approved'] != 1) { ?> <a href="<?= $page_settings['domain'] ?>_approved.php?id=<?= $row['id'] . $show ?>" class="btn btn-default btn-warning" style="color:#FFF;"> <i class="glyphicon glyphicon-remove-sign" aria-hidden="true"></i> <?= _lang('Wait to confirm the edit') ?> </a> <?php } else { ?> <a href="<?= $page_settings['domain'] ?>_approved.php?id=<?= $row['id'] . $show ?>" class="btn btn-default btn-success" style="color:#FFF;"> <i class="glyphicon glyphicon-ok-sign" aria-hidden="true"></i> <?= _lang('Confirmed') ?> </a> <?php } ?> <?php if ($row['status'] != 4) { ?> <a href="<?= $page_settings['domain'] ?>_status.php?id=<?= $row['id'] . $show ?>" class="btn btn-default btn-warning" style="color:#FFF;"> <i class="glyphicon glyphicon-remove-sign" aria-hidden="true"></i> <?= _lang('Wait for Approval') ?> </a> <?php } else { ?> <a href="<?= $page_settings['domain'] ?>_status.php?id=<?= $row['id'] . $show ?>" class="btn btn-default btn-success" style="color:#FFF;"> <i class="glyphicon glyphicon-ok-sign" aria-hidden="true"></i> <?= _lang('Approved') ?> </a> <?php } ?> <? } else { ?> <? if ($row['approved'] == 1) { ?> <button type="button" class="btn btn-success "> <i class="glyphicon glyphicon-ok-sign" aria-hidden="true"></i> <?= _lang('Confirmed') ?> </button> <? } else { ?> <button type="button" class="btn btn-warning "> <i class="glyphicon glyphicon-remove-sign" aria-hidden="true"></i> <?= _lang('Wait to confirm the edit') ?> </button> <? } ?> <? } ?> <? if (($row_profile['profile_id'] == 1 || $row_profile['profile_id'] == 2) && $row['isemailverified'] == 0 && $row['email']) { ?> <a href="<?= $page_settings['domain'] ?>_email.php?id=<?= $row['id'] ?>&status=<?= $status ?>" class="btn btn-success "> <i class="fa fa-envelope-o" aria-hidden="true"></i> <?= _lang('Resend Email Verification') ?> </a>
<a href="<?= $page_settings['domain'] ?>_email_verify.php?id=<?= $row['id'] ?>&status=<?= $status ?>" class="btn btn-warning " style="margin-top: 0"> <i class="fa fa-envelope-o" aria-hidden="true"></i> <?= _lang('Pass Email Verification') ?> </a> <? } ?> <? if (($row_profile['profile_id'] == 1 || $row_profile['profile_id'] == 2) && $row['isphoneverified'] == 0 && $row['mobno']) { ?> <a href="<?= $page_settings['domain'] ?>_tel.php?id=<?= $row['id'] ?>&status=<?= $status ?>" class="btn btn-warning" style="margin-top:0;"> <i class="fa fa-mobile" aria-hidden="true"></i> <?= _lang('Pass Tel Verification') ?> </a> <? } */ ?>
<button type="button" class="btn btn-primary" id="LiSaveBtn"> <i class="fa fa-floppy-o" aria-hidden="true"></i> <?= _lang('Save') ?> </button> </div> </div> </div>
</div> <!-- /.box-body --> </div> <!-- /.box --> </div> <!-- /.col --> </div> <!-- /.row --> </form> </div> </div> </div> </div> <? include('_footer.php') ?> <script type="text/javascript"> function del(_this) { $(_this).closest(".row_container").remove(); $(_this).parent().remove(); }
function add_instrumentquali() { var html = '<div class="LiInstrumentqualiClass"><select class="form-control input-sm" name="instrumentquali[mas_instrument][]" data-value="" style="width:29%; display:inline-block;"><option value="">-樂器-</option><? foreach($rows_instrument_type as $row_instrument_type){?><? $sql = "select * from master_type_code where typeid = ? and extra1 = ? and deleted = ? order by sort asc"; $parameters = array('INSTRUMENT', $row_instrument_type['code'], 0); $rows_instrument = bind_pdo($sql, $parameters, "selectall"); ?><optgroup label="<?= $row_instrument_type['name_' . get_langcode()] ?>"><? foreach($rows_instrument as $row_instrument){?><option value="<?=$row_instrument['id']?>"><?=$row_instrument['name_' . get_langcode()]?></option><? }?></optgroup><? }?></select><select class="form-control input-sm" name="instrumentquali[grade][]" data-value="" style="width:25%; display:inline-block;"><option value=""></option><? for($i = 1;$i <= 9;$i++){?><option value="<?=$i?>"><? if ($i > 8) { echo '8+'; } else { echo $i; }?></option><? }?></select><select class="form-control input-sm" name="instrumentquali[year][]" data-value="" style="width:25%; display:inline-block;"><option value=""></option><? for($i = date('Y');$i >= date('Y') - 100;$i--){?><option value="<?=$i?>"><?=$i?></option><? }?></select><input type="button" value="X" onClick="del(this)" class="form-del"></div>'; $('#LiInstrumentqualiBox').append(html); } $(function () { <? if(count($count_instrumentquali) == 0){?> add_instrumentquali(); <? }?> $('#sel1_area').change( function () { //console.log('#sel1_position'+$(this).val()); $('.dropdown-menu').hide(); $('#sel1_position' + $(this).val()).show(); } ); }) </script>
<script type="text/javascript">
$(document).ready(function (e) { $('#LiSaveBtn').click( function () { var thisform = $('#myform'); $.post('_ajax.php', { ajax: 'checkEmail', email: $('input[name="email"]', thisform).val(), password: $('input[name="password"]', thisform).val() }, function (json) { var json1 = JSON.parse(json); $.post('_ajax.php', { ajax: 'checkTel', type: 'student', mobno: $('input[name="mobno"]', thisform).val() }, function (json) { var json2 = JSON.parse(json); var focus_array = new Array(); var error = false; $('.error').hide(); if (!$('input[name="contactname"]', thisform).val()) { $("#contactnameError").show(); focus_array[focus_array.length] = $('input[name="contactname"]', thisform); error = true; } <? if(!$row['id']){?> if (!$('input[name="email"]', thisform).val()) { $("#emailError", thisform).show(); focus_array[focus_array.length] = $('input[name="email"]', thisform); error = true; } else { if (!/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/.test($('input[name="email"]', thisform).val())) { $("#emailError2", thisform).show(); focus_array[focus_array.length] = $('input[name="email"]', thisform); error = true; } else { if (json1.email_status == true || json1.user_status == true) { $("#emailError3", thisform).show(); focus_array[focus_array.length] = $('input[name="email"]', thisform); error = true; } } } <? }?>
<? if(!$row['id']){?> if (!$('input[name="password"]', thisform).val()) { $("#passwordError", thisform).show(); focus_array[focus_array.length] = $('input[name="password"]', thisform); error = true; } else { <?php } else { ?> if ($('input[name="password"]', thisform).val()) { <?php } ?> if (json1.password_status == false) { $("#passwordBox", thisform).hide(); $("#passwordError4", thisform).show(); focus_array[focus_array.length] = $('input[name="password"]', thisform); error = true; } if ($('input[name="password"]', thisform).val().length < 8) { $("#passwordError3", thisform).show(); focus_array[focus_array.length] = $('input[name="password"]', thisform); error = true; } if (!$('input[name="repassword"]', thisform).val()) { focus_array[focus_array.length] = $('input[name="password"]', thisform); $("#repasswordError", thisform).show(); error = true; } if ($('input[name="password"]', thisform).val() && $('input[name="repassword"]', thisform).val()) { if ($('input[name="password"]', thisform).val() != $('input[name="repassword"]', thisform).val()) { focus_array[focus_array.length] = $('input[name="password"]', thisform); $("#passwordError2", thisform).show(); error = true; } } }
<? if(!$row['mobno']){?> if (!$('input[name="mobno"]', thisform).val()) { $("#mobnoError").show(); focus_array[focus_array.length] = $('input[name="mobno"]', thisform); error = true; } else { var num = $('input[name="mobno"]', thisform).val(); if ($.isNumeric(num) == false) { $("#mobnoError2").show(); focus_array[focus_array.length] = $('input[name="mobno"]', thisform); error = true; } else if (json2.mobno_status == true) { $("#mobnoError3", thisform).show(); focus_array[focus_array.length] = $('input[name="mobno"]', thisform); error = true; } } <? }?> if ($('input[name="hometelno"]', thisform).val()) { var num = $('input[name="hometelno"]', thisform).val(); if ($.isNumeric(num) == false) { $("#hometelnoError2").show(); focus_array[focus_array.length] = $('input[name="hometelno"]', thisform); error = true; } } if (!$('input[name="gender"]:checked', thisform).val()) { $("#genderError").show(); focus_array[focus_array.length] = $('input[name="gender"]', thisform); error = true; }
/*if (!$('select[name="mas_contactstudentrel"]', thisform).val()) { $("#contactstudentrelError").show(); focus_array[focus_array.length] = $('input[name="mas_contactstudentrel"]', thisform); error = true; } if (!$('select[name="mas_yearrange"]', thisform).val()) { $("#yearrangeError").show(); focus_array[focus_array.length] = $('input[name="mas_yearrange"]', thisform); error = true; }*/ if (!$('select[name="mas_residencecode"]', thisform).val()) { $("#residencecodeError").show(); focus_array[focus_array.length] = $('input[name="mas_residencecode"]', thisform); error = true; } if (!$('select[name="mas_contacttimerange"]', thisform).val()) { $("#contacttimerangeError").show(); focus_array[focus_array.length] = $('select[name="mas_contacttimerange"]', thisform); error = true; } if ($('#teachmodeError .InstrumentExpSection').size() > 0) { $('#teachmodeError .InstrumentExpSection').each( function () { if ($(this).parent().attr('id') != 'MusicalCVBox') { if (!$('select[name="instrumentquali[mas_instrument][]"]', this).val() || !$('select[name="instrumentquali[grade][]"]', this).val() || !$('select[name="instrumentquali[year][]"]', this).val()) { $("#instrumentError").show(); error = true; focus_array[focus_array.length] = $('select[name="instrumentquali[mas_instrument][]"]', this); } } } ); } if (error == false) { $("#myform").submit(); //return true; } else { //focus_array[0].focus(); /*$('html, body').animate({ scrollTop: $(focus_array[0]).offset().top - 200 }, 500);*/
$('html, body').animate({ scrollTop: $(".error:visible").first().offset().top - 150 }, 500); //return false; } } ); }); } ); });
</script>
<!-- crop image --> <link href="js/cropper/cropper.css" rel="stylesheet"> <script src="js/cropper/cropper.js"></script>
<script type="text/javascript"> $(function () { var $image = $('#image');
$(".crop_image").on("click", function () { var canvas = $image.cropper('getCroppedCanvas'); var photo = canvas.toDataURL('image/jpeg');
$(this).closest(".crop_image_container").find("#cropped_img").attr("src", photo); $(this).closest(".crop_image_container").find("#base64_img").attr("value", photo); $(this).closest(".crop_image_container").find("#cropped_img_container").show(); $(this).closest(".crop_image_container").find(".ori_image").hide();
$("#image_container").hide(); //console.log(photo); });
var options = { aspectRatio: 1, cropBoxResizable: false, cropBoxMovable: false, dragMode: 'move', viewMode: '1', zoomOnTouch: false, zoomOnWheel: false, //zoomable: false, /*autoCropArea: 1, strict: false, guides: false, highlight: false, dragCrop: false, cropBoxMovable: true, cropBoxResizable: true, zoomOnTouch: true, zoomable: true, scalable: true, responsive: true,*/ built: function () { // Width and Height params are number types instead of string $image.cropper("setCropBoxData", {width: 400, height: 400}); $image.cropper("zoomTo", 1); } /*crop: function (e) {
}*/ };
// Cropper $image.on({ 'build.cropper': function (e) { //console.log(e.type); }, 'built.cropper': function (e) { //console.log(e.type); }, 'cropstart.cropper': function (e) { //console.log(e.type, e.action); }, 'cropmove.cropper': function (e) { //console.log(e.type, e.action); }, 'cropend.cropper': function (e) { //console.log(e.type, e.action); }, 'crop.cropper': function (e) { //console.log(e.type, e.x, e.y, e.width, e.height, e.rotate, e.scaleX, e.scaleY); }, 'zoom.cropper': function (e) { //console.log(e.type, e.ratio); } }).cropper(options);
for (var i = 1; i <= 1; i++) { $("#inputImage_" + i).on("change", function () { $("#image_container").show(); location.href = "#image_container"; });
// Import image crop_function($("#inputImage_" + i), $image); } });
function crop_function(_this, $image) { var $inputImage = _this; var URL = window.URL || window.webkitURL; var blobURL;
if (URL) { $inputImage.change(function () { var files = this.files; var file;
if (!$image.data('cropper')) { return; }
if (files && files.length) { file = files[0];
if (/^image\/\w+$/.test(file.type)) {
var img = new Image(); img.src = window.URL.createObjectURL(file); img.onload = function () { if (parseInt(img.width) > 10000 || parseInt(img.height) > 10000) { //window.alert('The resolution of image is too large. Please resize your image file under 1024px X 1024px.'); alert('圖片解析度過高,請將圖片縮放至少於10000px X 10000px。'); $image.cropper('reset'); $inputImage.val(''); } else { $("#image_container").css("height", "400px"); $("#image_container").css("margin-bottom", "70px");
blobURL = URL.createObjectURL(file); $image.one('built.cropper', function () {
// Revoke when load complete URL.revokeObjectURL(blobURL); }).cropper('reset').cropper('replace', blobURL); $inputImage.val(''); } } } else { alert('請選擇圖片上傳。'); } } }); } else { $inputImage.prop('disabled', true).parent().addClass('disabled'); } }
function delphoto(thisform) { $(thisform).hide(); $('.img', $(thisform).parent()).remove(); } </script>
</body> </html>
|