%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64 User : ndkhermy ( 1200) PHP Version : 8.5.12 Disable Function : NONE Directory : /home1/ndkhermy/public_html/website_6031bb72/admin/manage_home/ |
Upload File : |
<?php
error_reporting(0);
include("../function.php");
if ($_SESSION['admin_id'] == "") {
header('location:../login.php');
}
$login_tbl = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM admin WHERE admin_id='" . $_SESSION['admin_id'] . "'"));
$mudule_access_tbl = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM mudule_access_tbl WHERE `module_id` ='1' AND `admin_id`='" . $login_tbl['admin_id'] . "'"));
// Sidebar strat
include('../include/sidebar.php');
// Sidebar wrap
$id = 1;
?>
<!-- [ Main Content ] start -->
<section class="pcoded-main-container">
<div class="pcoded-content">
<!-- [ breadcrumb ] start -->
<div class="page-header">
<div class="page-block">
<div class="row align-items-center">
<div class="col-md-12">
<div class="page-header-title">
<div class="card-header d-flex justify-content-between">
<button class="btn btn-dark btn-sm btn-round fw-bold has-ripple text-white"><i class="feather icon-edit"></i> Add | Edit | Opportunities Head/Footer </button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- [ breadcrumb ] end -->
<!-- [ Main Content ] start -->
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<?php if (isset($_SESSION['message'])) {
echo '<div class="alert alert-success alert-dismissible fade show" role="alert">
<i class="feather icon-thumbs-up text-success"></i> <strong class="text-dark">' . $_SESSION['message'] . '</strong>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
</button>
</div>';
}
unset($_SESSION['message']);
?>
<?php if (isset($_SESSION['img_error'])) {
echo '<div class="alert alert-danger alert-dismissible fade show" role="alert">
<i class="feather icon-alert-triangle text-danger"></i> <strong class="text-dark">' . $_SESSION['img_error'] . '</strong>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
</button>
</div>';
}
unset($_SESSION['img_error']);
?>
<?php
$fetQuery = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM opportunities_head_tbl WHERE id='$id'"));
?>
<form method="post" action="" enctype="multipart/form-data" autocomplete="off">
<div class="row">
<div class="col-md-6 ">
<div class="form-group">
<label class="form-label" for="title">Title</label>
<input type="text" name="title" class="form-control" value="<?php if ($id != '') {
echo $fetQuery['title'];
} ?>">
</div>
</div>
<div class="col-md-6 ">
<div class="form-group">
<label class="form-label" for="title_ar">Title Ar</label>
<input type="text" name="title_ar" class="form-control" value="<?php if ($id != '') {
echo $fetQuery['title_ar'];
} ?>">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="form-label" for="footer_line 1">Footer Line 1</label>
<textarea name="footer_line1" id="editor1" class="form-control"><?php if ($id != '') {
echo $fetQuery['footer_line1'];
} ?></textarea>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="form-label" for="footer_line 2">Footer Line 2</label>
<textarea name="footer_line2" id="editor2" class="form-control"><?php if ($id != '') {
echo $fetQuery['footer_line2'];
} ?></textarea>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="form-label" for="footer_line 3">Footer Line 3</label>
<textarea name="footer_line3" id="editor3" class="form-control"><?php if ($id != '') {
echo $fetQuery['footer_line3'];
} ?></textarea>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="form-label" for="footer_line 1 Arabic">Footer Line 1 Arabic</label>
<textarea name="footer_line1_ar" id="editor4" class="form-control"><?php if ($id != '') {
echo $fetQuery['footer_line1_ar'];
} ?></textarea>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="form-label" for="footer_line 2 Arabic">Footer Line 2 Arabic</label>
<textarea name="footer_line2_ar" id="editor5" class="form-control"><?php if ($id != '') {
echo $fetQuery['footer_line2_ar'];
} ?></textarea>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="form-label" for="footer_line 3 Arabic">Footer Line 3 Arabic</label>
<textarea name="footer_line3_ar" id="editor6" class="form-control"><?php if ($id != '') {
echo $fetQuery['footer_line3_ar'];
} ?></textarea>
</div>
</div>
<div class="row">
<div class="col-md-6">
<?php if ($_SESSION['admin_id'] == 1 || $mudule_access_tbl['update1'] == 1) { ?>
<input type="submit" name="update" class="btn btn-success" value="Update">
<?php } ?>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- [ form-element ] end -->
</div>
<!-- [ Main Content ] end -->
</div>
</section>
<?php include('../include/footer.php'); ?>
<!-- Update data start --->
<?php
if (isset($_POST['update'])) {
$title = isset($_POST['title']) ? str_replace("'", "\'", $_POST['title']) : '';
$title_ar = isset($_POST['title_ar']) ? str_replace("'", "\'", $_POST['title_ar']) : '';
$footer_line1 = isset($_POST['footer_line1']) ? str_replace("'", "\'", $_POST['footer_line1']) : '';
$footer_line2 = isset($_POST['footer_line2']) ? str_replace("'", "\'", $_POST['footer_line2']) : '';
$footer_line3 = isset($_POST['footer_line3']) ? str_replace("'", "\'", $_POST['footer_line3']) : '';
$footer_line1_ar = isset($_POST['footer_line1_ar']) ? str_replace("'", "\'", $_POST['footer_line1_ar']) : '';
$footer_line2_ar = isset($_POST['footer_line2_ar']) ? str_replace("'", "\'", $_POST['footer_line2_ar']) : '';
$footer_line3_ar = isset($_POST['footer_line3_ar']) ? str_replace("'", "\'", $_POST['footer_line3_ar']) : '';
$editQry = mysqli_query($conn, "UPDATE `opportunities_head_tbl` SET
`title`='$title',
`title_ar`='$title_ar',
`footer_line1`='$footer_line1',
`footer_line2`='$footer_line2',
`footer_line3`='$footer_line3',
`footer_line1_ar`='$footer_line1_ar',
`footer_line2_ar`='$footer_line2_ar',
`footer_line3_ar`='$footer_line3_ar' WHERE id='$id'") or die(mysqli_error($conn));
if ($editQry) {
echo "<script>window.location='head.php?page=oppo_head';</script>";
$_SESSION['message'] = "Record Updated successfully";
}
}
?>
<!-- Update data warp --->