-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_employee.php
1334 lines (1096 loc) · 54.5 KB
/
add_employee.php
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
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
error_reporting(0);
session_start();
if($_SESSION['username']=="")
{
header('location:index.php');
}
include('config.php');
extract($_POST);
$under_name=mysqli_query($con,"select * from add_employee");
/*
$target_dir = "profile/";
$target_file = $target_dir . basename($_FILES["uploadFile"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
*/
if(isset($submit))
{
$d=date("ymd");
$t=time();
$r=rand(55,90);
$s=rand(30,50);
$t=rand(5,25);
$imgid=($d+$t)*$r;
$imid=($d+$t)*$s;
$imgi=($d+$t)*$t;
//echo $image;
$image=$_FILES['image']['name'];
$im=$imgid."-".$image;
$id_proof=$_FILES['id_proof']['name'];
$imm=$imid."-".$id_proof;
$add_proof=$_FILES['add_proof']['name'];
$imi=$imgi."-".$add_proof;
/* if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
$uploadOk = 0;
} */
$chkid=mysqli_query($con,"select * from add_employee");
$chkrows=mysqli_num_rows($chkid);
$ques2=mysqli_query($con,"select * from company_details where company_code='$company_code'");
$rw2=mysqli_fetch_array($ques2);
$com_emp2 = $rw2['company_emp_code'];
$com_emp4 = $com_emp2.'-';
$chkid2=mysqli_query($con,"select * from add_employee where employee_code LIKE '$com_emp4%' ORDER BY employee_code DESC ");
$rows2=mysqli_num_rows($chkid2);
if($chkrows == 0)
{
$ques=mysqli_query($con,"select * from company_details where company_code='$company_code'");
$rw=mysqli_fetch_array($ques);
$com_emp = $rw['company_emp_code'];
$seq = 1;
$a1 = sprintf("%03d", $seq);
$emp_id2 = $com_emp.'-'.$a1;
}
elseif($rows2 == 0)
{
$seq = 1;
$a2 = sprintf("%03d", $seq);
$emp_id2 = $com_emp2.'-'.$a2;
}
else
{
$ques3=mysqli_query($con,"select * from company_details where company_code='$company_code'");
$rw3=mysqli_fetch_array($ques3);
$com_emp3 = $rw3['company_emp_code'];
$com_emp5 = $com_emp3.'-';
$chkid3=mysqli_query($con,"select * from add_employee where employee_code LIKE '$com_emp5%' ORDER BY employee_code DESC ");
$rows1=mysqli_fetch_array($chkid3);
$last_id = $rows1['employee_code'];
// $restid2 = substr("$last_id",0,3); //for first 3 lick csi
$restid = substr("$last_id", -3); //for last 3 like oo1
$b = "$restid" + 1; //for last id +1 like 001 +1
$a3 = sprintf("%03d", $b); //for 001,002
$emp_id2 = $com_emp3.'-'.$a3;
}
@$emp_period_to=$emp_period_to;
$qqu=mysqli_query($con,"select * from add_employee where employee_code='$emp_id2'");
$rows=mysqli_num_rows($qqu);
if($rows)
{
$err="<div class='alert alert-danger'>This Employee Id .$emp_id2 Already Exists..</div>";
header('refresh:2');
}
else
{
if(sizeof(@$errors) == 0)
{
$que=mysqli_query($con,"INSERT INTO `add_employee`(`employee_code`,`emp_type`,`employee_first_name`, `employee_last_name`,`emp_password`, `company_code`, `employee_city`, `employee_address`, `employee_state`, `employee_pincode`, `employee_email`, `offically_email_id`, `employee_mobile_no`, `offically_mobile_no`, `employee_department`, `employee_designation`, `employee_underwriter`, `employee_branch_name`, `joining_date`, `period_to`, `basic_amount`, `hra`, `conveyance`, `mobile_allo`, `other_allo`, `total_salary`, `employee_status`, `emp_pic`, `id_proof`, `add_proof`)
VALUES ('$emp_id2','$emp_type','$firstname','$lastname','$password','$company_code','$emp_city','$emp_add','$emp_state','$emp_pincode','$emp_email','$offically_email','$emp_mobileno','$offically_mobileno','$emp_department','$emp_designation','$emp_underwriter','$emp_branch_name','$emp_period_from',
'$emp_period_to','$emp_basic_amount','$emp_hra','$emp_conveyance','$mobile_allo','$other_allo','$emp_total_salary','$emp_status','$im','$imm','$imi')");
move_uploaded_file($_FILES['image']['tmp_name'],"profile/".$im);
move_uploaded_file($_FILES['id_proof']['tmp_name'],"documents/".$imm);
move_uploaded_file($_FILES['add_proof']['tmp_name'],"documents/".$imi);
$err="<div class='alert alert-success'>Employee Successfully Added with Employee Id= $emp_id2 and Password= $password </div>";
header('refresh:2');
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>HRMS Admin Panel</title>
<link href="http://themepixels.com/demo/webpage/chain/css/style.default.css" rel="stylesheet">
<link href="css/style.default.css" rel="stylesheet">
<link href="css/jquery.gritter.css" rel="stylesheet">
<link href="css/stylemanual.css" rel="stylesheet"> <!-- my css -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/city-autocomplete.css">
<!-- search-->
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script type="text/javascript">
/* $(function() {
$( "#searchid" ).autocomplete({
source: 'search_id_name.php'
});
});
*/
</script>
<!-- //search-->
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&language=en"></script>
<script src="js/jquery.table2excel.js"></script>
<script>
$(document).ready(function(){
$("#export-btn").click(function(){
$("#example1").find('[style*="display: none"]').remove();
$("#example1").table2excel({
exclude: ".noExl",
name: "Excel Document Name",
filename: "Employee-" + Date(),
fileext: ".xls",
exclude_img: true,
exclude_links: true,
exclude_inputs: true
});
});
});
</script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
<!-- Upload Image Code Start -->
<script src="js/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(function() {
$("#uploadFile").on("change", function()
{
var files = !!this.files ? this.files : [];
if (!files.length || !window.FileReader) return; // no file selected, or no FileReader support
if (/^image/.test( files[0].type)){ // only image file
var reader = new FileReader(); // instance of the FileReader
reader.readAsDataURL(files[0]); // read the local file
reader.onloadend = function(){ // set image data as background of div
$("#imagePreview").css("background-image", "url("+this.result+")");
}
}
});
});
</script>
<script type="text/javascript">
function chkAplha(event,err)
{
if(!((event.which>=65 && event.which<=90) || (event.which>=97 && event.which<=122) || event.which==0 || event.which==8 || event.which==32))
{
document.getElementById(err).innerHTML="<font color='red'>It must be contain alphabets only</font>";
return false;
}
else
{
document.getElementById(err).innerHTML=" ";
}
}
</script>
<style>
#imagePreview {
width: 180px;
height: 180px;
background-position: center center;
background-size: cover;
-webkit-box-shadow: 0 0 1px 1px rgba(0, 0, 0, .3);
display: inline-block;
-webkit-box-shadow: 3px 3px 5px 6px #ccc; /* Safari 3-4, iOS 4.0.2 - 4.2, Android 2.3+ */
-moz-box-shadow: 3px 3px 5px 6px #ccc; /* Firefox 3.5 - 3.6 */
box-shadow: 3px 3px 5px 6px #ccc;
}
</style>
<!-- Upload Image Code End -->
<script>
function sum() {
var txtFirstNumberValue = document.getElementById('e17').value;
var txtSecondNumberValue = document.getElementById('e18').value;
var txtthirdNumberValue = document.getElementById('e19').value;
var fourth = document.getElementById('ee19').value;
var five = document.getElementById('eee19').value;
var result = parseInt(txtFirstNumberValue) + parseInt(txtSecondNumberValue)+parseInt(txtthirdNumberValue)+parseInt(fourth)+parseInt(five);
if (!isNaN(result)) {
document.getElementById('e20').value = result;
}
}
function isNumber(evt,errn) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
document.getElementById(errn).innerHTML="<font color='red'>It must be contain Number only</font>";
return false;
}
else
{
document.getElementById(errn).innerHTML=" ";
}
}
function getdata()
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("exec_code").innerHTML=xmlhttp.responseText;
}
}
var x=document.getElementById("d1").value;
//alert(str);
xmlhttp.open("GET","insertemp.php?n="+x,true);
xmlhttp.send();
}
function showpfno(str)
{
//var x=document.getElementById("e14").value;
if(str==1)
{
//alert("hiiiiii");
document.getElementById("ee256").disabled = true;
}
else if(str==2)
{
document.getElementById("ee256").disabled = false;
}
}
</script>
<script type="text/javascript" language="javascript">
/*function checkfile(sender) {
var validExts = new Array( ".pdf");
var fileExt = sender.value;
fileExt = fileExt.substring(fileExt.lastIndexOf('.'));
if (validExts.indexOf(fileExt) < 0) {
alert("Invalid file selected, valid files are of " +
validExts.toString() + " types.");
document.getElementById("filedocxpdf").value="";
document.getElementById("filedocxpdf2").value="";
return false;
}
else return true;
}
function checkfile2(sender) {
var validExts = new Array( ".PNG",".gif",".jpeg",".jpg","png");
var fileExt = sender.value;
fileExt = fileExt.substring(fileExt.lastIndexOf('.'));
if (validExts.indexOf(fileExt) < 0) {
alert("Invalid file selected, valid files are of " +
validExts.toString() + " types.");
document.getElementById("uploadFile").value="";
return false;
}
else return true;
}*/
function ValidateFileUpload() {
var fuData = document.getElementById('uploadFile');
var FileUploadPath = fuData.value;
if (FileUploadPath == '') {
alert("Please upload an image");
} else {
var Extension = FileUploadPath.substring(FileUploadPath.lastIndexOf('.') + 1).toLowerCase();
if (Extension == "gif" || Extension == "png" || Extension == "bmp"
|| Extension == "jpeg" || Extension == "jpg") {
if (fuData.files && fuData.files[0]) {
var size = fuData.files[0].size;
//alert(size);
var MAX_SIZE = 1024000;
if(size > MAX_SIZE){
alert("Maximum file size exceeds");
document.getElementById("uploadFile").value="";
return false;
}else{
var reader = new FileReader();
reader.onload = function(e) {
$('#blah').attr('src', e.target.result);
}
reader.readAsDataURL(fuData.files[0]);
}
}
}
else {
alert("Photo only allows file types of GIF, PNG, JPG, JPEG and BMP. ");
document.getElementById("uploadFile").value="";
return false;
}
}}
//validation for pdf
function ValidateFileUploadPdf() {
var fuData = document.getElementById('filedocxpdf');
var FileUploadPath = fuData.value;
if (FileUploadPath == '') {
alert("Please upload an Pdf");
} else {
var Extension = FileUploadPath.substring(FileUploadPath.lastIndexOf('.') + 1).toLowerCase();
if (Extension == "pdf") {
if (fuData.files && fuData.files[0]) {
var size = fuData.files[0].size;
//alert(size);
var MAX_SIZE = 2048000;
if(size > MAX_SIZE){
alert("Maximum file size exceeds");
document.getElementById("filedocxpdf").value="";
return false;
}else{
var reader = new FileReader();
reader.onload = function(e) {
$('#blah').attr('src', e.target.result);
}
reader.readAsDataURL(fuData.files[0]);
}
}
}
else {
alert("Please Upload Pdf Only ");
document.getElementById("filedocxpdf").value="";
return false;
}
}}
//validation ends
//validation for pdf2
function ValidateFileUploadPdf2() {
var fuData = document.getElementById('filedocxpdf2');
var FileUploadPath = fuData.value;
if (FileUploadPath == '') {
alert("Please upload an Pdf");
} else {
var Extension = FileUploadPath.substring(FileUploadPath.lastIndexOf('.') + 1).toLowerCase();
if (Extension == "pdf") {
if (fuData.files && fuData.files[0]) {
var size = fuData.files[0].size;
//alert(size);
var MAX_SIZE = 2048000;
if(size > MAX_SIZE){
alert("Maximum file size exceeds");
document.getElementById("filedocxpdf2").value="";
return false;
}else{
var reader = new FileReader();
reader.onload = function(e) {
$('#blah').attr('src', e.target.result);
}
reader.readAsDataURL(fuData.files[0]);
}
}
}
else {
alert("Please Upload Pdf Only ");
document.getElementById("filedocxpdf2").value="";
return false;
}
}}
//validation ends
function chkeid()
{
var e=document.getElementById("e4").value;
var atpos=e.indexOf("@");
var dotpos=e.lastIndexOf(".");
if(atpos<3 || dotpos<atpos+3)
{
//alert("Invalid Email Format");
document.getElementById('e4').style.borderColor="red";
}
else
{
document.getElementById('e4').style.borderColor="green";
document.getElementById("error").innerHTML="";
}
}
function chekval(event)
{
if((event.which>=34 && event.which<=43) || (event.which>=58 && event.which<=63))
{
//alert("Please Just Don't");
return false;
}
}
</script>
</head>
<body>
<?php include('include/header.php');?>
<section>
<?php include('include/sidebar.php');?>
<div class="mainpanel">
<div class="pageheader">
<div class="media">
<div class="pageicon pull-left">
<a href="admindashboard.php"><i style="color:white" class="fa fa-plus"></i></a>
</div>
<div class="media-body mediabody1">
<ul class="breadcrumb">
<li><a href="admindashboard.php"><i class="fa fa-home" aria-hidden="true"></i></a></li>
<li><a href="admindashboard.php">Home</a></li>
<li>Employee</li>
<li><a href="download/download2.php"><i class="fa fa-cloud-download" style="color:#428bca;"></i> <span>Export Employee</span></a></li>
</ul>
<h4>Add Employee</h4>
</div>
</div><!-- media -->
</div><!-- pageheader -->
<div class="contentpanel">
<form method="post" enctype="multipart/form-data" >
<div class="row">
<div class="col-sm-6" id="error">
<?php echo @$errors;?>
<?php echo @$err;?>
</div>
</div>
<div class="row">
<div class="col-sm-12" style="color:white;font-weight:bold;font-size:14px;background-color:#428BCA">
<h5 style="padding-top:5px; padding-bottom:5px">Company Details : </h5>
</div>
</div>
<div class="row paddtop paddbottom">
<div class="col-sm-4">
<div class="form-group">
<label><b>Company Name :</b> <span style="color:red;">*</span> </label>
<select class="form-control select1" name="company_code" id="e23">
<option value="">Select Company</option>
<?php
$ques=mysqli_query($con,"select * from company_details");
while($rw=mysqli_fetch_array($ques))
{
$code=$rw['company_code'];
echo "<option value='$code'>".$rw['company_name']."</option>";
}
?>
</select>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label><b>Employee Type :</b><span style="color:red;">*</span> </label>
<select class="form-control select1" name="emp_type" id="e50">
<option value="">Select Type</option>
<option value="Full Time">Full Time</option>
<option value="Intern">Intern</option>
</select>
</div>
</div>
</div><!-- Row -->
<div class="row">
<div class="col-sm-12" style="color:white;font-weight:bold;font-size:14px;background-color:#428BCA">
<h5 style="padding-top:5px; padding-bottom:5px">Employee Details : </h5>
</div>
</div>
<div class="row paddtop paddbottom">
<!--<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Employee Code :</b> <span style="color:red;">*</span></label>
<input type="text" name="emp_code" id="e0" style="height:35px;" class="form-control" placeholder="Employee Code"/>
</div><!-- form-group
</div>-->
<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>First Name :</b> <span style="color:red;">*</span></label>
<input type="text" name="firstname" id="e1" style="height:35px;text-transform:capitalize;" class="form-control" placeholder="Employee First Name" onkeypress="return chkAplha(event,'error1')" />
</div><!-- form-group -->
<div id="error1"></div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Last Name :</b></label>
<input type="text" name="lastname" id="e2" style="height:35px;text-transform:capitalize;" class="form-control" placeholder="Employee Last Name" autocomplete="off" onkeypress="return chkAplha(event,'error2')" />
</div><!-- form-group -->
<div id="error2"></div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Password :</b></label>
<input type="password" name="password" id="e01" style="height:35px;text-transform:capitalize;" class="form-control" placeholder="Employee password" />
</div><!-- form-group -->
</div>
</div><!-- Row -->
<div class="row">
<div class="col-sm-12" style="color:white;font-weight:bold;font-size:14px;background-color:#428BCA">
<h5 style="padding-top:5px; padding-bottom:5px">Employee Personal Details : </h5>
</div>
</div>
<div class="row paddtop">
<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Employee Contact No :</b> <span style="color:red;">*</span></label>
<input type="text" name="emp_mobileno" style="height:35px;" id='e3' maxlength="10"class="form-control" onkeypress="return isNumber(event,'error3')" placeholder="Employee Contact No" />
</div><!-- form-group -->
<div id="error3"></div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Employee Email :</b> <span style="color:red;">*</span></label>
<input type="email" name="emp_email" style="height:35px;" id="e4" class="form-control" onblur="return chkeid()" placeholder="Employee Email" />
</div><!-- form-group -->
</div>
<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Employee Address :</b> <span style="color:red;">*</span></label>
<textarea class="form-control" rows="2" name="emp_add" id="e5" style="text-transform:capitalize;" placeholder="Employee Address" onkeypress="return chekval(event)" ></textarea>
</div>
</div>
</div><!-- Row -->
<div class="row paddbottom" >
<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Employee City :</b> <span style="color:red;">*</span></label>
<input type="text" name="emp_city" id="e6" style="height:35px;" class="form-control" placeholder="Employee City" autocomplete="off" data-country="in" onkeypress="return chkAplha(event,'error4')"/>
</div>
<div id="error4"></div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Employee State :</b> <span style="color:red;">*</span></label>
<input type="text" name="emp_state" id="e7" style="height:35px;text-transform:capitalize;" class="form-control" placeholder="Employee State"onkeypress="return chkAplha(event,'error5')" />
</div><!-- form-group -->
<div id="error5"></div>
</div>
<!-- form-group --><div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Employee Pincode :</b> <span style="color:red;">*</span></label>
<input type="text" name="emp_pincode" id="e8" style="height:35px;" maxlength="6" class="form-control" onkeypress="return isNumber(event,'error6')" placeholder="Employee Pincode"/>
</div>
<div id="error6"></div>
</div>
</div>
<div class="row">
<div class="col-sm-12" style="color:white;font-weight:bold;font-size:14px;background-color:#428BCA">
<h5 style="padding-top:5px; padding-bottom:5px">Employee Offically/Hireachy Details : </h5>
</div>
</div>
<div class="row paddtop">
<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Offically Contact No :</b> </label>
<input type="text" name="offically_mobileno" style="height:35px;" onkeypress="return isNumber(event,'error7')" id="e9" maxlength="10"class="form-control" placeholder="Offically Contact No"/>
</div><!-- form-group -->
<div id="error7"></div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Offically Email :</b> </label>
<input type="email" name="offically_email"style="height:35px;" id="e10" onkeypress="return chekval(event)" class="form-control" placeholder="Offically Email"/>
</div><!-- form-group -->
</div>
<div class="col-sm-4">
<div class="form-group">
<label><b>Employee Reporting To :</b><span style="color:red;">*</span> </label> <!--<span style="float:right"><a href="">View Details</a></span>-->
<select class="form-control select1" name="emp_underwriter" class="form-control" id="e13" placeholder="Employee Underwriter" >
<option value="">Select Reporting To</option>
<?php
while($row=mysqli_fetch_array($under_name))
{
$id=$row['employee_code'];
$name=$row['employee_first_name'];
$designation=$row['employee_designation'];
$under_r=$row['employee_underwriter'];
echo "<option value='$id'>[".$id."] ".$name." [".$designation."] </option>";
}
?>
</select>
</div>
</div>
</div>
<div class="row paddtop paddbottom">
<div class="col-sm-4">
<div class="form-group">
<label><b>Employee Designation :</b><span style="color:red;">*</span> </label> <span style="float:right"><a href="" data-toggle="modal" data-target="#examModal" data-whatever="@mdo">Add Designation</a></span>
<div id="aut2"><select class="form-control select1" name="emp_designation" class="form-control" id="e12">
<option value="">Select Designation</option>
<?php
$q=mysqli_query($con,"select * from designation");
while($roow=mysqli_fetch_array($q))
{
echo "<option>".$roow['designation_name']."</option>";
}
?>
</select></div>
</div>
</div>
<!--<div class="form-group">
<label class="control-label"><b>Employee Designation :</b> <span style="color:red;">*</span></label><span style="float:right"><a href="" data-toggle="modal" data-target="#examModal" data-whatever="@mdo">Add Designation</a></span>
<input type="text" name="emp_designation" style="height:35px;"class="form-control" id="e12" placeholder="Employee Designation"/>
</div> form-group -->
<div class="col-sm-4">
<div class="form-group">
<label><b>Employee Department :</b><span style="color:red;">*</span> </label> <span style="float:right"><a href="" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">Add Department</a></span>
<div id="aut1"><select class="form-control select1" name="emp_department" id="e11">
<option value="">Select Department</option>
<?php
$quee=mysqli_query($con,"select * from department");
while($rw=mysqli_fetch_array($quee))
{
echo "<option>".$rw['department_name']."</option>";
}
?>
</select></div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label class="control-label"><b>Employee Branch Name :</b> <span style="color:red;">*</span></label><span style="float:right"><a href="" data-toggle="modal" data-target="#exaModal" data-whatever="@mdo">Add Branch</a></span>
<div id="brnh"> <select class="form-control select1" name="emp_branch_name" style="height:35px;text-transform:capitalize;" class="form-control" id="e14" placeholder="Employee Branch">
<option value="">Select Branch Name</option>
<?php
$qq=mysqli_query($con,"select * from add_branch");
while($row=mysqli_fetch_array($qq))
{
$id=$row['b_id'];
$code=$row['branch_code'];
$name=$row['branch_name'];
echo "<option>".$name."</option>";
}
?>
</select></div>
</div><!-- form-group -->
</div>
</div>
<!-- uplode -->
<div class="row">
<div class="col-sm-12" style="color:white;font-weight:bold;font-size:14px;background-color:#428BCA">
<h5 style="padding-top:5px; padding-bottom:5px">Employee Profile Image : </h5>
</div>
</div>
<div class="row paddtop paddbottom">
<div class="col-sm-3" style="margin-top: 48px;">
<div class="form-group">
<label class="control-label"><b>Upload Image :</b> <span style="color:red;"></span></label>
<input class="form-control" id="uploadFile" onchange="return ValidateFileUpload()" type="file" name="image" class="img" accept="image/x-png,image/gif,image/jpeg" />
<span style="color:red;">Upload Png Jpeg gif only max Size 1 mb</span></label>
</div><!-- form-group -->
</div>
<div class="col-sm-4">
</div>
<div class="col-sm-4">
<div id="imagePreview"></div>
</div>
</div><!-- Row -->
<div class="row">
<div class="col-sm-12" style="color:white;font-weight:bold;font-size:14px;background-color:#428BCA">
<h5 style="padding-top:5px; padding-bottom:5px">Employee Documents : </h5>
</div>
</div>
<div class="row paddtop paddbottom">
<div class="col-sm-3">
<div class="form-group">
<label class="control-label" class="col-sm-4 control-label"><b>Upload ID Proof :</b> <span style="color:red;"></span></label>
</div>
</div>
<div class="col-sm-3 col-xs-11">
<div class="form-group">
<input type="file" name="id_proof" style="height:35px;" class="form-control" id="filedocxpdf" onchange="return ValidateFileUploadPdf()" accept="application/pdf"/>
<span style="color:red;">Upload Pdf only max Size 2 mb</span></label>
</div><!-- form-group id="e1"-->
</div>
</div><!-- Row -->
<div class="row paddtop paddbottom">
<div class="col-sm-3">
<div class="form-group">
<label class="control-label" class="col-sm-4 control-label"><b>Upload Address Proof :</b> <span style="color:red;"></span></label>
</div>
</div>
<div class="col-sm-3 col-xs-11">
<div class="form-group">
<input type="file" name="add_proof" style="height:35px;" class="form-control" id="filedocxpdf2" onchange="return ValidateFileUploadPdf2()" accept="application/pdf" />
<span style="color:red;">Upload Pdf only max Size 2 mb</span></label>
</div><!-- form-group -->
</div>
</div><!-- Row -->
<!--/uplode-->
<div class="row">
<div class="col-sm-12" style="color:white;font-weight:bold;font-size:14px;background-color:#428BCA">
<h5 style="padding-top:5px; padding-bottom:5px">Employee Payable Details : </h5>
</div>
</div>
<div class="row paddtop">
<div class="col-sm-3">
<div class="form-group">
<label class="control-label"><b>Date of Joining :</b> <span style="color:red;">*</span></label>
<input type="date" name="emp_period_from" style="height:35px;"class="form-control" id="e15" placeholder="Employee Designation"/>
</div><!-- form-group -->
</div>
<!-- <div class="col-sm-3">
<div class="form-group">
<label class="control-label"><b> Working Period :</b> </label>
<input type="date" name="emp_period_to" style="height:35px;" disabled class="form-control" id="ee256" placeholder="" />
</div><!-- form-group -->
<!-- </div>-->
<div class="col-sm-3">
<div class="form-group">
<label class="control-label"><b> Basic Salary:</b> <span style="color:red;">*</span></label>
<input type="text" name="emp_basic_amount" style="height:35px;" class="form-control" id="e17" onkeypress="return isNumber(event,'error8')" onkeyup="sum()" maxlength="7" placeholder="Amount" />
</div><!-- form-group -->
<div id="error8"></div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="control-label"><b>HRA :</b></label>
<input type="text" name="emp_hra" style="height:35px;"class="form-control" id="e18" onkeypress="return isNumber(event,'error9')" onkeyup="sum()" maxlength="7" placeholder="Amount"/>
</div><!-- form-group -->
<div id="error9"></div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="control-label"><b> Conveyance :</b> </label>
<input type="text" name="emp_conveyance" style="height:35px;" class="form-control" id="e19" onkeypress="return isNumber(event,'errorl10')" onkeyup="sum()" maxlength="7" placeholder="Amount" />
</div><!-- form-group -->
<div id="errorl10"></div>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<div class="form-group">
<label class="control-label"><b>Mobile Allowance :</b> </label>
<input type="text" name="mobile_allo" style="height:35px;"class="form-control" id="ee19" onkeypress="return isNumber(event,'errorl11')" onkeyup="sum()" maxlength="7" placeholder="Amount"/>
</div><!-- form-group -->
<div id="errorl11"></div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="control-label"><b> Other Allowance :</b> </label>
<input type="text" name="other_allo" style="height:35px;" class="form-control" id="eee19" onkeypress="return isNumber(event,'errors')" onkeyup="sum()" maxlength="7" placeholder="Amount" />
</div><!-- form-group -->
<div id="errors"></div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="control-label"><b> Total Salary:</b> <span style="color:red;">*</span></label>
<input type="text" name="emp_total_salary" style="height:35px;" readonly class="form-control" id="e20" placeholder="Amount" />
</div><!-- form-group -->
</div>
<div class="col-sm-3">
<div class="form-group">
<label><b>Employee Status :</b> </label>
<select class="form-control select1" style="height:35px;" name="emp_status" onchange="showpfno(this.value)" id="e22">
<option value="0">Select Status</option>
<option value="1">Active</option>
<option value="2">Inactive</option>
</select>
</div>
</div>
<!--<div class="col-sm-3">
<div class="form-group">
<label class="control-label"><b>Target Amount :</b> </label>
<input type="number" name="emp_target_amount" style="height:35px;" id="e21" onkeypress="return isNumber(event)" class="form-control" maxlength="7" placeholder="Employee Target Amount"/>
</div><!-- form-group -->
<!-- </div>-->
</div>
<div class="row">
<!-- form-group -->
<!--<div class="col-sm-3">
<div class="form-group">
<label class="control-label"><b>Employee Target Type :</b> <span style="color:red;">*</span></label>
<div id="brnh"> <select class="form-control select1" name="employee_target_type" style="height:35px;text-transform:capitalize;" class="form-control" id="ee25" placeholder="Employee Branch">
<option value="">Select Type</option>
<option>Square Feet</option>
<option>Square Yard</option>
</select></div>
</div>
</div>-->
<!-- form-group -->
<!-- <div class="col-sm-3">
<div class="form-group">
<label><b>Employee Status :</b> </label>
<select class="form-control select1" style="height:35px;" name="emp_status" onchange="showpfno(this.value)" id="e22">
<option value="0">Select Status</option>
<option value="1">Active</option>
<option value="2">Inactive</option>
</select>
</div>
</div>-->
<!--<div class="col-sm-3" >
<div class="form-group">
<label class="control-label"><b>Interview Taken By :</b> <span style="color:red;">*</span></label>
<input class="form-control search" id="searchid" type="text" name="interviewer_name" placeholder="Interviewer Name" onkeypress="return chkAplha(event,'error')"/>
<div id="result" VALUE="<?php //echo $final_username;?>"onkeypress="return chkAplha(event,'error')">
</div><!-- form-group -->
<!--</div>
</div>-->
</div>
<div class="row">
<div class="col-sm-offset-4 col-sm-4 ">
<input type="submit" name="submit" value="Add Employe" id="submit" class="btn btn-success button1">
<button type="reset" class="btn btn-danger resetbutt">Reset All</button>
</div>
</div><!-- Row -->
</div>
</form>
</div>
</div><!-- mainwrapper -->
</section>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">