| Server IP : 172.67.206.42 / Your IP : 104.23.243.231 Web Server : Apache System : Linux server.localhost.com 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64 User : pahana ( 1029) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /home/pahana/public_html/phAdmin/ |
Upload File : |
<?php
// include "include/sessionAdmin.php";
// include "include/configure.php";
include "include/header.php";
if (isset($_POST['submit']) && $_POST['submit'] == "Submit") {
if (isset($_POST['action']) && $_POST['action'] == "update") {
$sqlCondition = "";
$imageName = $_FILES["pgImg"]["name"];
if (!empty($imageName)) {
if (isset($_POST['preImageName']) && $_POST['preImageName'] != "")
@unlink("../img/" . $_POST['preImageName']);
$strDtMix = @date("d") . substr((string)microtime(), 2, 6);
$uploadfile = $strDtMix . "." . pathinfo($imageName, PATHINFO_EXTENSION);
move_uploaded_file($_FILES['pgImg']['tmp_name'], "../img/" . $uploadfile);
$sqlCondition = "pgImg='" . $uploadfile . "',";
}
mysqli_query($conn, "UPDATE about_us SET " . $sqlCondition . "shortDesc='" . ($_POST['shortDesc']) . "',aboutDesc='" . ($_POST['aboutDesc']) . "',aboutTitle='" . ($_POST['aboutTitle']) . "' WHERE id='1'");
header("location: aboutUs.php?act=2");
}
}
$sqlEdit = mysqli_query($conn, "SELECT * FROM about_us WHERE id='1'");
$rowsEdit = mysqli_fetch_array($sqlEdit);
extract($rowsEdit);
$action = "update";
?>
<script src="<?= $siteUrl ?>assets/vendor/summernote/summernote.js"></script>
<link rel="stylesheet" href="<?= $siteUrl ?>assets/vendor/summernote/summernote.css" />
<link rel="stylesheet" href="<?= $siteUrl ?>assets/vendor/summernote/summernote-bs3.css" />
<section role="main" class="content-body">
<header class="page-header">
<h2>Manage About Us</h2>
<div class="right-wrapper pull-right">
<ol class="breadcrumbs">
<li> <a href="<?= $siteUrl; ?>"> <i class="fa fa-home"></i> </a> </li>
<li><span>Update About Us</span></li>
</ol>
<a> </a>
</div>
</header>
<?php
if (isset($_GET['act'])) {
if ($_GET['act'] == "2") {
$msgTxt = 'About us has been updated successfully';
}
echo '<div class="alert alert-info"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button><strong>' . $msgTxt . '</strong></div>';
}
?>
<div class="row">
<div class="col-lg-12">
<section class="panel">
<header class="panel-heading">
<div class="panel-actions"> </div>
<h2 class="panel-title">Update About Us</h2>
</header>
<div class="panel-body">
<form class="form-horizontal form-bordered" method="post" enctype="multipart/form-data">
<div class="form-group">
<label class="col-md-2 control-label" for="inputDefault">Title</label>
<div class="col-md-9">
<input type="text" class="form-control" name="aboutTitle" value="<?= $aboutTitle ?>" id="inputDefault" required>
<span class="hintTxt">e.i. About Us</span>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Short Description</label>
<div class="col-md-9">
<textarea class="summernote" id="shortDesc" name="shortDesc" data-plugin-summernote data-plugin-options='{ "height": 100, "codemirror": { "theme": "ambiance" } }'><?php echo htmlspecialchars($shortDesc); ?></textarea>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Description</label>
<div class="col-md-9">
<textarea class="summernote" id="aboutDesc" name="aboutDesc" data-plugin-summernote data-plugin-options='{ "height": 200, "codemirror": { "theme": "ambiance" } }'><?php echo htmlspecialchars($aboutDesc); ?></textarea>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label" for="inputHelpText">Image</label>
<div class="col-md-9">
<?php if ($pgImg != "") {
echo "<img src='" . $siteUrlMain . "img/" . $pgImg . "' />";
?>
<br />
<input type="hidden" name="preImageName" value="<?= $pgImg; ?>" />
<?php } ?>
<input type="file" class="form-control" name="pgImg" />
<span class="hintTxt">540px X 360px</span>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label" for="inputDisabled"> </label>
<div class="col-md-9">
<input type="hidden" name="action" value="<?= $action; ?>" />
<button class="btn btn-primary" name="submit" value="Submit">Submit</button>
<button type="button" onclick="window.location.href='<?= $siteUrl; ?>'" class="btn btn-default">Cancel</button>
</div>
</div>
</form>
</div>
</section>
</div>
</div>
</section>
</div>
</section>
<?php include "include/footer.php"; ?>