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 : 18.119.158.110


Current Path : /proc/thread-self/root/var/www/html/univadmin_bkp/univadmin/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/univadmin_bkp/univadmin/src/activateTT.php

<?php
function getTTlist($aobj_context){

    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
    $univcode = $aobj_context->mobj_data["univcode"];
    $deggrp = $aobj_context->mobj_data["deggrp"];

    $query = "SELECT fdbname, ffolder FROM dbname WHERE funivcode = $univcode";
    $result = $aobj_context->mobj_db->GetRow($query);
    $db = $result['fdbname'];
    $folder = $result['ffolder'];

    $query = "SELECT deg.fdegree,d.fdescpn,CONCAT(fpath,'/',ffilename) as ttpath,deg.factive
    FROM {$db}.deg_timetable deg INNER JOIN {$db}.degree d ON d.fdegree=deg.fdegree AND d.ffaculty='$deggrp'";
    // var_dump($query);
    $result = $aobj_context->mobj_db->GetAll($query);
    //var_dump($result);
    if($result)
	{
		echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
	}
	else
	{
		$arr['msg'] = 'Could not get TimeTable List';
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 	
	}	
}

function updateTTstatus($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
    $univcode = $aobj_context->mobj_data["univcode"];
    $deggrp = $aobj_context->mobj_data["deggrp"];

    $query = "SELECT fdbname, ffolder FROM dbname WHERE funivcode = $univcode";
    $result = $aobj_context->mobj_db->GetRow($query);
    $db = $result['fdbname'];
    
    if(isset($_POST["myData"]))
    {
        $json = json_decode($_POST["myData"],true);
        // var_dump($json);
        foreach($json as $item){
        $query = "UPDATE {$db}.deg_timetable SET factive='".$item['factive']."' Where fdegree = '".$item['degree']."'";
        // var_dump($query);
        $results = $aobj_context->mobj_db->Execute($query);
        // var_dump($results);
        $rows_affectedu = $aobj_context->mobj_db->affected_rows();
        }
    }
    if($results)
    {
        $data = "Uploaded Successfully.";
        echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"success"); 
        return;	
    }
    else
    {
        $data = "Error while updating";
        echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"error"); 
        return;
    }
	
}
?>