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


Current Path : /proc/thread-self/root/var/www/html/rcub/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/rcub/src/degstudymatdet.php

<?php

require_once("/var/www/html/aws/aws-autoloader.php");
use Aws\S3\S3Client;


function DisplayAllUploads($aobj_context)
{

	$fdegree    = stripslashes($aobj_context->mobj_data["fdegree"]);
	$sem    = stripslashes($aobj_context->mobj_data["sem"]);
	$subject    = stripslashes($aobj_context->mobj_data["subject"]);
	
    $college = $_SESSION['collcode'];
    $univcode = $_SESSION['FUNIVCODE'];
	
	if($college == '')
	{
		$data = 'Session Expired Login again and enter';
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
		return;
	}	

    if($sem == 'All')
    {
        $cnd = "";
    }else
    {
        $cnd = "and o.fexamno = '{$sem}'";
    }

    if($subject == 'All')
    {
        $cnd1 = "";
    }else
    {
        $cnd1 = "and o.fsubcode = '{$subject}'";
    }


    $Query = "select distinct o.fdegree, d.fdescpn,d.fexamno,o.fsubcode,
    o.FUPDTEACH,su.fsubname,o.fchapter,
    count(distinct fregno) as viewed,
    o.FOSMID as id,
    date_format(o.FCREATEDATE,'%d/%m/%Y %h:%i:%s %p') as upddate,
    d.fexamname,o.FUPDDEPT,fpath,ifnull(fapprstatus,'Pending') as fapprstatus,FLINK
    FROM degree d inner join osmmain o on d.fdegree = o.fdegree 
    and d.fexamno = o.fexamno 
    inner join subject su on su.fdegree = o.fdegree and su.fexamno = o.fexamno
    and su.fsubcode = o.fsubcode and su.fintass = 'F'
    left join osmdetl od  on d.fdegree = od.fdegree
    and od.fexamno = o.fexamno
    and od.fsubcode = o.fsubcode
    where o.fdegree = '{$fdegree}'
    and o.fcollcode = '{$college}'
    {$cnd} {$cnd1}
    group by o.fdegree,o.fexamno,o.fsubcode,o.FCHAPTER
    order by d.fdescpn,d.fexamno";
    $lobj_get_data = $aobj_context->mobj_db->GetAll($Query);
    
    $k=0;
    $sl_no=1;
    foreach($lobj_get_data as $ak=>$av)
    {
     
        $fdescpn=$av['fdescpn'];
        $fexamname=$av['fexamname'];
        $upddate=$av['upddate'];
        $viewed=$av['viewed'];
        $fchapter=$av['fchapter'];
        $fsubname=$av['fsubname'];
        $fpath = $av['fpath'];
        $FLINK = $av['FLINK'];
        $id = $av['id'];
        $FUPDTEACH = $av['FUPDTEACH'];
    
        if($k%2==0)
        $class='tbl_row1';
        else
        $class='tbl_row_alter1';

        $str_reval.="<tr>";		
        $str_reval.="<td class='{$class}' style=' font-size:12px; text-align:center; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' >{$sl_no}</td>";
        $str_reval.="<td class='{$class}' style=' font-size:12px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; text-align:center; ' >&nbsp;{$upddate}</td>";
        $str_reval.="<td class='{$class}' style=' font-size:12px; text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; text-align:center;  ' >{$FUPDTEACH}&nbsp;</td>";
        // $str_reval.="<td class='{$class}' style=' font-size:12px; text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; text-align:center;  ' >&nbsp;{$fdescpn}</td>";
        $str_reval.="<td class='{$class}' style=' font-size:12px; text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; text-align:center; ' >{$fexamname}</td>";
        $str_reval.="<td class='{$class}' style=' font-size:12px; text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; text-align:left; ' >{$fsubname}</td>";
        $str_reval.="<td class='{$class}' style=' font-size:12px; text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; text-align:left; ' >{$fchapter}</td>";
        $str_reval.="<td class='{$class}' style=' font-size:12px; text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; text-align:center; ' >{$viewed}</td>";

        if($fpath !='')
            $str_reval.="<td class='{$class}' align='center' style=' font-size:12px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-weight:bold;text-align:center;' ><a href='https://online-univ-study-material.s3.ap-south-1.amazonaws.com/{$univcode}/{$fpath}' target='_blank' style='color:blue;text-decoration:none;' >View</a></td>"; 
        else
            $str_reval.="<td class='{$class}' align='center' style=' font-size:12px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-weight:bold;text-align:center;' ><a href='{$FLINK}' target='_blank' style='color:blue;text-decoration:none;' >View</a></td>"; 
        
        $str_reval.="<td class='{$class}' align='center' style=' font-size:12px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-weight:bold;text-align:center;' ><a href='#' onclick = 'deleteStudyMat({$id})' style='color:red;text-decoration:none;' >Delete</a></td>"; 
        $str_reval.="</tr>";
        $sl_no++;
        $k++;
    }


	if($lobj_get_data)
	{
	
		$data = "Uploaded Successfully";
		echo $aobj_context->mobj_output->ToJSONEnvelope($str_reval,0,"success"); 
		return;
	}
	else
	{
		$data = "No Documents Uploaded";
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
		return;
	}

}

function deleteStudyMat($aobj_context)
{
    $id    = stripslashes($aobj_context->mobj_data["id"]);

    $query = "delete from osmmain where FOSMID = '{$id}'";
    $lobj_get_data = $aobj_context->mobj_db->Execute($query);

    if($lobj_get_data)
	{
	
		$data = "Deleted Successfully";
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"success"); 
		return;
	}
	else
	{
		$data = "Deletion failure Please try after some time";
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
		return;
	}
}


function getStuddeg($aobj_context)
{
    $college = $_SESSION['collcode'];

    $select_qry = "select distinct d.fdegree, concat(d.fdegree,' - ',d.fdescpn) as fdescpn
	FROM degree d inner join osmmain s on d.fdegree = s.fdegree
	where ifnull(d.fcurrexam,'') = 'T'
	and s.fcollcode = '{$college}'
	and d.fexamno = s.fexamno
	order by fdescpn"; 
   // var_dump($select_qry);
	$cntrresults = $aobj_context->mobj_db->GetAll($select_qry);

	

    if($cntrresults)
	{
	
		$data = "Deleted Successfully";
		echo $aobj_context->mobj_output->ToJSONEnvelope($cntrresults,0,"success"); 
		return;
	}
	else
	{
		$data = "Deletion failure Please try after some time";
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
		return;
	}
}

?>