?
Path : /home/u949514618/domains/karmaasrconsultants.com/public_html/admin/ |
Current File : /home/u949514618/domains/karmaasrconsultants.com/public_html/admin/newprocourse.php |
<?php include_once("tophead.php"); if(isset($_SESSION['username']) && $_SESSION['role'] == 'author') { header('Location: index.php'); } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Admin | Dashboard</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"> <!-- Bootstrap 3.3.7 --> <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css"> <!-- Font Awesome --> <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css"> <!-- Ionicons --> <link rel="stylesheet" href="bower_components/Ionicons/css/ionicons.min.css"> <!-- Theme style --> <link rel="stylesheet" href="dist/css/AdminLTE.min.css"> <!-- AdminLTE Skins. Choose a skin from the css/skins folder instead of downloading all of them to reduce the load. --> <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css"> <!-- bootstrap wysihtml5 - text editor --> <link rel="stylesheet" href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css"> <!-- HTML5 Shim and Respond.js 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="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <!-- Google Font --> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic"> </head> <body class="hold-transition skin-blue sidebar-mini"> <div class="wrapper"> <?php include_once("header.php"); ?> <!-- Left side column. contains the logo and sidebar --> <?php include_once("leftsidebar.php"); ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> <i class="fa fa-user-plus"></i> Add Department <small> Add/Edit</small> </h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li> <li class="active">Add Department</li> </ol> </section> <!-- Main content --> <section class="content"> <!-- Small boxes (Stat box) --> <div class="row"> <div class="col-xs-12"> <?php if(isset($_POST['submit'])){ $title = mysqli_real_escape_string($con,$_POST['title']); $proid = mysqli_real_escape_string($con,$_POST['proid']); $department = mysqli_real_escape_string($con,$_POST['department']); $duration = mysqli_real_escape_string($con,$_POST['duration']); $eligibility = mysqli_real_escape_string($con,$_POST['eligibility']); $tutionfee = mysqli_real_escape_string($con,$_POST['tutionfee']); $desc = $_POST['desc']; $image = $_FILES['image']['name']; $image_tmp = $_FILES['image']['tmp_name']; $phimage = $_FILES['headerimage']['name']; $headerimage_tmp = $_FILES['headerimage']['tmp_name']; $date = time(); $insert_query = "INSERT INTO `course` (`id`, `program_id`, `department_id`, `title`, `image`, `desc`, `header_image`, `duration`, `eligibility`, `tution_fee`) VALUES (NULL,'$proid', '$department', '$title', '$image', '$desc', '$phimage', '$duration', '$eligibility', '$tutionfee')"; if(mysqli_query($con, $insert_query)){ $msg = "Image has been added"; move_uploaded_file($image_tmp, "img/coursse/$image"); move_uploaded_file($headerimage_tmp, "img/coursse/banner/$phimage"); header('Location: procourse.php'); } else{ $error = "Image has not been added"; } } ?> <div class="col-md-8"> <div class="box box-info"> <div class="box-header with-border"> <h3 class="box-title">Add Course</h3> </div> <!-- /.box-header --> <!-- form start --> <form class="form-horizontal" method="post" enctype="multipart/form-data"> <div class="box-body"> <div class="form-group"> <label for="proid" class="col-sm-2 control-label">Program Name*</label> <div class="col-sm-10"> <select class="form-control" name="proid" id="proidd" onChange="change_brand()"> <option>Select Any One...</option> <?php $type_query = "select * from whyus order by id asc"; $type_run = mysqli_query($con, $type_query); if(mysqli_num_rows($type_run) > 0){ while ($type_row = mysqli_fetch_array($type_run)) { $pro_name = $type_row['author_name']; $pro_id = $type_row['id']; echo "<option value='".$pro_id."' ".((isset($proid) and $proid == $pro_name)?"selected":"").">".ucfirst($pro_name)."</option>"; # code... } } else{ echo "<center><h6>Not Available</h6></center>"; } ?> </select> </div> </div> <div class="form-group"> <div id="city"> </div> </div> <div class="form-group"> <label for="title" class="col-sm-2 control-label">Course Name*</label> <?php if(isset($error)){ echo "<span class='pull-right' style='color:red;'>$error</span>"; } else{ echo "<span class='pull-right' style='color:green;'>Jet Set Go</span>"; } ?> <div class="col-sm-10"> <input name="title" type="text" class="form-control" value="<?php if(isset($title)){echo $title;} ?>" id="lefttext" placeholder="Name"> </div> </div> <div class="form-group"> <label for="desc" class="col-sm-2 control-label">Description*</label> <div class="col-sm-10"> <textarea id="desc" name="desc" rows="10" cols="80"> <?php if(isset($desc)){echo $desc;} ?> </textarea> </div> </div> <div class="form-group"> <label for="uploadimage" class="col-sm-2 control-label">Upload/Image</label> <div class="col-sm-10"> <input name="image" type="file" class="form-control" id="uploadimage" value="<?php if(isset($image)){echo $image;} ?>"> </div> </div> <div class="form-group"> <label for="headerimage" class="col-sm-2 control-label">Upload Header Image</label> <div class="col-sm-10"> <input name="headerimage" type="file" class="form-control" id="headerimage"> </div> </div> <div class="form-group"> <label for="duration" class="col-sm-2 control-label">Duration*</label> <div class="col-sm-10"> <input name="duration" type="text" class="form-control" value="<?php if(isset($duration)){echo $duration;} ?>" id="lefttext" placeholder="Duration"> </div> </div> <div class="form-group"> <label for="eligibility" class="col-sm-2 control-label">Eligibility*</label> <div class="col-sm-10"> <input name="eligibility" type="text" class="form-control" value="<?php if(isset($eligibility)){echo $eligibility;} ?>" id="lefttext" placeholder="Eligibility"> </div> </div> <div class="form-group"> <label for="tutionfee" class="col-sm-2 control-label">Tution Fee*</label> <div class="col-sm-10"> <input name="tutionfee" type="text" class="form-control" value="<?php if(isset($tutionfee)){echo $tutionfee;} ?>" id="lefttext" placeholder="Tution Fee"> </div> </div> </div> <!-- /.box-body --> <div class="box-footer"> <input type="submit" class="btn btn-info pull-right" value="Add Service" name="submit"> </div> <!-- /.box-footer --> </form> </div> </div> <div class="col-md-4"> <?php if(isset($check_image)){ echo "<img src='img/gallery/$check_image' width='100%'>"; } ?> </div> <!-- /.box --> </div> </div> <!-- /.row --> <!-- Main row --> <!-- /.row (main row) --> </section> <!-- /.content --> </div> <!-- /.content-wrapper --> <?php include_once("footer.php"); ?> <!-- Control Sidebar --> <?php include_once("controlsidebar.php"); ?> <!-- /.control-sidebar --> <!-- Add the sidebar's background. This div must be placed immediately after the control sidebar --> <div class="control-sidebar-bg"></div> </div> <!-- ./wrapper --> <!-- jQuery 3 --> <script src="bower_components/jquery/dist/jquery.min.js"></script> <!-- Bootstrap 3.3.7 --> <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <!-- FastClick --> <script src="bower_components/fastclick/lib/fastclick.js"></script> <!-- AdminLTE App --> <script src="dist/js/adminlte.min.js"></script> <!-- AdminLTE for demo purposes --> <script src="dist/js/demo.js"></script> <!-- CK Editor --> <script src="bower_components/ckeditor/ckeditor.js"></script> <!-- Bootstrap WYSIHTML5 --> <script src="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script> <script> $(function () { // Replace the <textarea id="editor1"> with a CKEditor // instance, using default configuration. CKEDITOR.replace('desc') //bootstrap WYSIHTML5 - text editor $('.textarea').wysihtml5() }) </script> <script type="text/javascript"> function change_brand(){ var xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET","ajax1.php?underid="+document.getElementById("proidd").value,false); xmlhttp.send("null"); document.getElementById("city").innerHTML=xmlhttp.responseText; } </script> </body> </html>