Al-HUWAITI Shell
Al-huwaiti


Server : Apache
System : Linux server.xvl.jdw.mybluehostin.me 5.14.0-611.42.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 24 05:30:20 EDT 2026 x86_64
User : gdckalyandurg ( 1043)
PHP Version : 8.2.30
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/gdckalyandurg/public_html/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gdckalyandurg/public_html/admin/department-paper-edit.php
<?php
include("config.php");
admin_protect();

$id = $_GET['id'];
$paper_info = $db->selectRow('department_papers', '*', $id);

$courses = $db->selectAll('subjects', '*', 'ORDER BY id DESC');

if(isset($_POST['submit'])){

	$title = isset($_POST['title'])?$_POST['title']:'';
	$course = isset($_POST['course'])?$_POST['course']:'';
	$course_type = isset($_POST['course_type'])?$_POST['course_type']:'';
	$year = isset($_POST['year'])?$_POST['year']:'';
	$semister = isset($_POST['semister'])?$_POST['semister']:'';
	
	if(!empty($title)){
	
		
		$file = $_FILES['file']['name'];
		
		if(!empty($file)){
			$file_tmp = $_FILES['file']['tmp_name'];
			$folder = "uploads/";

			$status = upload_any_file($file,$file_tmp,$folder);
			$file_name = $status[1];
		} else {
			$file_name = $_POST['old_file'];
		}
		
		$data = array('title' => $title,
					  'download' => $file_name,
					  'course_type' => $course_type,
					  'subject' => $course,
					  'semister' => $year.'-'.$semister,
					  'type_year'=>$year,
					  'type_sem'=>$semister);
					  
		$result = $db->update('department_papers', $data, $id);
		
		if($result){
		$msg = "success";
		header("location: department-paper-edit.php?id=$id&msg=$msg");
		} else {
		$msg = "fail";
		header("location: department-paper-edit.php?id=$id&msg=$msg");
		}
		
	}

}
function upload_any_file($file,$tmp,$folder){
    
        $random_digits=rand(0000,9999);
        $new_file=$random_digits.$file;
        $path = $folder.$new_file;
            
        if (file_exists($path)){
            $msg = array("error","File Name already exists");
        } else{
            move_uploaded_file($tmp,$path);
            $msg = array("success",$path);
        }
            
        return $msg;
    
    }
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SVGM Government Degree College, Kalyandurg | Admin Panel</title>

<!-- Site favicon -->
<link rel='shortcut icon' type='image/x-icon' href='images/favicon.ico' />
<!-- /site favicon -->

<!-- Entypo font stylesheet -->
<link href="css/entypo.css" rel="stylesheet">
<!-- /entypo font stylesheet -->

<!-- Font awesome stylesheet -->
<link href="css/font-awesome.min.css" rel="stylesheet">
<!-- /font awesome stylesheet -->

<!-- Bootstrap stylesheet min version -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- /bootstrap stylesheet min version -->

<!-- Integral core stylesheet -->
<link href="css/integral-core.css" rel="stylesheet">
<!-- /integral core stylesheet -->

<!--Summernote-->
<link href="plugins/summernote/css/summernote.css" rel="stylesheet">
<!--Markdown-->
<link href="plugins/markdown/css/bootstrap-markdown.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/integral-forms.css">


<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
      <script src="js/html5shiv.min.js"></script>
      <script src="js/respond.min.js"></script>
<![endif]-->


</head>
<body>

<!-- Loader Backdrop -->
	<div class="loader-backdrop">           
	  <!-- Loader -->
		<div class="loader">
			<div class="bounce-1"></div>
			<div class="bounce-2"></div>
		</div>
	  <!-- /loader -->
	</div>
<!-- loader backgrop -->

