<?php 
/*
##################################################################
#                       PHP 4&5 MySQL 4&5                        #
##################################################################
#           Copyright (c) 2004-2008 Armia Systems Inc            #
##################################################################
#               This file is part of Cybermatch site             #
##################################################################
#    Developed By: simi (simi@armia.com)                         #

##################################################################
#               Developed On:   03-23-2009                       #
##################################################################
#               Modified By:                                     #
##################################################################
#               Modified On:                                     #
##################################################################
# This script may not be distributed, sold, given away for free  #
# to third party, or used as a part of any internet services 	 #
# such as webdesign etc.                                         #
##################################################################
*/

require_once ("config.inc.php");
require_once ("includes/userlogincheck.inc.php");
require_once ("includes/mysql.inc.php");
require_once ("includes/arrays.inc.php");
require_once ("classes/settings.class.php");
require_once ("classes/userside.class.php");
require_once ("classes/misc.class.php");

$objU           =   new userside($objDB);
$objM		= new misc($objDB);
$array	= $objU->select($_SESSION['user_id']);
//if session exist clear session
if(isset($_SESSION['sess_buy_credits']) && $_SESSION['sess_buy_credits']!=''){
	$_SESSION['sess_buy_credits']='';
}//end if
include_once ("title.inc.php");
include_once ("tophtml.inc.php");      

if($siteSettings['regmode']==REGISTRATION_FREE_MODE)
{
    header("location:index.php");exit;
}
$creditValue    = $siteSettings['credit_value'];
$memberShipAmt = $siteSettings['membership_amount'];
$creditRequired = $memberShipAmt/$creditValue;
switch($siteSettings['ValidityDayMembership'])
{
	case "1":
		$showValidtyDay='single';
	break;
	default:
		$showValidtyDay=$siteSettings['ValidityDayMembership'];
	break;
}//end switch
?>
<div class="row">
	<div class="eight columns">
		<div class="search-rslts">
			<div class="row"><div class="inenr-hd"><h2>Buy Credits</h2></div></div>
                        <div class="row">
				<h2 class="headings2 buy_creadit_head" style="float:right;">My Credit Balance : <span><?php echo $array['nCredits']; ?></span></h2>
			</div>
			<div class="row">
				<h2 class="headings2 buy_creadit_top"><b>One credit = $<?php echo $creditValue;?></b><br/>Using credits you can maintain your account. To renew your account for a period of <?php echo $showValidtyDay;?> days you need to buy <?php echo $creditRequired;?> credits. </h2>
			</div>
			<div class="row">			
				<form name="frmStep1" method="post" action="<?php echo $objU->SecureUrl();?>/buy_now.php">
					<input type="hidden" name="showmsgtype" value="buy_credits">
					<div class="newdesignforinput maintext1">
						<?php if(isset($message) && trim($message)!='')
							  {
						?>
						<div class="full_row">
							<div class="maintext1 warning"><?php echo $message;?></div>
						</div>
						<?php }//end if?>
						
						<div class="full_row">
							<div class="three columns">Select Credits</div>
							<div class="five columns margin_R_200">
								<select name="ddlCredits" class="selectbox" >
									<?php for($i=1;$i<101;$i++){ ?>
									<option value="<?php echo $i;?>"><?php echo $i;?></option>
									<?php } ?>
								</select>
							</div>
						</div>
						<div class="full_row">
							<div class="three columns">&nbsp;</div>
							<div class="five columns margin_R_200">
								<input name="CON1" type="submit" class="loginbutton" value="Buy Now"><input type="hidden" name="step" value="3">
							</div>
						</div>
						<div id="hide"><?php echo $script?></div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="four columns right search_result_R">
		<?php include_once ("left.inc.php");?>
	</div>
</div>

<?php include_once('bottomhtml.inc.php');?>
