( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
require("./NewsSql.inc.php");
$db = new NewsSQL($dbname);
$PicturePath = "../photo/";
page_protect();
if (empty($page)){
$page = 0;
}
$record = 20;
if ($Delepisode==$admin_yes) {
$db->delepisode($catid,$PicturePath);
}
if (!empty($addepisode)) {
$tempuserfile = $_FILES['userfile']['tmp_name'];
$tempuserfile_name = $_FILES['userfile']['name'];
if ((!empty($tempuserfile)) && (!empty($tempuserfile_name))) {
$pathinfo = pathinfo($tempuserfile_name, PATHINFO_EXTENSION);
if(!in_array(strtolower($pathinfo), array('jpg','png','gif')))
{
header('Location: cate.php?msg=Invalid File Type!<br>') ;
}
$userfile = $tempuserfile;
$userfile_name = $tempuserfile_name;
}
if ((!empty($userfile)) && (!empty($userfile_name))) {
$videouser = $_SESSION['euserid'];
$userfile_name = preg_replace('/[\ ]/', '-', $userfile_name);
$userfile_name = $videouser.$userfile_name;
$dest1 = $PicturePath.$userfile_name;
copy($userfile, $dest1);
session_start();
$_SESSION['fn']= $userfile_name;
$db->addepisode($catalogname,$description,$slug,$parentid);
unset($_SESSION['fn']);
/* $db->epilogo($catalogid,$userfile_name,$PicturePath);*/
}
}
if (!empty($editepisode)) {
$db->editepisode($catalogname,$description,$catid);
}
$result = $db->getallepisodes($page,$record);
?>
<html>
<head>
<title><?php print "$admin_newsadmin"; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php print "$admin_charset"; ?>">
<link href="styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style4 {font-size: 11px}
.style6 {font-size: 12px}
.style7 {font-size: 10px}
-->
</style>
<script language="JavaScript" type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script language="JavaScript" type="text/javascript" src="js/jquery.validate.js"></script>
<script>
$(document).ready(function(){
$("#myform").validate();
});
</script>
</head>
<body>
<?php
?>
<style type="text/css">
<!--
.style4 {font-size: 11px}
.style6 {font-size: 12px}
.style7 {font-size: 10px}
-->
</style>
<?php
include 'header.php';
?>
<table width="1000" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="200" valign="top"><?php
include 'navigation.php';
?>
</td>
<td valign="top">
<div class="graycellv3" style=" width:800px;">
<br><span id="buttoned2" style="margin-top:10px">My Categories </span><br>
<br>
<table width="700" border="0" cellspacing="1" cellpadding="4" bgcolor="#F2F2F2">
<tr class="style6">
<td width="27">ID</td>
<td width="268"><?php print "$admin_name"; ?></td>
<td width="94">Parent</td>
<td colspan="3"><?php print "$admin_opreation"; ?></td>
</tr>
<?php
if (!empty($result)) {
foreach ($result as $key => $val) {
$catalogid = stripslashes($val["catalogid"]);
$catalogname = stripslashes($val["catalogname"]);
$parentid = stripslashes($val["parentid"]);
$parentname = $db->getcatalognamebyid($parentid);
?>
<tr >
<td class="style6"><?php print "$catalogid"; ?></td>
<td class="style6"><?php print "$catalogname"; ?></td>
<td class="style6"><?php print "$parentname"; ?></td>
<td width="71" class="style6"><a href="viewreporta.php?catid=<?php print "$catalogid"; ?>" class="en_b">View Videos</a></td>
<td width="42" class="style6"><a href="editcatalog.php?catid=<?php print "$catalogid"; ?>" class="en_b"><?php print "$admin_edit"; ?></a></td>
<td width="43" class="style6"><a href="delepisode.php?catid=<?php print "$catalogid"; ?>" class="en_b"><?php print "$admin_del"; ?></a></td>
</tr>
<?php
}
}
?>
</table>
<?php
if (empty($result)) {?><br>
<br>
<strong> You havent created categories yet</strong>
<a href="home.php">Start Adding Content in this Category</a>
<?php } ?>
<br>
<br>
<br>
<br>
<table width="700" height="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left">
<br><span id="buttoned2" style="margin-top:10px">Add Episode/Category</span><br>
<br>
<br>
<form action="<?php print "$PHP_SELF"; ?>" method="POST" ENCTYPE="multipart/form-data">
<table width="700" border="0"cellspacing="1" cellpadding="2">
<tr >
<td width="155" class="style6" >Category Name :</td>
<td width="434" class="style6" ><input name="catalogname" type="text" size="50"></td>
</tr>
<tr >
<td class="style6"><?php print "$admin_description"; ?> :</td>
<td class="style6"><textarea name="description" cols="40" rows="5"></textarea></td>
</tr>
<tr>
<td class="style6">Category Picture</td>
<td class="style6"><input name="userfile" type="file" size="30"></td>
</tr>
<tr >
<td class="style6"> </td>
<td class="style6"><input name="addepisode" type="submit" class="large ezbutton green" style=" margin-top:2px;border:0px;width:200px; margin-right:5px" value="Add Category/Episode"></td>
</tr>
</table>
<p><a href="home.php"><?php print "$admin_back"; ?></a>
</p>
</form>
</td>
</tr>
</table></div></div></div></div></div>
<p align="right"> </p>
</div>
</td>
</tr>
</table>
</body>
</html>