<?php
ob_start();
session_start();
?>
<?php
if(isset($_SESSION['user_liwwan_admin_2023930']) AND ($_SESSION['type'] == "manager_session_alliwan") ){
$pageTitle = 'Add workshop';
include 'init.php';
?>
<?php
if (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['add_workshop'])) {
$wsh_cusname = filter_var($_POST['wsh_cusname'], FILTER_SANITIZE_STRING);
$wsh_cusphone = filter_var($_POST['wsh_cusphone'], FILTER_SANITIZE_STRING);
$wsh_type = filter_var($_POST['wsh_type'], FILTER_SANITIZE_STRING);
$wsh_place = filter_var($_POST['wsh_place'], FILTER_SANITIZE_STRING);
$wsh_desc = filter_var($_POST['wsh_desc'], FILTER_SANITIZE_STRING);
$formErrors = array();
if (empty($wsh_cusname)){
$formErrors[] = ' project tittle Cant Be <strong>Empty</strong> ';
}
//loop into errors array and echo it
foreach($formErrors as $error){
echo '<div class= "alert alert-danger text-center">' . $error . '</div>' ;
}
if (empty($formErrors)){
$wsh_code =rand(0000000,1000000);
$stmt = $conn->prepare("INSERT INTO
workshops(wsh_customer_name, wsh_customer_phone, wsh_type, wsh_place, wsh_desc, wsh_cus_code, adddate)
VALUES (:zname, :zphon, :ztype, :zplac, :zdesc, :zcode, now() ) ");
$stmt->execute(array(
'zname' => $wsh_cusname,
'zphon' => $wsh_cusphone,
'ztype' => $wsh_type,
'zplac' => $wsh_place,
'zdesc' => $wsh_desc,
'zcode' => $wsh_code
));
header('location:workshops.php');
exit();
} else{
$msg=urlencode("البيانات المدخلة تحتوي على مشكلة" . "، أعد المحاولة");
header('location:add_customer_template.php?Message='. $msg);
exit();
}
}
?>
<section class="add_my">
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST" class="form mt-5">
<p class="text-center h3 fw-bold text-center m-auto add_my_p"> إضافة ورشة عمل </p>
<div class="row">
<div class="input-group">
<div class="col-lg-6 col-sm-12">
<div class="tex-area mt-2">
<div class="mb-3">
<label for="wsh_cusname" class="text-muted fw-bold text-center"><span class="text-danger fs-5">◈</span> إسم العميل </label>
<input type="text" class="w-100 text-muted fw-bold py-2" name="wsh_cusname" required="required" id="wsh_cusname"/>
</div>
</div>
</div>
<div class="col-lg-6 col-sm-12">
<div class="tex-area mt-2">
<div class="mb-3">
<label for="wsh_cusphone" class="text-muted fw-bold text-center"> رقم هاتف العميل </label>
<input type="text" class="w-100 text-muted fw-bold py-2" name="wsh_cusphone" id="wsh_cusphone"/>
</div>
</div>
</div>
<div class="col-lg-6 col-sm-12">
<div class="tex-area mt-2">
<div class="mb-3">
<label for="wsh_type" class="text-muted fw-bold text-center"> نوع الورشة </label>
<input type="text" class="w-100 text-muted fw-bold py-2" name="wsh_type" id="wsh_type"/>
</div>
</div>
</div>
<div class="col-lg-6 col-sm-12">
<div class="tex-area mt-2">
<div class="mb-3">
<label for="wsh_place" class="text-muted fw-bold text-center"> مكان الورشة </label>
<input type="text" class="w-100 text-muted fw-bold py-2" name="wsh_place" id="wsh_place"/>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-sm-12">
<div class="tex-area mt-2">
<div class="mb-3">
<label for="wsh_desc" class="form-label mt-2 text-muted fw-bold text-center" > شرح </label>
<textarea class="form-control text-muted fw-bold" id="wsh_desc" rows="4" name="wsh_desc"></textarea>
</div>
</div>
</div>
<hr>
<div class="col-8"></div>
<div class="col-4">
<button class="btn btn-primary px-4" name="add_workshop" type="submit"> تأكيد </button>
</div>
</div>
</form>
</section>
<?php
ob_end_flush();
include 'assets/includes/template/footer.php';
?>
<?php
}else{
header('Location:index.php');
exit;
}
?>| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| assets | Folder | 0755 |
|
|
| images | Folder | 0755 |
|
|
| ac_citycalc.php | File | 15.27 KB | 0644 |
|
| ac_edit_admin.php | File | 2.67 KB | 0644 |
|
| ac_edit_admininfo.php | File | 4.36 KB | 0644 |
|
| ac_edit_imgs.php | File | 34.27 KB | 0644 |
|
| ac_edit_pr.php | File | 10.72 KB | 0644 |
|
| ac_projects.php | File | 5.24 KB | 0644 |
|
| ac_workshops.php | File | 18.62 KB | 0644 |
|
| add_admin.php | File | 4.32 KB | 0644 |
|
| add_customer_template.php | File | 11.1 KB | 0644 |
|
| add_project.php | File | 17.22 KB | 0644 |
|
| add_workshop.php | File | 5.15 KB | 0644 |
|
| admins.php | File | 4.81 KB | 0644 |
|
| citycalc.php | File | 5.01 KB | 0644 |
|
| cons_orders.php | File | 4.51 KB | 0644 |
|
| custommer_templates.php | File | 4.59 KB | 0644 |
|
| dashboard.php | File | 4.11 KB | 0644 |
|
| edit_cus_template.php | File | 11.74 KB | 0644 |
|
| editadminpassword.php | File | 5.17 KB | 0644 |
|
| error_log | File | 309.84 KB | 0644 |
|
| imgs.php | File | 18.17 KB | 0644 |
|
| index.php | File | 3.19 KB | 0644 |
|
| init.php | File | 183 B | 0644 |
|
| logout.php | File | 186 B | 0644 |
|
| newsletter.php | File | 3.13 KB | 0644 |
|
| projects.php | File | 13.89 KB | 0644 |
|
| projects_card.php | File | 13.29 KB | 0644 |
|
| show.php | File | 8.81 KB | 0644 |
|
| workshop_details.php | File | 12.08 KB | 0644 |
|
| workshops.php | File | 4.63 KB | 0644 |
|