<?php 
include("../db.php");

header('Content-Type: application/json');

  

    $status = 0;

    $subjectArray = array();
    
    $array = array();
//echo $ss="select * from student_notice where class='$class' and type='2' and session='$session' ";
	$allSubject = $db->getRows("select * from image_upload  ORDER BY id DESC ");
    if(count($allSubject) > 0){
        $status = 1;

    	foreach($allSubject as $subject){
                array_push($subjectArray,["id"=>"$subject[id]","head"=>"$subject[head]","image"=>"https://$_SERVER[HTTP_HOST]/uploads/gallery/$subject[image_name]" ]);
    	}

    }
 
 $array['status'] = $status;
 $array['gallery'] = $subjectArray;
 
 echo json_encode($array);
?>