<?php
require_once ("../config.inc.php");
require_once ("../includes/adminlogincheck.inc.php");
require_once ("../includes/mysql.inc.php");
require_once ("../classes/settings.class.php");

$message	= "";

if (!$objDB) 
{
	$message	= "Unable to Locate Database Server.";
}//end if
else 
{
	$objS		= new settings($objDB);

	if (isset($_POST['SetNow']) && $_POST['SetNow']=='Save Settings') 
	{
		if($_FILES['userfile']['name']!='')
		{
			$imagedir = "../images/";
			$logofile = $_FILES['userfile'];
			$logofilename = $_FILES['userfile']['name'];
			$logofiletype = $_FILES['userfile']['type'];
			$logotempname= $_FILES['userfile']['tmp_name'];
			$logoimagedest = $imagedir . $logofilename;
			$logoimagedest_thumb = $imagedir . 'thumb_'.$logofilename;
			$remove_image_name = $_POST['remove_image_name'];
	
			if (!is_writable($imagedir)) 
			{
				$error = true;
				$_SESSION['sessionMsg'] .= " * Change the permission of 'images' folder in the root to 777 <br>";
			}//end if
	
			if ($logofiletype != "") 
			{
				if (!$objS->isValidWebImageType($logofiletype,$logofilename,$logotempname)) 
				{
					$_SESSION['sessionMsg'] .= " * Invalid Logo file ! Upload an image (jpg/gif/bmp/png)" . "<br>";
					$error = true;
				}//end if
				else 
				{
					if (file_exists($logoimagedest)) 
					{
						@rename($imagedir.$logofilename,$imagedir.'old_'.$logofilename);
						@rename($imagedir.'thumb_'.$logofilename,$imagedir.'old_'.'thumb_'.$logofilename);
					}//end if
				}//end else 
			}//end if 
		
			if($error!=true)
			{
				 if ($objS->isValidWebImageType($logofiletype,$logofilename,$logotempname)) 
				 {
					//Uploading the logo image 
					if($logofilename != "")
					{
						@unlink($imagedir.$remove_image_name);
						@unlink($imagedir.'thumb_'.$remove_image_name);
						move_uploaded_file($_FILES['userfile']['tmp_name'], $logoimagedest);
						chmod($logoimagedest,0777);
						list($originalwidth, $originalheight, $originaltype) = getimagesize($logoimagedest);
						if($originalwidth<=510 and $originalheight<=118)
						{
															  ;
						}//end if
						else
						{
							   $resizedimage=$logoimagedest;
							   if($originalwidth >=510)
							   {
									 $imagewidth=510;
							   }//end if
							   else
							   {
									  $imagewidth=$originalwidth;
							   }//end else
							  if($originalheight >=118)
							  {
											  $imageheight=118;
							  }//end if
							  else
							  {
									 $imageheight=$originalheight;
							  }//end else
							  $objS->ResizeImageTogivenWitdhAndHeight($logoimagedest.$file_name,$imageheight,$imagewidth,$resizedimage);
					  }//end else
						
						//create logo thumb image  
						$objS->resizeImg2($logoimagedest, '219','73', false, '60', 0,"",$logoimagedest_thumb);
						
					}//end if
				}//end if
			}//end if
		}//end if

		$objS->set_values($_POST);
		$message = $objS->configure();
	}//end if
	else if (isset($_POST['btnSave2']) && $_POST['btnSave2']=='Save Settings') 
	{
		$objS->set_values($_POST);
		$message = $objS->configure2();
	}//end if
	else if (isset($_POST['btnSave3']) && $_POST['btnSave3']=='Save Settings') 
	{
		$objS->set_values($_POST);
		$message = $objS->configure3();
	}//end if
	else if (isset($_POST['btnSave4']) && $_POST['btnSave4']=='Save Settings') 
	{
		if($_FILES['frmpemyourfile']['name']!="")
		{
			$filename	=	$_FILES['frmpemyourfile']['name'];
			$blacklist  = array("php", "phtml", "php3", "php4", "js", "shtml", "pl" ,"py", "exe");
			foreach ($blacklist as $file)
			{
				if(preg_match("/\.$file\$/i", "$filename"))
				{
					$_SESSION['sessionMsg'] = " Please upload a pem file";
				}//end if
			}//end foreach
		}//end if

		if($_SESSION['sessionMsg'] == "")
		{
			@chmod('../pem/',0777);
			$up_path='../pem/'.$_FILES['frmpemyourfile']['name'];
			move_uploaded_file( $_FILES['frmpemyourfile']['tmp_name'], $up_path);			
		}//end if

		if($_POST['ddlPaymentMethod']=="CC")
		{
		   ob_start();
		   phpinfo(8);
		   $info = ob_get_contents();
		   ob_end_clean();
		   $info = stristr($info, 'curl');
		   preg_match('/\d/', $info, $match);
		   $curl_ver = $match[0];
			if($curl_ver=="")
			{
			  $message= "Curl support required.Please recompile your php with curl support" . "<br>";
			  $error = true;
		   }//end curl if
  		}//end if
		
		if($error!=true)
		{
			$objS->set_values($_POST);
			$message = $objS->configure4();
		}//end if
	}//end if
	else if (isset($_POST['btnSave5']) && $_POST['btnSave5']=='Save Settings') 
	{
		$objS->set_values($_POST);
		$message = $objS->configure5();
	}//end if
	else if (isset($_POST['btnSave7']) && $_POST['btnSave7']=='Save Settings') 
	{
		$objS->set_values($_POST);
		$message = $objS->configure7();
	}//end if
	else 
	{
		$array	= $objS->select();
		$objS->set_values($array);
	}//end else
	if (isset($_POST['COCD']) && $_POST['COCD']=='Clear Old Chat Data') 
	{
		$objS->clear_chat_table();
	}//end if
}//end else

$array	= $objS->select();
$objS->set_values($array);
$arrayFull	= $objS->select();

$ddlCurrency=($_POST['ddlCurrency']!='')?$_POST['ddlCurrency']:$arrayFull['currencycode'];
$ddlStyles=($_POST['ddlStyles']!='')?$_POST['ddlStyles']:$arrayFull['styles'];
$ddlPaymentMethod=($_POST['ddlPaymentMethod']!='')?$_POST['ddlPaymentMethod']:$arrayFull['paymentmethod'];

