171 lines
7.2 KiB
PHP
171 lines
7.2 KiB
PHP
<script>
|
|
function validate() {
|
|
|
|
// Get form values
|
|
var date = $('#date_of_screening').val().trim();
|
|
var name = $('#patient_name').val();
|
|
var mobile_no = $('#mobile_no').val();
|
|
|
|
// Check if village name is empty
|
|
if (!date) {
|
|
BootstrapDialog.alert('Please select Date.');
|
|
return;
|
|
}
|
|
if (name === '') {
|
|
BootstrapDialog.alert('Please Enter Patient Name.');
|
|
return;
|
|
}
|
|
if (name === '') {
|
|
BootstrapDialog.alert('Please Enter Mobile Number.');
|
|
return;
|
|
}
|
|
|
|
|
|
save_section();
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
<style>
|
|
#modal-add-village {
|
|
overflow-y: scroll;
|
|
}
|
|
|
|
#modal-add-village .modal-dialog {
|
|
max-width: 65%;
|
|
width: 65%;
|
|
}
|
|
</style>
|
|
<div class="modal fade" id="modal-add-village" role="dialog" aria-hidden="true">
|
|
<form id="flex_form_village" name="flex_form_village" action="#" method="post">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="widget-header">
|
|
<h5 class="widget-title">Add Cancers Screening</h5>
|
|
<div class="widget-toolbar">
|
|
<div class="widget-menu">
|
|
<a href="#" class="close" data-action="close" data-dismiss="modal">
|
|
<i class="ace-icon fa fa-times"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label for="date_of_screening">Date of Screening <span style="color: red;">*</span></label>
|
|
<input type="date" class="form-control" name="date_of_screening" id="date_of_screening" />
|
|
<input type="hidden" name="village_id" id="village_id">
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label for="patient_name">Patient Name <span style="color: red;">*</span></label>
|
|
<input type="text" class="form-control" name="patient_name" id="patient_name" placeholder="Enter Name" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label for="date_of_screening">History Book No <span style="color: red;">*</span></label>
|
|
<input type="number" class="form-control" name="history_book_no" id="history_book_no" />
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label for="dob">Age </label>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<input type="number" class="form-control" name="dob" id="dob" />
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label for="mobile_no">Number <span style="color: red;">*</span></label>
|
|
<input type="number" class="form-control" name="mobile_no" id="mobile_no" placeholder="Enter Number" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label for="test_result">Findings</label>
|
|
<select class="select2 form-control" name="findings" id="findings" required>
|
|
<option value="" selected disabled>Select Findings</option>
|
|
<option value="Yes">Yes</option>
|
|
<option value="No">No</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<?php
|
|
// Assuming $conn is your database connection
|
|
$ohc_type_ids = $_SESSION['current_ohcttype'];
|
|
|
|
$village_query = "SELECT id, village, tehsil FROM village WHERE find_in_set($ohc_type_ids,ohc_type_id)";
|
|
|
|
$result = mysqli_query($conn, $village_query);
|
|
$options = '';
|
|
while ($vill = mysqli_fetch_assoc($result)) {
|
|
$tehsil = getFieldFromTable('name', 'tehsils', 'id', $vill['tehsil']);
|
|
$options .= '<option value="' . $vill['id'] . '">' . $vill['village'] . ' / ' . $tehsil . '</option>';
|
|
}
|
|
?>
|
|
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label for="village">Village</label>
|
|
<select class="form-control select2" id="village" name="village">
|
|
<option value="">Please Select Option</option>
|
|
<?php echo $options; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label for="body_part">Name of Technician</label>
|
|
<input type="text" name="name_of_technician" id="name_of_technician" class="form-control">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label for="village">Remarks</label>
|
|
<input type="text" name="remark" id="remark" class="form-control">
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="widget-toolbox padding-8 clearfix">
|
|
<button type="button" class="btn btn-info btn-sm save_button" onclick="validate();">
|
|
<i class="ace-icon fa fa-floppy-o bigger-110"></i> Save
|
|
</button>
|
|
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">
|
|
<i class="ace-icon fa fa-times bigger-110"></i> Cancel
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|