0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.145.105.199


Current Path : /var/www/html/collportal/student/
Upload File :
Current File : /var/www/html/collportal/student/studentMasmenu.php

<?php
    function getStudentsMasmenu($aobj_context){

        $query = "select trim(fmenuname)as fmenuname, trim(fpath) as fpath,
                  trim(fmainmenu)as fmainmenu, trim(fmenucode)as fmenucode  
                  from student_masmenu where ifnull(fismainmenu, '') = 'T'
                  and ifnull(factive, '') = 'T'";
        $res = $aobj_context->mobj_db->GetAll($query);

        $array = [];
        foreach($res as $v){
            $arr['title'] = $v['fmenuname'];
            $arr['url'] = $v['fpath'];

            $query1 = "select distinct fcategory from student_masmenu where 
                       ifnull(factive, '') = 'T' and fmainmenu='{$v['fmenucode']}'";
            $res1 = $aobj_context->mobj_db->GetAll($query1);

            $items = [];
            foreach($res1 as $val){
                $item['category'] = $val['fcategory'];
                
                $query2 = "select trim(fmenuname)as fmenuname, trim(fpath) as fpath,
                       trim(fmainmenu)as fmainmenu, trim(fmenucode)as fmenucode,  
                       trim(fcategory)as fcategory from student_masmenu where
                       ifnull(factive, '') = 'T' and fmainmenu='{$v['fmenucode']}'
                       and fcategory='{$val['fcategory']}'";

                $res2 = $aobj_context->mobj_db->GetAll($query2);

                $options = [];
                foreach($res2 as $val){
                    $option['title'] = $val['fmenuname'];
                    $option['url'] = $val['fpath'];
                    array_push($options, $option);
                }
                $item['options']=$options;
                array_push($items, $item);
            }
            $arr['items'] = $items;
            array_push($array, $arr);
        }
        echo $aobj_context->mobj_output->ToJSONEnvelope($array, 0, "success"); 
    }
?>