include_once('title.inc.php');
?>
<script language="javascript" type="text/javascript">
function validate()
{
	var frm	= document.frmSettings;
	
	if (frm.adminuser.value == "") {
		alert("Please enter username of the administrator.");
		frm.adminuser.focus();
		return false;
	}
	if (frm.adminmail.value == "") {
		alert("Please enter email address of the administrator.");
		frm.adminmail.focus();
		return false;
	}
	if (frm.sitename.value == "") {
		alert("Please enter name of the site.");
		frm.sitename.focus();
		return false;
	}
	if (frm.site_normal_url.value == "") {
		alert("Please enter normal url of the site.");
		frm.site_normal_url.focus();
		return false;
	}
	if (frm.site_secure_url.value == "") {
		alert("Please enter secure url of the site.");
		frm.site_secure_url.focus();
		return false;
	}
	if (frm.background_check_amount.value == "") {
		alert("Please enter amount for background check.");
		frm.background_check_amount.focus();
		return false;
	}
	if (frm.identity_verification_amount.value == "") {
		alert("Please enter amount of identity verification.");
		frm.identity_verification_amount.focus();
		return false;
	}
	if (frm.membership_amount.value == "") {
		alert("Please enter amount of membership.");
		frm.membership_amount.focus();
		return false;
	}
	if (frm.featured_amount.value == "") {
		alert("Please enter amount of featured membership.");
		frm.featured_amount.focus();
		return false;
	}
	
	if (frm.auth_loginid.value == "") {
		alert("Please enter login id of authorize account.");
		frm.auth_loginid.focus();
		return false;
	}
	
	if (frm.auth_txnkey.value == "") {
		alert("Please enter transaction key of authorize account.");
		frm.auth_txnkey.focus();
		return false;
	}
	if (frm.auth_email.value == "") {
		alert("Please enter email address of authorize account.");
		frm.auth_email.focus();
		return false;
	}
	if (frm.bc_user.value == "") {
		alert("Please enter username of backgroundcheck account.");
		frm.bc_user.focus();
		return false;
	}
	if (frm.bc_password.value == "") {
		alert("Please enter password of backgroundcheck account.");
		frm.bc_password.focus();
		return false;
	}
	if (frm.bc_account.value == "") {
		alert("Please enter account number of backgroundcheck account.");
		frm.bc_account.focus();
		return false;
	}
	
	if (frm.tellafriendmail.value == "") {
		alert("Please enter Tell A Friend Mail template.");
		frm.tellafriendmail.focus();
		return false;
	}

	
	return true;
}

function change_site()
{
	document.frmSettings.image.src=document.frmSettings.userfile.value;
}
function checkAdd()
{
	//if yes show the value portion
	if(document.getElementById('radGoogleAdsy').value=='yes')
	{
		document.getElementById('googleadvalue').style.display='';
	}//end if
}//end function

function checkAddN()
{
	if(document.getElementById('radGoogleAdsn').value=='no')
	{
		document.getElementById('googleadvalue').style.display='none';
	}//end if
}//end function

//Bookmark
function checkAddBookmark()
{
	//if yes show the value portion
	if(document.getElementById('radBookmarky').value=='Yes')
	{
		document.getElementById('BookmarkValue').style.display='';
	}//end if
}//end function

function checkAddBookmarkN()
{
	if(document.getElementById('radBookmarkn').value=='No')
	{
		document.getElementById('BookmarkValue').style.display='none';
	}//end if
}//end function

function showAuthMsg(ccode)
{
	if(ccode!='USD')
	{
		document.getElementById('showErrorMsg').style.display='';
	}//end if
	else
	{
		document.getElementById('showErrorMsg').style.display='none';
	}//end else
}//end function

function checkIdValue(nVal)
{
	if(nVal=='y')
	{
		document.getElementById('idVeryShow').style.display='';
	}//end if
	else
	{
		document.getElementById('idVeryShow').style.display='none';
	}//end else
}//end function

function checkPayMode(nVal)
{
	if(nVal=='p')
	{
		document.getElementById('idPMode').style.display='';
	}//end if
	else
	{
		document.getElementById('idPMode').style.display='none';
	}//end else
}//end function

//Payment method
function displayDetails(val)
{
	var frm = document.frmSettings4;

	document.getElementById('CC').style.display='none';
	document.getElementById('UP').style.display='none';
	document.getElementById('WP').style.display='none';

	if(val=='CC')
	{
		document.getElementById('CC').style.display='';
		document.getElementById('UP').style.display='none';
		document.getElementById('WP').style.display='none';
	}//end if
	if(val=='UP')
	{
		document.getElementById('CC').style.display='none';
		document.getElementById('UP').style.display='';
		document.getElementById('WP').style.display='none';
	}//end if
	if(val=='WP')
	{
		document.getElementById('CC').style.display='none';
		document.getElementById('UP').style.display='none';
		document.getElementById('WP').style.display='';
	}//end if

	/*for(i=0;i<frm.ddlPaymentMethod.options.length;i++)
	{
		if(frm.ddlPaymentMethod.options[i].value == val)
		{
			document.getElementById(frm.ddlPaymentMethod.options[i].value).style.display='';
		}//end if
		else
		{
			document.getElementById(frm.ddlPaymentMethod.options[i].value).style.display='none';
		}//end else
	}//end for loop*/
}//end function
</script>
<link href="../styles/tabcontent.css" type="text/css" rel="stylesheet">
<script language="javascript" type="text/javascript" src="../js/tabcontent.js"></script>
<script language="javascript" type="text/javascript" src="../js/template.js"></script>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" class="white"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="72%" valign="top"><?php include_once('tophtml.php');?>
          <table width="100%"  border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td><table width="100%"  border="0" cellspacing="0" cellpadding="5">
              <tr>
                <td width="41%" class="headings1">Site Settings </td>
                <td width="59%" class="headings1">&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table>
