<?php
ob_start();
session_start();
?>
<?php
if(isset($_SESSION['user_liwwan_admin_2023930']) AND ($_SESSION['type'] == "manager_session_alliwan") ){
$pageTitle = 'workshop details';
include 'init.php';
?>
<?php
if (isset($_GET['wsh'])) {
$cuscod = $_GET['wsh'];
$lets = "wsh_cus_code = ".$cuscod." ";
}else {
$wshidis = $_POST['wsh_id'];
$lets = "wshid = ".$wshidis." ";
}
$sql = "SELECT * FROM workshops WHERE $lets LIMIT 1";
$result = $conn->query($sql);
while($row = $result->fetch()) {
$id= $row['wshid'];
?>
<section class="con-benfs">
<div class="container">
<div class="row ">
<div class="col-lg-4 col-sm-4"><hr class=""></div>
<div class="col-lg-4 col-sm-4"><p class="fw-bold fs-3 text-center"> workshop : <span class="fw-bold text-info fs-3 shadow-sm rounded p-2 section-title text-center"><?php echo $row['wsh_cus_code'] ?></span></p></div>
<div class="col-lg-4 col-sm-4"><hr class=""></div>
<div class="col-12 mt-3"><p class="fw-bold fs-5 section-title text-center"> <?php echo $row['wsh_customer_name'] ?> </p></div>
<div class="col-12"><p class="fw-bold fs-6 text-center"> <?php echo $row['wsh_desc'] ?> </p></div>
</div>
<hr>
<div class="row wsh_det">
<div class="col-lg-3 col-md-6">
<span class="text-center text-muted fw-bold">
<?php echo $row['wsh_place'];?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#B78D65"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M51.7 295.1l31.7 6.3c7.9 1.6 16-.9 21.7-6.6l15.4-15.4c11.6-11.6 31.1-8.4 38.4 6.2l9.3 18.5c4.8 9.6 14.6 15.7 25.4 15.7c15.2 0 26.1-14.6 21.7-29.2l-6-19.9c-4.6-15.4 6.9-30.9 23-30.9h2.3c13.4 0 25.9-6.7 33.3-17.8l10.7-16.1c5.6-8.5 5.3-19.6-.8-27.7l-16.1-21.5c-10.3-13.7-3.3-33.5 13.4-37.7l17-4.3c7.5-1.9 13.6-7.2 16.5-14.4l16.4-40.9C303.4 52.1 280.2 48 256 48C141.1 48 48 141.1 48 256c0 13.4 1.3 26.5 3.7 39.1zm407.7 4.6c-3-.3-6-.1-9 .8l-15.8 4.4c-6.7 1.9-13.8-.9-17.5-6.7l-2-3.1c-6-9.4-16.4-15.1-27.6-15.1s-21.6 5.7-27.6 15.1l-6.1 9.5c-1.4 2.2-3.4 4.1-5.7 5.3L312 330.1c-18.1 10.1-25.5 32.4-17 51.3l5.5 12.4c8.6 19.2 30.7 28.5 50.5 21.1l2.6-1c10-3.7 21.3-2.2 29.9 4.1l1.5 1.1c37.2-29.5 64.1-71.4 74.4-119.5zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm144.5 92.1c-2.1 8.6 3.1 17.3 11.6 19.4l32 8c8.6 2.1 17.3-3.1 19.4-11.6s-3.1-17.3-11.6-19.4l-32-8c-8.6-2.1-17.3 3.1-19.4 11.6zm92-20c-2.1 8.6 3.1 17.3 11.6 19.4s17.3-3.1 19.4-11.6l8-32c2.1-8.6-3.1-17.3-11.6-19.4s-17.3 3.1-19.4 11.6l-8 32zM343.2 113.7c-7.9-4-17.5-.7-21.5 7.2l-16 32c-4 7.9-.7 17.5 7.2 21.5s17.5 .7 21.5-7.2l16-32c4-7.9 .7-17.5-7.2-21.5z"/></svg>
</span>
</div>
<div class="col-lg-3 col-md-6">
<span class="text-center text-muted fw-bold">
<?php echo $row['wsh_type'] ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#B78D65"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160v96H192 320 512V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM512 288H320v32c0 17.7-14.3 32-32 32H224c-17.7 0-32-14.3-32-32V288H0V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V288z"/></svg>
</span>
</div>
<div class="col-lg-3 col-md-6">
<span class="text-center text-muted fw-bold">
<?php echo $row['adddate'] ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="#B78D65"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M128 0c17.7 0 32 14.3 32 32V64H288V32c0-17.7 14.3-32 32-32s32 14.3 32 32V64h48c26.5 0 48 21.5 48 48v48H0V112C0 85.5 21.5 64 48 64H96V32c0-17.7 14.3-32 32-32zM0 192H448V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V192zm64 80v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zm128 0v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H336zM64 400v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H208zm112 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H336c-8.8 0-16 7.2-16 16z"/></svg>
</span>
</div>
<div class="col-lg-3 col-md-6s">
<span class="text-center text-muted fw-bold">
<?php echo $row['wsh_type'] ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="#B78D65"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg> </span>
</div>
</div>
<hr>
</div>
</section>
<?php
$stmt1 = $conn->prepare("SELECT * FROM workshopsaccounting WHERE acc_wshid = ".$id." ORDER BY acc_id DESC ");
// Excute the ststment
$stmt1->execute();
//Assign To varriable
$woshacc = $stmt1->FetchAll();
?>
<section class="mt-s">
<div class="container">
<h3 class="text-center text-muted shadow-sm fw-bold mt-4"> حسابات الورشة </h3>
<div class="row bg-muted shadow mt-2">
<div class="col-3 text-center fw-bold"><p>تحكم</p></div>
<div class="col-3 text-center fw-bold"><p>ت البيان</p></div>
<div class="col-3 text-center fw-bold"><p>البيان</p></div>
<div class="col-3 text-center fw-bold"><p>المبلغ</p></div>
</div>
<?php foreach ($woshacc as $wosha ) {?>
<?php
if ($wosha['acc_type'] === 'a') { $bg = 'bg-success bg-gradient text-white'; }
if ($wosha['acc_type'] === 'b') { $bg = 'bg-warning bg-gradient'; }
?>
<div class="row">
<div class="col-12 <?php echo $bg; ?> p-2 m-1 text-center">
<div class="row">
<div class="col-3">
<div class="row">
<div class="col-lg-4 col-sm-12 mt-1">
<form action="ac_workshops.php" method="POST">
<input type="hidden" name="acc_del" value="<?php echo $wosha['acc_id'];?>">
<input type="hidden" name="acc_wsh_cod" value="<?php echo $row['wsh_cus_code'];?>">
<button href="ac_workshops.php" type="submit" name="delacc" onclick="return confirm('متأكد من حذف القيد ؟');" class=" px-3 btn btn-danger opacity-75 fw-bold bg-gradient border-0">D</button>
</form>
</div>
<div class="col-lg-4 col-sm-12 mt-1">
<form action="ac_workshops.php" method="POST">
<input type="hidden" name="ac_wsh_id" value="<?php echo $wosha['acc_id'];?>">
<input type="hidden" name="acc_wsh_is" value="<?php echo $wosha['acc_wshid'];?>">
<button href="ac_workshops.php" type="submit" name="edit_acc" class=" px-3 btn btn-info opacity-75 fw-bold bg-gradient border-0">ED</button>
</form>
</div>
</div>
</div>
<div class="col-3">
<span class="fw-bold"><?php echo $wosha['acc_date']; ?></span>
</div>
<div class="col-3">
<span class="fw-bold"><?php echo $wosha['acc_tittle']; ?></span>
</div>
<div class="col-3">
<span class="fw-bold"><?php echo $wosha['acc_amount']; ?></span>
</div>
</div>
</div>
</div>
<?php }?>
</div>
</section>
<?php
$querya = "SELECT * FROM workshopsaccounting WHERE acc_wshid = ".$id." AND acc_type ='a' ";
$query_run = $conn->prepare($querya);
$qtya= 0;
$result = $conn->query($querya);
while($suma = $result->fetch()) {
$qtya += $suma['acc_amount'];
}
$queryb = "SELECT * FROM workshopsaccounting WHERE acc_wshid = ".$id." AND acc_type ='b' ";
$query_run = $conn->prepare($queryb);
$qtyb= 0;
$result = $conn->query($queryb);
while($sumb = $result->fetch()) {
$qtyb += $sumb['acc_amount'];
}
?>
<section class="mt-s">
<div class="container">
<hr>
<div class="row">
<div class="col-12 bg-dark bg-gradient text-white p-2 m-1 text-center">
<div class="row">
<div class="col-6">
<span class="fw-bold bg-success bg-gradient px-2 py-1">مجموع الإيرادات = <?php echo $qtya; ?></span>
</div>
<div class="col-6">
<span class="fw-bold bg-warning bg-gradient text-dark px-2 py-1">مجموع المصاريف = <?php echo $qtyb; ?></span>
</div>
</div>
</div>
</div>
</div>
</section>
<div class="hei_sec">
<hr class="my-5 bg-warning w-75 m-auto">
</div>
<?php
$resultsumworkshop = $qtya - $qtyb;
?>
<section>
<div class="container-sm">
<div class="account_sec rounded-pill">
<div class="row g-2 py-3 mx-3">
<div class="col-lg-3 col-sm-3">
<form action="ac_workshops.php" method="POST">
<input type="hidden" name="ac_wsh_id" value="<?php echo $row ['wshid'];?>">
<input type="hidden" name="ac_wsh_cd" value="<?php echo $row ['wsh_cus_code'];?>">
<button href="ac_workshops.php" type="submit" name="add_Revenues" class="w-100 btn btn-success fw-bold bg-none border-0">إضافة إيراد + </button>
</form>
</div>
<div class="col-lg-3 col-sm-3">
<form action="ac_workshops.php" method="POST">
<input type="hidden" name="ac_wsh_id" value="<?php echo $row ['wshid'];?>">
<input type="hidden" name="ac_wsh_cd" value="<?php echo $row ['wsh_cus_code'];?>">
<button href="ac_workshops.php" type="submit" name="add_expenses" class="w-100 btn btn-warning fw-bold bg-none border-0">إضافة مصروف + </button>
</form>
</div>
<div class="col-lg-6 col-sm-3">
<p class="w-75 fw-bold py-2 rounded bg-gradient m-auto text-center <?php if ($resultsumworkshop > 0) {echo 'bg-info';}elseif ($resultsumworkshop < 0 ) {echo 'bg-danger text-wlite';} ?>">صافي مجموع الحسابات = <?php echo $resultsumworkshop; ?></p>
</div>
</div>
</div>
</div>
</section>
<?php }?>
<?php
include 'assets/includes/template/footer.php';
?>
<?php
}else{
header('Location:index.php');
exit;
}
?>
<?php
ob_end_flush();| 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 |
|