}
?>
</div>

<div id="container">
<?php 
include 'sidebar.php';
?>
<div id="content">
	<div class="login">
	<?php 
include 'functions.php';
if (isset($_POST['submit']) == 'Submit') {
    $data = array('category_id' => 0, 'user_id' => $_SESSION['id'], 'category_name' => mysql_real_escape_string($_POST['category']), 'status' => 1, 'date' => date('Y-m-d'));
    //dbRowInsert('video_category', $data);
    $output = InsertPDO('video_category', $data);
} else {
    ?>
	<form method="post" name="myform" onSubmit="return validform();">
	<label for="email"><span>Category Name: </span><input type="text" name="category" value="" /></label>
	<label><span></span><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Cancel" /></label>
	</form>
	<?php 
}
?>
	<?php 
if (!empty($_GET['delete'])) {
    Delete('video_category', 'category_id', $_GET['delete']);
    header('Location: video-category.php');
}
$query = "SELECT category_id, category_name, date, status FROM video_category WHERE user_id=:user_id";
<?php

include 'config.inc.php';
require_once 'functions.php';
if (isset($_POST['submit']) == 'Submit') {
    $fname = mysql_real_escape_string($_POST['fname']);
    $lname = mysql_real_escape_string($_POST['lname']);
    $email = mysql_real_escape_string($_POST['email']);
    $pass = mysql_real_escape_string($_POST['pass']);
    $utype = mysql_real_escape_string($_POST['utype']);
    $data = array('firstname' => $fname, 'lastname' => $lname, 'email' => $email, 'password' => $pass, 'user_type' => $utype, 'status' => 1, 'date' => curdate());
    InsertPDO('library_user', $data);
    header("Location: index.php");
}
include 'header.php';
?>
<script language="javascript">
function validform(){
var y=document.forms["myForm"]["fname"].value;
if(y==null || y=="" || y.length<3)
{
alert('please enter your First name which is more than 3 character');
document.forms["myForm"]["fname"].focus();
return false;
}
var p=document.forms["myForm"]["lname"].value;
if(p==null || p=="" || p.length<2)
{
alert('please enter your Last name which is more than 2 character');
document.forms["myForm"]["lname"].focus();
return false;
		<?php 
}
?>
	</div>

	<div id="container">
	<?php 
include 'sidebar.php';
?>
		<div id="content">
			<div class="login">
			<?php 
if (isset($_POST['submit']) == 'Submit') {
    include 'functions.php';
    $form_data = array('video_library_id' => 0, 'user_id' => $_SESSION['id'], 'category_id' => mysql_real_escape_string($_POST['category']), 'video_url' => mysql_real_escape_string($_POST['url']), 'video_title' => mysql_real_escape_string($_POST['title']), 'video_tag' => mysql_real_escape_string($_POST['tags']), 'status' => 1, 'date' => date('Y-m-d'));
    InsertPDO('video_library', $form_data);
} else {
    ?>
				<form name="myForm" method="post" onSubmit="return validform();">
					<label for="utype"><span>Select Category:</span><select name="category" size="1">
					<?php 
    $sql = "SELECT category_id, category_name FROM video_category WHERE user_id=:user_id";
    $res = $dbh->prepare($sql);
    $res->bindValue(':user_id', $_SESSION['id'], PDO::PARAM_INT);
    $res->execute();
    while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
        ?>
					<option value="<?php 
        echo $row['category_id'];
        ?>
"><?php