<ul id="maintab" class="shadetabs">
								<li class="selected"><a href="#" rel="tcontent1">Main</a></li>
								<li><a href="#" rel="tcontent2">Admin Profile</a></li>
								<li><a href="#" rel="tcontent3">Registration</a></li>
								<li><a href="#" rel="tcontent4">Payment</a></li>
								<li><a href="#" rel="tcontent5">Mail Template</a></li>
<?php
//if background checking is enable
if($arrayFull['bcheck']=='Yes')
{
?>
								<li><a href="#" rel="tcontent7">Background Settings</a></li>
<?php }//end if?>
								<li><a href="#" rel="tcontent6">Chat</a></li>
							</ul>
         <!-- tab content start here -->
<div class="tabcontentstyle">

	<div id="tcontent1" class="tabcontent">
		<form name="frmSettings" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" onSubmit="return validate();" enctype="multipart/form-data">
							<input type="hidden" name="remove_image_name" value="<?php echo $arrayFull['sitelogo'];?>">
                                <table width="100%"  border="0" cellspacing="0" cellpadding="5">
            <tr>
              <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr align="left">
                  <td height="40" align="center" class="maintext2"><strong class="boldtext">#</strong></td>
                  <td class="maintext2"><strong class="boldtext">Setting Name</strong></td>
                  <td colspan="2" class="maintext2Copy"><strong class="boldtext">Setting Value </strong></td>
                </tr>
				<?php
					if(isset($message) && $message!='')
					{
				?>
                <tr align="left">
                  <td align="center" class="maintext2">&nbsp;</td>
                  <td colspan="3" class="maintext2Copy warning"><?php echo $message;?></td>
                </tr>
				<?php }//end if?>
				<?php if (is_resource($objDB)) { ?>
                <tr align="left">
                  <td width="3%" align="center" class="maintext2">1</td>
                  <td width="34%" class="maintext2">Site Name</td>
                  <td colspan="2" class="maintext2Copy"><input name="sitename" type="text" value="<?php echo $objS->sitename?>" size="35" maxlength="100" class="textbox"></td>
                </tr>
                <tr align="left" valign="top">
                  <td align="center" class="maintext2">2</td>
                  <td class="maintext2">Site Logo</td>
                  <td width="30%" class="maintext2"><input type="file" name="userfile" onChange="change_site();" class="textbox"></td>
                  <td width="33%" class="maintext2Copy">&nbsp;&nbsp;<?php if($arrayFull['sitelogo']!=''){echo '<img src="../images/'.$arrayFull['sitelogo'].'" width="70" height="70" border="0" id="image" name="image">';}?></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">3</td>
                  <td class="maintext2">Site URL</td>
                  <td colspan="2" class="maintext2Copy"><input name="site_normal_url" type="text" value="<?php echo $objS->site_normal_url?>" size="35" maxlength="100" class="textbox3"></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">4</td>
                  <td class="maintext2">Site Secure URL</td>
                  <td colspan="2" class="maintext2Copy"><input name="site_secure_url" type="text" value="<?php echo $objS->site_secure_url?>" size="35" maxlength="100" class="textbox3"></td>
                </tr>
                <tr align="left" valign="top">
                  <td align="center" class="maintext2">5</td>
                  <td class="maintext2">Styles</td>
                  <td class="maintext2"><?php $objS->ShowTemplates($ddlStyles);?></td>
				  <td class="maintext2Copy">&nbsp;&nbsp;<span id="txtHint"></span></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">6</td>
                  <td width="34%" class="maintext2">Select Currency</td>
                  <td colspan="2" class="maintext2Copy"><select name="ddlCurrency" onChange="showAuthMsg(this.value);" class="textbox">
									<option value="USD" <?php if($ddlCurrency=='USD'){echo 'selected';}?>>U.S. Dollars</option>
									<option value="AUD" <?php if($ddlCurrency=='AUD'){echo 'selected';}?>>Australian Dollars</option>
									<option value="GBP" <?php if($ddlCurrency=='GBP'){echo 'selected';}?>>British Pounds</option>
									<option value="CAD" <?php if($ddlCurrency=='CAD'){echo 'selected';}?>>Canadian Dollars</option>
									<option value="CZK" <?php if($ddlCurrency=='CZK'){echo 'selected';}?>>Czech Koruna</option>
									<option value="DKK" <?php if($ddlCurrency=='DKK'){echo 'selected';}?>>Danish Kroner</option>
									<option value="EUR" <?php if($ddlCurrency=='EUR'){echo 'selected';}?>>Euros</option>
									<option value="HKD" <?php if($ddlCurrency=='HKD'){echo 'selected';}?>>Hong Kong Dollar</option>
									<option value="HUF" <?php if($ddlCurrency=='HUF'){echo 'selected';}?>>Hungarian Forint</option>
									<option value="ILS" <?php if($ddlCurrency=='ILS'){echo 'selected';}?>>Israeli New Shekels</option>
									<option value="JPY" <?php if($ddlCurrency=='JPY'){echo 'selected';}?>>Japanese Yen</option>
									<option value="MXN" <?php if($ddlCurrency=='MXN'){echo 'selected';}?>>Mexican Pesos</option>
									<option value="NZD" <?php if($ddlCurrency=='NZD'){echo 'selected';}?>>New Zealand Dollar</option>
									<option value="NOK" <?php if($ddlCurrency=='NOK'){echo 'selected';}?>>Norwegian Kroner</option>
									<option value="PLN" <?php if($ddlCurrency=='PLN'){echo 'selected';}?>>Polish Zlotych</option>
									<option value="SGD" <?php if($ddlCurrency=='SGD'){echo 'selected';}?>>Singapore Dollar</option>
									<option value="SEK" <?php if($ddlCurrency=='SEK'){echo 'selected';}?>>Swedish Kronor</option>
									<option value="CHF" <?php if($ddlCurrency=='CHF'){echo 'selected';}?>>Swiss Francs</option>
								</select></td>
                </tr>
                <tr align="left" id="showErrorMsg" style="<?php if($ddlCurrency=='USD'){echo 'display:none;';}?>">
                  <td align="center" class="maintext2">7</td>
                  <td class="maintext2">&nbsp;</td>
                  <td colspan="2" class="maintext2Copy"><b>Authorize.net will support only US Dollar</b></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">8</td>
                  <td class="maintext2">Email Type</td>
                  <td colspan="2" class="maintext2Copy"><input type="radio" name="radEmailType" value="html" <?php if($arrayFull['emailtype']=='html'){echo 'checked';}?>>HTML<input type="radio" name="radEmailType" value="text" <?php if($arrayFull['emailtype']=='text'){echo 'checked';}?>>TEXT</td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">9</td>
                  <td class="maintext2">Maximum number of images on profile (upload)</td>
                  <td colspan="2" class="maintext2Copy"><input name="txtMaxImg" type="text" value="<?php echo $arrayFull['maximgupload']?>" size="5" maxlength="100" class="textbox2"></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">10</td>
                  <td class="maintext2">Number of records per page</td>
                  <td colspan="2" class="maintext2Copy"><input name="txtNoRec" type="text" value="<?php echo $arrayFull['numberofrecords']?>" size="5" maxlength="100" class="textbox2"></td>
                </tr>
                <tr align="left" id="idVeryShow" style="<?php if($arrayFull['id_veryfy']=='No'){echo 'display:none;';}?>">
                  <td align="center" class="maintext2">11</td>
                  <td class="maintext2">Identity Verification Amount</td>
                  <td colspan="2" class="maintext2Copy">$
                                      <input name="identity_verification_amount" type="text" value="<?php echo $objS->identity_verification_amount?>" size="5" maxlength="10" class="textbox2">
									  <font size="-2"><strong>Note</strong>: <em>Inclusive of all taxes.</em></font></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">12</td>
                  <td class="maintext2">Featured Amount</td>
                  <td colspan="2" class="maintext2Copy">$
                                        <input name="featured_amount" type="text" value="<?php echo $objS->featured_amount?>" size="5" maxlength="10" class="textbox2">
										<font size="-2"><strong>Note</strong>: <em>Inclusive of all taxes.</em></font></td>
                </tr>
                <tr align="left" valign="top">
                  <td align="center" class="maintext2">13</td>
                  <td class="maintext2">Allowed Image Types (Comma Separated, no periods)<br>
                                      <span class="warning">* Give Content Types</span></td>
                  <td colspan="2" class="maintext2Copy"><input name="txtImageTypes" type="text" value="<?php echo $arrayFull['allowedimagetypes']?>" size="65" class="textbox3">
<br>
					Recommended Formats : gif,jpg,jpeg,png,image/gif,image/pjpeg ,image/jpeg,image/png,image/x-png,image/pjpeg,image/bmp</td>
                </tr>
                <!--<tr align="left">
                  <td class="maintext2">13</td>
                  <td class="maintext2">Enable/disable Member Plans</td>
                  <td colspan="2" class="maintext2Copy"><input type="radio" name="radUPlan" value="Yes" <?php if($arrayFull['userplans']=='Yes'){echo 'checked';}?>>Yes<input type="radio" name="radUPlan" value="No" <?php if($arrayFull['userplans']=='No'){echo 'checked';}?>>No</td>
                </tr>-->
                <tr align="left">
                  <td align="center" class="maintext2">14</td>
                  <td class="maintext2">Enable Member Feed</td>
                  <td colspan="2" class="maintext2Copy"><input type="radio" name="radFeed" value="Yes" <?php if($arrayFull['userfeed']=='Yes'){echo 'checked';}?>>Yes<input type="radio" name="radFeed" value="No" <?php if($arrayFull['userfeed']=='No'){echo 'checked';}?>>No</td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">15</td>
                  <td class="maintext2">Testimonials Approval Mode</td>
                  <td colspan="2" class="maintext2Copy"><input type="radio" name="radTestimonial" value="auto" <?php if($arrayFull['testimonialmode']=='auto'){echo 'checked';}?>>Auto Approval<input type="radio" name="radTestimonial" value="admin" <?php if($arrayFull['testimonialmode']=='admin'){echo 'checked';}?>>Admin Approval</td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">16</td>
                  <td class="maintext2">Enable affiliate program</td>
                  <td colspan="2" class="maintext2Copy"><input type="radio" name="radAffiliate" value="Yes" <?php if($arrayFull['affiliates']=='Yes'){echo 'checked';}?>>Yes<input type="radio" name="radAffiliate" value="No" <?php if($arrayFull['affiliates']=='No'){echo 'checked';}?>>No</td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">17</td>
                  <td class="maintext2">Enable identity varification</td>
                  <td colspan="2" class="maintext2Copy"><input type="radio" name="radIdVeryf" value="Yes" <?php if($arrayFull['id_veryfy']=='Yes'){echo 'checked';}?> onClick="checkIdValue('y');">Yes<input type="radio" name="radIdVeryf" value="No" <?php if($arrayFull['id_veryfy']=='No'){echo 'checked';}?> onClick="checkIdValue('n');">No</td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">18</td>
                  <td class="maintext2">Enable background check</td>
                  <td colspan="2" class="maintext2Copy"><input type="radio" name="radBChk" value="Yes" <?php if($arrayFull['bcheck']=='Yes'){echo 'checked';}?>>Yes<input type="radio" name="radBChk" value="No" <?php if($arrayFull['bcheck']=='No'){echo 'checked';}?>>No</td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">19</td>
                  <td class="maintext2">Profile Approval</td>
                  <td colspan="2" class="maintext2Copy"><input name="profile_approval" type="radio" value="AU" <?php echo $objS->profile_approval == "AU" ? "checked" : ""?>>
                                      <strong>Automatic</strong> 
                                        <input name="profile_approval" type="radio" value="EM" <?php echo $objS->profile_approval == "EM" ? "checked" : ""?>> 
                                        <strong>Email</strong> 
                                        <input name="profile_approval" type="radio" value="AD" <?php echo $objS->profile_approval == "AD" ? "checked" : ""?>> 
                                        <strong>Admin Approved</strong></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">20</td>
                  <td class="maintext2">Enable Google AdSense</td>
                  <td colspan="2" class="maintext2Copy"><input type="radio" name="radGoogleAds" id="radGoogleAdsy" value="yes" <?php if($arrayFull['googleaddemo']=='yes'){echo 'checked';}?> onClick="checkAdd();">Yes <input name="radGoogleAds" type="radio" id="radGoogleAdsn" onClick="checkAddN();" value="no" <?php if($arrayFull['googleaddemo']=='no'){echo 'checked';}?>>No</td>
                </tr>
                <tr align="left" valign="top" id="googleadvalue" style="<?php if($arrayFull['googleaddemo']=='no'){echo 'display:none;';}?>">
                  <td align="center" class="maintext2">21</td>
                  <td class="maintext2">Google AdSense Code</td>
                  <td colspan="2" class="maintext2Copy"><textarea name="txtGoogleValue" rows="8" cols="45" class="textbox_textarea"><?php echo $arrayFull['googleadvalue'];?></textarea></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">22</td>
                  <td class="maintext2">Enable Social Bookmark</td>
                  <td colspan="2" class="maintext2Copy"><input type="radio" name="radBookmark" id="radBookmarky" value="Yes" <?php if($arrayFull['bookmark_enable']=='Yes'){echo 'checked';}?> onClick="checkAddBookmark();">Yes <input name="radBookmark" type="radio" id="radBookmarkn" onClick="checkAddBookmarkN();" value="No" <?php if($arrayFull['bookmark_enable']=='No'){echo 'checked';}?>>No</td>
                </tr>
                <tr align="left" valign="top" id="BookmarkValue" style="<?php if($arrayFull['bookmark_enable']=='No'){echo 'display:none;';}?>">
                  <td align="center" class="maintext2">23</td>
                  <td class="maintext2">Bookmark Value</td>
                  <td colspan="2" class="maintext2Copy"><textarea name="txtBookmarkValue" rows="8" cols="45" class="textbox_textarea"><?php echo $arrayFull['bookmark_value'];?></textarea><br><br>
				  You can get your Bookmark Value from here : http://www.addthis.com/</td>
                </tr>
                <tr align="left" valign="top">
                  <td align="center" class="maintext2">24</td>
                  <td class="maintext2">Default Meta Keywords</td>
                  <td colspan="2" class="maintext2Copy"><textarea name="txtKeyword" cols="75" rows="8" class="textbox_textarea"><?php echo $arrayFull['metatagKey'];?></textarea></td>
                </tr>
                <tr align="left" valign="top">
                  <td align="center" class="maintext2">25</td>
                  <td class="maintext2">Default Meta Description</td>
                  <td colspan="2" class="maintext2Copy"><textarea name="txtDescription" cols="75" rows="8" class="textbox_textarea"><?php echo $arrayFull['metatagDes'];?></textarea></td>
                </tr>
				<?php }//end 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 (is_resource($objDB)) { ?>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td align="center"><table width="16%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><input type="submit" class="loginbutton" name="SetNow" value="Save Settings"></td>
                              <td><input name="btnReset" type="reset" class="signupbutton" value="Clear"></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table><?php }//end if?></td>
                  </tr>
                </table></td>
            </tr>
          </table>
                            </form>
	</div>
	
	<div id="tcontent2" class="tabcontent">
		<form name="frmSettings" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" onSubmit="return validate();">
                              <table width="100%"  border="0" cellspacing="0" cellpadding="5">
            <tr>
              <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr align="left">
                  <td height="40" align="center" class="maintext2"><strong class="boldtext">#</strong></td>
                  <td class="maintext2"><strong class="boldtext">Setting Name</strong></td>
                  <td class="maintext2Copy"><strong class="boldtext">Setting Value </strong></td>
                </tr>
				<?php
					if(isset($message) && $message!='')
					{
				?>
                <tr align="left">
                  <td align="center" class="maintext2">&nbsp;</td>
                  <td colspan="2" class="maintext2Copy warning"><?php echo $message;?></td>
                </tr>
				<?php }//end if?>
				<?php if (is_resource($objDB)) { ?>
                <tr align="left">
                  <td width="3%" align="center" class="maintext2">1</td>
                  <td width="27%" class="maintext2">Admin Username</td>
                  <td width="70%" class="maintext2Copy"><input name="adminuser" type="text" value="<?php echo $objS->adminuser?>" size="35" maxlength="100" class="textbox"></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">2</td>
                  <td class="maintext2">Admin Password</td>
                  <td class="maintext2Copy"><input name="adminpassword" type="password" size="35" class="textbox">
                                      <STRONG>Note:</STRONG> <EM>Entering a password here will reset the existing   password. </EM></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">3</td>
                  <td class="maintext2">Admin Email</td>
                  <td class="maintext2Copy"><input name="adminmail" type="text" value="<?php echo $objS->adminmail?>" size="35" maxlength="100" class="textbox"></td>
                </tr>
				<?php }//end 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 (is_resource($objDB)) { ?>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td align="center"><table width="16%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><input type="submit" class="loginbutton" name="btnSave2" value="Save Settings"></td>
                              <td><input name="btnReset" type="reset" class="signupbutton" value="Clear"></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table><?php }//end if?>
                    </td>
                  </tr>
                </table></td>
            </tr>
          </table>
                            </form>
	</div>
	
	<div id="tcontent3" class="tabcontent">
		<form name="frmSettings" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" onSubmit="return validate();">
                               <table width="100%"  border="0" cellspacing="0" cellpadding="5">
            <tr>
              <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr align="left">
                  <td height="40" align="center" class="maintext2"><strong class="boldtext">#</strong></td>
                  <td class="maintext2"><strong class="boldtext">Setting Name</strong></td>
                  <td class="maintext2Copy"><strong class="boldtext">Setting Value </strong></td>
                </tr>
				<?php
					if(isset($message) && $message!='')
					{
				?>
                <tr align="left">
                  <td align="center" class="maintext2">&nbsp;</td>
                  <td colspan="2" class="maintext2Copy warning"><?php echo $message;?></td>
                </tr>
				<?php }//end if?>
				<?php if (is_resource($objDB)) { ?>
                <tr align="left">
                  <td width="3%" align="center" class="maintext2">1</td>
                  <td width="27%" class="maintext2">Payment Mode</td>
                  <td width="70%" class="maintext2Copy"><input type="radio" name="radPayMode" value="Free" <?php if($arrayFull['regmode']=='Free'){echo 'checked';}?> onClick="checkPayMode('f');">Free<input type="radio" name="radPayMode" value="Paid" <?php if($arrayFull['regmode']=='Paid'){echo 'checked';}?> onClick="checkPayMode('p');">Paid</td>
                </tr>
                <tr align="left" id="idPMode" style="<?php if($arrayFull['regmode']=='Free'){echo 'display:none;';}?>">
                  <td align="center" class="maintext2">2</td>
                  <td class="maintext2">Membership Amount</td>
                  <td class="maintext2Copy">$
                                      <input name="membership_amount" type="text" value="<?php echo $objS->membership_amount?>" size="5" maxlength="10" class="textbox2">
									  <font size="-2"><strong>Note</strong>:<em> Inclusive of all taxes</em>.</font></td>
                </tr>
				<?php }//end 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 (is_resource($objDB)) { ?>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td align="center"><table width="16%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><input type="submit" class="loginbutton" name="btnSave3" value="Save Settings"></td>
                              <td><input name="btnReset" type="reset" class="signupbutton" value="Clear"></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table><?php }//end if?>
                    </td>
                  </tr>
                </table></td>
            </tr>
          </table>
                            </form>
	</div>
	
	<div id="tcontent4" class="tabcontent">
				<form name="frmSettings4" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" onSubmit="return validate();">
                                <table width="100%"  border="0" cellspacing="0" cellpadding="5">
            <tr>
              <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr align="left">
                  <td height="40" align="center" class="maintext2"><strong class="boldtext">#</strong></td>
                  <td width="27%" class="maintext2"><strong class="boldtext">Setting Name</strong></td>
                  <td width="70%" class="maintext2Copy"><strong class="boldtext">Setting Value </strong></td>
                </tr>
				<?php
					if(isset($message) && $message!='')
					{
				?>
                <tr align="left">
                  <td align="center" class="maintext2">&nbsp;</td>
                  <td colspan="2" class="maintext2Copy warning"><?php echo $message;?></td>
                </tr>
				<?php }//end if?>
				<?php if (is_resource($objDB)) { ?>
                <tr align="left">
                  <td width="3%" align="center" class="maintext2">1</td>
                  <td colspan="2" class="maintext2Copy"><strong>Paypal</strong></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">2</td>
                  <td valign="top" class="maintext2">Get A New PayPal Account</td>
                  <td valign="top" class="maintext2Copy"><a href="https://www.paypal.com/us/mrb/pal=NCGEZ2VF6YL62" target="_blank"><img src="../images/paypal_small.jpg" width="77" height="30" border="0" alt="Get A New PayPal Account" title="Get A New PayPal Account"></a></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">3</td>
                  <td valign="top" class="maintext2">Enable Paypal?</td>
                  <td valign="top" class="maintext2Copy"><input type="checkbox" id="chkPaypal" name="chkPaypal" <?php if (isset($arrayFull['enablepaypal']) and ($arrayFull['enablepaypal'] == "Y")) {    echo " CHECKED ";} ?>>&nbsp;
			      <br><input type="checkbox" id="chkSandbox" name="chkSandbox" <?php if (isset($arrayFull['enablepaypalsandbox']) and ($arrayFull['enablepaypalsandbox'] == "N")) {    echo " CHECKED ";} ?>>&nbsp;Check To Make Paypal Live (Uncheck To Make Paypal Test Mode)</td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">4</td>
                  <td valign="top" class="maintext2">Paypal Email Address</td>
                  <td valign="top" class="maintext2Copy"><input name="txtPaypalEmail" type="text" value="<?php echo $arrayFull['paypalemail'];?>" size="35" maxlength="100" class="textbox"></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">5</td>
                  <td valign="top" class="maintext2">Paypal Identity Token</td>
                  <td valign="top" class="maintext2Copy"><input name="txtPaypalAuthToken" type="text" value="<?php echo $arrayFull['paypalauthtokenid'];?>" size="35" maxlength="100" class="textbox"></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">6</td>
                  <td colspan="2" valign="top" class="maintext2Copy"><strong>Google Checkout </strong></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">7</td>
                  <td valign="top" class="maintext2">Get A New Google Checkout Account</td>
                  <td valign="top" class="maintext2Copy">&nbsp;</td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">8</td>
                  <td valign="top" class="maintext2">Enable Google Checkout?</td>
                  <td valign="top" class="maintext2Copy"><input type="checkbox" id="chkGoogle" name="chkGoogle" <?php if (isset($arrayFull['enablegoogle']) and ($arrayFull['enablegoogle'] == "Y")) {    echo " CHECKED ";} ?>>
					  <br><br><input type="checkbox" id="chkGoogleSandbox" name="chkGoogleSandbox" <?php if (isset($arrayFull['enablegooglesandbox']) and ($arrayFull['enablegooglesandbox'] == "NO")) {    echo " CHECKED ";} ?>>&nbsp;Check To Make Google Live (Uncheck To Make Google Sandbox/Test Mode)</td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">9</td>
                  <td valign="top" class="maintext2">GoogleMerchant ID</td>
                  <td valign="top" class="maintext2Copy"><input name="txtGoogleId" type="text" value="<?php echo $arrayFull['googleid'];?>" size="35" maxlength="100" class="textbox"></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">10</td>
                  <td valign="top" class="maintext2">Google Merchant Key</td>
                  <td valign="top" class="maintext2Copy"><input name="txtGoogleKey" type="text" value="<?php echo $arrayFull['googlekey'];?>" size="35" maxlength="100" class="textbox"></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">11</td>
                  <td colspan="2" valign="top" class="maintext2Copy"><strong>Payment </strong></td>
                </tr>
                <tr align="left">
                  <td align="center" class="maintext2">12</td>
                  <td valign="top" class="maintext2">Payment Gateway</td>
                  <td valign="top" class="maintext2Copy"><select name="ddlPaymentMethod" onChange="javascript:displayDetails(this.value);" class="textbox">
						<option value='NN'>None</option>
						<option value='CC' <?php if ($ddlPaymentMethod=="CC") {echo " SELECTED ";}?>>Authorize.net</option>
						<option value='WP' <?php if ($ddlPaymentMethod=="WP") {echo " SELECTED ";}?>>Worldpay</option>
						<option value='UP' <?php if ($ddlPaymentMethod=="UP") {echo " SELECTED ";}?>>Yourpay</option>
						</select></td>
                </tr>
                <tr align="left" valign="top">
                  <td align="center" class="maintext2">13</td>
                  <td colspan="2" valign="top" class="maintext2Copy"><div id="UP" <?php if ($ddlPaymentMethod!="UP") { echo "style=display:none";} ?>>
						 	<table width="100%"  border="0" cellpadding="5" cellspacing="1" class="maintext">
								<tr>
									<td align="right">Get A New YourPay Account </td>
								    <td><a href="http://www.firstdata.com/yourpay/" target="_blank"><img src="../images/yourpay_small.jpg" width="63" height="16" border="0" alt="Get A New YourPay Account" title="Get A New YourPay Account"></a></td>
								</tr>
								<tr>
									<td align="right">Yourpay Store Id</td>
									<td align="left"><input type="text" value="<?php echo $arrayFull['urpaystoreid'];?>" name="txtYourpayStoreId" size="30" maxlength="100" class="textbox"> </td>
								</tr>
								<?php
								  $enablechecked2="";
								  if($arrayFull['urpaydemo']=="NO" or $_POST['txtUrPayDemo']=="1")
								    $enablechecked2="checked";
								?>
								<tr>
									<td align="right">&nbsp;</td>
									<td align="left"><input type="checkbox"  value="1" name="txtUrPayDemo" <?php echo $enablechecked2?>> Check To Make Yourpay Live (Uncheck To Make Yourpay Test Mode)</td>
								</tr>
								<tr>
									<td align="right">Pem File</td>
									<td align="left"><input type="file" name="frmpemyourfile" class="textbox">
									<input type="hidden" value="<?php echo $arrayFull['pemfolder'];?>" name="frmpemyourfile2"></td>
								</tr>
							</table>
						 </div>
							<div id="CC" <?php if ($ddlPaymentMethod!="CC") {    echo "style=display:none";} ?>>
<?php
if(PAYMENT_CURRENCY_CODE=='USD')
{
?>
						 	<table width="100%"  border="0" cellpadding="5" cellspacing="1" class="maintext">
								<tr>
									<td align="right">Get A New Authorize.net Account</td>
								    <td><a href="http://www.authorize.net/" target="_blank"><img src="../images/authorize_small.jpg" width="49" height="36" border="0" alt="Get A New Authorize.net Account" title="Get A New Authorize.net Account"></a></td>
								</tr>
								<tr>
								  <td align="right">Authorize.net Demo</td>
								  <td align="left"><input type="checkbox" name="auth_demo" value="YES" <?php echo $objS->auth_demo == "YES" ? "checked" : ""?>> Check To Make Authorize.net Live (Uncheck To Make Authorize.net Test Mode)</td>
							  </tr>
								<tr>
									<td align="right">Authorize.net Login</td>
									<td align="left"><input name="auth_loginid" type="text" value="<?php echo $objS->auth_loginid?>" size="35" maxlength="100" class="textbox"></td>
								</tr>
								<tr>
									<td align="right">Authorize.net Password</td>
									<td align="left"><input name="auth_pass" type="text" value="<?php echo $objS->auth_pass?>" size="35" maxlength="100" class="textbox"></td>
								</tr>
								<tr>
									<td align="right">Authroze.net Key</td>
									<td align="left"><input name="auth_txnkey" type="text" value="<?php echo $objS->auth_txnkey?>" size="35" maxlength="100" class="textbox"></td>
								</tr>
								<tr>
								  <td align="right">Authorize.net Email</td>
								  <td align="left"><input name="auth_email" type="text" value="<?php echo $objS->auth_email?>" size="35" maxlength="100" class="textbox"></td>
							  </tr>
							</table>
<?php
}//end if?>
						 </div>
						<div id="WP" <?php if ($ddlPaymentMethod!="WP") {    echo "style=display:none";} ?>>
						 	<table width="100%"  border="0" cellpadding="5" cellspacing="1" class="maintext">
								<tr>
									<td align="right">Get A New WorldPay Account</td>
								    <td><a href="http://www.worldpay.com/" target="_blank"><img src="../images/worldpay_small.jpg" width="78" height="20" border="0" alt="Get A New WorldPay Account" title="Get A New WorldPay Account"></a></td>
								</tr>
								<tr>
								  <td align="right">Worldpay Demo</td>
								  <td align="left"><input type="checkbox" name="radWorldPayDemo" value="YES" <?php echo $arrayFull['worldpaydemo'] == "YES" ? "checked" : ""?>> Check To Make WorldPay Live (Uncheck To Make WorldPay Test Mode)</td>
							  </tr>
								<tr>
									<td align="right">Worldpay Installation Id</td>
									<td align="left"><input name="txtWorldpayInstId" type="text" value="<?php echo $arrayFull['worldpayid'];?>" size="35" maxlength="100" class="textbox"></td>
								</tr>
								<tr>
									<td align="right">Worldpay Email Address</td>
									<td align="left"><input name="txtWorldpayEmail" type="text" value="<?php echo $arrayFull['worldpayemail'];?>" size="35" maxlength="100" class="textbox"></td>
								</tr>
								<tr>
									<td align="right">Transaction Method</td>
									<td align="left"><input name="radWTransactMethod" type="radio" value="A" <?php if($arrayFull['worldpaytransmode']=="A") { echo "checked"; }?>>
												 AUTHORISED 
											      <input name="radWTransactMethod" type="radio" value="C" <?php if($arrayFull['worldpaytransmode']=="C") { echo "checked"; } ?>>CAPTURED</td>
								</tr>
							</table>
						 </div></td>
                </tr>
				<?php }//end 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 (is_resource($objDB)) { ?>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td align="center"><table width="16%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><input type="submit" class="loginbutton" name="btnSave4" value="Save Settings"></td>
                              <td><input name="btnReset" type="reset" class="signupbutton" value="Clear"></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table><?php }//end if?>
                    </td>
                  </tr>
                </table></td>
            </tr>
          </table>
                            </form>
	</div>

	<div id="tcontent5" class="tabcontent">
		<form name="frmSettings" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" onSubmit="return validate();">
                                <table width="100%"  border="0" cellspacing="0" cellpadding="5">
            <tr>
              <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr align="left">
                  <td height="40" align="center" class="maintext2"><strong class="boldtext">#</strong></td>
                  <td class="maintext2"><strong class="boldtext">Setting Name</strong></td>
                  <td class="maintext2Copy"><strong class="boldtext">Setting Value </strong></td>
                </tr>
				<?php
					if(isset($message) && $message!='')
					{
				?>
                <tr align="left">
                  <td align="center" class="maintext2">&nbsp;</td>
                  <td colspan="2" class="maintext2Copy warning"><?php echo $message;?></td>
                </tr>
				<?php }//end if?>
				<?php if (is_resource($objDB)) { ?>
                <tr align="left" valign="top">
                  <td width="3%" align="center" class="maintext2">1</td>
                  <td width="27%" class="maintext2">Tell A Friend Mail Template</td>
                  <td width="70%" class="maintext2Copy"><textarea name="tellafriendmail" cols="85" rows="10" class="textbox_textarea"><?php echo htmlspecialchars($objS->tellafriendmail)?></textarea></td>
                </tr>
				<?php }//end 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 (is_resource($objDB)) { ?>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td align="center"><table width="16%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><input type="submit" class="loginbutton" name="btnSave5" value="Save Settings"></td>
                              <td><input name="btnReset" type="reset" class="signupbutton" value="Clear"></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table><?php }//end if?>
                    </td>
                  </tr>
                </table></td>
            </tr>
          </table>
                            </form>
	</div>

	<div id="tcontent6" class="tabcontent">
		<form name="frmChats" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
				<table width="100%"  border="0" cellspacing="0" cellpadding="5">
            <tr>
              <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
				<?php
					if(isset($message) && $message!='')
					{
				?>
                <tr align="left">
                  <td align="center" class="maintext2">&nbsp;</td>
                  <td colspan="2" class="maintext2Copy  warning"><?php echo $message;?></td>
                </tr>
				<?php }//end if?>
				<?php if (is_resource($objDB)) { ?>
                <tr align="left">
                  <td width="3%" align="center" class="maintext2">&nbsp;</td>
                  <td colspan="2" class="maintext2Copy ">Clean Chat Table</td>
                </tr>
				<?php }//end 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 (is_resource($objDB)) { ?>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td align="center"><table width="11%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><input name="COCD" type="submit" id="COCD" value="Clear Old Chat Data" class="loginbutton"></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table><?php }//end if?>
                    </td>
                  </tr>
                </table></td>
            </tr>
          </table>
			</form>
	</div>
