%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_test/ |
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'] . "'"));
// Sidebar strat
include('../include/sidebar.php');
// Sidebar wrap
$id = 2;
?>
<!-- [ 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 text-light fw-bold btn-sm btn-round has-ripple"><i class="feather icon-edit"></i> Manage | Testimonial Head</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-header d-flex justify-content-between">
</div> -->
<div class="card-body">
<?php if(isset($_SESSION['message'])){
echo '<div class="alert alert-success alert-dismissible fade show" role="alert">
<strong class="text-dark">'.$_SESSION['message'].' <i class="feather icon-thumbs-up text-success"></i></strong>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
</button>
</div>';
}
unset($_SESSION['message']);
?>
<?php if(isset($_SESSION['error'])){
echo '<div class="alert alert-success alert-dismissible fade show" role="alert">
<strong class="text-dark">'.$_SESSION['error'].' <i class="feather icon-thumbs-up text-danger"></i></strong>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
</button>
</div>';
}
unset($_SESSION['error']);
?>
<?php
$fetQuery = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM all_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'];
} ?>" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="heading">Heading</label>
<input type="text" name="heading" class="form-control" value="<?php if ($id != '') {
echo $fetQuery['heading'];
} ?>" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="title Arabic">Title Arabic</label>
<input type="text" name="title_ar" class="form-control" value="<?php if ($id != '') {
echo $fetQuery['title_ar'];
} ?>" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="heading Arabic">Heading Arabic</label>
<input type="text" name="heading_ar" class="form-control" value="<?php if ($id != '') {
echo $fetQuery['heading_ar'];
} ?>" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<?php
if (($id != '')) {
echo '<input type="submit" name="update" class="btn btn-success" value="Update">';
} else {
echo '<input type="submit" name="add" class="btn btn-success" value="Add">';
}
?>
<!-- <a class="btn btn-dark text-white" href="head.php?page=test_head">Back</a> -->
</div>
</div>
</form>
</div>
</div>
</div>
<!-- [ form-element ] end -->
</div>
<!-- [ Main Content ] end -->
</div>
</section>
<?php include('../include/footer.php'); ?>
<!-- Insert data start --->
<?php
if (isset($_POST['add'])) {
$title = str_replace("'", "\'", $_POST['title']);
$heading = str_replace("'", "\'", $_POST['heading']);
$title_ar = str_replace("'", "\'", $_POST['title_ar']);
$heading_ar = str_replace("'", "\'", $_POST['heading_ar']);
$addQry = mysqli_query($conn,"INSERT `all_head_tbl` SET
`title`='$title',
`heading`='$heading',
`title_ar`='$title_ar',
`heading_ar`='$heading_ar''") or die(mysqli_error($conn));
if ($addQry) {
echo "<script>window.location='head.php?page=test_head';</script>";
$_SESSION['message'] = "Record Added successfully";
}
}
?>
<!-- Insert data warp --->
<!-- Update data start --->
<?php
if (isset($_POST['update'])) {
$title = str_replace("'", "\'", $_POST['title']);
$heading = str_replace("'", "\'", $_POST['heading']);
$title_ar = str_replace("'", "\'", $_POST['title_ar']);
$heading_ar = str_replace("'", "\'", $_POST['heading_ar']);
$editQry = mysqli_query($conn, "UPDATE `all_head_tbl` SET
`title`='$title',
`heading`='$heading',
`title_ar`='$title_ar',
`heading_ar`='$heading_ar' WHERE id='$id'") or die(mysqli_error($conn));
if ($editQry) {
echo "<script>window.location='head.php?page=test_head';</script>";
$_SESSION['message'] = "Record Updated successfully";
}
}
?>
<!-- Update data warp --->