<?php
include("../../db.php");
//header("Access-Control-Allow-Origin: * ");
header('Content-Type: application/json');

	$array = array();
	$status=0;
	
    $classArray = array();
	
	$allclasses = $db->getRows("select * from class where school_id=1  ");
    if(count($allclasses) > 0){
        $status = 1;
        
    	foreach($allclasses as $class){
                array_push($classArray,["id"=>"$class[id]","class"=>"$class[class]"]);
    	}
        
    }

	
    $array['status'] = $status;
    $array['data'] = $classArray;
    
    echo json_encode($array);
	
	?>