39 lines
1.2 KiB
PHP
Executable File
39 lines
1.2 KiB
PHP
Executable File
<?php
|
|
require_once('../../../fixed/config/go_con.php');
|
|
|
|
$tretment_id = mysqli_real_escape_string($db, $_POST['tretment_id']);
|
|
|
|
$note = mysqli_real_escape_string($db, $_POST['note']);
|
|
$price = mysqli_real_escape_string($db, $_POST['price']);
|
|
|
|
$contnute = true;
|
|
|
|
|
|
|
|
if ($contnute) {
|
|
|
|
$query = "SELECT * FROM `walla_answers` WHERE `tretment_id`= $tretment_id";
|
|
$sql = mysqli_query($db, $query);
|
|
if (mysqli_num_rows($sql) > 0) {
|
|
|
|
mysqli_query(
|
|
$db,
|
|
"INSERT INTO `walla_points`(`points`, `notes`, `tretment_id`, `walla_reasons_id`, `date_time`, `user_id`, `activation_id`)
|
|
VALUES ('$price','$note','$tretment_id','10','$date_time','$admin_id','2')"
|
|
);
|
|
|
|
echo"
|
|
<script>
|
|
swalfun('تم الاضافة بنجاح','','success');
|
|
location.reload(1);
|
|
</script>
|
|
";
|
|
} else {
|
|
echo"
|
|
<script>
|
|
swalfun('حدث خطأ','العميل غير مسجل في ولاء','error');
|
|
</script>
|
|
";
|
|
}
|
|
}
|
|
|