-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
3784 lines (3308 loc) · 133 KB
/
index.php
File metadata and controls
3784 lines (3308 loc) · 133 KB
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
session_start();
// Database connection settings
$db_host = 'localhost';
$db_name = 'vdart_hr';
$db_user = 'root'; // Change if your MySQL username is different
$db_pass = ''; // Add your MySQL password if any
// Admin dashboard login handling (different from admin mode)
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['adminDashboardPassword'])) {
// Clean any output buffers to prevent extra content
if (ob_get_level()) {
ob_clean();
}
$enteredPassword = trim($_POST['adminDashboardPassword']);
$correctPassword = 'vdart123';
if ($enteredPassword === $correctPassword) {
$_SESSION['admin_dashboard_logged_in'] = true;
// Set proper headers
header('Content-Type: text/plain');
// Send clean response
echo 'dashboard_success';
exit();
} else {
// Set proper headers
header('Content-Type: text/plain');
// Send clean response
echo 'dashboard_failed';
exit();
}
}
// Admin mode login handling (different from dashboard)
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['adminModePassword'])) {
$enteredPassword = $_POST['adminModePassword'];
$correctPassword = 'admin2024';
if ($enteredPassword === $correctPassword) {
$_SESSION['admin_mode_logged_in'] = true;
echo 'mode_success';
} else {
echo 'mode_failed';
}
exit();
}
// Handle custom field addition
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['addCustomField'])) {
if (isset($_SESSION['admin_mode_logged_in']) && $_SESSION['admin_mode_logged_in'] === true) {
$fieldType = sanitizeInput($_POST['fieldType']);
$fieldValue = sanitizeInput($_POST['fieldValue']);
$conn = connectDB();
if ($conn) {
try {
// Check if custom fields table exists, if not create it
$createTableSql = "CREATE TABLE IF NOT EXISTS custom_dropdown_fields (
id INT AUTO_INCREMENT PRIMARY KEY,
field_type VARCHAR(50) NOT NULL,
field_value VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY unique_field (field_type, field_value)
)";
$conn->exec($createTableSql);
// Insert the custom field
$sql = "INSERT INTO custom_dropdown_fields (field_type, field_value) VALUES (:field_type, :field_value)";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':field_type', $fieldType);
$stmt->bindParam(':field_value', $fieldValue);
$stmt->execute();
echo json_encode(['success' => true, 'message' => 'Custom field added successfully']);
} catch(PDOException $e) {
if ($e->getCode() == 23000) { // Duplicate entry
echo json_encode(['success' => false, 'message' => 'This option already exists']);
} else {
echo json_encode(['success' => false, 'message' => 'Error adding custom field']);
}
}
} else {
echo json_encode(['success' => false, 'message' => 'Database connection failed']);
}
} else {
echo json_encode(['success' => false, 'message' => 'Unauthorized']);
}
exit();
}
// Handle custom field deletion
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['deleteCustomField'])) {
if (isset($_SESSION['admin_mode_logged_in']) && $_SESSION['admin_mode_logged_in'] === true) {
$fieldType = sanitizeInput($_POST['fieldType']);
$fieldValue = sanitizeInput($_POST['fieldValue']);
$conn = connectDB();
if ($conn) {
try {
$sql = "DELETE FROM custom_dropdown_fields WHERE field_type = :field_type AND field_value = :field_value";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':field_type', $fieldType);
$stmt->bindParam(':field_value', $fieldValue);
$stmt->execute();
if ($stmt->rowCount() > 0) {
echo json_encode(['success' => true, 'message' => 'Custom field deleted successfully']);
} else {
echo json_encode(['success' => false, 'message' => 'Field not found']);
}
} catch(PDOException $e) {
echo json_encode(['success' => false, 'message' => 'Error deleting custom field']);
}
} else {
echo json_encode(['success' => false, 'message' => 'Database connection failed']);
}
} else {
echo json_encode(['success' => false, 'message' => 'Unauthorized']);
}
exit();
}
// Function to get custom dropdown fields
function getCustomDropdownFields($fieldType) {
$conn = connectDB();
$customFields = [];
if ($conn) {
try {
$sql = "SELECT field_value FROM custom_dropdown_fields WHERE field_type = :field_type ORDER BY field_value";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':field_type', $fieldType);
$stmt->execute();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$customFields[] = $row['field_value'];
}
} catch(PDOException $e) {
logError("Error fetching custom fields: " . $e->getMessage());
}
}
return $customFields;
}
// Function to connect to the database
function connectDB() {
global $db_host, $db_name, $db_user, $db_pass;
try {
$conn = new PDO("mysql:host=$db_host;dbname=$db_name", $db_user, $db_pass);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $conn;
} catch(PDOException $e) {
logError("Database connection failed: " . $e->getMessage());
return false;
}
}
// Function to sanitize input data
function sanitizeInput($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data, ENT_QUOTES, 'UTF-8');
return $data;
}
// Function to log errors to a file
function logError($message) {
$logFile = 'error_log.txt';
$timestamp = date('Y-m-d H:i:s');
$logMessage = "[$timestamp] $message\n";
file_put_contents($logFile, $logMessage, FILE_APPEND);
}
// Function to validate form data
function validateForm($data) {
$errors = [];
// Required fields
$requiredFields = [
'employeeName', 'employeeId', 'designation', 'team',
'calDal', 'buHead', 'doj', 'dor', 'resignDecision'
];
foreach ($requiredFields as $field) {
if (empty($data[$field])) {
$errors[] = ucfirst(str_replace('_', ' ', $field)) . ' is required.';
}
}
// Validate at least one reason for leaving is selected
if (!isset($data['reasonsForLeaving']) || empty($data['reasonsForLeaving'])) {
$errors[] = 'Please select at least one reason for leaving.';
}
// Validate Yes/No questions have values
$yesNoQuestions = [
'exploredOptions', 'specificEvent', 'recommendCompany', 'openToReapply'
];
foreach ($yesNoQuestions as $field) {
if (!isset($data[$field]) || ($data[$field] !== 'Yes' && $data[$field] !== 'No')) {
$errors[] = 'Please answer all Yes/No questions.';
break;
}
}
// Validate descriptions for conditional fields
if (isset($data['exploredOptions']) && $data['exploredOptions'] === 'Yes' && empty($data['exploredOptionsDesc'])) {
$errors[] = 'Please provide a description for your exploration of options to stay.';
}
if (isset($data['specificEvent']) && $data['specificEvent'] === 'Yes' && empty($data['specificEventDesc'])) {
$errors[] = 'Please provide a description of the specific event that prompted your resignation.';
}
if (isset($data['recommendCompany']) && $data['recommendCompany'] === 'No' && empty($data['recommendCompanyDesc'])) {
$errors[] = 'Please provide a reason why you would not recommend our company.';
}
if (isset($data['openToReapply']) && $data['openToReapply'] === 'No' && empty($data['openToReapplyDesc'])) {
$errors[] = 'Please provide a reason why you would not reapply to our company.';
}
// Validate ratings
$ratingFields = [
'ratingPay', 'ratingTraining', 'ratingSupervisor', 'ratingRelationship',
'ratingBenefits', 'ratingPromotion', 'ratingPerformance', 'ratingDiscipline'
];
$validRatings = ['Excellent', 'Good', 'Fair', 'Poor'];
foreach ($ratingFields as $field) {
if (!isset($data[$field]) || !in_array($data[$field], $validRatings)) {
$errors[] = 'Please provide a rating for all categories.';
break;
}
}
return $errors;
}
// Function to save exit interview data to database
function saveExitInterview($data) {
$conn = connectDB();
if (!$conn) {
return [
'success' => false,
'message' => 'Database connection failed.'
];
}
try {
// Begin transaction
$conn->beginTransaction();
// Insert basic information
$sql = "INSERT INTO exit_interviews (
employee_name, employee_id, designation, team,
cal_dal, bu_head, doj, dor, resign_decision,
explored_options, explored_options_desc,
specific_event, specific_event_desc,
recommend_company, recommend_company_desc,
open_to_reapply, open_to_reapply_desc,
encourage_to_stay, factors_new_role,
areas_to_improve, members_to_thank,
rating_pay, rating_training, rating_supervisor,
rating_relationship, rating_benefits, rating_promotion,
rating_performance, rating_discipline,
hrbp_note, submission_date
) VALUES (
:employee_name, :employee_id, :designation, :team,
:cal_dal, :bu_head, :doj, :dor, :resign_decision,
:explored_options, :explored_options_desc,
:specific_event, :specific_event_desc,
:recommend_company, :recommend_company_desc,
:open_to_reapply, :open_to_reapply_desc,
:encourage_to_stay, :factors_new_role,
:areas_to_improve, :members_to_thank,
:rating_pay, :rating_training, :rating_supervisor,
:rating_relationship, :rating_benefits, :rating_promotion,
:rating_performance, :rating_discipline,
:hrbp_note, NOW()
)";
$stmt = $conn->prepare($sql);
// Bind parameters
$stmt->bindParam(':employee_name', $data['employeeName']);
$stmt->bindParam(':employee_id', $data['employeeId']);
$stmt->bindParam(':designation', $data['designation']);
$stmt->bindParam(':team', $data['team']);
$stmt->bindParam(':cal_dal', $data['calDal']);
$stmt->bindParam(':bu_head', $data['buHead']);
$stmt->bindParam(':doj', $data['doj']);
$stmt->bindParam(':dor', $data['dor']);
$stmt->bindParam(':resign_decision', $data['resignDecision']);
$stmt->bindParam(':explored_options', $data['exploredOptions']);
$stmt->bindParam(':explored_options_desc', $data['exploredOptionsDesc']);
$stmt->bindParam(':specific_event', $data['specificEvent']);
$stmt->bindParam(':specific_event_desc', $data['specificEventDesc']);
$stmt->bindParam(':recommend_company', $data['recommendCompany']);
$stmt->bindParam(':recommend_company_desc', $data['recommendCompanyDesc']);
$stmt->bindParam(':open_to_reapply', $data['openToReapply']);
$stmt->bindParam(':open_to_reapply_desc', $data['openToReapplyDesc']);
$stmt->bindParam(':encourage_to_stay', $data['encourageToStay']);
$stmt->bindParam(':factors_new_role', $data['factorsNewRole']);
$stmt->bindParam(':areas_to_improve', $data['areasToImprove']);
$stmt->bindParam(':members_to_thank', $data['membersToThank']);
$stmt->bindParam(':rating_pay', $data['ratingPay']);
$stmt->bindParam(':rating_training', $data['ratingTraining']);
$stmt->bindParam(':rating_supervisor', $data['ratingSupervisor']);
$stmt->bindParam(':rating_relationship', $data['ratingRelationship']);
$stmt->bindParam(':rating_benefits', $data['ratingBenefits']);
$stmt->bindParam(':rating_promotion', $data['ratingPromotion']);
$stmt->bindParam(':rating_performance', $data['ratingPerformance']);
$stmt->bindParam(':rating_discipline', $data['ratingDiscipline']);
$stmt->bindParam(':hrbp_note', $data['hrbpNote']);
$stmt->execute();
// Get the interview ID
$interviewId = $conn->lastInsertId();
// Insert reasons for leaving
if (isset($data['reasonsForLeaving']) && is_array($data['reasonsForLeaving'])) {
$reasonsSql = "INSERT INTO exit_interview_reasons (interview_id, reason) VALUES (:interview_id, :reason)";
$reasonsStmt = $conn->prepare($reasonsSql);
foreach ($data['reasonsForLeaving'] as $reason) {
$reasonsStmt->bindParam(':interview_id', $interviewId);
$reasonsStmt->bindParam(':reason', $reason);
$reasonsStmt->execute();
}
}
// Commit the transaction
$conn->commit();
// Send notification email to HR (if server supports mail)
try {
sendNotificationEmail($data);
} catch (Exception $e) {
// Log email error but don't fail the submission
logError("Error sending notification email: " . $e->getMessage());
}
return [
'success' => true,
'message' => 'Exit interview submitted successfully.',
'interview_id' => $interviewId
];
} catch(PDOException $e) {
// Rollback the transaction if something failed
$conn->rollback();
logError("Error saving exit interview: " . $e->getMessage());
return [
'success' => false,
'message' => 'An error occurred while saving the exit interview: ' . $e->getMessage()
];
}
}
// Function to send notification email to HR
function sendNotificationEmail($data) {
$to = "hr@vdart.com"; // Change to your actual HR email
$subject = "New Exit Interview Submitted - " . $data['employeeName'];
$message = "A new exit interview has been submitted.\n\n";
$message .= "Employee Name: " . $data['employeeName'] . "\n";
$message .= "Employee ID: " . $data['employeeId'] . "\n";
$message .= "Designation: " . $data['designation'] . "\n";
$message .= "Team: " . $data['team'] . "\n";
$message .= "Date of Resignation: " . $data['dor'] . "\n\n";
$message .= "Please log in to the HR portal to view the complete exit interview details.";
$headers = "From: system@vdart.com"; // Change to your actual system email
// Only try to send mail if the function exists and we're not in a local development environment
if (function_exists('mail') && $_SERVER['SERVER_NAME'] != 'localhost') {
mail($to, $subject, $message, $headers);
}
}
// Redirect function to handle both relative and absolute URLs
function redirectTo($url) {
if (!headers_sent()) {
header('Location: ' . $url);
exit;
} else {
echo '<script>window.location.href="' . $url . '";</script>';
echo '<noscript><meta http-equiv="refresh" content="0;url=' . $url . '"></noscript>';
exit;
}
}
// Handle form submission
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !isset($_POST['adminDashboardPassword']) && !isset($_POST['adminModePassword']) && !isset($_POST['addCustomField']) && !isset($_POST['deleteCustomField'])) {
// Collect and sanitize all form data
$formData = [];
// Basic information
$formData['employeeName'] = sanitizeInput($_POST['employeeName'] ?? '');
$formData['employeeId'] = sanitizeInput($_POST['employeeId'] ?? '');
$formData['designation'] = sanitizeInput($_POST['designation'] ?? '');
$formData['team'] = sanitizeInput($_POST['team'] ?? '');
$formData['calDal'] = sanitizeInput($_POST['calDal'] ?? '');
$formData['buHead'] = sanitizeInput($_POST['buHead'] ?? '');
$formData['doj'] = sanitizeInput($_POST['doj'] ?? '');
$formData['dor'] = sanitizeInput($_POST['dor'] ?? '');
// Resignation details
$formData['resignDecision'] = sanitizeInput($_POST['resignDecision'] ?? '');
if ($formData['resignDecision'] === 'Other' && isset($_POST['resignOther'])) {
$formData['resignDecision'] = 'Other: ' . sanitizeInput($_POST['resignOther']);
}
// Reasons for leaving
if (isset($_POST['reasonsForLeaving']) && is_array($_POST['reasonsForLeaving'])) {
$formData['reasonsForLeaving'] = array_map('sanitizeInput', $_POST['reasonsForLeaving']);
// If 'Others' is selected and reasonsOther is provided, append it
if (in_array('Others', $formData['reasonsForLeaving']) && !empty($_POST['reasonsOther'])) {
// Find the 'Others' index and replace it with the specific reason
$index = array_search('Others', $formData['reasonsForLeaving']);
if ($index !== false) {
$formData['reasonsForLeaving'][$index] = 'Others: ' . sanitizeInput($_POST['reasonsOther']);
}
}
} else {
$formData['reasonsForLeaving'] = [];
}
// Yes/No questions with descriptions
$formData['exploredOptions'] = sanitizeInput($_POST['exploredOptions'] ?? '');
$formData['exploredOptionsDesc'] = $formData['exploredOptions'] === 'Yes' ?
sanitizeInput($_POST['exploredOptionsDesc'] ?? '') : '';
$formData['specificEvent'] = sanitizeInput($_POST['specificEvent'] ?? '');
$formData['specificEventDesc'] = $formData['specificEvent'] === 'Yes' ?
sanitizeInput($_POST['specificEventDesc'] ?? '') : '';
$formData['recommendCompany'] = sanitizeInput($_POST['recommendCompany'] ?? '');
$formData['recommendCompanyDesc'] = $formData['recommendCompany'] === 'No' ?
sanitizeInput($_POST['recommendCompanyDesc'] ?? '') : '';
$formData['openToReapply'] = sanitizeInput($_POST['openToReapply'] ?? '');
$formData['openToReapplyDesc'] = $formData['openToReapply'] === 'No' ?
sanitizeInput($_POST['openToReapplyDesc'] ?? '') : '';
// Text questions
$formData['encourageToStay'] = sanitizeInput($_POST['encourageToStay'] ?? '');
$formData['factorsNewRole'] = sanitizeInput($_POST['factorsNewRole'] ?? '');
$formData['areasToImprove'] = sanitizeInput($_POST['areasToImprove'] ?? '');
$formData['membersToThank'] = sanitizeInput($_POST['membersToThank'] ?? '');
// Ratings
$formData['ratingPay'] = sanitizeInput($_POST['ratingPay'] ?? '');
$formData['ratingTraining'] = sanitizeInput($_POST['ratingTraining'] ?? '');
$formData['ratingSupervisor'] = sanitizeInput($_POST['ratingSupervisor'] ?? '');
$formData['ratingRelationship'] = sanitizeInput($_POST['ratingRelationship'] ?? '');
$formData['ratingBenefits'] = sanitizeInput($_POST['ratingBenefits'] ?? '');
$formData['ratingPromotion'] = sanitizeInput($_POST['ratingPromotion'] ?? '');
$formData['ratingPerformance'] = sanitizeInput($_POST['ratingPerformance'] ?? '');
$formData['ratingDiscipline'] = sanitizeInput($_POST['ratingDiscipline'] ?? '');
// HRBP Note
$formData['hrbpNote'] = sanitizeInput($_POST['hrbpNote'] ?? '');
// Validate form data
$errors = validateForm($formData);
if (empty($errors)) {
// Save the exit interview data
$result = saveExitInterview($formData);
if ($result['success']) {
// Set success message and redirect to thank you page
$_SESSION['success_message'] = $result['message'];
$_SESSION['interview_id'] = $result['interview_id'];
redirectTo('thank_you.php');
} else {
// Set error message and redirect back to form
$_SESSION['error_message'] = $result['message'];
$_SESSION['form_data'] = $formData; // Save form data for repopulation
redirectTo('exit-interview1.php');
}
} else {
// Set validation errors and redirect back to form
$_SESSION['validation_errors'] = $errors;
$_SESSION['form_data'] = $formData; // Save form data for repopulation
redirectTo('exit-interview1.php');
}
}
// Check for any form data in session (for repopulating the form)
$formData = $_SESSION['form_data'] ?? [];
unset($_SESSION['form_data']); // Clear after retrieving
// Check for error messages
$errorMessage = $_SESSION['error_message'] ?? '';
unset($_SESSION['error_message']);
// Check for validation errors
$validationErrors = $_SESSION['validation_errors'] ?? [];
unset($_SESSION['validation_errors']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Exit Interview Form | VDart</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap">
<!-- Add datepicker CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flatpickr/4.6.13/flatpickr.min.css">
</head>
<style>
:root {
--primary-color: #2563eb;
--primary-light: #dbeafe;
--primary-dark: #1e40af;
--secondary-color: #475569;
--accent-color: #f97316;
--success-color: #10b981;
--warning-color: #f59e0b;
--danger-color: #ef4444;
--text-color: #334155;
--text-light: #64748b;
--text-dark: #1e293b;
--background-color: #f8fafc;
--card-bg: #ffffff;
--sidebar-bg: #f1f5f9;
--border-color: #e2e8f0;
--input-bg: #f1f5f9;
--box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
--box-shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.1);
--transition: all 0.2s ease-in-out;
--radius: 8px;
--radius-sm: 4px;
}
/* Dark Mode Colors */
.dark-theme {
--primary-color: #3b82f6;
--primary-light: #1e3a8a;
--primary-dark: #60a5fa;
--text-color: #e2e8f0;
--text-light: #94a3b8;
--text-dark: #f8fafc;
--background-color: #0f172a;
--card-bg: #1e293b;
--sidebar-bg: #111827;
--border-color: #334155;
--input-bg: #293548;
--box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
--box-shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.25);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
html {
scroll-behavior: smooth;
}
body {
background-color: var(--background-color);
color: var(--text-color);
line-height: 1.5;
font-size: 16px;
min-height: 100vh;
font-weight: 400;
display: flex;
flex-direction: column;
overflow-x: hidden;
}
/* Split Layout Container */
.app-container {
display: flex;
min-height: 100vh;
width: 100%;
}
/* Left Sidebar for Insights */
.insights-sidebar {
width: 320px;
background-color: var(--sidebar-bg);
padding: 2rem 1.5rem;
box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
position: fixed;
height: 100vh;
overflow-y: auto;
z-index: 10;
}
/* Main Content Area */
.main-content {
flex: 1;
margin-left: 320px;
padding: 1.5rem;
max-width: calc(100vw - 320px);
}
.container {
max-width: 1000px;
margin: 0 auto;
padding: 0;
}
/* Header Styling */
.header {
margin-bottom: 2rem;
}
.logo-container {
margin-bottom: 1.5rem;
text-align: center;
}
.company-logo {
font-size: 2rem;
font-weight: 700;
color: var(--primary-color);
letter-spacing: 0.5px;
}
.header h1 {
font-size: 1.8rem;
margin-bottom: 1rem;
font-weight: 700;
color: var(--text-dark);
}
.header p {
font-size: 0.95rem;
margin-bottom: 0.75rem;
color: var(--text-light);
line-height: 1.6;
}
/* Progress Bar */
.progress-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 4px;
background-color: var(--border-color);
z-index: 1000;
}
.progress-bar {
height: 100%;
background: var(--primary-color);
width: 0%;
transition: width 0.3s ease;
}
/* Insights Styling */
.insights-header {
margin-bottom: 1.5rem;
text-align: center;
}
.insights-title {
font-size: 1.5rem;
font-weight: 600;
color: var(--text-dark);
margin-bottom: 0.5rem;
}
.insights-subtitle {
font-size: 0.9rem;
color: var(--text-light);
}
.insights-section {
background: var(--card-bg);
margin-bottom: 1.5rem;
padding: 1.25rem;
border-radius: var(--radius);
box-shadow: var(--box-shadow);
}
.insights-section h3 {
font-size: 1rem;
font-weight: 600;
color: var(--text-dark);
margin-bottom: 0.75rem;
display: flex;
align-items: center;
}
.insights-section h3 i {
margin-right: 0.5rem;
color: var(--primary-color);
}
.insights-list {
list-style-type: none;
}
.insights-list li {
margin-bottom: 0.75rem;
font-size: 0.9rem;
position: relative;
padding-left: 1.5rem;
}
.insights-list li:before {
content: '•';
color: var(--primary-color);
font-weight: bold;
position: absolute;
left: 0;
top: 0;
}
.insights-tips {
background-color: var(--primary-light);
padding: 1rem;
border-radius: var(--radius-sm);
margin-top: 1rem;
}
.insights-tips p {
font-size: 0.9rem;
color: var(--primary-dark);
font-style: italic;
}
/* Form Sections */
.form-section {
background: var(--card-bg);
margin-bottom: 1.5rem;
padding: 1.5rem;
border-radius: var(--radius);
box-shadow: var(--box-shadow);
transition: var(--transition);
border-left: 3px solid var(--primary-color);
}
.form-section:hover {
box-shadow: var(--box-shadow-hover);
}
.form-section.completed {
border-left-color: var(--success-color);
}
/* Section Headers */
.section-header {
display: flex;
align-items: center;
margin-bottom: 1.5rem;
padding-bottom: 0.75rem;
border-bottom: 1px solid var(--border-color);
}
.section-header i {
font-size: 1.25rem;
color: var(--primary-color);
margin-right: 0.75rem;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
background-color: var(--primary-light);
border-radius: 50%;
}
.section-header h2 {
color: var(--text-dark);
font-weight: 600;
font-size: 1.25rem;
margin: 0;
}
.section-subtitle {
color: var(--text-light);
font-style: italic;
margin-left: 0.5rem;
font-size: 0.85rem;
font-weight: 400;
}
/* Question Headers */
.question-header {
display: flex;
align-items: center;
margin-bottom: 1rem;
}
.question-number {
background: var(--primary-color);
color: white;
width: 28px;
height: 28px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
margin-right: 0.75rem;
flex-shrink: 0;
}
.question-header h3 {
color: var(--text-dark);
font-weight: 600;
font-size: 1rem;
margin: 0;
line-height: 1.4;
}
/* Form Grid */
.grid-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 1rem;
width: 100%;
}
.form-group {
margin-bottom: 1.25rem;
position: relative;
transition: var(--transition);
width: 100%;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
color: var(--text-color);
font-size: 0.9rem;
}
.form-group.completed label:after {
content: '✓';
color: var(--success-color);
margin-left: 0.5rem;
}
/* Input Styling */
input[type="text"],
input[type="password"],
textarea,
select {
width: 100%;
padding: 0.75rem 1rem;
border: 1px solid var(--border-color);
border-radius: var(--radius-sm);
font-size: 0.95rem;
background-color: var(--input-bg);
color: var(--text-color);
transition: var(--transition);
font-family: 'Poppins', sans-serif;
}
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
textarea {
resize: vertical;
min-height: 80px;
line-height: 1.6;
}
/* Input with Icon Styling */
.input-with-icon,
.textarea-with-icon {
position: relative;
}
.input-with-icon i,
.textarea-with-icon i {
position: absolute;
left: 1rem;
top: 50%;
transform: translateY(-50%);
color: var(--text-light);
font-size: 1rem;
}
.input-with-icon input,
.textarea-with-icon textarea {
padding-left: 2.5rem;
}
.textarea-with-icon i {
top: 1rem;
transform: none;
}
/* Custom Select Styling */
.custom-select {
position: relative;
width: 100%;
}
.custom-select select {
width: 100%;
padding-left: 2.5rem;
appearance: none;
cursor: pointer;
font-family: 'Poppins', sans-serif;
}
.custom-select .select-icon {
position: absolute;
left: 1rem;
top: 50%;
transform: translateY(-50%);
color: var(--text-light);
font-size: 1rem;
z-index: 1;
pointer-events: none;
}
.custom-select .select-arrow {
position: absolute;
right: 1rem;
top: 50%;
width: 8px;
height: 8px;
border-right: 2px solid var(--text-light);
border-bottom: 2px solid var(--text-light);
transform: translateY(-70%) rotate(45deg);
pointer-events: none;
}
/* Radio and Checkbox Styling */
.radio-group,
.checkbox-grid {
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
margin-bottom: 1.25rem;
}
.radio-option,
.checkbox-option {
display: flex;
align-items: center;
position: relative;
}
.radio-option input,
.checkbox-option input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.radio-option label,
.checkbox-option label {
position: relative;
padding-left: 2rem;
cursor: pointer;
line-height: 24px;
font-weight: normal;
display: inline-block;
color: var(--text-color);
user-select: none;
font-size: 0.95rem;
font-family: 'Poppins', sans-serif;
}
.radio-option label:before,
.checkbox-option label:before {
content: '';
position: absolute;
left: 0;
top: 2px;