<?php
include("../../db.php");
header('Content-Type: application/json');

$session = $_REQUEST['session'];
$class = $_REQUEST['class'];

$status = 0;

$sqlsec = $db->getRows("select idno,omr,admissionno,name,section,fname,fincome,medium from student where session='$session' and class = '$class' and  status=1  and issue_TC=0 order by name");

if (count($sqlsec) > 0){
    $status = 1;
}

$colorArray = array(array("name"=>"Select House", "color"=>"#000000"),array("name"=>"Christopher Columbus", "color"=>"#0000FF"), array("name"=>"Mahatma Gandhi", "color"=>"#008000"),
    array("name"=>"Albert Einstein", "color"=>"#FFC300"), array("name"=>"Leonardo DaVinci", "color"=>"#FF0000"));

echo json_encode(array("status" => $status, "data" => array("students"=>$sqlsec, "house_color_code" => $colorArray)));