<style>.top-bar-minimize{display:none;}
thead, tfoot {display: table-header-group;}
.top-bar+.well,.accordion .accordion-heading+.accordion-body{display: inline-block !important;width: 100% !important;overflow: inherit !important;} 
.headPrint img{margin: -5px 14px 0px 290px;}
</style>
<script>
function fetchResult(term,cls,subject,section){
	var term=document.getElementById(term).value;
	var cls=document.getElementById(cls).value;
	var subject=document.getElementById(subject).value;
	var section=document.getElementById(section).value;
	if(term==""){
		alert("Please Select Term");
	}else if(cls==""){
		alert("Please Select class");
	}
	else{
		$.post( "<?php echo URL_ROOT ?>ExamCBSE/ajax.php", { type: "examSummery" ,cls: cls, section: section, subject: subject, term: term} , function( data ) {
			$("#detailDiv").show();
			$("#printDiv").html(data);
		});
	}
}
function  fetchSubject(cls){
	
	$.post( "<?php echo URL_ROOT ?>ExamCBSE/ajax.php", { type: "classSubject" ,cls: cls} , function( data ) {
		$("#subject_div").html(data);
	});
}
</script>
<?php
$pgMod="fee_summery";
$pgAct="view";
?>
    <form method="get" action="">
    <input type="hidden" name="src" value="ExamCBSE" />
    <input type="hidden" name="page_id" value="<?php echo $pgMod; ?>" />
	<div class="row-fluid">
            <div class="span12">
            	<div class="top-bar">
                <h3><i class="icon-cog"></i>Exam Report Section  </h3>
				</div>
				<div class="well no-padding">
                	<div class="controls controls-row">
                        <div class="control-group span3">
                          <!--  <label class="control-label" for="medium">Term</label>-->
                            <div class="controls span3">
                                <select name="term" onChange="fetchResult('term','class','subject','section')" id="term">
                                    <option value="">Term</option>
                                    <?php 
                                        $class=$db->getRows("select * from examterm where school_id='".$_SESSION["admin"]["school_id"]."' ");
                                        foreach($class as $cla){
                                            ?>
                                            <option <?php if($cla["name"]==$_GET["term"])echo 'selected';?> value="<?php echo $cla["name"] ?>">
                                                <?php echo $cla["name"] ?>
                                            </option>
                                            <?php
                                        }
                                    ?>
                                </select>
                            </div>
                        </div>
                        <div class="control-group span3">
                            <!--<label class="control-label" for="class">Class</label>-->
                            <div class="controls span3">
                                <select onchange="fetchSubject($(this).val());fetchResult('term','class','subject','section');" name="class" id="class">
                                    <option value="">Class</option>
                                    <?php 
                                        $class=$db->getRows("select * from class  where school_id='".$_SESSION["admin"]["school_id"]."' ");
                                        foreach($class as $cla){
                                            ?>
                                            <option <?php if($cla["class"]==$aryForm["class"])echo 'selected';?> value="<?php echo $cla["class"] ?>">
                                                <?php echo $cla["class"] ?>
                                            </option>
                                            <?php
                                        }
                                    ?>
                                </select>
                            </div>
                        </div>
                        <div class="control-group span3">
                            <!--<label class="control-label" for="class">Section</label>-->
                            <div class="controls span3">
                               <select name="section" onchange="fetchResult('term','class','subject','section')" id="section" >
                <option value="">Section</option>
                <?php 
                    $class=$db->getRows("select * from section where school_id='".$_SESSION["admin"]["school_id"]."'");
                    foreach($class as $cla){
                        ?>
                        <option <?php if($cla["name"]==$aryForm["section"])echo 'selected';?> value="<?php echo $cla["name"] ?>">
                            <?php echo $cla["name"] ?>
                        </option>
                        <?php
            
                    }
                ?>
            </select>
                            </div>
                        </div>
                        <div class="control-group span3">
                           <!-- <label class="control-label" for="subject">Subject</label>-->
                            <div class="controls span3" id="subject_div">
                                <select name="subject" id="subject">
                                    <option value="">Subject</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    
                    <br>
				</div>
                
				<!-- / Forms: Content -->

			</div>
    </div>
    </form>
    <div class="row-fluid hide" id="detailDiv">
        <div class="span12">
            <div class="top-bar">
                <h3><i class="icon-cog"></i> Detail</h3>
                <div style="float:right; margin-top:5px">
                    <button onclick="printDiv('printDiv')" type="button" class="btn btn-primary">Print</button>
                    <button onclick="SMSComplete('completeFeeShw','completeFeeShowSMS')" type="button" class="btn btn-primary">SMS</button>
                </div>
            </div>
            <div class="well no-padding" id="printDiv">
            	loading...
                
              </div>
          </div>
    </div>