<?php if (!$session->is_logged_in()){redirect_to("index.php");}	
?>
<?php require_once("includes/initialize.php");
	
//$id=$session->user_id;
$user_data = Userdata::find_by_id($session->user_id);
 $biodata = Biodata::find_by_id($user_data->formno,$user_data->email);

//echo  $user_data->std_process_id." level";

$dp = DEPARTMENTCLASS::department_authenticate($biodata->courses);

$alldp = DEPARTMENTCLASS::find_all($dp->faculty);
foreach ($alldp as $aldp){
	$faculty = $aldp->faculty;
}
$pay_cat='';
if ($faculty=='Engineering' or $faculty=='Applied Sciences' or $faculty=='Enviromental Studies'){
$pay_cat='science';	
}elseif ($faculty=='Management Sciences'){
	$pay_cat='nonscience';
}
$level = $biodata->programme;
 $level = $level." "."I";


$pay_settings = Pay_settings::authenticate(1,$level,$pay_cat);

//$biodata = Biodata::find_by_id($session->user_id);
	

//$transact = Transaction::t_processing($id);
$transaction = Transaction::authenticate($biodata->formno, $biodata->email);


	
	
	?>
    
   <div class="art-content-layout">
    <div class="art-content-layout-row">

 <div class="art-layout-cell layout-item-0" style="width: 100%" >
 
 <marquee behavior="alternate" scrolldelay="200" onmouseover="this.setAttribute('scrollamount',0,0);" onmouseout="this.setAttribute('scrollamount',6,0);" ><div style="color:#F00; font-style:italic; font-weight:bolder;">NOTE: <span style="color:#F00; font-style:italic;">Upon successful payment of the acceptance fees, click Admission Module to print your admission letter</span> </div></marquee>

 
 </div>
 </div>
 </div>  
    <div class="art-content-layout">
    <div class="art-content-layout-row">

 <div class="art-layout-cell layout-item-0" style="width: 100%" >
 
 
<div style="text-transform:uppercase; color:#099; font-weight:bolder; border-bottom:inset #000 thin;">Acceptance fees payment </div>
<!--<hr style="width:100%;">
<br />-->
<?php if ($message!='Approved Successful'){
		   echo output_message($message);
	   }elseif ($message=='Approved Successful') {	
	   echo "<script>window.open('acceptance_receipt.php')</script>";
 		 echo "<span style=\"color:#060; font-weight:bolder \">{$message}</span>";
	   }else{
		   echo output_message($message);
		   //echo "<br/>";
	   }
	   	//$message =$transaction->responsecode;
	   

	   ?>
</div>
 </div></div>



<div class="art-content-layout">
    <div class="art-content-layout-row">
    <div class="art-layout-cell layout-item-0" style="width: 30%; background-color:#FFF; margin:0; padding:0;" >
    <div>
    <div style="border-bottom:inset thin #0FC; width:100%; margin:0;background-color:#096 "><a href="#" style="color:#FFF; font-size:17px; text-decoration:none; display:block ">Make payment</a></div>
    
    <div style="border-bottom:inset thin #0FC;background-color:#096 "><a href="../pages/includes/requery.php" style="color:#FFF; font-size:17px; text-decoration:none;display:block ">Requery</a></div>
    
    <div style="border-bottom:inset thin #0FC;background-color:#096 "><a href="../pages/includes/viewLogs.php" style="color:#FFF; font-size:17px; text-decoration:none; display:block">View Txn Logs</a></div>
    <div  style="border-bottom:inset thin #0FC;background-color:#096 "><a href="#" style="color:#FFF; font-size:17px; text-decoration:none; display:block">Create ticket</a></div>
    <!--<div style="margin-bottom:0; padding:0; background-color:#FFF; margin:0" ></div>-->
    </div>
    
    <img src="images/infooter.PNG" width="231" height="70" style="margin-top:0px; padding:0; margin-left:0px; margin-right:0px; margin-bottom:0; background-color:#FFF; " />   
    </div>
    
    
    <div class="art-layout-cell layout-item-0" style="width: 70%" >


<div style="font-size:16px; margin-right:20px "><label style="font-size:16px" >Your details are:</label></div>

<div style="font-size:16px; margin-right:20px "><label style="font-size:16px; margin-right:23px ">Form Number:</label><?php echo $biodata->formno;?></div>

