<?php

        include('../../config/config.php');

        $campusID = $_POST['campusID'];

        $selectclassforadmission = mysqli_query($link,"SELECT * FROM `classtemplate` INNER JOIN admissionclass 
        ON classtemplate.ClassTemplateID = admissionclass.AdmissionDefaultClassID WHERE admissionclass.CampusID='$campusID' ORDER BY `classtemplate`.ClassTemplateName ASC");
        $selectclassforadmissionrow = mysqli_num_rows($selectclassforadmission);
        $selectclassforadmissionrowcnt = mysqli_fetch_assoc($selectclassforadmission);


        if($selectclassforadmissionrow > 0)
        {

            echo '<option value="0" data-amount="0" data-status="" >Select class</option>';
            
               do{

                     $ClassTemplateName = $selectclassforadmissionrowcnt['ClassTemplateName'];
                    $ClassTemplatID = $selectclassforadmissionrowcnt['AdmissionClassID'];
                    $paymentamount =  $selectclassforadmissionrowcnt['PaymentAmount'];
                    $PaymentStatus =  $selectclassforadmissionrowcnt['PaymentStatus'];
                     $AdmissionDefaultClassID = $selectclassforadmissionrowcnt['AdmissionDefaultClassID'];
                    

                   echo '<option  data-amount="'.$paymentamount.'" data-status="'.$PaymentStatus.'" value="'.$AdmissionDefaultClassID.'">'.$ClassTemplateName.'</option>';

               }while($selectclassforadmissionrowcnt = mysqli_fetch_assoc($selectclassforadmission));
        }else
        {
          
            echo '<option value="0" data-amount="0" data-status="" >No class found</option>';  
        }



?>