<?php
include_once("../include/main.inc.php");
check_session('MyCpanel','index.php');

################ Paging Starts From Here ##################
@extract($_REQUEST);
$start = (intval($start)==0 or $start=="")?$start=0:$start;
$pagesize = intval($pagesize)==0?$pagesize=20:$pagesize;

$record_type="Meta Details";
$script_name="manage_categories.php";
$table_name="category_tbl";
####################################################
if($id=="update_record") {
	$pageTitle=trim($pageTitle);
	updateTable($table_name," pageTitle='$pageTitle', pageKeywords='$pageKeywords', pageDescription='$pageDescription', pageTitle1='$pageTitle1', pageKeywords1='$pageKeywords1', pageDescription1='$pageDescription1' where catID='$catID'");
	
	
	$_SESSION[session_message]=$record_type.' has been updated successfully';
	header("Location: ".SITE_ADMIN_URL."/".$script_name."?start=".$start."&catID=".$catID."&parentID=".$parentID."&pagesize=".$pagesize);
	exit;	
}

admin_header();
?>

<table width="100%"  border="0" cellpadding="0" cellspacing="2">
 <tr><td align="right"><input type="button" class="button" value="Back To Manage Category" onclick="window.location.href='<?=SITE_ADMIN_URL?>/<?=$script_name;?>?start=<?=$_REQUEST[start]?>&catID=<?=$catID;?>&parentID=<?=$parentID?>&pagesize=<?=$pagesize?>';"></td></tr>
</table>
<br />

<form name="metaFrm" method=post action="" enctype="multipart/form-data" onsubmit="return validate(this);">
<table width="99%"  border="0" cellpadding="2" cellspacing="2" class="lightBorder">
 <?php
 $categoryRes=getResult($table_name," where catID='$catID'");
 @extract($categoryRes);
 echo $catgType;

 if($catgType==0)
 {
  ?>
 

 <tr bgcolor="#f9f9f9">
  
  <td class="brdrbtm" valign="top" width="20%"><h2>Product Section Category Meta</h2><br><b>Page Title *</b></td>
  <td class="brdrbtm"><textarea name="pageTitle" cols="100" rows="4" ><?=$pageTitle;?></textarea></td>
 </tr>
 <tr bgcolor="#f9f9f9">
  <td class="brdrbtm" valign="top"><b>Page Description</b></td>
  <td class="brdrbtm"><textarea name="pageDescription" cols="100" rows="7" ><?=$pageDescription;?></textarea></td>
 </tr>
 <tr bgcolor="#f0f0f0">
  <td class="brdrbtm" valign="top"><b>Page Keywords</b></td>
  <td class="brdrbtm"><textarea name="pageKeywords" cols="100" rows="7" ><?=$pageKeywords;?></textarea></td>
 </tr> 
 
<?
}
?>
 <tr bgcolor="#f9f9f9">
   
  <td class="brdrbtm" valign="top" width="20%"><h2>Services/ Companies Category Meta</h2><br><b>Page Title *</b></td>
  <td class="brdrbtm"><textarea name="pageTitle1" cols="100" rows="4" ><?=$pageTitle1;?></textarea></td>
 </tr>
 <tr bgcolor="#f9f9f9">
  <td class="brdrbtm" valign="top"><b>Page Description</b></td>
  <td class="brdrbtm"><textarea name="pageDescription1" cols="100" rows="7" ><?=$pageDescription1;?></textarea></td>
 </tr>
 <tr bgcolor="#f0f0f0">
  <td class="brdrbtm" valign="top"><b>Page Keywords</b></td>
  <td class="brdrbtm"><textarea name="pageKeywords1" cols="100" rows="7" ><?=$pageKeywords1;?></textarea></td>
 </tr> 
 <tr bgcolor="#f0f0f0">
  <td class="brdrbtm"></td>
  <td class="brdrbtm">
   <input type="submit" name="submit" value="Update <?=$record_type;?>" class="button">
   <input type="hidden" name="id" value="update_record">
   <input type="hidden" name="start" value="<?=$start;?>">
   <input type="hidden" name="pagesize" value="<?=$pagesize;?>">
  </td>
 </tr> 
</table>
</form>

<?php
admin_footer();
exit;
?>