<?php
$pgMod="fee_structure";
$pgAct="view";
if(isset($_GET['action']) && trim($_GET['action'])!='')
		$pgAct=strtolower($_GET['action']);

  if($_POST)
    {

		      $ch = curl_init();
   
        $data = array("fee"=>$_POST['fee'],"cnvc"=>$_POST['cnvc'],
        "tax"=>$_POST['tax'],
        "total_amount"=>$_POST['total_amount'],);

        $url = "https://bps.savarnacloudtech.com/api/fee.php";
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
        $responce = curl_exec($ch);

        redirect(URL_ADMIN_HOME.getQueryString(array("src"=>"website", "page_id"=>$pgMod)));

}		


if(isset($_SESSION['msg']) && $_SESSION['msg']!="")
{
	?>
	<div class="alert alert-success">
	  <a class="close" data-dismiss="alert">×</a>
	  <i class="icon icon-thumbs-up-alt"></i> <b>Notice</b><?php echo $_SESSION['msg'] ?></i>
	</div>
	<?php
	unset($_SESSION["msg"]);
}
if(is_array($alert_err) && count($alert_err)>0)
{
	?>
	<div class="alert alert-error">
	  <a class="close" data-dismiss="alert">×</a>
	  <i class="icon icon-warning-sign"></i> <b>Notice</b> <?php echo $alert_err[0] ?></i>
	</div>
	<?php
}

//	echo "<pre>";print_r($aryForm);echo "</pre>".$aryForm['root'];exit;
?>
<!-- Forms --> 
	<div class="row-fluid">
        <form method="post" action="" enctype="multipart/form-data">
			<!-- Forms: Box -->
			<div class="span12">

				<!-- Forms: Top Bar -->
				<div class="top-bar">
					<h3><i class="icon-cog"></i> Fee Structure</h3>
				</div>
				<!-- / Forms: Top Bar -->

				<!-- Forms: Content -->
				<div class="well no-padding">

						
                        <?php
                     $aryPgAct=array("src"=>"website", "page_id"=>$pgMod,"action"=>"add");

            $url = "https://bps.savarnacloudtech.com/api/get_fee.php";

            $context  = stream_context_create($options);
            $result = file_get_contents($url, false, $context);

            $aryForm = json_decode($result,true);
                        ?>
                       
                        <div class="control-group">
							<label class="control-label" for="heading">Fee Amount</label>
							<div class="controls">
								<input type="text" id="image" name="fee" class="input-block-level" value="<?php echo $aryForm['fee'] ?>" >
							</div>
						</div>
                        <div class="control-group">
							<label class="control-label" for="heading">Convenience Fee</label>
							<div class="controls">
								<input type="text" id="image" name="cnvc" class="input-block-level" value="<?php echo $aryForm['cnvc'] ?>" >
							</div>
						</div>   
						<div class="control-group">
							<label class="control-label" for="heading">G.S.T</label>
							<div class="controls">
								<input type="text" id="image" name="tax" class="input-block-level" value="<?php echo $aryForm['tax'] ?>" >
							</div>
						</div>    <div class="control-group">
							<label class="control-label" for="heading">Total Amount</label>
							<div class="controls">
								<input type="text" id="image" name="total_amount" class="input-block-level" value="<?php echo $aryForm['total_amount'] ?>" >
							</div>
						</div>
                        

						<div class="form-actions">
                        
							<button type="submit" class="btn btn-primary"> Save</button>
							<button type="button" class="btn"> Cancel</button>
						</div>
                        
				</div>
				<!-- / Forms: Content -->

			</div>
			<!-- / Forms: Box -->

        </form>
	</div>
<?php   

?>
<!-- / Forms -->