<div style="font-size:16px; margin-right:20px "><label style="font-size:16px; margin-right:54px ">Fullname:</label><?php echo $biodata->surname.", ".$biodata->othernames; ?></div>
<div style="font-size:16px; margin-right:20px "><label style="font-size:16px; margin-right:37px ">Department:</label><?php echo $biodata->courses; ?></div>
<div style="font-size:16px; margin-right:20px "><label style="font-size:16px; margin-right:83px ">Level:</label><?php echo $biodata->programme; ?></div>
<div style="font-size:16px; margin-right:20px "><label style="font-size:16px; margin-right:83px ">Transaction ID:</label><?php echo $transaction->txt_ref; ?></div>


<div style=" font-size:16px; font-weight:bolder;"><label style="font-size:16px" >Total payable acceptance fees: </label>
<?php echo $pay_settings->amount;
 ?></div>
<?php ?>




<?php

 //$txt_ref= $transaction->txt_ref;
$amount=$pay_settings->amount ;
$txt_ref =  $transaction->txt_ref;
$_SESSION['txn_ref']=$txt_ref;
$cust_id= $biodata->formno;
$_SESSION['cust_id']=$cust_id;
$cust_name =  $biodata->othernames." ".$biodata->surname;
//$cust_name=  $biodata->othernames." ".$biodata->surname;
$_SESSION['cust_name']=$cust_name;
//$product_id = 6207;
//$pay_item_id= 101;
//$cur = 566;
//$mackey = "CEF793CBBE838AA0CBB29B74D571113B4EA6586D3BA77E7CFA0B95E278364EFC4526ED7BD255A366CDDE11F1F607F0F844B09D93B16F7CFE87563B2272007AB3";
//$ash_codes= ( $txt_ref.  $product_id.  $pay_item_id .$amount ."https://sandbox.interswitchng.com/webpay/api/v1/gettransaction.json" . $mackey);
//$ash_code= hash('sha512',$ash_codes);



?>

 <form action="./acceptance_pay/confirmPayerDetails.php" method="POST">
<input name="product_id" type="hidden" value="<?php echo $product_id; ?>" />
<input name="cust_id" type="hidden" value="<?php echo $cust_id; ?>" />
<input name="cust_name" type="hidden" value="<?php echo $cust_name?>"/>
<input name="pay_item_id" type="hidden" value="<?php echo $pay_item_id; ?>" />
<input name="pay_item_name" type="hidden" value="Acceptance Payment" />
<input name="amount" type="hidden" value="<?php echo $amount; ?>" />
<input name="txn_ref" type="hidden" value="<?php echo $txt_ref; ?>" />
 
<!--<input name="xml_data" type="hidden" value=
                   '<payment_item_detail>
			  	<item_details detail_ref="<?php //echo $txt_ref; ?>" college="OSCOTECH" department="<?php //echo $biodata->programme; ?>" faculty="<?php //echo $faculty; ?>">
              		<item_detail item_id="1" item_name="ict overhead fees" item_amt="<?php // echo $ict_overheads; ?>" bank_id="76" acct_num="0284122013" />
                       <item_detail item_id="2" item_name="overhead fees" item_amt="<?php //echo $overheads; ?>" bank_id="76" acct_num="0213965027" /> 
              <?php /*
			  		$sql=mysql_query("SELECT * FROM tranzact_t_items WHERE txn_ref='{$_SESSION['txn_ref']}'");
					
					$i=2;
					while($rowt=mysql_fetch_array($sql)){
						$fees_description =$rowt['fees_description'];
						$amountt = preg_replace("/\.?0*$/",'',$rowt['amount']);
						$amountp = $amountt * 100;
					$i++;*/
				?>
			  		<item_detail item_id="<?php // echo $i;?>" item_name="<?php //echo $fees_description;?>" item_amt="<?php // echo $amount; ?>" bank_id="76" acct_num="0213965027" />
                 <?php	
						//	}														
							?>   
			   </item_details> 
               
            </payment_item_detail>'/>

-->


<input type="submit" name="submit" class="btn btn-danger" id="btn" value="PAY NOW" /> 





 </div>
    </div>
</div>
</div>


</article></div>
    <style>
	#accept:hover {
		text-decoration:none;
		font-style:italic;
	}
	</style>
    
    <script src="../javascripts/jquery.min.js"></script>        
<script src="../javascripts/bootstrap.min.js" type="text/javascript"></script>
<script type="application/javascript">
$(document).ready(function() {
	//alert("welcome");
	//$("#btn").hide();
	//$(".downinner").hide();
	//$('#accept').on('click', function(){
		
		//var ptype = $('#paytype').val();
		//$("#accept").hide();
		//$("#btn").show();
		//var dpt =$('#depart').val();
		//var lev = $('#lev').val();
	//});
});
	</script>