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.217.116.245
<?php
function getdatedetails($aobj_context)
{
$fdaterange = trim($aobj_context->mobj_data["fdaterange"]);
$college_code_from = trim($aobj_context->mobj_data["college_code_from"]);
$college_code_to = trim($aobj_context->mobj_data["college_code_to"]);
$degree_code_from = trim($aobj_context->mobj_data["degree_code_from"]);
$degree_code_to = trim($aobj_context->mobj_data["degree_code_to"]);
$Examno_from = trim($aobj_context->mobj_data["Examno_from"]);
$Examno_to = trim($aobj_context->mobj_data["Examno_to"]);
if($fdaterange == 'adm' )
{
$fileds = "FADMFROM,FADMTO";
}else if( $fdaterange == 'exam' )
{
$fileds = "FAPPFROM,FAPPTO";
}else if($fdaterange == 'ht')
{
$fileds = "FHTFROM,FHTTO";
}else if($fdaterange == 'iam')
{
$fileds = "FIAFROM,FIATO";
}else if($fdaterange == 'prm')
{
$fileds = "FPRFROM,FPRTO";
}
$query = "select fcollcode,fdegree,fexamno,{$fileds} from collexam
where fcollcode between '{$college_code_from}' and '{$college_code_to}'
and fdegree between '{$degree_code_from}' and '{$degree_code_to}'
and fexamno between '{$Examno_from}' and '{$Examno_to}'
order by fcollcode,fdegree,fexamno";
$result = $aobj_context->mobj_db->getAll($query);
foreach($result as $key => $value)
{
$table.="<table id ='ftable1' align='left' cellpadding='2' cellspacing='1' border='1' style='width:650px;overflow:auto;margin:0px;padding:0px;'>";
$table.="<tr >";
$table.="<td align='center' style='width:122px' >{$value['fcollcode']}</td>";
$table.="<td align='center' style='width:120px' >{$value['fdegree']}</td>";
$table.="<td align='center' style='width:90px' >{$value[fexamno]}</td>";
$table.="<td align='center' style='width:100px' >{$value[3]}</td>";
$table.="<td align='center' style='width:100px' >{$value[4]}</td>";
$table.="</tr>";
$table.="</table>";
}
if($result)
{
$arr['table'] = $table;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
}
function SaveDateRange($aobj_context)
{
$fdaterange = trim($aobj_context->mobj_data["fdaterange"]);
$college_code_from = trim($aobj_context->mobj_data["college_code_from"]);
$college_code_to = trim($aobj_context->mobj_data["college_code_to"]);
$degree_code_from = trim($aobj_context->mobj_data["degree_code_from"]);
$degree_code_to = trim($aobj_context->mobj_data["degree_code_to"]);
$Examno_from = trim($aobj_context->mobj_data["Examno_from"]);
$Examno_to = trim($aobj_context->mobj_data["Examno_to"]);
$fdate = trim($aobj_context->mobj_data["fdate"]);
$tdate = trim($aobj_context->mobj_data["tdate"]);
if($fdaterange == 'adm' )
{
$fileds = "FADMFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d') , FADMTO = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
}else if( $fdaterange == 'exam' )
{
$fileds = "FAPPFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d'), FAPPTO = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
}else if($fdaterange == 'ht')
{
$fileds = "FHTFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d') , FHTTO = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
}else if($fdaterange == 'iam')
{
$fileds = "FIAFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d'), FIATO = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
}else if($fdaterange == 'prm')
{
$fileds = "FPRFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d') , FPRTO = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
}
$query = "update collexam set
{$fileds}
where fdegree between '{$degree_code_from}' and '{$degree_code_to}'
and fexamno between '{$Examno_from}' and '{$Examno_to}'
and fcollcode between '{$college_code_from}' and '{$college_code_to}'";
$lobj_update = $aobj_context->mobj_db->Execute($query);
if($lobj_update)
{ $arr = "updated success";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$error_msg = "updation failed";
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"success");
}
}
?>
|