$scale = $gmarks->getGradeScale($cid, $dep);
$grade_set = explode(',', $scale);
?>

	<div class="box box-default" id="formula">
	
			<div class="box-header">
				<h3 class="box-title">Sessional Formula</h3>
			</div> <!-- /.box header -->
			<!-- form start -->
			<form role="form" action="post" id="sessional_formula">
				<div class="box-body">
					<div class="form-group">
						<label for="formula">Select formula</label>
						    <?php 
$sf = $gmarks->getSessionalFormula(Session::get('teacher_id'), $cid, $dep);
if ($sf->num_rows) {
    $formula = $sf->fetch_object()->formula;
} else {
    $formula = 1;
}
?>
							<select name="formula" class="form-control" id="formula">
								<option value="" <?php 
echo $formula == 0 ? 'selected' : '';
?>
>Formula</option>
								<option value="1" <?php 
echo $formula == 1 ? 'selected' : '';
?>
>Highest of Two Class Tests + Internal Assessment (Default)</option>
	</div>
	<div class="row">
		<div class="col-md-12">
			<div class="box box-default">
				<div class="box-header">
					<h3 class="box-title">Sessional Formula</h3>
					<div class="box-tools pull-right">
	                	<button class="btn btn-default btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
	                </div>
				</div> <!-- /.box header -->
				<div class="box-body">
					<h3><strong>
					 <?php 
unset($gmarks);
$marks = new Marks();
$sf = $marks->getSessionalFormula('', $cid, $dep);
if ($sf->num_rows) {
    $formula = $sf->fetch_object()->formula;
} else {
    $formula = 1;
}
switch ($formula) {
    case 1:
        echo 'Highest of Two Class Tests + Internal Assessment';
        break;
    case 2:
        echo 'Average of Two Class Tests + Internal Assessment';
        break;
    default:
        echo 'Highest of Two Class Tests + Internal Assessment';
        break;