<!-- Script PHP/MYSQL of management of classifieds ads developed by Script PAG Script PAG all rights reserved. Use under license. http://www.script-pag.com -->
<?php

	$vals = '';
	$val_price = 0;
	$i = 0;
	
	foreach($cache_credits as $v)
	{
		$credits = (int) $v['credits'];
		$discount = (int) $v['discount'];
		$offer = (!empty($discount)) ? ' <span class="offer"> + '. $discount .' '. $param_gen['currency'] .' '. $language['account_dashboard_credit_offered'] .'</span>' : '';
		$total = $credits + $discount;
		
		if($i == 0)
		{
			$vals .= '<a href="javascript:void(0)" class="selected" data-price="'. $total .'" onclick="changeCredit(\''. $credits .'\', \''. $total .'\', 0);"><span>'. $credits .' '. $param_gen['currency'] .' '. $offer .'</span></a>';
			$val_price = $credits;
			$val_credits = $total;
		}
						
		else $vals .= '<a href="javascript:void(0)" data-price="'. $total .'" onclick="changeCredit(\''. $credits .'\', \''. $total .'\', 0);"><span>'. $credits .' '. $param_gen['currency']  .' '. $offer .'</span></a>';
			
		$i++;
	}
	
?>
<div class="container-100">
	<div class="container-100-child forms credits">
	
		<h1><?php echo $info_page; ?></h1>
		<form method="post" action="">
				
		    <div>
			    
			    <h3><?php echo $language['account_dashboard_credit_title2']; ?></h3>
				<p><?php echo $language['account_dashboard_credit_amount']; ?></p>
				            
		        <input type="hidden" value="<?php echo $val_price; ?>" name="select_credit" id="select_credit" />  
		        <input type="hidden" value="<?php echo $val_credits; ?>" name="total_credit" id="total_credit" />
		        
		        <p class="flex-container"><?php echo $vals; ?></p>
		        
				<p><?php echo $language['account_dashboard_credit_balance']; ?><span class="info_form" id="credit_1"><?php echo $acc_credit;?></span> <?php echo $param_gen['currency']; ?></p>        
			    <p><?php echo $language['account_dashboard_credit_credited']; ?><span class="info_form" id="credit_2">0</span> <?php echo $param_gen['currency']; ?></p>
				<p class="bold"><?php echo $language['account_dashboard_credit_balance_new']; ?><span class="info_form" id="credit_3">0</span> <?php echo $param_gen['currency']; ?></p>
				
		    </div>
		    
			<input type="submit" value="<?php echo $language['bt_submit']; ?>" />
		
		</form>

	</div>
</div>