<? 
include("../includes/site_config.php");
include_once("include/header.php");
$mode=$_GET['mode'];
if($_REQUEST['title']){
$sel=mysql_query("SELECT * from metadata");
$count=mysql_num_rows($sel);
if($count>0){
$upd=mysql_query("update metadata set title='".$_REQUEST['title']."', description='".$_REQUEST['description']."', keywords='".$_REQUEST['keywords']."'");
}else{
$ins=mysql_query("insert into metadata set title='".$_REQUEST['title']."', description='".$_REQUEST['description']."', keywords='".$_REQUEST['keywords']."'");

		}
	}

###################
$select=mysql_query("SELECT * from metadata");
$val=mysql_fetch_object($select);


?>
<? include("admin_tabs.php");?>
<div class="mainwidth">
<div class="admin-page-header"><div class="admin-page-heading">&nbsp;&nbsp;MetaData</div></div>
<div class="clear"></div>
<div class="admin-page">
  <table width="<?php print("$CONST_TABLE_WIDTH"); ?>" align="<?php print("$CONST_TABLE_ALIGN"); ?>" border="0" cellspacing="<?php print("$CONST_TABLE_CELLSPACING"); ?>" cellpadding="<?php print("$CONST_TABLE_CELLPADDING"); ?>">
<form action="<?=$_SERVER['PHP_SELF']?>" method="post" name="meta">
  <tr>
    <td width="10%"><div align="left">Site Title: </div></td>
    <td width="66%">
      <div align="left">
        <textarea name="title" rows="4" style="width:438px"><?=$val->title?>
      </textarea>
        </div></td>
  </tr>
  <tr>
    <td><div align="left">Site Description: </div></td>
    <td><div align="left">
      <textarea name="description" rows="4" style="width:438px"><?=$val->description?>
    </textarea>
    </div></td>
  </tr>
  <tr>
    <td><div align="left">Site Keywords: </div></td>
    <td><div align="left">
      <textarea name="keywords" rows="4" style="width:438px"><?=$val->keywords?>
    </textarea>
    </div></td>
  </tr>
  <tr>
    <td>&nbsp;<input type="hidden" name="type" value="smeta" /></td>
    <td><div align="left"><span class="tdfoot">
      <input name="Validate2" type="submit" class="normal" value="<?php echo BUTTON_UPDATE ?>" />
      </span>
        <!--<input type="image" src="<?=$SKIN_IMAGE_PATH?>/update-options-btn.jpg" name="update"/>-->
    </div></td>
  </tr>
  </form>
</table>
</div><div class="admin-page-bottom"></div></div>
</body>
</html>
<? include("include/footer.php");?>