 <?php include ("../core/kfunctions.php");

//include ("seredirect.php");

?>

<html>

<head>

<?php kheader(); ?>

<link href="../css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">

<script src='../js/jquery.js'></script>



</head> 

<body>



    <div id="wrapper">



        <!-- Navigation -->

        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">

            <!-- Brand and toggle get grouped for better mobile display -->

            <?php ktopbar(); ?>

            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->

            <?php kleftbar(); ?>

            <!-- /.navbar-collapse -->

        </nav>



        <div id="page-wrapper">



            <div class="container-fluid">

            

                 <div class="col-lg-12">

                        <h2 class="page-header">Upload to File Portal</h2>

                      </div>



<div class="col-lg-12">

<div class="panel panel-default">

<div class="panel-body">

<?php

if(isset($_POST["submit_upload"])){

$filename=$_POST["filename"];

$filetype=$_POST["filetype"];

$comment=$_POST["comment"];

$rolenumber=$_SESSION["rolenumber"];

$yy=date("Y");

$fyy=substr($yy,2,2);

$mm=date("m");

$dd=date("d");

$hi=date("h");

$mi=date("i");

$sa=date("sa");

$fsa=substr($sa,0,2);   

$mediaid="up".$rolenumber.$fyy.$mm.$dd.$hi.$mi;



include("../core/uploads.php");





$insert_uploaded=$dbh->prepare("insert into uploaded (mediatype,mediaid,img,imgname,comment) values('$filetype','$mediaid','$img','$filename','$comment')");

$insert_uploaded->execute();



}

?>

<form method='post' enctype="multipart/form-data">

<div class='col-lg-4'>

<input type='file' name='fileToUpload' id='fileToUpload' required>

</div>

<div class='col-lg-4'>

<input type='text' name='filename' class='form-control' placeholder='File name' required>

</div>

<div class='col-lg-3'>

<select class='form-control' name='filetype' required>

<option value=''>File type </option>

<option value='file'>File </option>

<option value='image'>Image </option>

</select>

</div>

<div class='col-lg-1'>

<input type='submit' class='btn btn-sm btn-primary' name='submit_upload' value='Submit'>

</div>

<div class='col-lg-12'><br></div>

<div class='col-lg-12'>

<textarea class='form-control' placeholder='Comment' name='comment'></textarea>

</div>

</form>



</div></div>

</div>



                    </div>

                </div>

                <!-- /.row -->

                

    <!-- jQuery -->

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.js"></script>

       



    <!-- Bootstrap Core JavaScript -->







</body>



</html>