217 lines
9.2 KiB
PHP
Executable File
217 lines
9.2 KiB
PHP
Executable File
<?php
|
|
require_once('fixed/config/go_con.php');
|
|
access(19);
|
|
|
|
$number = $_GET['number'];
|
|
$emp_id = $_GET['emp_id'];
|
|
$branch_id = $_GET['branch'];
|
|
$booking_day_date = $_GET['date'];
|
|
$booking_day_time = $_GET['time'];
|
|
|
|
$location = 'index.php';
|
|
if (!empty($number)) {
|
|
if (!empty($booking_day_date)) {
|
|
if (!empty($booking_day_time)) {
|
|
if (!empty($emp_id)) {
|
|
if (!empty($branch_id)) {
|
|
if ($commercial_register_id == 5) {
|
|
$location = 'booking_physical_therapy?emp_id='.$emp_id.'&date='.$booking_day_date.'&time='.$booking_day_time.'&branch='.$branch_id.'&number='.$number;
|
|
} else {
|
|
$location = 'booking?emp_id='.$emp_id.'&date='.$booking_day_date.'&time='.$booking_day_time.'&branch='.$branch_id.'&number='.$number;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en" dir="rtl">
|
|
<?php require_once('fixed/head/go.php'); ?>
|
|
<body class="rtl">
|
|
<?php require_once('fixed/loader/go.php'); ?>
|
|
<!-- page-wrapper Start-->
|
|
<div class="page-wrapper" id="pageWrapper">
|
|
<?php require_once('fixed/header/go.php'); ?>
|
|
<!-- Page Body Start-->
|
|
<div class="page-body-wrapper">
|
|
<?php require_once('fixed/sidebar/go.php'); ?>
|
|
<div class="page-body">
|
|
<div class="container-fluid">
|
|
<div class="page-header">
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<h3>اضافة عميل</h3>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Container-fluid starts-->
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-body new-user order-list">
|
|
<form action="" method="post" enctype="multipart/form-data">
|
|
<div id="get_tretment"></div>
|
|
<h4 class="mt-0 header-title">معلومات العميل</h4>
|
|
<div class="form-group row">
|
|
<div class="col-lg-4 col-sm-6">
|
|
<label for="" class="col-form-label text-right">الاسم الكامل</label>
|
|
<input id="tretment_name" class="form-control clickfun" type="text" required>
|
|
</div>
|
|
<div class="col-lg-4 col-sm-6">
|
|
<label for="" class="col-form-label text-right">رقم الجوال</label>
|
|
<input id="tretment_number" class="form-control clickfun" type="number" value="<?=$number?>" required>
|
|
</div>
|
|
<div class="col-lg-4 col-sm-6">
|
|
<label for="" class="col-form-label text-right">العمر</label>
|
|
<input id="tretment_age" class="form-control clickfun" type="number">
|
|
</div>
|
|
<div class="col-lg-6 col-sm-6">
|
|
<label for="tretment_offer" class="col-form-label text-right">العروض</label>
|
|
<select id="tretment_offer" class="form-control">
|
|
<?php
|
|
$get_an_employee_offer_sql = mysqli_query($db, "SELECT `id`,`name`,`upload_image_id` FROM `an_employee_offer` WHERE `activation_id` = 2");
|
|
while ($get_an_employee_offer = mysqli_fetch_assoc($get_an_employee_offer_sql)) {
|
|
?>
|
|
<option value="<?=$get_an_employee_offer['id']?>" data-upload="<?=$get_an_employee_offer['upload_image_id']?>" ><?=$get_an_employee_offer['name']?></option>
|
|
<?php
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
<div class="col-lg-6 col-sm-6">
|
|
<label for="tretment_how_hear" class="col-form-label text-right">كيف سمعت عنا ؟</label>
|
|
<select id="tretment_how_hear" class="form-control" >
|
|
<?php
|
|
$get_how_to_hear_sql = mysqli_query($db, "SELECT `id`,`name`FROM `how_to_hear` WHERE `activation_id` = 2");
|
|
while ($get_how_to_hear = mysqli_fetch_assoc($get_how_to_hear_sql)) {
|
|
?>
|
|
<option value="<?=$get_how_to_hear['id']?>"><?=$get_how_to_hear['name']?></option>
|
|
<?php
|
|
}
|
|
?>
|
|
<!-- <option value="frind">صديق</option> -->
|
|
<option value="else">اخرى</option>
|
|
</select>
|
|
</div>
|
|
<div id="showUploadImage" class="col-lg-6 col-sm-6" style="display:none;">
|
|
<label for="" class="col-form-label text-right">ارفاق صوره</label>
|
|
<input name="" class="form-control clickfun" type="file">
|
|
</div>
|
|
<div id="frind" class="col-lg-6 col-sm-6" style="display:none;">
|
|
<label for="" class="col-form-label text-right">رقم الصديق</label>
|
|
<input name="" class="form-control clickfun" type="number">
|
|
</div>
|
|
<div id="else" class="col-lg-6 col-sm-6" style="display:none;">
|
|
<label for="" class="col-form-label text-right">يرجى ذكرها</label>
|
|
<input name="" class="form-control clickfun" type="text">
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="form-group row">
|
|
<div class="col-lg-12">
|
|
<div id="add_tretment" style="background-color: #086367; color:white; text-align:center; cursor: pointer;" class="form-control">إضافة</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Container-fluid Ends-->
|
|
</div>
|
|
<?php require_once('fixed/footer/go.php'); ?>
|
|
</div>
|
|
</div>
|
|
<?php require_once('fixed/js/go.php'); ?>
|
|
<script>
|
|
$(function() {
|
|
$("#tretment_offer").change(function() {
|
|
let showUploadImage = $("#tretment_offer").find(":selected").data('upload');
|
|
if (showUploadImage == 2) {
|
|
$("#showUploadImage").show()
|
|
} else {
|
|
$("#showUploadImage").hide()
|
|
}
|
|
});
|
|
});
|
|
|
|
$(function() {
|
|
$("#tretment_how_hear").change(function() {
|
|
let value = $(this).val();
|
|
console.log(value);
|
|
if (value == 'frind' || value == 'else') {
|
|
if (value == 'frind') {
|
|
$("#frind").show()
|
|
$("#else").hide()
|
|
}
|
|
if (value == 'else') {
|
|
$("#else").show()
|
|
$("#frind").hide()
|
|
}
|
|
} else {
|
|
$("#frind").hide()
|
|
$("#else").hide()
|
|
}
|
|
});
|
|
});
|
|
click = 0;
|
|
$(function() {
|
|
$("#add_tretment").click(function() {
|
|
add_tretment();
|
|
});
|
|
});
|
|
$('.clickfun').keypress(function (e) {
|
|
var key = e.which;
|
|
if(key == 13) {
|
|
add_tretment();
|
|
}
|
|
});
|
|
function add_tretment() {
|
|
let tretment_name = $("#tretment_name").val();
|
|
if (tretment_name == '') {
|
|
swalfun('حدث خطأ', 'يرجى ادخال اسم العميل', 'error');
|
|
}
|
|
let tretment_number = $("#tretment_number").val();
|
|
if (tretment_number.length !== 9) {
|
|
swalfun('حدث خطأ', 'رقم الجوال يجب أن يتكون من 9 أرقام وبدون 0 في البداية', 'error');
|
|
return false;
|
|
}
|
|
let tretment_age = $("#tretment_age").val();
|
|
if (tretment_age == '' || tretment_age == 0) {
|
|
swalfun('حدث خطأ', 'يرجى ادخال عمر العميل', 'error');
|
|
return false;
|
|
}
|
|
let tretment_offer = $("#tretment_offer").val();
|
|
let tretment_how_hear = $("#tretment_how_hear").val();
|
|
if (tretment_how_hear == 1) {
|
|
swalfun('حدث خطأ', 'يرجى ادخال كيف سمع عنا', 'error');
|
|
return false;
|
|
}
|
|
let location = <?=json_encode($location);?>; // where go after add
|
|
if (click == 0) {
|
|
click++
|
|
$.post("work/order/ajax/add_tretment_ajax.php", {
|
|
tretment_name,
|
|
tretment_number,
|
|
tretment_age,
|
|
tretment_offer,
|
|
tretment_how_hear,
|
|
location
|
|
}, function(get_tretment) {
|
|
$("#get_tretment").html(get_tretment);
|
|
})
|
|
} else {
|
|
swalfun("يرجى الانتظار", "", "warning");
|
|
}
|
|
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|