<?php
//if background checking is enable
if($arrayFull['bcheck']=='Yes')
{
?>
	<div id="tcontent7" class="tabcontent">
		<form name="frmSettings" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" onSubmit="return validate();">
                               <table width="100%"  border="0" cellspacing="0" cellpadding="5">
            <tr>
              <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr align="left">
                  <td height="40" align="center" class="maintext2"><strong class="boldtext">#</strong></td>
                  <td class="maintext2"><strong class="boldtext">Setting Name</strong></td>
                  <td class="maintext2Copy"><strong class="boldtext">Setting Value </strong></td>
                </tr>
				<?php
					if(isset($message) && $message!='')
					{
				?>
                <tr align="left">
                  <td align="center" class="maintext2">&nbsp;</td>
                  <td colspan="2" class="maintext2Copy warning"><?php echo $message;?></td>
                </tr>
				<?php }//end if?>
				<?php if (is_resource($objDB)) { ?>
                <tr align="left">
                  <td width="3%" align="center" class="maintext2">1</td>
                  <td width="27%" class="maintext2">Background Check Amount</td>
                  <td width="70%" class="maintext2Copy">$
                                      <input name="background_check_amount" type="text" value="<?php echo $objS->background_check_amount?>" size="5" maxlength="10" class="textbox2">
									  <font size="-2"><strong>Note:</strong> <em>Inclusive of all taxes.</em></font></td>
                </tr>
                <tr align="left" valign="top">
                  <td align="center" class="maintext2">2</td>
                  <td class="maintext2">Background Check Settings</td>
                  <td class="maintext2Copy"><table width="80%"  border="0" cellpadding="5" cellspacing="0" class="maintext">
                                        <tr id="mobilealert1">
                                          <td width="16%" align="left"><strong>Username</strong></td>
                                          <td width="84%" colspan="2" align="left"><input type="text" value="<?php echo $objS->bc_user?>" name="bc_user" id="bc_user" size="35" maxlength="100" class="textbox"></td>
                                        </tr>
                                        <tr id="mobilealert2">
                                          <td align="left"><strong>Password</strong></td>
                                          <td colspan="2" align="left"><input type="text" value="<?php echo $objS->bc_password?>" name="bc_password" id="bc_password" size="35" maxlength="100" class="textbox"></td>
                                        </tr>
                                        <tr id="mobilealert3" >
                                          <td align="left"><strong>Account</strong></td>
                                          <td colspan="2" align="left"><input type="text" value="<?php echo $objS->bc_account?>" name="bc_account" id="bc_account" size="35" maxlength="100" class="textbox"></td>
                                        </tr>
                  </table></td>
                </tr>
				<?php }//end 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 (is_resource($objDB)) { ?>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td align="center"><table width="16%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><input type="submit" class="loginbutton" name="btnSave7" value="Save Settings"></td>
                              <td><input name="btnReset" type="reset" class="signupbutton" value="Clear"></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table><?php }//end if?>
                    </td>
                  </tr>
                </table></td>
            </tr>
          </table>
                            </form>
	</div>
<?php }//end if?>
</div>

<script type="text/javascript">
//Start Tab Content script for UL with id="maintab" Separate multiple ids each with a comma.
initializetabcontent("maintab")
</script>
<!-- tab contents ends here --></td>
        </tr>
    </table>      
    </td>
  </tr>
</table>
<?php include_once('bottomhtml.php');?>