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.135.249.119


Current Path : /var/www/html/gug/src/
Upload File :
Current File : /var/www/html/gug/src/getMessages.php

<?php

function getMessages($aobj_context){

    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $query = "select ffadm, ffexapp, ffval, ffrv, ffgen, ffcntr,ffpgcntr, ffqpmsg,fcollcode 
    from control";
    $enable_flags = $aobj_context->mobj_db->GetRow($query);
    // var_dump($enable_flags);
    $messages = array();

   if($enable_flags['fcollcode'] == 'T')
    {
       
        // select fcollcode, fansreceive, fanssent from college where ifnull(fqpmsgshow,'') = 'T' and fcollcode = '6001'
        $query = "select fcollcode, fmessage 
        from college where fcollcode = '{$_SESSION['FCOLLCODE']}'";
        $results  = $aobj_context->mobj_db->GetRow($query);

 $qpmsg1 = '<div style="text-align: center">
                        <h2>'.$results['fmessage'].'</h2>
                    </div>
                    <hr style="border:1px solid #16a085;">';

        //$qpmsg1 .= "<p>".$results['fmessage']."</p>";
        if(count($results) > 0)
            $messages[] = $qpmsg1;
    }

    if($enable_flags['ffgen'] == 'T')
    {
        $query = "SELECT  message FROM message_board 
        where current_date() between display_from
        and display_to and college_code = 'flash'";
        $lobj_messages = $aobj_context->mobj_db->GetAll($query);
        foreach($lobj_messages as $k => $v)
        {
            $messages[] = $v['message'];
        }
    }

    if($enable_flags['ffqpmsg'] == 'T')
    {
        $qpmsg1 = '<div style="text-align: center">
                        <h2>Information on collecting Question Papers from University</h2>
                    </div>
                    <hr style="border:1px solid #16a085;">';
        // select fcollcode, fansreceive, fanssent from college where ifnull(fqpmsgshow,'') = 'T' and fcollcode = '6001'
        $query = "select fcollcode, fansreceive, fanssent 
        from college where ifnull(fqpmsgshow,'') = 'T' and fcollcode = '{$_SESSION['FCOLLCODE']}'";
        $results  = $aobj_context->mobj_db->GetRow($query);

        $qpmsg1 .= "<p>".$results['fansreceive']."</p>";

        $qpmsg1 .= "<div style='text-align: center'>
        <h2>Information on sending Written Answer Booklets to University</h2>
        </div>
            <hr style='border:1px solid #16a085;'>";
        
        $qpmsg1 .= "<p>".$results['fanssent']."</p>";
        if(count($results) > 0)
            $messages[] = $qpmsg1;
    }

    if($enable_flags['ffcntr'] == 'T')
    {
        $query = "select distinct fcollcode, concat(fcollname, ', ',ftown) as fcollname, 
        fmobile, ifnull(fthcntr,'F') as fthcntr from college where fcollcode = '{$_SESSION['FCOLLCODE']}'";
        $results  = $aobj_context->mobj_db->GetRow($query);
        $cntr = $results['fthcntr'];
        $flag = 'T';
        if($cntr != 'F')
        {    
              $table .= '
            <h2>UG Theory Center Details</h2>';

            if($results['fthcntr'] == $results['fcollcode'])
            {
                $flag = 'C';	
                $table .= '<table style="margin-left:2px;text-align: left;width: 100%"  border="1" cellpadding="10" cellspacing="0" >
                    <thead>
                        <tr style = "background-color:#8acc51">
                            <th  align="center" colspan="3"><b>Examination Center</b></th>
                        </tr>
                    </thead>
                <tbody>
                <tr>
                    <td width="10%" align="left"><b>'.$results['fcollcode'].'</b></td>
                    <td width="70%" align="left"><b>'.$results['fcollname'].'</b></td>
                    <td width="20%" align="left"><b>'.$results['fmobile'].'</b></td>
                </tr></tbody></table>';	

                $query = "select distinct fcollcode, concat(fcollname, ', ',ftown) as fcollname, 
                fmobile,fthcntr from college 
                where fthcntr = '{$_SESSION['FCOLLCODE']}' 
                and fcollcode <> fthcntr";
                $results  = $aobj_context->mobj_db->GetAll($query);

                $table .= '<br><br>
                <table style="margin-left:2px;text-align: left;width: 100%"  border="1" cellpadding="10" cellspacing="0" >
                <thead>
                    <tr style = "background-color:#8acc51">
                        <th  align="center" colspan="3"><b>Tagged Colleges</b></th>
                    </tr>
                </thead><tbody>';

                foreach ($results as $key => $value) 
                {
                    
                    $table .= '<tr>
                        <td width="10%" align="left"><b>'.$value['fcollcode'].'</b></td>
                        <td width="70%" align="left"><b>'.$value['fcollname'].'</b></td>
                        <td width="20%" align="left"><b>'.$value['fmobile'].'</b></td>
                        </tr>';
                }
                $table .= '</tbody></table>';
            }
            else
            {
                $query = "select distinct fcollcode, concat(fcollname, ', ',ftown) as fcollname, fmobile,fthcntr from college where fcollcode = '{$cntr}'";
                $results  = $aobj_context->mobj_db->GetRow($query);
                
                $table .= '<table style="margin-left:2px;text-align: left;width: 100%"  border="1" cellpadding="10" cellspacing="0" >
                    <thead>
                        <tr style = "background-color:#8acc51">
                            <th  align="center" colspan="3"><b>Examination Center</b></th>
                        </tr>
                    </thead>
                <tbody>
                <tr>
                    <td width="10%" align="left"><b>'.$results['fcollcode'].'</b></td>
                    <td width="70%" align="left"><b>'.$results['fcollname'].'</b></td>
                    <td width="20%" align="left"><b>'.$results['fmobile'].'</b></td>
                </tr></tbody></table>';	
            }	


            // $table .="<br><span class='remodal-cancel' onclick='admcollegesum(\"".$flag."\")'>Continue</span>";
            
            // $lobj_messages.push($table);
            $messages[] = $table;
        }    
    }

    if($enable_flags['ffpgcntr'] == 'T')
    {
       

        $query = "select distinct fcollcode, concat(fcollname, ', ',ftown) as fcollname, 
        fmobile, ifnull(fpgthcntr,'F') as fpgthcntr from college where fcollcode = '{$_SESSION['FCOLLCODE']}'";

        $results  = $aobj_context->mobj_db->GetRow($query);

        $cntr = $results['fpgthcntr'];

        if($cntr != 'F')
        {    
            $table = "";    
            $table .= '
            <h2>PG Theory Center Details</h2>';

            $flag = 'T';

            if($results['fpgthcntr'] == $results['fcollcode'])
            {
                $flag = 'C';    
                $table .= '<table style="margin-left:2px;text-align: left;width: 100%"  border="1" cellpadding="10" cellspacing="0" >
                    <thead>
                        <tr style = "background-color:#8acc51">
                            <th  align="center" colspan="3"><b>Examination Center</b></th>
                        </tr>
                    </thead>
                <tbody>
                <tr>
                    <td width="10%" align="left"><b>'.$results['fcollcode'].'</b></td>
                    <td width="70%" align="left"><b>'.$results['fcollname'].'</b></td>
                    <td width="20%" align="left"><b>'.$results['fmobile'].'</b></td>
                </tr></tbody></table>'; 

                $query = "select distinct fcollcode, concat(fcollname, ', ',ftown) as fcollname, 
                fmobile,fpgthcntr from college 
                where fpgthcntr = '{$_SESSION['FCOLLCODE']}' 
                and fcollcode <> fpgthcntr";
                $results  = $aobj_context->mobj_db->GetAll($query);

                $table .= '<br><br>
                <table style="margin-left:2px;text-align: left;width: 100%"  border="1" cellpadding="10" cellspacing="0" >
                <thead>
                    <tr style = "background-color:#8acc51">
                        <th  align="center" colspan="3"><b>Tagged Colleges</b></th>
                    </tr>
                </thead><tbody>';

                foreach ($results as $key => $value) 
                {
                    
                    $table .= '<tr>
                        <td width="10%" align="left"><b>'.$value['fcollcode'].'</b></td>
                        <td width="70%" align="left"><b>'.$value['fcollname'].'</b></td>
                        <td width="20%" align="left"><b>'.$value['fmobile'].'</b></td>
                        </tr>';
                }
                $table .= '</tbody></table>';
            }
            else
            {
                $query = "select distinct fcollcode, concat(fcollname, ', ',ftown) as fcollname, fmobile,fpgthcntr from college where fcollcode = '{$cntr}'";
                $results  = $aobj_context->mobj_db->GetRow($query);
                
                $table .= '<table style="margin-left:2px;text-align: left;width: 100%"  border="1" cellpadding="10" cellspacing="0" >
                    <thead>
                        <tr style = "background-color:#8acc51">
                            <th  align="center" colspan="3"><b>Examination Center</b></th>
                        </tr>
                    </thead>
                <tbody>
                <tr>
                    <td width="10%" align="left"><b>'.$results['fcollcode'].'</b></td>
                    <td width="70%" align="left"><b>'.$results['fcollname'].'</b></td>
                    <td width="20%" align="left"><b>'.$results['fmobile'].'</b></td>
                </tr></tbody></table>'; 
            } 
            $messages[] = $table;  
        }    

        // $table .="<br><span class='remodal-cancel' onclick='admcollegesum(\"".$flag."\")'>Continue</span>";
        
        // $lobj_messages.push($table);
        
    }

    echo $aobj_context->mobj_output->ToJSONEnvelope($messages); 
}

?>