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.144.4.50
<?php
/*
*
* FOR THE IDENTIFY TRANSACTION FORM
* PROGRAMED BY NAVEEN
* DATE: 31/03/09
* TIME: 10:45 AM
*
*/
function getITModuleData($aobj_context)
{
session_start();
$college_code = $_SESSION['collcode'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$degree_code=trim($aobj_context->mobj_data["degree_range"]);
$degree_code=($degree_code=='')?" ":" where FDEGREE like '%{$degree_code}%'";
$get_degree_code = " select A.FDEGREE, A.FDESCPN, IF(B.FDELETED='F','CHECKED',' ') AS CHECKED from
(select FDEGREE, FDESCPN from degree {$degree_code}
group by FDEGREE) A
LEFT JOIN colldeg B on A.FDEGREE = B.FDEGREE and B.FCOLLCODE='{$college_code}'
group by A.FDEGREE ";
$lobj_get_degree_code = $aobj_context->mobj_db->getAll($get_degree_code);
// var_dump($lobj_get_degree_code); die();
$arr['error']=1;
if(!empty($lobj_get_degree_code))
{
$e_data.="<table align = 'center' width='100%' cellspacing='0' cellpadding='1' border='0' >";
$e_data.="<th align='left' colspan='6' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:24px;'>Transaction Module</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;'>Sl.No.</td>";
$e_data.="<td align='center' style='width:155px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Degree Code</td>";
$e_data.="<td align='center' style='width:155px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Degree Descriptions</td>";
$e_data.="<td align='center' style='width:155px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Select</td>";
$e_data.="</tr>";
$k=0;
$id=0;
$m=0;
//var_dump($lobj_get_moudle_names); die();
$counter_degree = 1;
foreach($lobj_get_degree_code as $key=>$value)
{
if($k%2==0)
{
$class='tbl_row';
$inp_class='tbl_row_input';
}
else
{
$input_class='tbl_row1';
$inp_class='tbl_row1_input';
}
$checked=($value['CHECKED']!='CHECKED')?" ":"checked";
$e_data.="<tr class='ui-widget-content jqgrow'>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px; ' id='it_cnt_{$id}' >{$counter_degree}</td>";
$e_data.="<td class='tbl_row_new' style='border-right:1px solid #C5DBEC; padding:2px; font-size:12px; ' id='it_mname_{$id}' >{$value[FDEGREE]}</td>";
$e_data.="<td class='tbl_row_new' style=' border-right:1px solid #C5DBEC; padding:2px; font-size:12px; ' id='it_dname_{$id}' >{$value[FDESCPN]}</td>";
$e_data.="<td align='center' class='tbl_row_new' style=' border-right:1px solid #C5DBEC; padding:2px; font-size:12px; ' id='it_dname_{$id}' ><input type='checkbox' id='it_fmodule_{$id}' {$checked} ></td>";
/* $e_data.="<td align='Left' style='width: 5px; border-left:1px solid #ccc; padding:4px;' id='it_cnt_{$id}' >{$counter_degree}</td>";
$e_data.="<td align='Left' style='width: 60px; padding:4px;' id='it_mname_{$id}' >{$value[FDEGREE]}</td>";
$e_data.="<td align='Left' style='width: 200px;padding:4px;' id='it_dname_{$id}' >{$value[FDESCPN]}</td>";
$e_data.="<td align='Center' style='width: 10px; padding:2px;'><input type='checkbox' id='it_fmodule_{$id}' {$checked} ></td>";
*/ $e_data.="</tr>";
$k++;
$id++;
$m++;
$counter_degree++;
}
$e_data.="</table>";
$arr['total_count']= $m;
$arr['html']=$e_data;
$arr['error']=0;
}
// var_dump($arr['html']); die();
if($arr['error']==0)
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
else
{
$error_msg = "Invalid Degree Code..!";
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"success");
}
return;
}
function saveIdentifyTransactions($aobj_context)
{
session_start();
$college_code = $_SESSION['collcode'];
$log_name=$_SESSION['usr'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
include_once("/JSON.php");
$json = new Services_JSON();
$lstr_param = stripslashes($aobj_context->mobj_data["mod_arr"]);
$mobj_jsondata = $json->decode($lstr_param);
$mod_arr_data = get_object_vars($mobj_jsondata);
//echo "<pre>"; print_r($mod_arr_data); die();
for($k=0;$k<count($mod_arr_data);$k++)
{
$check_dup="select count(*) as count from colldeg where
FCOLLCODE='{$college_code}' and FDEGREE='{$mod_arr_data[$k]->name}'";
$lobj_check_dup = $aobj_context->mobj_db->getRow($check_dup);
$dup_flag=$lobj_check_dup[count];
//echo $check_dup; die();
if($mod_arr_data[$k]->it_fmodule && $dup_flag==0 )
{
$insert_colldeg =" insert into colldeg( FCOLLCODE,
FDEGREE,
FDELETED,
FLOGNAME,
FLOGDATE
) value
(
'{$college_code}',
'{$mod_arr_data[$k]->name}',
'F',
'{$log_name}',
now()
)";
//echo $insert_colldeg; die();
$lobj_insert_colldeg = $aobj_context->mobj_db->Execute($insert_colldeg);
//echo $insert_colldeg;
}// end of if
else if($mod_arr_data[$k]->it_fmodule == 0 && $dup_flag!=0)
{
$update_colldeg_pre_data= " update colldeg set FDELETED='T'
where FCOLLCODE='{$college_code}' and FDEGREE='{$mod_arr_data[$k]->name}'";
$lobj_update_colldeg_pre_data = $aobj_context->mobj_db->Execute($update_colldeg_pre_data);
}
else if($mod_arr_data[$k]->it_fmodule == 1 && $dup_flag!=0)
{
$update_colldeg_pre_data= " update colldeg set FDELETED='F'
where FCOLLCODE='{$college_code}' and FDEGREE='{$mod_arr_data[$k]->name}'";
$lobj_update_colldeg_pre_data = $aobj_context->mobj_db->Execute($update_colldeg_pre_data);
}
//ECHO $update_colldeg_pre_data; DIE();
} //end of for
if($lobj_insert_colldeg || $lobj_delete_from_colldeg_pre_data )
{
$arr='Inserted Successfully';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
else
{
$arr='Inserted Successfully';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
}
?>
|