<?php if (!$session->is_logged_in()) {
    redirect_to("index.php");
}
?>
<?php require_once("includes/initialize.php");
//$tag=""; 
//if ((isset($_GET['type'])))
//$tag=$_GET['type'];

// if (isset($_SESSION['paymentID'])){
//   $_SESSION['paymentID'];
// }
$id = $session->user_id;

$user_data=Userdata::find_by_id($session->user_id);
$transact_feedbackchk = Transaction::findacceptance($user_data->formno, $user_data->email);
if (!$transact_feedbackchk){
    
    $transact_feedbackchk = Transaction::findacceptanceRemitaSuccess($user_data->formno, $user_data->email);
    
    if (!$transact_feedbackchk){
    redirect_to ("http://eportal.oscotechesaoke.edu.ng/student_portal/dashboard.php");
    }
 }







//The code below was commented .............................
      
//         if ((substr($user_data->formno,2,2)!=18) and ((substr($user_data->formno,2,2)!=19))){
      
//       //echo "All new table: ".substr($user_data->formno,2,2);
      
//       Switch(substr($user_data->formno,2,2))
//       {
//           case '20':$table='form_data';
//           break;
          
//           case '21': $table='form_data21';
//           break;
          
//           case '22': $table='form_data22';
          
//           case '23': $table='form_data23';
//       }
  
      
//       $biodata = Biodata2::find_by_id($table, $user_data->formno, $user_data->email);
       
//       // echo "kll: ". $biodata->passport;
//         $new_dp = DEPARTMENTCLASS::new_admin_dept($biodata->formno);
        
//           if (!isset($new_dp->department)){
//           $biodata->courses ='Nil';   
//           }else{
//         $biodata->courses = $new_dp->department;
//           }
//       $biodata->programme = $biodata->level;
  
//         // $pixf = substr($biodata->passport, 10);
//       $dp = DEPARTMENTCLASS::department_authenticate($biodata->department);
//       $pix = "../../admission/passport/".$biodata->passport;
    
    
    
       
//   }else{
 


// $biodata = Biodata::find_by_id($user_data->formno, $user_data->email);

// }









//All the code above was commented.
//echo  $user_data->std_process_id." level";


// if (($user_data->std_process_id==1) && (($user_data->start_session=='2019/2020') OR ($user_data->start_session=='2018/2019'))){
//     redirect_to("dashboard.php");
// }

// if (substr($user_data->formno,2,2)=='19'){

//  $new_dp = DEPARTMENTCLASS::new_admin_dept($user_data->formno);
//   $biodata->courses = $new_dp->department;
  
//  $biodata->programme = $biodata->level;
   
// }






//The code below was commented

// $dp = DEPARTMENTCLASS::department_authenticate($biodata->courses);
// $display_course = COURSECLASS::fetch_all_course($biodata->courses, $biodata->programme, $session_class->semester);







// $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';
// }

// if( $biodata->programme=='Adv. Cert.'){
//   $level = $biodata->programme;  
// }else {
// $level = $biodata->programme;
// $level = $level . " " . "I";

// }
// $pay_settings = Pay_settings::authenticate(1, $level);

//$biodata = Biodata::find_by_id($session->user_id);

//echo "<br>Form: ".$user_data->formno.' '. $user_data->email;
//$transact = Transaction::t_processing($id);


//$transaction = Transaction::authenticate($user_data->formno, $user_data->email);




// The code above was commented

?>

<div class="art-content-layout">
    <div class="art-content-layout-row">

        <div class="art-layout-cell layout-item-0" style="width: 100%">

           
 <?php
  if ((substr($biodata->formno,0,2))=="PU"){?>

 <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, make sure you do not block any pop up message on your machine. Click Payment Module to pay School fees</span> </div></marquee>
<?php } else {?>
 
 <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, make sure you do not block any pop up message on your machine. Click Admission Module to print your admission letter</span> </div></marquee>
<?php  }?>

        </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;">
                School fees payment
            </div>
            <?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>";
                $_SESSION['success'] = $message;
            } else {
                echo output_message($message);
            }

            ?>
        </div>
    </div>
</div>

<style>
  input[type=text] {
  width: 100%;
  padding: 10px 15px;
  margin: 8px 0;
  box-sizing: border-box;
}

.actbutton {
    display:none;
}
.control-labelu,.control-labelt {
    margin-top:10px;
    font-size:16px;
}
</style>
<div class="art-content-layout">
    <div class="art-content-layout-row">
     

       	<form name="form1" id="form1" action="pages/postjsonnd.php" method="post" style="width:100%;" class="form-horizontal">
			 
			
			<div class="row" style="float:left;margin-top:20px">
			
					<label class="control-labelu col-md-4" >Payer Name</label>
				
						<input type="text" class="form-control col-md-8" placeholder="Enter Name..." name="name" >
				
                
					<label class="col-md-4 control-labelt">Payer Email</label>
				
						<input type="text" class="form-control col-md-8" placeholder="Enter Email..." name="email" >
				
			
					<label class="col-md-4 control-labelt">Payer Phone</label>
					
						<input type="text" class="form-control col-md-8" placeholder="Enter Phone..." name="phone" >
				
				</div>	 
				<input type="hidden" id="stid" name="stid">
				 <div class="form-group">
					<div class="col-md-8">
						<button class="btn btn-sm btn-primary actbutton" id="payButton" style='font-size:16px;margin-top:20px;background-color:green; color:white; padding:10px 16px; border-radius:5px; margin-bottom:15px' type="button">Proceed</button>
				
				 <!--<a href='./validate-bank-source.php' style='color:red; font-weight:bolder; padding-left:5%; padding-top:10%'>Validate Bank Receipt</a>-->

				
				
					</div>
				</div>
			</form>
    
  <style>
      #payButton:hover{
          cursor:pointer;
      }
      
    .actbutton {
        display:none;
    }  
  </style>    
      
      <script type="text/javascript" src="pages/js/jquery.js"></script>
<script src="pages/js/bootstrap.min.js"></script>
        <script type="text/javascript">
            $(function() {
                
                if ( $("input[name='name']").val()=='')
                {
                     $(".actbutton").css('display','none');
                }
                
                $("button#payButton").click(function(){
                  $('form[name=form1]').submit();
                });
                
         
      
     $.ajax({
       url : 'pages/genrrrnd.php', // my php file
       type : 'GET', // type of the HTTP request
       success : function(result){ 
           
          // alert('Result: '+result);
           var result = JSON.parse(result);
           
            $("input[name='name']").val(result.name);
            $("input[name='email']").val(result.email);
           $("input[name='phone']").val(result.phone);
           $("#stid").val(result.paymentid);
           
           if (result.name!=''){
               
               $(".actbutton").css('display','block');
           }
      
       }
         
         
     });     
            });
        </script>
      
      
</div>
</div>


</article></div>
