<?php
if (!defined("WHMCS")) {
	exit("This file cannot be accessed directly");
}
$query = "SELECT * FROM `tblpricing` WHERE type = 'product' && relid = ".$_POST['productid'];

$result = full_query($query);

$apiresults = array();

while ($data = mysql_fetch_array($result)) {
	$rows['monthly']['pricesetup'] = $data['msetupfee'];
	$rows['monthly']['price'] = $data['monthly'];
	$rows['monthly']['title'] = 'Monthly';
	
	$rows['quarterly']['pricesetup'] = $data['qsetupfee'];
	$rows['quarterly']['price'] = $data['quarterly'];
	$rows['quarterly']['title'] = '1 Year';	
	
	$rows['semiannually']['pricesetup'] = $data['ssetupfee'];
	$rows['semiannually']['price'] = $data['semiannually'];
	$rows['semiannually']['title'] = '2 Years';
		
	$rows['annually']['pricesetup'] = $data['asetupfee'];
	$rows['annually']['price'] = $data['annually'];
	$rows['annually']['title'] = '3 Years';
		
	$rows['biennially']['pricesetup'] = $data['bsetupfee'];
	$rows['biennially']['price'] = $data['biennially'];
	$rows['biennially']['title'] = '4 Years';	
	
	$rows['triennially']['pricesetup'] = $data['tsetupfee'];
	$rows['triennially']['price'] = $data['triennially'];					
	$rows['triennially']['title'] = '5 Years';	
	
	$apiresults = $rows;
}
?>