csrtechnew.ohctech.in/add_placement_pool.php
2025-10-16 15:19:10 +05:30

257 lines
13 KiB
PHP

<style>
/* Enhanced modal styling */
.modal-content {
border-radius: 8px;
overflow: hidden;
width: 800px; /* Optional: Set a width for the modal */
}
.modal-header {
border-bottom: 1px solid #ddd;
padding: 16px;
}
.modal-body {
padding: 24px;
}
.form-group {
margin-bottom: 1.5rem;
}
.btn-info,
.btn-danger {
border-radius: 4px;
}
.form-control {
border-radius: 4px;
}
.widget-title {
font-size: 1.25rem;
font-weight: bold;
}
</style>
<div class="modal fade" id="modal-add-placement_pool" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalLabel">Placement Pool Form</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form id="placement_pool_form" name="placement_pool_form" action="#" method="post">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-sm-4">
<input type="text" id="id" name="id" hidden>
<label for="partner_name">Employer Name <span style="color: red;">*</span></label>
<select class="form-control select2" id="partner_name" name="partner_name" required>
<option value="" selected>Please Select Placement Employer Name</option>
<?php
$sql = "SELECT p.partner_id, cm.client_name, p.partner_location FROM partners p INNER JOIN client_master cm ON p.partner_name = cm.id";
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_assoc($result)) {
echo "<option value='" . htmlspecialchars($row['partner_id']) . "'>" . htmlspecialchars($row['client_name']) . " (" . htmlspecialchars($row['partner_location']) . ")</option>";
}
?>
</select>
</div>
<div class="form-group col-sm-4">
<label for="md_name">Owner/MD Name</label>
<input class="form-control" type="text" id="md_name" name="md_name" placeholder="Owner/MD Name">
</div>
<div class="form-group col-sm-4">
<label for="hr_name">HR/Representative Name</label>
<input class="form-control" type="text" id="hr_name" name="hr_name" placeholder="HR/Representative Name">
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-4">
<label for="w_number">WhatsApp Number</label>
<input class="form-control" type="text" id="w_number" name="w_number" placeholder="WhatsApp Number">
</div>
<div class="form-group col-sm-4">
<label for="salary_offering">Salary Offering <span style="color: red;">*</span></label>
<input type="number" id="salary_offering" name="salary_offering" placeholder="Enter Offering Salary" class="form-control" required>
</div>
<div class="form-group col-sm-4">
<label for="food">Food <span style="color: red;">*</span></label>
<select name="food" id="food" class="form-control" required>
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-4">
<label for="accomodation">Accommodation</label>
<select name="accomodation" id="accomodation" class="form-control">
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
<div class="form-group col-sm-4">
<label for="standard_salary">Salary Accordance To The Standard <span style="color: red;">*</span></label>
<select name="standard_salary" id="standard_salary" class="form-control" required>
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
<div class="form-group col-sm-4">
<label for="PF">PF/MC and Other Benefits <span style="color: red;">*</span></label>
<select name="PF" id="PF" class="form-control" required>
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-4">
<label for="proof">Placement Proof</label>
<select name="proof" id="proof" class="form-control">
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
<div class="form-group col-sm-4">
<label for="visits">No. of Visits of Employer</label>
<select name="visits" id="visits" class="form-control">
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
<div class="form-group col-sm-4">
<label for="mou">MOU</label>
<select name="mou" id="mou" class="form-control">
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-4">
<label for="o_facilities">Other Facilities</label>
<select name="o_facilities" id="o_facilities" class="form-control">
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
<div class="form-group col-sm-4">
<label for="brand">Brand</label>
<select name="brand" id="brand" class="form-control">
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
<div class="form-group col-sm-4">
<label for="culture">Trainees Feedback/Work Culture</label>
<select name="culture" id="culture" class="form-control">
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-4">
<label for="retention">Retention</label>
<select name="retention" id="retention" class="form-control">
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
<div class="form-group col-sm-4">
<label for="support">Infrastructure Support</label>
<select name="support" id="support" class="form-control">
<option value="" disabled selected>Please Select Option</option>
<option value="1" selected>Yes</option>
<option value="0">No</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-4">
<label for="position">Job Position Offering</label>
<input type="text" class="form-control" name="position" id="position" maxlength="100" placeholder="Enter Job Position Offering" required>
</div>
<div class="form-group col-sm-12">
<label for="remarks">Remarks</label>
<input type="text" class="form-control" name="remarks" id="remarks" maxlength="100" placeholder="Enter Remarks" required>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-info save_button" onclick="validate();">Save</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</form>
</div>
</div>
</div>
<script>
function validate() {
var isValid = true;
var errorMessages = [];
// Check required fields and collect error messages
if ($('#partner_name').val() === '' || $('#partner_name').val() === null) {
errorMessages.push('Please select Placement Employer Name.');
isValid = false;
}
// if ($('#md_name').val() === '' || $('#md_name').val() === null) {
// errorMessages.push('Please Enter MD Name.');
// isValid = false;
// }
// if ($('#hr_name').val() === '' || $('#hr_name').val() === null) {
// errorMessages.push('Please Enter HR Name.');
// isValid = false;
// }
if ($('#salary_offering').val() === '' || $('#salary_offering').val() <= 0) {
errorMessages.push('Salary Offering is required and must be a positive number.');
isValid = false;
}
if ($('#food').val() === '' || $('#food').val() === null) {
errorMessages.push('Food option is required.');
isValid = false;
}
if ($('#standard_salary').val() === '' || $('#standard_salary').val() === null) {
errorMessages.push('Salary Accordance To The Standard option is required.');
isValid = false;
}
// if ($('#PF').val() === '' || $('#PF').val() === null) {
// errorMessages.push('PF/MC and Other Benefits option is required.');
// isValid = false;
// }
// if ($('#position').val() === '') {
// errorMessages.push('Job Position Offering is required.');
// isValid = false;
// }
// Display all error messages if any
if (!isValid) {
BootstrapDialog.alert({
title: 'Validation Notification',
message: errorMessages.join('<br>'),
type: BootstrapDialog.TYPE_DANGER
});
} else {
save_placement_pool(); // Proceed if all fields are valid
}
}
</script>