<?php if (!$session->is_logged_in()) {
    redirect_to("index.php");
}
?>
<?php require_once("includes/initialize.php");
//$tag="";
//if ((isset($_GET['type'])))
//$tag=$_GET['type'];

$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){
    
    redirect_to ("http://eportal.oscotechesaoke.edu.ng/student_portal/dashboard.php");
 }

      
        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';
      }
  
      
       $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);

}
//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;
   
// }

$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);

?>

<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>-->
 <?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;">
                Acceptance 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>


<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="javascript:void(0)"
                            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="javascript:void(0)"
                                                                                     style="color:#FFF; font-size:17px; text-decoration:none; display:block">Re-generate
                        pin</a></div>
                <div style="border-bottom:inset thin #0FC;background-color:#096 "><a href="javascript:void(0)"
                                                                                     style="color:#FFF; font-size:17px; text-decoration:none; display:block">Create
                        ticket</a></div>
                        </div>
                        
                       <!--<div><img src="images/image001.png" width="50px" height="20px"-->
                       <!--                     </div> -->
             <img src="images/images.png" width="231" height="120" 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 $level; ?></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
            //if ($_SESSION['success']=='Approved Successful'){


            //}else{
            if ($transaction->status !== 'Approved Successful') :
                echo '<a href="tranzact.php" id="accept" 
style="background-color:#030; color:#FFF; font-weight:bolder; border-radius:5px;padding:5px; margin-top:5; 
text-decoration:none; font-size:17px; font-stretch:extra-expanded">Proceed</a>           

            <a href="dashboard.php" id="back"
               style="background-color:#030; color:#FFF; font-weight:bolder; border-radius:5px;padding:5px; margin-top:5; margin-left:20px ; text-decoration:none; font-size:17px; font-stretch:extra-expanded">
                Back</a>';

            elseif ($transaction->status == 'Approved Successful'):
                echo '  <a href="acceptance_receipt.php" target="_self"
               style="background-color:#030; color:#FFF; font-weight:bolder; border-radius:5px;padding:5px; margin-top:5; margin-left:20px ; text-decoration:none; font-size:17px;
                font-stretch:extra-expanded">
                Print Receipt</a>';
            endif;
            ?>
            </form>

            <?php if ($transaction->status == 'UNPAID') : ?>
                <!--<div>-->
                <!--    <div class="row">-->
                        <!--<div class="col-md-3 col-lg-3 col-sm-3 col-xs-3">-->
                        <!--    <img src="./images/inter.jpg" class="img-responsive bankImg" alt="">-->
                        <!--</div>-->
                        <!--<div class="col-md-3 col-lg-3 col-sm-3 col-xs-3">-->
                        <!--    <img src="./images/mc.jpg" class="img-responsive bankImg bankFix" alt="">-->

                        <!--</div>-->
                        <!--<div class="col-md-3 col-lg-3 col-sm-3 col-xs-3">-->
                        <!--    <img src="./images/visa.png" class="img-responsive bankImg" alt="">-->

                        <!--</div>-->
                        <!--<div class="col-md-3 col-lg-3 col-sm-3 col-xs-3">-->
                        <!--    <img src="./images/verve.jpg" class="img-responsive bankImg" alt="">-->

                <!--        </div>-->
                <!--    </div>-->
                <!--</div>-->
            <?php endif; ?>

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


</article></div>
<style>
    #accept:hover {
        text-decoration: none;
        font-style: italic;
    }
</style>


<script type="text/javascript">

    var mes = <?php echo json_encode($message)?>
        $(document).ready(function () {
            alert(mes);
            if (mes == "Approved Successful") {
                $('#accept').attr('disabled', 'disabled');
            }
        }
</script>