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.15.18.73
<?php
function getDefaultDispatchAnswersScript($aobj_context)
{
session_start();
$college_code = $_SESSION['collcode'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$dsp_date = $aobj_context->mobj_data["date"];
$dsp_session = $aobj_context->mobj_data["session"];
$e_data.="<table align = 'center' width='100%' cellspacing='0' cellpadding='1' border='0' >";
$e_data.="<th align='left' colspan='7' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:24px;'>Bundle Details</th>";
$e_data.="<tr class='ui-state-default ui-jqgrid-hdiv'>";
$e_data.="<td align='center' style='width:155px; font-size:12px; border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Degree</td>";
$e_data.="<td align='center' style='width:155px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Exam</td>";
$e_data.="<td align='center' style='width:155px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>SubCode</td>";
$e_data.="<td align='center' style='width:155px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Name</td>";
$e_data.="<td align='center' style='width:155px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Bundles</td>";
$e_data.="<td align='center' style='width:155px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Script</td>";
$e_data.="</tr>";
$get_records =" select c.FDEGREE,c.FEXAMNO,c.FCSUBCODE,s.FSUBNAME,c.FNOBUNDLE,c.FTOTSCRIPT
from colldesp c inner join subject s on
c.FDEGREE=s.FDEGREE and c.FCSUBCODE=s.FCSUBCODE and c.FEXAMNO=s.FEXAMNO
where c.FCOLLCODE='{$college_code}'and
c.FDOE='{$dsp_date}' and c.FSESSION='{$dsp_session}' and c.FDELETED='F' " ;
$lobj_get_records = $aobj_context->mobj_db->GetAll($get_records);
// echo $get_records;
//var_dump($lobj_get_records); die();
$k=0;
$r_id = 1;
foreach($lobj_get_records as $key=>$value)
{
$e_data.="<tr class={$class}>";
$e_data.="<td align='left' style=' border-bottom:1px solid #C5DBEC; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC;'><input name='dispatch_answer_scripts' {$inp_class} type=text style='width:70px;border:none;' readonly id='d_degree_{$r_id}' value='{$value[FDEGREE]}'></td>";
$e_data.="<td align='left' style=' border-bottom:1px solid #C5DBEC; border-right:1px solid #C5DBEC;'><input {$inp_class} type=text style='width:30px;border:none;' readonly id='d_exam_{$r_id}' value='{$value[FEXAMNO]}'></td>";
$e_data.="<td align='left' style=' border-bottom:1px solid #C5DBEC; border-right:1px solid #C5DBEC;'><input {$inp_class} type=text style='width:85px;border:none;' readonly id='d_code_{$r_id}' value='{$value[FCSUBCODE]}'></td>";
$e_data.="<td align='left' style=' border-bottom:1px solid #C5DBEC; border-right:1px solid #C5DBEC;'><input {$inp_class} type=text style='width:210px;border:none;' readonly id='d_name_{$r_id}' value='{$value[FSUBNAME]}'></td>";
$e_data.="<td align='right' style=' border-bottom:1px solid #C5DBEC; padding:2px; border-right:1px solid #C5DBEC;'><input type='text' id='d_bundles_{$r_id}' style='width:80px; text-align:Right' value='{$value[FNOBUNDLE]}' ></td>";
$e_data.="<td align='right' style=' border-bottom:1px solid #C5DBEC; padding:2px;border-right:1px solid #C5DBEC;'><input type='text' id='d_script_{$r_id}' style='width:80px; text-align:Right' value='{$value[FTOTSCRIPT]}' ></td>";
$e_data.="</tr>";
$k++;
$r_id++;
}
$e_data.="</table><br>";
//$e_data.="<center> <a href='#' onclick='MarkEnterySubjectWiseTablePrevPage()' style='color:#FF9900'><b>Prev</b></a> ";
//$e_data.="<a href='#' onclick='MarkEnterySubjectWiseTableNextPage()' style='color:#FF9900'><b>Next</b></a></center>";
$arr['html']=$e_data;
$arr['table_data']=$lobj_get_records;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
function saveDispatchAnswerScripts($aobj_context)
{
session_start();
$college_code = $_SESSION['collcode'];
$u_id = $_SESSION['user_id'];
$log_name = $_SESSION['usr'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$dispatch_doe=trim($aobj_context->mobj_data["doe"]);
$dispatch_session=trim($aobj_context->mobj_data["session"]);
$Type=trim($aobj_context->mobj_data["Type"]);
include_once("/JSON.php");
$json = new Services_JSON();
$lstr_param = stripslashes($aobj_context->mobj_data["disp_arr"]);
$mobj_jsondata = $json->decode($lstr_param);
$dispatch_data = get_object_vars($mobj_jsondata);
for($k=0;$k<count($dispatch_data);$k++)
{
$insert_colldesp="insert into colldesp(
FCOLLCODE,
FDOE,
FSESSION,
FDEGREE,
FEXAMNO,
FCSUBCODE,
FNOBUNDLE,
FTOTSCRIPT,
FDELETED)
values
(
'{$college_code}',
'{$dispatch_doe}',
'{$dispatch_session}',
'{$dispatch_data[$k]->degree_code}',
'{$dispatch_data[$k]->degree_exam}',
'{$dispatch_data[$k]->degree_subcode}',
'{$dispatch_data[$k]->degree_bundle}',
'{$dispatch_data[$k]->degree_script}',
'F'
) ";
//echo $insert_colldesp; die();
$lobj_insert_colldesp = $aobj_context->mobj_db->Execute($insert_colldesp);
// var_dump($lobj_insert_colldesp); die();
if($lobj_insert_colldesp)
{
$arr='Inserted Successfully';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
else
{
$arr='Insertion Failed';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
}
}
?>
|