Mini Shell

Direktori : /home/rizant5/public_html-1210/admin/
Upload File :
Current File : /home/rizant5/public_html-1210/admin/sample-edit.php

<?php 
require_once("../config.php");
require_once("function-file.php");
require_once("function-menu.php");
cookiecheck();
$sample_id=$_GET['sample_id'];
$db=$conn->prepare("select * from samples where sample_id='$sample_id'");
$db->execute();$dbres=$db->fetch();
if(isset($_POST['save'])){
	$title=$_POST['title'];
	$course_id=$_POST['course_id'];
	$sample_desc=$_POST['sample_desc'];
	$video_url=$_POST['video_url'];
	$conn->exec("update samples SET title='$title',course_id='$course_id',sample_desc='$sample_desc',video_url='$video_url' where sample_id='$sample_id'");
	header("location:sample.php");
}
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Add Sample</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <?php  cssfile();?>
  </head>
  <body class="hold-transition skin-blue layout-top-nav">
    <!-- Site wrapper -->
    <div class="wrapper">
<?php headermenu();?>
      <!-- =============================================== -->
      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <!-- Main content -->
        <section class="content">
          <!-- Default box -->
          <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Add Sample</h3>
              <div class="box-tools pull-right">
                <a href="sample.php" class="btn btn-info btn-sm" ><i class="fa fa-angle-double-left"></i> Back</a>
              </div>
            </div>
            <div class="box-body">
            <form action="#" method="post" role="form" class="form-horizontal" enctype="multipart/form-data">
              <div class="form-group">
              		<div class="col-sm-6"><label>Title of Sample:</label><br>
                  		<input type="text" name="title" class="form-control" value="<?php echo $dbres['title'];?>">
                  	</div>
              		<div class="col-sm-6"><label>Select Course</label><select name="course_id" class="form-control" >
                    <option value="">--Select--</option>
                    <?php $data=$conn->prepare("select * from courses");
					$data->execute();$result=$data->fetchall();
					foreach($result as $row){echo"<option ";if($dbres['course_id']==$row['course_id']){echo "selected ";} echo"value='$row[course_id]'>$row[course_name]</option>";}?>
                    </select></div>
              </div>
               <div class="form-group">
              		<div class="col-sm-12"><label>Sample Description</label>
                    <textarea name="sample_desc" class="form-control" placeholder="Type News Description" rows="4"><?php echo $dbres['sample_desc'];?></textarea></div>
              </div>
               <div class="form-group">
               	<div class="col-sm-12"><label>Embed Video</label><textarea name="video_url" class="form-control" placeholder="Place Iframe code of video"><?php echo $dbres['video_url'];?></textarea></div>
              </div> 
              <div class="form-group">
              		<div class="col-sm-12" align="right">
                    <button type="reset"  class="btn btn-default" rows="4">Reset</button>&nbsp;&nbsp;
                    <button  type="submit" name="save" class="btn btn-success" >Save</button></div>
                   
              </div>
            </div><!-- /.box-body -->
          </div><!-- /.box -->
        </section><!-- /.content -->
      </div></div><!-- /.content-wrapper -->
      <?php footer();?>
    </div><!-- ./wrapper -->
   <?php jsfile();ratenum();?>
</body>
</html>

Zerion Mini Shell 1.0