PATH:
home
/
dkwgdcnelloreac
/
public_html
/
admin
/
Editing: department_timetable-edit.php
<?php include("config.php"); admin_protect(); $id = $_GET['id']; $paper_info = $db->selectRow('department_timetable', '*', $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_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' => $semister, 'course_year'=>$year); $result = $db->update('department_timetable', $data, $id); if($result){ $msg = "success"; header("location: department_timetable-edit.php?id=$id&msg=$msg"); } else { $msg = "fail"; header("location: department_timetable-edit.php?id=$id&msg=$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><?php echo $settings->name; ?> | 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">Semester Wise Time Tables</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>Semester Wise Time Tables</strong></li> </ol> </div> <div class="col-lg-4 "> <a href="department_timetable.php" class="btn btn-success pull-right">Semester Wise Time Tables</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>dept Time Table 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> <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($paper_info->course_year == 'I') echo 'selected'; ?>>I Year</option> <option value="II" <?php if($paper_info->course_year == 'II') echo 'selected'; ?>>II Year</option> <option value="III" <?php if($paper_info->course_year == '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($paper_info->semister == 'I') echo 'selected'; ?>>I Semister</option> <option value="II" <?php if($paper_info->semister == 'II') echo 'selected'; ?>>II Semister</option> <option value="III" <?php if($paper_info->semister == 'III') echo 'selected'; ?>>III Semister</option> <option value="IV" <?php if($paper_info->semister == 'IV') echo 'selected'; ?>>IV Semister</option> <option value="V" <?php if($paper_info->semister == 'V') echo 'selected'; ?>>V Semister</option> <option value="VI" <?php if($paper_info->semister == '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> </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>
SAVE
CANCEL