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.118.151.112
<?php
class applicationForm
{
function __construct($aobj_context)
{
session_start();
$this->aobj_context=$aobj_context;
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$this->aobj_context=$aobj_context;
$this->ip=$_SERVER["REMOTE_ADDR"];
}
function assignParams()
{
$this->edit_app_code=trim($this->aobj_context->mobj_data["edit_app_code"]);
$this->fcntrcode=trim($this->aobj_context->mobj_data["fcntrcode"]);
$this->fsubcode=trim($this->aobj_context->mobj_data["fsubcode"]);
$this->fname=trim($this->aobj_context->mobj_data["fname"]);
$this->fmotname=trim($this->aobj_context->mobj_data["fmotname"]);
$this->ffatname=trim($this->aobj_context->mobj_data["ffatname"]);
$this->fspousename=trim($this->aobj_context->mobj_data["fspousename"]);
$this->fdob=trim($this->aobj_context->mobj_data["fdob"]);
$this->fgender=trim($this->aobj_context->mobj_data["fgender"]);
$this->fdomicile=trim($this->aobj_context->mobj_data["fdomicile"]);
$this->fph=trim($this->aobj_context->mobj_data["fph"]);
$this->fexserv=trim($this->aobj_context->mobj_data["fexserv"]);
$this->fnss=trim($this->aobj_context->mobj_data["fnss"]);
$this->fsports=trim($this->aobj_context->mobj_data["fsports"]);
$this->f371=trim($this->aobj_context->mobj_data["f371"]);
$this->fproj=trim($this->aobj_context->mobj_data["fproj"]);
$this->frural=trim($this->aobj_context->mobj_data["frural"]);
$this->fkannada=trim($this->aobj_context->mobj_data["fkannada"]);
$this->fqualify=trim($this->aobj_context->mobj_data["fqualify"]);
$this->fpob=trim($this->aobj_context->mobj_data["fpob"]);
$this->fcatcode=trim($this->aobj_context->mobj_data["fcatcode"]);
$this->freligion=trim($this->aobj_context->mobj_data["freligion"]);
$this->fcaste=trim($this->aobj_context->mobj_data["fcaste"]);
$this->fsubcaste=trim($this->aobj_context->mobj_data["fsubcaste"]);
$this->fnational=trim($this->aobj_context->mobj_data["fnational"]);
$this->fqualexam=trim($this->aobj_context->mobj_data["fqualexam"]);
$this->fqualdur=trim($this->aobj_context->mobj_data["fqualdur"]);
$this->fcollname=trim($this->aobj_context->mobj_data["fcollname"]);
$this->funivname=trim($this->aobj_context->mobj_data["funivname"]);
$this->fregno=trim($this->aobj_context->mobj_data["fregno"]);
$this->fadmyear=trim($this->aobj_context->mobj_data["fadmyear"]);
$this->fpassyear=trim($this->aobj_context->mobj_data["fpassyear"]);
$this->fattempts=trim($this->aobj_context->mobj_data["fattempts"]);
$this->fpermmcregno=trim($this->aobj_context->mobj_data["fpermmcregno"]);
$this->fstmcno=trim($this->aobj_context->mobj_data["fstmcno"]);
$this->fcentmcno=trim($this->aobj_context->mobj_data["fcentmcno"]);
$this->foccupation=trim($this->aobj_context->mobj_data["foccupation"]);
$this->fadd1=trim($this->aobj_context->mobj_data["fadd1"]);
$this->fpincode=trim($this->aobj_context->mobj_data["fpincode"]);
$this->fphone=trim($this->aobj_context->mobj_data["fphone"]);
$this->fmobile=trim($this->aobj_context->mobj_data["fmobile"]);
$this->femail=trim($this->aobj_context->mobj_data["femail"]);
$this->finservice=trim($this->aobj_context->mobj_data["finservice"]);
$this->fdeptcode=trim($this->aobj_context->mobj_data["fdeptcode"]);
$this->fworkplace=trim($this->aobj_context->mobj_data["fworkplace"]);
$this->fservrend=trim($this->aobj_context->mobj_data["fservrend"]);
$this->fspeciality=trim($this->aobj_context->mobj_data["fspeciality"]);
$this->fdos=trim($this->aobj_context->mobj_data["fdos"]);
$this->fprobdecl=trim($this->aobj_context->mobj_data["fprobdecl"]);
$this->fdop=trim($this->aobj_context->mobj_data["fdop"]);
$this->fpgdegree=trim($this->aobj_context->mobj_data["fpgdegree"]);
$this->fpgdescpn=trim($this->aobj_context->mobj_data["fpgdescpn"]);
$this->fpgcompdate=trim($this->aobj_context->mobj_data["fpgcompdate"]);
$this->fenquiry=trim($this->aobj_context->mobj_data["fenquiry"]);
$this->fsuspension=trim($this->aobj_context->mobj_data["fsuspension"]);
$this->fabsence=trim($this->aobj_context->mobj_data["fabsence"]);
$this->fremarks=trim($this->aobj_context->mobj_data["fremarks"]);
$this->fpaymode=trim($this->aobj_context->mobj_data["fpaymode"]);
$this->famount=trim($this->aobj_context->mobj_data["famount"]);
if(empty($this->famount))
$this->famount=800;
if($this->fsuspension=="undefined")
$this->fsuspension="";
if($this->fabsence=="undefined")
$this->fabsence="";
}
function SaveDetails()
{
$check_dup="select count(*) as dup_cnt from student
where
fname='{$this->fname}'
and fmotname='{$this->fmotname}'
and ffatname='{$this->ffatname}'
and fdob='{$this->fdob}'";
$obj_check_dup=$this->aobj_context->mobj_db->GetRow($check_dup);
if($obj_check_dup[dup_cnt]>0)
{
$data="You have allready Entered the details.Please take Report";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
else if(empty($this->fname))
{
$data="Please Enter the Candidate Name";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}else if(empty($this->famount))
{
$data="Registration fee should be greater than zero";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
else if(empty($this->fphone))
{
$data="Please Enter the Phone Number";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}else if(empty($this->fpincode))
{
$data="Please Enter the Pin Code";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}else if(empty($this->fmobile))
{
$data="Please Enter the Mobile Number";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
$insert_qry=" insert into student
(
fcntrcode, fsubcode, fname,
fmotname,ffatname, fspousename,
fdob, fpob, fgender,
fdomicile, fph, fexserv, fnss, fsports, f371, fproj, frural, fkannada,
fcatcode, freligion, fcaste, fnational,famount, fqualexam, fqualify,
fqualdur, fcollname, funivname,
fregno, fadmyear,
fpassyear, fattempts, fpermmcregno,
fstmcno, fcentmcno, foccupation,
fadd1, fpincode, fphone,
fmobile, femail, finservice,
fdeptcode,
fworkplace, fservrend,fspeciality, fdos,
fprobdecl, fdop,
fpgdegree, fpgdescpn,
fpgcompdate,fenquiry,
fsuspension,fabsence,
fremarks,
created_date,
ip_address ,fpaymode
)
values
( '{$this->fcntrcode}', '{$this->fsubcode}', '{$this->fname}',
'{$this->fmotname}','{$this->ffatname}', '{$this->fspousename}',
'{$this->fdob}', '{$this->fpob}', '{$this->fgender}',
'{$this->fdomicile}', '{$this->fph}', '{$this->fexserv}', '{$this->fnss}', '{$this->fsports}', '{$this->f371}', '{$this->fproj}', '{$this->frural}', '{$this->fkannada}',
'{$this->fcatcode}', '{$this->freligion}', '{$this->fcaste}','{$this->fnational}','{$this->famount}', '{$this->fqualexam}', '{$this->fqualify}',
'{$this->fqualdur}', '{$this->fcollname}', '{$this->funivname}',
'{$this->fregno}', '{$this->fadmyear}',
'{$this->fpassyear}', '{$this->fattempts}', '{$this->fpermmcregno}',
'{$this->fstmcno}', '{$this->fcentmcno}', '{$this->foccupation}',
'{$this->fadd1}', '{$this->fpincode}', '{$this->fphone}',
'{$this->fmobile}', '{$this->femail}', '{$this->finservice}',
'{$this->fdeptcode}',
'{$this->fworkplace}', '{$this->fservrend}','{$this->fspeciality}', '{$this->fdos}',
'{$this->fprobdecl}', '{$this->fdop}',
'{$this->fpgdegree}', '{$this->fpgdescpn}',
'{$this->fpgcompdate}','{$this->fenquiry}',
'{$this->fsuspension}','{$this->fabsence}',
'{$this->fremarks}',
date_add(date_add(now(),INTERVAL 13 hour),interval 30 minute),'{$this->ip}','{$this->fpaymode}') ";
$insert_obj=$this->aobj_context->mobj_db->Execute($insert_qry);
$error=mysql_error();;
$this->last_inserted_id = $this->aobj_context->mobj_db->Insert_ID();
if($this->last_inserted_id)
{
$this->UpdateApplicationUniqueNo();
}
else
{
$data="Error While Inserting".$error.$this->fabsence ;;
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
}
function UpdateApplicationUniqueNo()
{
$get_last_no="select last_no+1 as app_no from last_no";
$obj = $this->aobj_context->mobj_db->GetRow($get_last_no);
$this->app_no=$obj[app_no];
$update_last_no="update last_no set last_no=last_no+1";
$this->aobj_context->mobj_db->Execute($update_last_no);
$update_app_no="update student set app_no={$this->app_no}
where internal_code={$this->last_inserted_id}";
$this->aobj_context->mobj_db->Execute($update_app_no);
$college_path=$this->aobj_context->main_src."/student_photos/{$college_code}";
$folder_path=$this->aobj_context->main_src."/student_photos";
$file_name=basename($_FILES['student_entry_upload']['name']);
$path_arr=pathinfo($_FILES['student_entry_upload']['name']);
$file_ext=$path_arr['extension'];
$full_file_path= $folder_path.'/'.$this->app_no."_".$file_name;;
$image_path="student_photos/".$this->app_no."_".$file_name;;
if(isset($_FILES['student_entry_upload']['name']) && $_FILES['student_entry_upload']['name'] != '')
{
if(move_uploaded_file($_FILES['student_entry_upload']['tmp_name'],$full_file_path))
{
$update="update student set photo_path='{$image_path}'
where internal_code= {$this->last_inserted_id} ";
$up_obj=$this->aobj_context->mobj_db->Execute($update);
$data="{$this->app_no}";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,0,"success");
return;
}
else
{
$data="Error While Moving the Image";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
}
}
function GetApplicationDetails()
{
$this->app_no=trim($this->aobj_context->mobj_data["app_no"]);
$get_data=" select s.app_no, mas.fcntrcode ,
sub.fsubcode,
s.fname, s.fmotname, s.ffatname,
s.fspousename,
date_format(s.fdob,'%d/%m/%Y') as fdob,
s.fpob, s.fgender, s.fdomicile, s.fph, s.fexserv, s.fnss, s.fsports, s.f371, s.fproj, s.frural, s.fkannada,
s.fcatcode, s.freligion, s.fcaste,
s.fnational, s.famount,
s.fqualexam, s.fqualify, s.fqualdur, s.fcollname, s.funivname,
s.fregno, s.fadmyear, s.fpassyear, s.fattempts, s.fpermmcregno,
s.fstmcno, s.fcentmcno, s.foccupation, s.fadd1, s.fpincode,
s.fphone, s.fmobile, s.femail, s.finservice,
s.fdeptcode, s.fworkplace,s.fservrend,
s.fspeciality, photo_path,
date_format(s.fdos,'%d/%m/%Y') as fdos,
date_format(s.fdop,'%d/%m/%Y') as fdop,
date_format(s.fpgcompdate,'%d/%m/%Y') as fpgcompdate,
s.fprobdecl, s.fpgdegree,
s.fpgdescpn, s.fenquiry, s.fsuspension,
s.fabsence, s.fremarks,
s.photo_path, s.created_date, s.ip_address ,s.fpaymode
from student s
left join subject sub on sub.fsubcode=s.fsubcode
left join mascategory cat on cat.FCATEGORY=s.fcatcode
left join mascntr mas on mas.fcntrcode=s.fcntrcode
where app_no={$this->app_no}";
$lobj_get_data=$this->aobj_context->mobj_db->GetRow($get_data);
if(count($lobj_get_data)>0)
{
echo $this->aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"Success");
}
else
{
echo $this->aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,-1,"failure");
}
return;
}
function UpdateAuditTrial()
{
$audit_trial=" insert into student_audit_trial
( app_no, pget_val, subject,
candidate_name, mother_name, father_name,
spouse_name, dob, sex, pob, pob_others,
nationality, college, college_others,
univ, univ_others, cncl_reg_no, cncl_reg_name,
rotary, marks, u_pg, phq,
category_others, caste, sub_caste, dd_amt,
dd_no, dd_date, dd_bank, address, pin,
debared, email, phone, mobile, in_service_status,
dept, dept_others, plc_of_working, date_of_entry,
prob_period, prob_date, doing_pg, pg_degree_course,
pg_degree_date, pg_diploma_course, pg_diploma_date,
speciality, enq_pending, suspension, absence,
remarks, photo_path, f_max_marksa, f_sec_marksa,
f_no_attaa, f_max_marksb, f_sec_marksb,
f_no_attbb, f_max_marksc, f_sec_marksc,
f_no_attcc, f_max_marksd, f_sec_marksd,
f_no_attdd, f_tot_max_marks, f_tot_sec_marks,
f_percentage, created_date, ip_address,
updated_date, updated_ip_addres)
select app_no, pget_val, subject,
candidate_name, mother_name, father_name,
spouse_name, dob, sex, pob, pob_others,
nationality, college, college_others,
univ, univ_others, cncl_reg_no, cncl_reg_name,
rotary, marks, u_pg, phq,
category_others, caste, sub_caste, dd_amt,
dd_no, dd_date, dd_bank, address, pin,
debared, email, phone, mobile, in_service_status,
dept, dept_others, plc_of_working, date_of_entry,
prob_period, prob_date, doing_pg, pg_degree_course,
pg_degree_date, pg_diploma_course, pg_diploma_date,
speciality, enq_pending, suspension, absence,
remarks, photo_path, f_max_marksa, f_sec_marksa,
f_no_attaa, f_max_marksb, f_sec_marksb,
f_no_attbb, f_max_marksc, f_sec_marksc,
f_no_attcc, f_max_marksd, f_sec_marksd,
f_no_attdd, f_tot_max_marks, f_tot_sec_marks,
f_percentage, created_date, ip_address,
date_add(date_add(now(),INTERVAL 13 hour),interval 30 minute),'{$this->ip}'
from student
where app_no='{$this->edit_app_code}' ";
$up_obj=$this->aobj_context->mobj_db->Execute($audit_trial); ;
}
function UpdateDetails()
{
$update="update student set
fcntrcode='{$this->fcntrcode}',
fsubcode='{$this->fsubcode}',
fname='{$this->fname}',
fmotname='{$this->fmotname}',
ffatname='{$this->ffatname}',
fspousename='{$this->fspousename}',
fdob='{$this->fdob}',
fpob='{$this->fpob}',
fgender='{$this->fgender}',
fdomicile='{$this->fdomicile}',
fph='{$this->fph}', fexserv='{$this->fexserv}', fnss='{$this->fnss}', fsports='{$this->fsports}', f371='{$this->f371}', fproj='{$this->fproj}', frural='{$this->frural}', fkannada='{$this->fkannada}',
fcatcode='{$this->fcatcode}',
freligion='{$this->freligion}',
fcaste='{$this->fcaste}',
fnational='{$this->fnational}',
fqualexam='{$this->fqualexam}',
fqualify='{$this->fqualify}',
fqualdur='{$this->fqualdur}',
fcollname='{$this->fcollname}',
funivname='{$this->funivname}',
fregno='{$this->fregno}',
fadmyear='{$this->fadmyear}',
fpassyear='{$this->fpassyear}',
fattempts='{$this->fattempts}',
fpermmcregno='{$this->fpermmcregno}',
fstmcno='{$this->fstmcno}',
fcentmcno='{$this->fcentmcno}',
foccupation='{$this->foccupation}',
fadd1='{$this->fadd1}',
fpincode='{$this->fpincode}',
fphone='{$this->fphone}',
fmobile='{$this->fmobile}',
femail='{$this->femail}',
finservice='{$this->finservice}',
fdeptcode='{$this->fdeptcode}',
fworkplace='{$this->fworkplace}',
fphdisable='{$this->fphdisable}',
fdos='{$this->fdos}',
fprobdecl='{$this->fprobdecl}',
fdop='{$this->fdop}',
fpgdegree='{$this->fpgdegree}',
fpgdescpn='{$this->fpgdescpn}',
fpgcompdate='{$this->fpgcompdate}',
fenquiry='{$this->fenquiry}',
fsuspension='{$this->fsuspension}',
fabsence='{$this->fabsence}',
fremarks='{$this->fremarks}',
fpaymode='{$this->fpaymode}'
where app_no='{$this->edit_app_code}' ";
$up_obj=$this->aobj_context->mobj_db->Execute($update);
//echo "<pre>";
//print_r($update);die();
if($up_obj)
{
echo $this->aobj_context->mobj_output->ToJSONEnvelope($this->edit_app_code,9,"success");
return;
}
else
{
$data="Updation Failed".mysql_error();;
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
}
function CheckPrintAppNo()
{
$this->app_no=trim($this->aobj_context->mobj_data["app_no"]);
$this->fdob=trim($this->aobj_context->mobj_data["fdob"]);
$get_data="select count(app_no) as cnt
from student
where app_no='{$this->app_no}'
and fdob='{$this->fdob}'";
$obj_get_data=$this->aobj_context->mobj_db->GetRow($get_data);
// echo $get_data;
$cnt=$obj_get_data['cnt'];
if($cnt==0)
{
echo $this->aobj_context->mobj_output->ToJSONEnvelope($obj_get_data,-1,"failure");
return;
}
else
{
$get_data="select count(app_no) as cnt
from student
where app_no='{$this->app_no}'
and fdob='{$this->fdob}'
and fapproved='T'";
$obj_get_data=$this->aobj_context->mobj_db->GetRow($get_data);
$cnt=$obj_get_data['cnt'];
if($cnt==0)
{
echo $this->aobj_context->mobj_output->ToJSONEnvelope($obj_get_data,-2,"failure");
return;
}
else
{
echo $this->aobj_context->mobj_output->ToJSONEnvelope($obj_get_data,0,"success");
return;
}
}
}function CheckPrintChallan()
{
$this->app_no=trim($this->aobj_context->mobj_data["app_no"]);
$this->fdob=trim($this->aobj_context->mobj_data["fdob"]);
$get_data="select count(app_no) as cnt
from student
where app_no='{$this->app_no}'
and fdob='{$this->fdob}'";
$obj_get_data=$this->aobj_context->mobj_db->GetRow($get_data);
// echo $get_data;
$cnt=$obj_get_data['cnt'];
if($cnt==0)
{
echo $this->aobj_context->mobj_output->ToJSONEnvelope($obj_get_data,-1,"failure");
return;
}
else
{
/* $get_data="select count(app_no) as cnt
from student
where app_no='{$this->app_no}'
and fdob='{$this->fdob}'
and fapproved='T'";
$obj_get_data=$this->aobj_context->mobj_db->GetRow($get_data);
$cnt=$obj_get_data['cnt'];
if($cnt==0)
{
echo $this->aobj_context->mobj_output->ToJSONEnvelope($obj_get_data,-2,"failure");
return;
}
else
{ */
echo $this->aobj_context->mobj_output->ToJSONEnvelope($obj_get_data,0,"success");
return;
//}
}
}
}
function saveStudentEntry($aobj_context)
{
$obj=new applicationForm($aobj_context);
$obj->assignParams();
if($obj->edit_app_code==0)
{
$obj->SaveDetails();
}
else
{
//$obj->UpdateAuditTrial();
$obj->UpdateDetails();
}
}
function CheckPrintAppNo($aobj_context)
{
$obj=new applicationForm($aobj_context);
$obj->CheckPrintAppNo();
}function CheckPrintChallan($aobj_context)
{
$obj=new applicationForm($aobj_context);
$obj->CheckPrintChallan();
}
function GetApplicationDetails($aobj_context)
{
$obj=new applicationForm($aobj_context);
return $obj->GetApplicationDetails();
}
function DiaplayUserSelectedPhoto($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$get_login_cnt="select login_cnt from login_counter";
$lobj_get_get_login_cnt = $aobj_context->mobj_db->getRow($get_login_cnt);
$login_cnt=$lobj_get_get_login_cnt[login_cnt];
$file_name=replaceChars(basename($_FILES['student_entry_upload']['name']));
$path_arr=pathinfo($_FILES['student_entry_upload']['name']);
$file_ext=$path_arr['extension'];
$temp_path=$aobj_context->main_src."/student_photos/temp";
if(!file_exists($temp_path))
{
mkdir($temp_path);
}
$file_path="/{$login_cnt}_{$file_name}";
$temp_path.=$file_path;
if(isset($_FILES['student_entry_upload']['name']) && $_FILES['student_entry_upload']['name'] != '')
{
$size=($_FILES['student_entry_upload']['size']/1024);
if($size>1024)
{
$data="Please Upload the Photo of size less than 1 MB";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-2,"success");
return;
}
if(move_uploaded_file($_FILES['student_entry_upload']['tmp_name'],$temp_path))
{
$data="student_photos/temp/{$file_path}";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"success");
return;
}
}
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
function replaceChars($name)
{
$spl_char = array("*","/","~","!","@","#","$","%","^","&",":",";","?","/","\\","_","-","'"," ","");
$link_name = strtolower(str_replace($spl_char,"_",$name));
return str_ireplace("__","_",$link_name);
}
?>
|