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.166.34
<?php
function savepost($aobj_context)
{
session_start();
$userid = $_SESSION['userid'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$postappiled = trim($aobj_context->mobj_data["postappiled"]);
$subjectapplied = trim($aobj_context->mobj_data["subjectapplied"]);
$fvacancies = trim($aobj_context->mobj_data["fvacancies"]);
if($fvacancies == 'Current Vacancies')
$vac = '10';
if($fvacancies == 'Reserved Vacancies(But not filled / Backlog)')
$vac = '11';
$appno = $userid.$vac.$postappiled.$subjectapplied;
//$_SESSION['appno'] = $appno;
$query = "INSERT INTO postdet(fuserid,fdegncode,fdegree,fappno,fvacancies) values('{$userid}','{$postappiled}','{$subjectapplied}','{$appno}','{$fvacancies}')";
$results = $aobj_context->mobj_db->Execute($query);
$query = "insert into perdetl(fuserid) values('{$userid}')";
$result = $aobj_context->mobj_db->Execute($query);
if($results)
{
$query = "select md.fdegndesc,mc.fdescpn,p.fappno,p.fvacancies,ifnull(p.fpaymentstatus,'Pending') as fpaymentstatus,fappstatus
from postdet p inner join mascourse mc on p.fdegree = mc.fdegree
inner join masdegn md on md.fdegncode = p.fdegncode
where fuserid = '{$userid}'";
$results = $aobj_context->mobj_db->getAll($query);
$i = 1;
$table ='';
foreach($results as $value)
{
if($value['fpaymentstatus']== 'Pending' || $value['fpaymentstatus']== 'failure')
{
$disabled = "";
$disabledtrue = "disabled";
}
if($value['fappstatus'] == 'T' || $value['fpaymentstatus'] == 'success')
{
$disabledtrue = "";
$disabled = "disabled";
}
$table.="<tr style = 'height:25px;'>";
$table.="<td><input type = 'text' id='postid_{$i}' disabled class='form-control1' value = '{$i}'></td>";
$table.="<td><input type = 'text' id='postvac_{$i}' value = '{$value['fvacancies']}' disabled class='form-control1'></td>";
$table.="<td><input type = 'text' id='postdeg_{$i}' value = '{$value['fdegndesc']}' disabled class='form-control1'></td>";
$table.="<td><input type = 'text' id='postsub_{$i}' disabled value = '{$value['fdescpn']}' class='form-control1'></td>";
$table.="<td><input type = 'text' id='postapplication_{$i}' disabled value ='{$value['fappno']}' class='form-control1'></td>";
$table.="<td align='center'></td>";
$table.="<td align='center'>{$value['fpaymentstatus']}</td>";
$table.="<td align='center'><button id='postprint_{$i}' {$disabledtrue} onclick='Printapplicationhome(\"{$value['fappno']}\");' class='btn btn-primary';type='submit';'>Print Application</button></td>";
$table.="</tr>";
$i++;
}
$rst['table'] = $table;
echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success");
}else
{
$query = "select md.fdegndesc,mc.fdescpn,p.fappno,p.fvacancies,ifnull(p.fpaymentstatus,'Pending') as fpaymentstatus,fappstatus
from postdet p inner join mascourse mc on p.fdegree = mc.fdegree
inner join masdegn md on md.fdegncode = p.fdegncode
where fuserid = '{$userid}'";
$results = $aobj_context->mobj_db->getAll($query);
$i = 1;
$table ='';
foreach($results as $value)
{
if($value['fpaymentstatus']== 'Pending' || $value['fpaymentstatus']== 'failure')
{
$disabled = "";
$disabledtrue = "disabled";
}
if($value['fappstatus'] == 'T' || $value['fpaymentstatus'] == 'success')
{
$disabledtrue = "";
$disabled = "disabled";
}
$table.="<tr style = 'height:25px;'>";
$table.="<td><input type = 'text' id='postid_{$i}' disabled class='form-control1' value = '{$i}'></td>";
$table.="<td><input type = 'text' id='postvac_{$i}' value = '{$value['fvacancies']}' disabled class='form-control1'></td>";
$table.="<td><input type = 'text' id='postdeg_{$i}' value = '{$value['fdegndesc']}' disabled class='form-control1'></td>";
$table.="<td><input type = 'text' id='postsub_{$i}' disabled value = '{$value['fdescpn']}' class='form-control1'></td>";
$table.="<td><input type = 'text' id='postapplication_{$i}' disabled value ='{$value['fappno']}' class='form-control1'></td>";
$table.="<td align='center'></td>";
$table.="<td align='center'>{$value['fpaymentstatus']}</td>";
$table.="<td align='center'><button id='postprint_{$i}' {$disabledtrue} onclick='Printapplicationhome(\"{$value['fappno']}\");' class='btn btn-primary';type='submit';'>Print Application</button></td>";
$table.="</tr>";
$i++;
}
$rst['table'] = $table;
echo $aobj_context->mobj_output->ToJSONEnvelope($rst,-1,"success");
}
}
function loadapplieddetails($aobj_context)
{
$userid = $_SESSION['userid'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$query = "select md.fdegndesc,mc.fdescpn,p.fappno,p.fvacancies,ifnull(p.fpaymentstatus,'Pending') as fpaymentstatus,fappstatus
from postdet p inner join mascourse mc on p.fdegree = mc.fdegree
inner join masdegn md on md.fdegncode = p.fdegncode
where fuserid = '{$userid}'";
$results = $aobj_context->mobj_db->getAll($query);
$i = 1;
$table ='';
foreach($results as $value)
{
if($value['fpaymentstatus']== 'Pending' || $value['fpaymentstatus']== 'failure')
{
$disabled = "";
$disabledtrue = "disabled";
}
if($value['fappstatus'] == 'T' || $value['fpaymentstatus'] == 'success')
{
$disabledtrue = "";
$disabled = "disabled";
}
$table.="<tr style = 'height:25px;'>";
$table.="<td><input type = 'text' id='postid_{$i}' disabled class='form-control1' value = '{$i}'></td>";
$table.="<td><input type = 'text' id='postvac_{$i}' value = '{$value['fvacancies']}' disabled class='form-control1'></td>";
$table.="<td><input type = 'text' id='postdeg_{$i}' value = '{$value['fdegndesc']}' disabled class='form-control1'></td>";
$table.="<td><input type = 'text' id='postsub_{$i}' disabled value = '{$value['fdescpn']}' class='form-control1'></td>";
$table.="<td><input type = 'text' id='postapplication_{$i}' disabled value ='{$value['fappno']}' class='form-control1'></td>";
$table.="<td align='center'></td>";
$table.="<td align='center'>{$value['fpaymentstatus']}</td>";
$table.="<td align='center'><button id='postprint_{$i}' {$disabledtrue} onclick='Printapplicationhome(\"{$value['fappno']}\");' class='btn btn-primary';type='submit';'>Print Application</button></td>";
$table.="</tr>";
$i++;
}
if($results)
{
$rst['table'] = $table;
echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success");
}else
{
$rst['msg'] = '';
echo $aobj_context->mobj_output->ToJSONEnvelope($rst,-1,"Failure");
}
}
function logoutsession($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
session_unset($_SESSION['username']);
session_unset($_SESSION['userid']);
$data='logged out successfully';
echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"Success");
}
function isloggedinvalidate($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
if(isset($_SESSION['username']) && isset($_SESSION['userid']))
{
$html['data']=1;
}
else
{
$html['data'] = 0;
}
echo $aobj_context->mobj_output->ToJSONEnvelope($html,0,"success");
return;
}
?>
|