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.16.50.1
<?php
function getDefaultDispatchAnswersScriptQp($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;'>QP Code</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.FQPCODE,s.FSUBNAME,c.FNOBUNDLE,c.FTOTSCRIPT
from colldesp c inner join subject s on
s.FQPCODE=c.FQPCODE
where c.FCOLLCODE='{$college_code}'and
c.FDOE='{$dsp_date}' and c.FSESSION='{$dsp_session}' and c.FDELETED='F'
group by c.FQPCODE,s.FSUBNAME " ;
$lobj_get_records = $aobj_context->mobj_db->GetAll($get_records);
$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='dispatch_degree_{$r_id}' value='{$value[FQPCODE]}'></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='dispatch_buddles_{$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='dispatch_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 saveDispatchAnswerScriptsQp($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++)
{
if(empty($dispatch_data[$k]->qp_code)) continue;
$delete="delete from colldesp
where FCOLLCODE='{$college_code}'
and FDOE='{$dispatch_doe}'
and FSESSION='{$dispatch_session}'
and FQPCODE='{$dispatch_data[$k]->qp_code}'
";
$lobj_delete = $aobj_context->mobj_db->Execute($delete);
$insert_colldesp="insert into colldesp(
FCOLLCODE,
FDOE,
FSESSION,
FQPCODE,
FNOBUNDLE,
FTOTSCRIPT,
FDELETED)
values
(
'{$college_code}',
'{$dispatch_doe}',
'{$dispatch_session}',
'{$dispatch_data[$k]->qp_code}',
'{$dispatch_data[$k]->degree_bundle}',
'{$dispatch_data[$k]->degree_script}',
'F'
) ";
$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;
}
}
?>
|