203 lines
8.0 KiB
PHP
203 lines
8.0 KiB
PHP
<div class="modal fade" id="modal-add-user" role="dialog" aria-hidden="true">
|
|
<form role="form" id="user_form" name="user_form" action="#" method="post">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="widget-header">
|
|
<h5 class="widget-title">User</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="form-group">
|
|
<label for="user_name">User Name</label>
|
|
<input type="hidden" class="form-control" name="user_id" id="user_id" value="" required />
|
|
<input type="text" class="form-control" name="user_name" id="user_name" maxlength="100"
|
|
placeholder="Enter Username" required />
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
<div class="form-group col-sm-6">
|
|
<label for="user_password">Password</label>
|
|
<input type="password" class="form-control" name="user_password" id="user_password"
|
|
maxlength="100" placeholder="Enter Password" required />
|
|
</div>
|
|
<div class="form-group col-sm-6">
|
|
<label for="confirm_password">Confirm Password</label>
|
|
<input type="password" class="form-control" name="confirm_password" id="confirm_password"
|
|
maxlength="100" placeholder="Confirm Password" required />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="form-group col-sm-6">
|
|
<label for="user_email">Email</label>
|
|
<input type="email" class="form-control" name="user_email" id="user_email" maxlength="100"
|
|
placeholder="Enter Email" required />
|
|
<input type="hidden" name="ohc_type[]" id="ohc_type">
|
|
<input type="hidden" name="user_role[]" id="user_role">
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group col-sm-6">
|
|
<label for="user_role">Patient</label>
|
|
<select class="chosen-select form-control" name="emp_id" id="emp_id">
|
|
<option value="" disabled>Please select employee</option>
|
|
<?php
|
|
$sql_emp_1 = "SELECT id,patient_name, emp_code FROM patient_master order by patient_name";
|
|
?>
|
|
<?php echo getEmployeeOptions() ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<!-- <div class="form-group col-sm-6">
|
|
<label for="vendor_id">Vendor</label>
|
|
<select class="chosen-select form-control" name="vendor_id" id="vendor_id">
|
|
<?php echo generateOption('employer_contractor','employer_contractor_name','id','','') ?>
|
|
</select>
|
|
</div> -->
|
|
<div class="form-group col-sm-6">
|
|
<label for="user_email">Status</label>
|
|
<select class="chosen-select form-control" name="status" id="status">
|
|
<option value="" disabled>select</option>
|
|
<option value="0">Inactive</option>
|
|
<option selected value="1">Active</option>
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="form-group col-sm-6">
|
|
<label for="user_role">User Role</label><br>
|
|
|
|
<?php
|
|
$ohc_query = " select role_id, role_name from role_master";
|
|
if (!$result = @mysqli_query($conn, $ohc_query)) {
|
|
exit(mysqli_error($conn));
|
|
}
|
|
if (mysqli_num_rows($result) > 0) {
|
|
while ($row = mysqli_fetch_assoc($result)) {
|
|
?>
|
|
<input type="checkbox" class="ohc_type" value="<?php echo $row['role_id'] ?>"
|
|
name="user_role_check" id="user_role_<?php echo $row['role_id'] ?>">
|
|
<label><?php echo $row['role_name'] ?></label><br />
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
|
|
</div>
|
|
|
|
<div class="form-group col-sm-6">
|
|
<label for="ohc_type">OHC Type</label> <br>
|
|
|
|
<?php
|
|
$ohc_query = "select ohc_type_id, ohc_type_name from ohc_type where ohc_category = 'OHC'";
|
|
if (!$result = @mysqli_query($conn, $ohc_query)) {
|
|
exit(mysqli_error($conn));
|
|
}
|
|
if (mysqli_num_rows($result) > 0) {
|
|
while ($row = mysqli_fetch_assoc($result)) {
|
|
?>
|
|
<input type="checkbox" class="ohc_type" value="<?php echo $row['ohc_type_id'] ?>"
|
|
name="ohc_type_check" id="ohc_type_<?php echo $row['ohc_type_id'] ?>">
|
|
<label><?php echo $row['ohc_type_name'] ?></label><br />
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<div class=" widget-toolbox padding-8 clearfix text-right">
|
|
<button type="button" class="btn btn-info btn-sm save_button" style="border-radius: 8px;"
|
|
onclick="validate();"><i class="ace-icon fa fa-floppy-o bigger-110"></i>Save </button>
|
|
<button type="button" class="btn btn-danger btn-sm" style="border-radius: 8px;"
|
|
data-dismiss="modal"><i class="ace-icon fa fa-times bigger-110"></i>Cancel</button>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
function validate() {
|
|
var user_name = $('#user_name').val();
|
|
if (user_name == '') {
|
|
BootstrapDialog.alert('Please Enter Username.!!!');
|
|
return false;
|
|
}
|
|
|
|
var user_password = $('#user_password').val();
|
|
var regularExpression = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,20}$/;
|
|
if (regularExpression.test(user_password) == false) {
|
|
BootstrapDialog.alert(
|
|
'Password must a capital letter, small letter, special character, a number and length should be greater than 8 and less than 20!!!'
|
|
);
|
|
return false;
|
|
}
|
|
// if(user_password == '' || user_password.length >20 || user_password.length < 8){
|
|
// BootstrapDialog.alert('Please Enter Valid Password.!!!');
|
|
// return false;
|
|
// }
|
|
// // if(!regularExpression.test(user_password)) {
|
|
|
|
// // return false;
|
|
// // }
|
|
|
|
var confirm_password = $('#confirm_password').val();
|
|
if (confirm_password == '') {
|
|
BootstrapDialog.alert('Please Enter Confirmed Password.!!!');
|
|
return false;
|
|
} else if (user_password == confirm_password) {
|
|
|
|
|
|
/*var user_email = $('#user_email').val();
|
|
if(user_email == ''){
|
|
BootstrapDialog.alert('Please Enter Email.!!!');
|
|
return false;
|
|
}
|
|
save_user();
|
|
return false;
|
|
}
|
|
else{
|
|
BootstrapDialog.alert('Password did not match!!');
|
|
return false;*/
|
|
}
|
|
save_user();
|
|
}
|
|
</script>
|
|
<style>
|
|
#modal-add-role {
|
|
overflow-y: scroll;
|
|
}
|
|
</style>
|