-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathview.php
884 lines (716 loc) · 27.9 KB
/
view.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
<?php
session_start();
if($_SESSION['status']=='Successful'){
// echo "<script>alert('Logged in!')</script>";
echo "";
}
else{
header("Location: index.html");
}
$link = mysqli_connect("localhost", "root" , "") or die (mysqli_error($link));
mysqli_select_db($link, "jobapp1") or die(mysqli_error($link));
date_default_timezone_set('Asia/Kolkata');
$curr_date= date("Y-m-d H:i:s"); // time in India
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" type="image/webp" sizes="32x32" href="J.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<title>Admin View</title>
</head>
<body>
<style>
@media(max-width:900px){
tr{
display: flex;
flex-direction: column;
}
td{
display: flex;
flex-direction: column;
}
th{
display: none;
font-size: 10px;
}
td button{
width: 100%;
}
}
</style>
<div class="topnav" id="topnav" >
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">☰ Admin Panel
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li class="dropdown-header" aria-disabled="">Database tables</li>
<li><a href="./tables/applicant.php">Applicant</a></li>
<li><a href="./tables/background.php">Background</a></li>
<li><a href="./tables/locate.php">Locate</a></li>
<li><a href="./tables/visions.php">Vision</a></li>
<li class="divider"></li>
<li class="dropdown-header">Complete log</li>
<li><a href="./tables/alltables.php">View all</a></li>
</ul>
</div>
<div class="tab">
<a class="active" href="index.html">Home</a>
<a href="#table"><span>Table</span></a>
<a href="#bottom"><span>Bottom</span></a>
<a href="#hold" onclick="ins()">Insert</a>
</div>
<form action="" method="post">
<div class="input-group" >
<input type="text" name="value" placeholder="Seach..." class="searc"></input>
<input type="submit" name="search" value="🔍" class="sicon"></input>
</div>
</form>
<script>
$(document).ready(function(){
// Add smooth scrolling to all links
$("a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior
event.preventDefault();
// Store hash
var hash = this.hash;
// Using jQuery's animate() method to add smooth page scroll
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function(){
// Add hash (#) to URL when done scrolling (default click behavior)
window.location.hash = hash;
});
} // End if
});
});
</script>
</div>
<br><br><br><br>
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins',sans-serif;
}
.topnav{
display: flex;
align-items: baseline;
justify-content: space-between;
background: rgba(0,0,0,0.7);
backdrop-filter: blur(10px);
padding: 10px;
position: fixed;
width: 100%;
z-index: 100;
}
.tab a{
color: #fff;
font-size: 25px;
margin: 0 20px;
transition: .5s;
padding: 15px 30px;
border-radius:50px 50px 0 0;
background: rgba(0,0,0,0.1);
text-shadow: 0 5px 4px rgba(0,0,0,0.3);
}
.tab a:hover{
text-decoration: none;
background: #fff;
color: #000;
border-radius: 0 0 50px 50px ;
}
.searc{
padding: 10px 30px;
}
.sicon{
background: #fff;
font-size: 25px;
margin:0 5px;
border-radius: 50%;
}
</style>
<?php
$link = mysqli_connect("localhost", "root" , "") or die (mysqli_error($link));
mysqli_select_db($link, "jobapp1") or die(mysqli_error($link));
if(isset($_POST['search']))
{
$count=0;
$link = mysqli_connect("localhost", "root" , "") or die (mysqli_error($link));
mysqli_select_db($link, "jobapp1") or die(mysqli_error($link));
$res = mysqli_query($link, "SELECT * from submissions WHERE fname= '$_POST[value]' ");
$las = mysqli_query($link, "SELECT * from submissions WHERE lname= '$_POST[value]' ");
$pos = mysqli_query($link, "SELECT * from submissions WHERE position like '%$_POST[value]%' ");
$city = mysqli_query($link, "SELECT * from submissions WHERE branch like '%$_POST[value]%' ");
// $lwc = mysqli_query($link, "SELECT * from background where lwc like '%$_POST[value]%'");
// $xp = mysqli_query($link, "SELECT * from background where xp = '$_POST[value]'");
// $skil = mysqli_query($link, "SELECT * from background where skill like '%$_POST[value]%'");
echo "<center>";
echo "<table class='table' border='5'>
<tr>
<th>First name</th>
<th>Last name</th>
<th>Email</th>
<th>LinkedIn</th>
<th>Position</th>
<th>Branch</th>
<th>Edit</th>
<th>Delete</th>
</tr>";
echo "</center>";
while($row=mysqli_fetch_array($res))
{
echo "<tr>";
echo "<td>"; echo $row["fname"]; echo "</td>";
echo "<td>"; echo $row["lname"]; echo "</td>";
echo "<td>"; echo $row["email"]; echo "</td>";
echo "<td>"; echo $row["linkedin"]; echo "</td>";
echo "<td>"; echo $row["position"]; echo "</td>";
echo "<td>"; echo $row["branch"]; echo "</td>";
echo "<td>"; ?><a href="edit.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-success">Edit</button></a> <?php echo "</td>";
echo "<td>"; ?><a href="delete.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-danger">Delete</button></a> <?php echo "</td>";
echo "</tr>";
$count= $count+1;
}
while($row=mysqli_fetch_array($las))
{
echo "<tr>";
echo "<td>"; echo $row["fname"]; echo "</td>";
echo "<td>"; echo $row["lname"]; echo "</td>";
echo "<td>"; echo $row["email"]; echo "</td>";
echo "<td>"; echo $row["linkedin"]; echo "</td>";
echo "<td>"; echo $row["position"]; echo "</td>";
echo "<td>"; echo $row["branch"]; echo "</td>";
echo "<td>"; ?><a href="edit.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-success">Edit</button></a> <?php echo "</td>";
echo "<td>"; ?><a href="delete.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-danger">Delete</button></a> <?php echo "</td>";
echo "</tr>";
$count= $count+1;
}
while($row=mysqli_fetch_array($pos))
{
echo "<tr>";
echo "<td>"; echo $row["fname"]; echo "</td>";
echo "<td>"; echo $row["lname"]; echo "</td>";
echo "<td>"; echo $row["email"]; echo "</td>";
echo "<td>"; echo $row["linkedin"]; echo "</td>";
echo "<td>"; echo $row["position"]; echo "</td>";
echo "<td>"; echo $row["branch"]; echo "</td>";
echo "<td>"; ?><a href="edit.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-success">Edit</button></a> <?php echo "</td>";
echo "<td>"; ?><a href="delete.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-danger">Delete</button></a> <?php echo "</td>";
echo "</tr>";
$count= $count+1;
}
while($row=mysqli_fetch_array($city))
{
echo "<tr>";
echo "<td>"; echo $row["fname"]; echo "</td>";
echo "<td>"; echo $row["lname"]; echo "</td>";
echo "<td>"; echo $row["email"]; echo "</td>";
echo "<td>"; echo $row["linkedin"]; echo "</td>";
echo "<td>"; echo $row["position"]; echo "</td>";
echo "<td>"; echo $row["branch"]; echo "</td>";
echo "<td>"; ?><a href="edit.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-success">Edit</button></a> <?php echo "</td>";
echo "<td>"; ?><a href="delete.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-danger">Delete</button></a> <?php echo "</td>";
echo "</tr>";
$count= $count+1;
}
}//if search
?>
</div>
<div id="pg1" class="col-md-12 text-center">
<form action="" method="post">
<h2>Sort by Applied Date</h2>
<label class="mx-3" for="from">From:</label>
<input style="padding: 5px;border-radius:5px;" id="from" type="date" name="from" placeholder="Date from">
<label style="margin-left:25px;" for="to">To:</label>
<input style="padding: 5px;border-radius:5px;" id="to" type="date" name="to" placeholder="Date To">
<input class="p-2 rounded mx-5" style="padding: 5px;margin-left:10px;background:#222; color:#fff" type="submit" class="mx-3" name="dsort" value="Submit">
</form>
<hr>
<br>
<form action="" method="post">
<div class="center">
<input type="submit" class="btn btn-primary mx-5 px-4" name="job" value="Developer"></input>
<input type="submit" class="btn btn-danger mx-5 px-5" name="job" value="HR"> </input>
<input type="submit" class="btn btn-success mx-5 px-5" name="job" value="Tester"> </input>
<input type="submit" class="btn btn-warning mx-5 px-5" name="ot" value="Other"> </input>
</div>
</form>
<style>
.center input{
padding: 5px 20px;
margin:0 10px;
}
h2{
text-align: center ;
}
</style>
<br><br>
<?php
if(isset($_POST['dsort'])){
$count=0;
$link = mysqli_connect("localhost", "root" , "") or die (mysqli_error($link));
mysqli_select_db($link, "jobapp1") or die(mysqli_error($link));
$date = mysqli_query($link, "SELECT * from submissions WHERE `date` BETWEEN '$_POST[from]' AND '$_POST[to]' group by(date) ");
echo "<center>";
echo "<table class='table' border='5'>
<tr>
<th>First name</th>
<th>Last name</th>
<th>Email</th>
<th>LinkedIn</th>
<th>Position</th>
<th>Branch</th>
<th>Date</th>
<th>Edit</th>
<th>Delete</th>
</tr>";
echo "</center>";
while($row=mysqli_fetch_array($date))
{
echo "<tr>";
echo "<td>"; echo $row["fname"]; echo "</td>";
echo "<td>"; echo $row["lname"]; echo "</td>";
echo "<td>"; echo $row["email"]; echo "</td>";
echo "<td>"; echo $row["linkedin"]; echo "</td>";
echo "<td>"; echo $row["position"]; echo "</td>";
echo "<td>"; echo $row["branch"]; echo "</td>";
echo "<td>"; echo $row["date"]; echo "</td>";
echo "<td>"; ?><a href="edit.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-success">Edit</button></a> <?php echo "</td>";
echo "<td>"; ?><a href="delete.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-danger">Delete</button></a> <?php echo "</td>";
echo "</tr>";
$count= $count+1;
}
echo "<h2>";
echo "From " ."<span style='font-weight:900';>". $_POST['from'] . "</span>"." To " ."<span style='font-weight:900';>" . $_POST['to'] ."</span>". " : " . $count . " Entries";
echo "</h2>";
echo "</table>";
}
if(isset($_POST['ot'])){
$count=0;
$link = mysqli_connect("localhost", "root" , "") or die (mysqli_error($link));
mysqli_select_db($link, "jobapp1") or die(mysqli_error($link));
$oth = mysqli_query($link, "SELECT * from submissions WHERE position not like 'developer'
and position not like 'tester' and position not like 'hr' ");
echo "<center>";
echo "<table class='table' border='5'>
<tr>
<th>First name</th>
<th>Last name</th>
<th>Email</th>
<th>LinkedIn</th>
<th>Position</th>
<th>Branch</th>
<th>Edit</th>
<th>Delete</th>
</tr>";
echo "</center>";
while($row=mysqli_fetch_array($oth))
{
echo "<tr>";
echo "<td>"; echo $row["fname"]; echo "</td>";
echo "<td>"; echo $row["lname"]; echo "</td>";
echo "<td>"; echo $row["email"]; echo "</td>";
echo "<td>"; echo $row["linkedin"]; echo "</td>";
echo "<td>"; echo $row["position"]; echo "</td>";
echo "<td>"; echo $row["branch"]; echo "</td>";
echo "<td>"; ?><a href="edit.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-success">Edit</button></a> <?php echo "</td>";
echo "<td>"; ?><a href="delete.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-danger">Delete</button></a> <?php echo "</td>";
echo "</tr>";
$count= $count+1;
}
echo "<h2>";
echo "Total Search results: " . $count;
echo "</h2>";
echo "</table>";
}
if(isset($_POST['job']))
{
$count=0;
$link = mysqli_connect("localhost", "root" , "") or die (mysqli_error($link));
mysqli_select_db($link, "jobapp1") or die(mysqli_error($link));
$pos = mysqli_query($link, "SELECT * from submissions WHERE position = '$_POST[job]' ");
$dev= mysqli_query($link,"SELECT COUNT(*) FROM submissions WHERE position='developer' ");
$test= mysqli_query($link,"SELECT COUNT(*) FROM submissions WHERE position='tester' ");
$hr= mysqli_query($link,"SELECT COUNT(*) FROM submissions WHERE position='hr' ");
echo "<center>";
echo "<table class='table' border='5'>
<tr>
<th>First name</th>
<th>Last name</th>
<th>Email</th>
<th>LinkedIn</th>
<th>Position</th>
<th>Branch</th>
<th>Edit</th>
<th>Delete</th>
</tr>";
echo "</center>";
while($row=mysqli_fetch_array($pos))
{
echo "<tr>";
echo "<td>"; echo $row["fname"]; echo "</td>";
echo "<td>"; echo $row["lname"]; echo "</td>";
echo "<td>"; echo $row["email"]; echo "</td>";
echo "<td>"; echo $row["linkedin"]; echo "</td>";
echo "<td>"; echo $row["position"]; echo "</td>";
echo "<td>"; echo $row["branch"]; echo "</td>";
echo "<td>"; ?><a href="edit.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-success">Edit</button></a> <?php echo "</td>";
echo "<td>"; ?><a href="delete.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-danger">Delete</button></a> <?php echo "</td>";
echo "</tr>";
$count= $count+1;
}
echo "<h2>";
echo "Total Search results: " . $count;
echo "</h2>";
echo "</table>";
}
?>
<br>
</div></div>
<br><br>
<?php
$fetchmax=mysqli_query($link,"SELECT * from recruit where id =1");
while($row=mysqli_fetch_array($fetchmax)){
$mxdv=$row['dev'];
$mhr=$row['hr'];
$mxtest=$row['test'];
$support=$row['support'];
}
$totalneed=$mxdv + $mhr + $mxtest + $support;
?>
<div class="col-sm-12" >
<form class="form-row " method="post" action="">
<div class="form-group">
<h2>Set required Spots</h2>
<label class="col-sm-12 control-label">For Developer</label>
<div class="col-sm-12">
<input class="form-control center" id="dev" type="number" name="dev" value="<?php echo $mxdv; ?>" >
</div>
<div class="form-group">
<label class="col-sm-12 control-label">For Human Resources</label>
<div class="col-sm-12">
<input class="form-control" id="hr" type="number" name="hr" value="<?php echo $mhr; ?>" >
</div>
<div class="form-group">
<label class="col-sm-12 control-label">For Testers</label>
<div class="col-sm-12">
<input class="form-control" id="test" type="number" name="test" value="<?php echo $mxtest; ?>" >
<br><br>
</div>
</div>
<input type="submit" name="setmax" style="width: 100%;background-image: linear-gradient(60deg, #29323c 0%, #485563 100%);" class="btn btn-primary btn-lg btn-block" />
</form>
</div>
<?php
if(isset($_POST['setmax'])){
$mxdev=$_POST['dev'];
$mxhr=$_POST['hr'];
$mxtester=$_POST['test'];
$set= mysqli_query($link, "UPDATE `recruit` SET `dev`='$mxdev',`test`='$mxtester',`hr`='$mxhr' WHERE id=1");
?>
<script>
window.location.href="view.php";
</script>
<?php
}
?>
<div class="hold" id="hold">
<div class="container col-sm-12" >
<h2>Insert data</h2>
<form class="form-row " method="post" action="">
<div class="form-group">
<label class="col-sm-12 control-label">First Name</label>
<div class="col-sm-12">
<input class="form-control" id="firstname" type="text" value="" name="fname" placeholder="First name" >
</div>
</div>
<div class="form-group">
<label class="col-sm-12 control-label" for="lastname">Last name</label>
<div class="col-sm-12">
<input type="text" class="form-control" id="lastname" type="text" name="lname" placeholder="Last name" >
</div></div>
<div class="form-group has-success has-feedback">
<label class="col-sm-12 control-label" for="email">Email</label>
<div class="col-sm-12">
<input type="text" class="form-control" name="email" id="email" placeholder="Email" >
</div></div>
<div class="form-group has-success has-feedback">
<label class="col-sm-12 control-label" for="linkedin">LinkedIn</label>
<div class="col-sm-12">
<input type="url" class="form-control" name="linkedin" id="linkedin" placeholder="LinkedIn" >
</div></div>
<div class="form-group has-success has-feedback">
<label class="col-sm-12 control-label" for="dob">Date of Birth</label>
<div class="col-sm-12">
<input type="date" class="form-control" name="dob" id="dob" placeholder="Date of birth" >
</div></div>
<div class="form-group has-success has-feedback">
<label class="col-sm-12 control-label" for="position">Position</label>
<div class="col-sm-12">
<input type="text" class="form-control" name="position" id="position" placeholder="Position" >
</input>
</div></div>
<div class="form-group has-success has-feedback">
<label class="col-sm-12 control-label" for="mobile">Mobile</label>
<div class="col-sm-12">
<input type="tel" class="form-control" name="mobile" id="mobile" placeholder="Mobile" >
</div></div>
<div class="form-group has-success has-feedback">
<label class="col-sm-12 control-label" for="city_name">Branch Name</label>
<div class="col-sm-12">
<input type="text" class="form-control" id="city_name" name="branch" placeholder="City" >
</div></div>
<div class="form-group has-success has-feedback">
<label class="col-sm-12 control-label" for="last_company">Last Company</label>
<div class="col-sm-12">
<input type="text" class="form-control" name="lwc" id="last_company" placeholder="Last company" >
</div></div>
<div class="form-group">
<label class="col-sm-12 control-label" for="rel" >Are you willing to relocate?</label>
<div class="col-sm-12">
<input type="radio" name="relocate" value="Yes" class="form-control-row" id="rel"> Yes </label>
<input type="radio" aria-selected="true" id="rel" class="form-control-row" name="relocate" value="No"> No
<input type="radio" name="relocate" id="rel" class="form-control-row" aria-selected="true" value="Notsure"> Not Sure
</div>
</div>
</div>
<div class="form-group has-success has-feedback">
<label class="col-sm-12 control-label" for="xp">Experience</label>
<div class="col-sm-12">
<input type="number" class="form-control" name="xp" id="xp" placeholder="Experience" >
</div>
</div>
<div class="form-group has-success has-feedback">
<label class="col-sm-12 control-label" for="skill">Skill</label>
<div class="col-sm-12">
<input type="textarea" class="form-control" name="skill" id="skill" placeholder="Skills" >
</div>
</div>
<div class="form-group has-success has-feedback">
<label class="col-sm-12 control-label" for="vision">Visions</label>
<div class="col-sm-12">
<input type="textarea" class="form-control" name="vision" id="vision" placeholder="Any aims" >
</div>
</div>
<input type="submit" name="insert" style="width: 100%;background-image: linear-gradient(60deg, #29323c 0%, #485563 100%);margin:10px 0;" class="btn btn-primary btn-lg btn-block" />
</form>
</div>
</div>
<style>
#hold{
max-height: 100%;
width: 100%;
display: none;
flex-direction: column;
position: relative;
overflow: hidden;
}
</style>
<script>
function ins(){
document.getElementById("hold").style.display="flex";
}
</script>
<br><br>
<div id="table" class="col-lg-12">
<table class="table table-dark table-hover ">
<thead>
<tr>
<th>#</th>
<th>Firstname</th>
<th>Lastname</th>
<th>Email</th>
<th>Linkedin</th>
<th>Position</th>
<th>Branch</th>
<th>Relocate</th>
<th>Date</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php
$mn = mysqli_query($link, "SELECT * from `submissions` ");
$count=0;
while($row=mysqli_fetch_array($mn))
{
echo "<tr>";
echo "<td>"; echo $row["id"]; echo "</td>";
echo "<td>"; echo $row["fname"]; echo "</td>";
echo "<td>"; echo $row["lname"]; echo "</td>";
echo "<td>"; echo $row["email"]; echo "</td>";
echo "<td>"; echo $row["linkedin"]; echo "</td>";
echo "<td>"; echo $row["position"]; echo "</td>";
echo "<td>"; echo $row["branch"]; echo "</td>";
echo "<td>"; echo $row["relocate"]; echo "</td>";
echo "<td>"; echo $row["date"]; echo "</td>";
echo "<td>"; ?><a href="edit.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-success">Edit</button></a> <?php echo "</td>";
echo "<td>"; ?><a href="delete.php?id=<?php echo $row["id"]; ?>"><button type="text/javascript" class="btn btn-danger">Delete</button></a> <?php echo "</td>";
echo "</tr>";
$count= $count+1;
}
echo "<h2>";
echo "Total Submissions: " . $count;
echo "</h2>";
?>
</tbody>
</table>
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins',sans-serif;
}
body, html{
scroll-behavior: smooth;
}
label{
margin-top: 20px;
}
h2{
text-shadow: 4px 4px 4px rgba(0,0,0,0.3);
}
#firsta:hover{
border-radius: 0;
}
a{
text-decoration: none;
}
a:hover{
text-decoration: none;
}
</style>
<div class="container" id="bottom">
<?php
?>
<h2>Total Recruitment:</h2>
<p></p>
<div class="progress">
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="<?php echo $count; ?>" aria-valuemin="0" aria-valuemax="<?php echo $totalneed; ?>" style="width:<?php echo $count;?>% ">
<?php echo $count;?>
</div>
</div>
<br>
</div>
<br>
</div>
<br>
<div class="chart">
<div id="piechart">
</div>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
// Load google charts
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
// Draw the chart and set the chart values
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Skill', 'Number of persons'],
['Problem Solving', <?php $prob=mysqli_query($link, "SELECT count(*) skill FROM `background` WHERE skill like '%solv%';");
$row=mysqli_fetch_array($prob);
echo $row["skill"]; ?>],
['Ethical Hacking', <?php $hack=mysqli_query($link, "SELECT count(*) skill FROM `background` WHERE skill like '%hack%';");
$row=mysqli_fetch_array($hack);
echo $row["skill"]; ?>],
['Data Science and Analysis', <?php $data=mysqli_query($link, "SELECT count(*) skill FROM `background` WHERE skill like '%data%';");
$row=mysqli_fetch_array($data);
echo $row["skill"]; ?>],
['Web Development', <?php $web=mysqli_query($link, "SELECT count(*) skill FROM `background` WHERE skill like '%web%';");
$row=mysqli_fetch_array($web);
echo $row["skill"]; ?>],
['Debugging', <?php $bug=mysqli_query($link, "SELECT count(*) skill FROM `background` WHERE skill like '%bug%';");
$row=mysqli_fetch_array($bug);
echo $row["skill"]; ?>],
['Coding', <?php $cod=mysqli_query($link, "SELECT count(*) skill FROM `background` WHERE skill like '%cod%';");
$row=mysqli_fetch_array($cod);
echo $row["skill"]; ?>],
['Big data', <?php $big=mysqli_query($link, "SELECT count(*) skill FROM `background` WHERE skill like '%big data%';");
$row=mysqli_fetch_array($big);
echo $row["skill"]; ?>],
['Other', <?php $other=mysqli_query($link, "SELECT count(*) skill FROM `background` WHERE skill not like '%solv%' and '%data%' and '%web%' ;");
$row=mysqli_fetch_array($other);
echo $row["skill"]; ?>]
]);
// Optional; add a title and set the width and height of the chart
var options = {'title':'The Skills applicants mentioned', 'width':600, 'height':500};
// Display the chart inside the <div> element with id="piechart"
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
</script>
</div>
<style>
.chart{
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
</style>
<div class="center">
<p style="text-align: center;color: rgba(0, 0, 0, 0.493);bottom: 5%;">© <script>document.write(new Date().getFullYear())</script> Vilas Hegde All Rights Reserved</p>
</div>
</body>
<?php
if(isset($_POST["insert"]))
{
$sql= "INSERT INTO `submissions`(`id`, `fname`, `lname`, `email`, `linkedin`, `position`, `branch`, `relocate`, `date`)
VALUES (NULL,'$_POST[fname]','$_POST[lname]','$_POST[email]','$_POST[linkedin]','$_POST[position]',
'$_POST[branch]','$_POST[relocate]', '".$curr_date."' );" ;
if ($link->query($sql) === TRUE) {
$last_id = $link->insert_id;
$sql1=mysqli_query($link,"INSERT INTO `applicant`(`id`, `name`, `email`, `mobile`, `dob`)
VALUES ( '$last_id','$_POST[fname]','$_POST[email]','$_POST[mobile]','$_POST[dob]');");
$sql2=mysqli_query($link,"INSERT INTO `background`(`id`,`name`, `lwc`, `xp`, `skill`)
VALUES ( '$last_id','$_POST[fname]','$_POST[lwc]','$_POST[xp]','$_POST[skill]');");
$sql3=mysqli_query($link,"INSERT INTO `locate`(`id`,`name`, `branch`, `position`, `mobile`)
VALUES ( '$last_id','$_POST[fname]','$_POST[branch]','$_POST[position]','$_POST[mobile]');");
$sql4=mysqli_query($link,"INSERT INTO `visions`(`id`,`name`, `vision`, `skills`)
VALUES ( '$last_id','$_POST[fname]','$_POST[vision]','$_POST[skill]'); ");
$link -> close();
?>
<script type="text/javascript">
window.location.href='view.php';
</script>
<?php
} else {
echo "Error: " . $sql . "<br>" . $link->error;
}
}
?>
<?php
if(isset($_POST["delete"]))
{
mysqli_query($link, "DELETE from submissions where first_name='".$firstname."' and email='".$email."' ") or die (mysqli_error($link));
?>
<script type="text/javascript">
window.location.href=window.location.href;
</script>
<?php
}
if(isset($_POST["update"]))
{
mysqli_query($link, "UPDATE submissions set first_name='$_POST[firstname]' where first_name='$_POST[firstname]'") or die (mysqli_error($link ));
?>
<script type="text/javascript">
window.location.href=window.location.href;
</script>
<?php
}
?>
</html>