<!-- Page container -->
<div class="page-container">

  <!-- Page Sidebar -->
  <?php include("includes/sidebar.php"); ?>
  <!-- /page sidebar -->
  
  <!-- Main container -->
  <div class="main-container">
  
	<!-- Main header -->
    <?php include("includes/header.php"); ?>
	<!-- /main header -->
	
	<!-- Main content -->
	<div class="main-content">
		<div class="row">
				<div class="col-lg-8">
				<h1 class="page-title">Model Papers</h1>
				<!-- Breadcrumb -->
				<ol class="breadcrumb breadcrumb-2"> 
					<li><a href="dashboard.php"><i class="fa fa-home"></i>Home</a></li> 
					<li class="active"><strong>Model Papers</strong></li> 
				</ol>
				</div>
				<div class="col-lg-4 ">
					<a href="department-papers.php" class="btn btn-success pull-right">View Model Papers</a>
				</div>
			</div>
		<div class="line-dashed"></div>
		<?php 
		  if(isset($_GET['msg'])){
			if($_GET['msg']=='fail'){
			echo "<div class='alert alert-warning'>
						<button class='close' data-dismiss='alert'>×</button>
						 <strong>No changes has been Done.</strong>
			</div>";
			} elseif($_GET['msg']=='success'){
			echo "<div class='alert alert-success'>
						<button class='close' data-dismiss='alert'>×</button>
						 <strong>Model Paper Updated Successfully.</strong>
			</div>";
			}
		  }
	   ?>
		<div class="row">
			<div class="col-lg-12">
				<div class="panel panel-default">
					
					<div class="panel-body">
		<form enctype="multipart/form-data" class="form-horizontal" method="post">
		 	
							<div class="form-group"> 
								<label class="col-sm-2 control-label">Department</label> 
								<div class="col-sm-6"> 
									<select class="form-control" name="course" data-validation="required">
									<option value="">Select Course</option>
									<?php foreach($courses as $course){ ?>
									<option value="<?php echo $course->id; ?>" <?php if($paper_info['subject'] == $course->id) echo 'selected'; ?>><?php echo $course->subject; ?></option>
									<?php } ?>
								</select>
								</div> 
							</div>
							<?php $yearsem = explode('-', $paper_info['semister']); ?>
							<div class="form-group"> 
								<label class="col-sm-2 control-label">Course Type</label> 
							<!--	<div class="col-sm-2"> 
									<select class="form-control" name="course_type" data-validation="required">
									<option value="">Select Course Type</option>
									<option value="UG" <?php if($paper_info['course_type'] == 'UG') echo 'selected'; ?>>UG</option>
									<option value="PG" <?php if($paper_info['course_type'] == 'PG') echo 'selected'; ?>>PG</option>
								</select>
								</div>--> 
								<div class="col-sm-2"> 
									<select class="form-control" name="year" data-validation="required">
									<option value="">Year</option>
									<option value="I" <?php if($yearsem[0] == 'I') echo 'selected'; ?>>I Year</option>
									<option value="II" <?php if($yearsem[0] == 'II') echo 'selected'; ?>>II Year</option>
									<option value="III" <?php if($yearsem[0] == 'III') echo 'selected'; ?>>III Year</option>
								</select>
								</div> 
								<div class="col-sm-2"> 
									<select class="form-control" name="semister" data-validation="required">
									<option value="">Semister</option>
									<option value="I" <?php if($yearsem[1] == 'I') echo 'selected'; ?>>I Semister</option>
									<option value="II" <?php if($yearsem[1] == 'II') echo 'selected'; ?>>II Semister</option>
									<option value="III" <?php if($yearsem[1] == 'III') echo 'selected'; ?>>III Semister</option>
									<option value="IV" <?php if($yearsem[1] == 'IV') echo 'selected'; ?>>IV Semister</option>
									<option value="V" <?php if($yearsem[1] == 'V') echo 'selected'; ?>>V Semister</option>
									<option value="VI" <?php if($yearsem[1] == 'VI') echo 'selected'; ?>>VI Semister</option>
								</select>
								</div> 
							</div>
							
			<div class="form-group"> 
				<label class="col-sm-2 control-label">Title</label> 
				<div class="col-sm-6"> 
					<input type="text" name="title"class="form-control" data-validation="required" value="<?php echo $paper_info['title']; ?>"> 
				</div> 
			</div>
			
			<div class="form-group"> 
				
			 	<label class="col-sm-2 control-label">Upload File</label> 
				<div class="col-sm-6"> 
					<a href="<?php echo $paper_info['download']; ?>" target="_blank">Download</a>
					<input name="file" type="file" class="form-control">
					<input type="hidden" name="old_file" value="<?php echo $paper_info['download']; ?>">
				</div> 
			</div>
			
			
			 <div class="form-group">
				<div class="col-sm-4 col-sm-offset-2">
					<button type="submit" name="submit" class="btn btn-primary">Submit</button>
				</div>
			</div>
						<input type="hidden" name="course_type" id="course_type" value="modelpaper"/>

	  </form>
</div>
				</div>
			</div>
		</div>
		
		<!-- Footer -->
		<?php include("includes/footer.php"); ?>	
		<!-- /footer -->
		
	  </div>
	  <!-- /main content -->
	  
  </div>
  <!-- /main container -->
  
</div>
<!-- /page container -->

<!--Load JQuery-->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="plugins/metismenu/js/jquery.metisMenu.js"></script>
<script type="text/javascript" src="plugins/ckeditor/ckeditor.js"></script>
<script src="js/functions.js"></script>
<script src="js/loader.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.26/jquery.form-validator.min.js"></script>
<script>
  $.validate({
  modules : 'file'
});
</script>
</body>
</html>

Al-HUWAITI Shell