<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: 			*/
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2008 Armia Systems, Inc                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts SocialWare                    |
// +----------------------------------------------------------------------+
// | Authors: simi<simi@armia.com>             		                      |
// |          										                      |
// +----------------------------------------------------------------------+
session_start();
require_once ("../config.inc.php");
require_once ("../includes/mysql.inc.php");
require_once ("../classes/settings.class.php");
$objSTN	= new settings($objDB);
$siteSettingsComm=$objSTN->select();

$id=$_GET['q'];

$condition="where vPageName='".$id."'";
$txtCnt=$objSTN->select_rows(TABLEPREFIX.'MetaTags','*',$condition);
if(mysql_num_rows($txtCnt)>0)
{
	$txtDes=$objSTN->fetchSingleValue($objSTN->select_rows(TABLEPREFIX.'MetaTags','vKeywords',$condition),'vKeywords');
	$txtDes2=$objSTN->fetchSingleValue($objSTN->select_rows(TABLEPREFIX.'MetaTags','vDescription',$condition),'vDescription');
	$nId=$objSTN->fetchSingleValue($objSTN->select_rows(TABLEPREFIX.'MetaTags','nId',$condition),'nId');
	$txtPName=$objSTN->fetchSingleValue($objSTN->select_rows(TABLEPREFIX.'MetaTags','vTitle',$condition),'vTitle');
}//end if
else
{
	$txtDes=$siteSettingsComm['metatagKey'];
	$txtDes2=$siteSettingsComm['metatagDes'];
	$txtPName=$siteSettingsComm['sitename'];
}//end else
?>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
				<?php if ($objDB) 
					  { 
				?>
  				<tr align="left">
                  <td width="3%" class="maintext2">&nbsp;</td>
                  <td width="27%" valign="top" class="maintext2">Page Title <span class="warning">*</span></td>
                  <td width="70%" valign="top" class="maintext2"><input type="text" name="txtPName" class="textbox3" value="<?php echo $txtPName;?>" size="75"></td>
  				</tr>
                 <tr align="left">
                  <td class="maintext2">&nbsp;</td>
                  <td valign="top" class="maintext2">Keywords <span class="warning">*</span></td>
                  <td valign="top" class="maintext2"><textarea name="txtDes" cols="50" rows="10" class="textbox_textarea"><?php echo $txtDes;?></textarea></td>
                 </tr>
                <tr align="left">
                  <td class="maintext2">&nbsp;</td>
                  <td valign="top" class="maintext2">Description <span class="warning">*</span></td>
                  <td valign="top" class="maintext2"><textarea name="txtDes2" cols="50" rows="10" class="textbox_textarea"><?php echo $txtDes2;?></textarea></td>
                </tr>
				<?php 			
						}//end first if
				?>
              </table>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="right"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td>&nbsp;</td>
                      </tr>
                    </table>
                      <?php if ($objDB) 
					  { 
					?>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td align="center"><table width="6%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><input type="submit" name="btnGo" value="Update"  onClick="return validateMeta();" class="loginbutton">
                                    </td>
                              </tr>
                        </table></td>
                      </tr>
                    </table>
					<?php 		
						}//end first if
				?></td>
                  </tr>
                </table>