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
Apache
: 172.26.7.228 | : 18.191.132.143
Cant Read [ /etc/named.conf ]
5.6.40-24+ubuntu18.04.1+deb.sury.org+1
www-data
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
var /
www /
html /
collportal_new /
src /
[ HOME SHELL ]
Name
Size
Permission
Action
AdmLogin.php
714
B
-rw-r--r--
addStudToCls.php
19.78
KB
-rw-r--r--
admdet.php
1.06
KB
-rw-r--r--
assignUserMenu.php
14.91
KB
-rw-r--r--
attEntryDaywise.php
11.03
KB
-rw-r--r--
caccesscontext.php
1.33
KB
-rwxr-xr-x
cappcontext.php
3.76
KB
-rw-r--r--
cdegree.php
4.54
KB
-rw-r--r--
cgetclsdepts.php
1.65
KB
-rw-r--r--
clogin.php
4.31
KB
-rw-r--r--
cmenus.php
2.46
KB
-rw-r--r--
constants.php
818
B
-rw-r--r--
coutput.php
1.84
KB
-rw-r--r--
crequestbroker.php
2.49
KB
-rw-r--r--
csessions.php
548
B
-rw-r--r--
csubject.php
5.75
KB
-rw-r--r--
cuser.php
3.53
KB
-rw-r--r--
cuserType.php
1.86
KB
-rw-r--r--
degreeResultSheet.php
3.82
KB
-rw-r--r--
degreeWise_IA_Report.php
4.79
KB
-rw-r--r--
deletecreatedclass.php
779
B
-rw-r--r--
duringExam.php
2.7
KB
-rw-r--r--
editclass.php
1.06
KB
-rw-r--r--
error_log.php
749
B
-rw-r--r--
getDegSemSubDetnew.php
8.55
KB
-rw-r--r--
getnumword.php
7.45
KB
-rwxr-xr-x
guidelines.php
578
B
-rw-r--r--
iamarksentry.php
6.92
KB
-rw-r--r--
json.php
34.52
KB
-rw-r--r--
jwt.php
13.16
KB
-rw-r--r--
login.php
8.01
KB
-rw-r--r--
marks_entry_qnWise.php
14.01
KB
-rw-r--r--
mregistry.php
21.88
KB
-rw-r--r--
practicalMark.php
28.2
KB
-rw-r--r--
preparethqp.php
23.68
KB
-rw-r--r--
protected.php
661
B
-rw-r--r--
savePassword.php
1.31
KB
-rw-r--r--
saveUserSetup.php
7.46
KB
-rw-r--r--
saveclsdets.php
2.27
KB
-rw-r--r--
sendGridMail.php
1.72
KB
-rw-r--r--
sendsmsapi_onex_new.php
4.19
KB
-rw-r--r--
student.php
61.41
KB
-rw-r--r--
studentsem.php
3.79
KB
-rw-r--r--
subject_Details.php
8.92
KB
-rw-r--r--
updateclass.php
583
B
-rw-r--r--
uploadStudentPhoto.php
2.15
KB
-rw-r--r--
uploadphotoofstud.php
1.84
KB
-rw-r--r--
userRightDetails.php
1.39
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : preparethqp.php
<?php require_once("/var/www/html/aws/aws-autoloader.php"); use Aws\S3\S3Client; use Aws\S3\Exception\S3Exception; function getPrepareQpDetails($aobj_context){ $teachcode = $aobj_context->mobj_data['teachcode']; $query = "select qp.fqpcode, concat(s.fsubname, ' - ', s.fsubshort) as fsubname, s.fvalmax, qp.fset, qp.fyear, qp.fexamtype, qp.fteachcode, ifnull(qp.fstatus, '') as fstatus, qp.ftype, qp.fpretype, qp.fmaxmarks, count(h.fqncode) as totcnt, count(m.fqpno) as qpcnt, qp.ftempcode from qpseterdet qp inner join (select distinct fsubname, fsubshort, fqpcode, fvalmax from subject where ifnull(fqpcode,'') <> '' group by fqpcode) s on qp.fqpcode = s.fqpcode inner join tdvs_qptempdetl h on qp.ftempcode = h.ftempcode left join mcqqpdet m on qp.fqpcode = m.fqpcode and qp.fteachcode = m.fteachcode and qp.fyear = m.fyear and qp.fexamtype = m.fexamtype and m.fnoqp = qp.fset and h.fqnno = m.fqpno and h.fqncode = m.fqncode and ifnull(m.fquestion,'') <> '' where qp.fteachcode = '{$teachcode}' and ifnull(qp.fstatus, '') = 'ACCEPTED' and ifnull(h.fsubqp,'F') = 'F' group by qp.fyear, qp.fexamtype, fqpcode,fset ,fteachcode, qp.ftype"; $result = $aobj_context->mobj_db->GetAll($query); if($result){ echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "succcess"); }else{ $arr['msg'] = 'No data found'; echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); return; } } // function getPrepareQpSummaryDet($aobj_context){ // $univcode = $aobj_context->mobj_data['univcode']; // $teachcode = $aobj_context->mobj_data['teachcode']; // $data = $aobj_context->req_body; // $qpcode = $data['qpcode']; // $query = "select ifnull(ftempcode, '')as ftempcode from tdvs_masqp where fqpcode='{$qpcode}'"; // $res = $aobj_context->pobj_db->GetRow($query); // $tempcode = $res['ftempcode']; // $query1 = "select * from tdvs_qptemphead where ftempcode='{$tempcode}'"; // $result = $aobj_context->pobj_db->GetAll($query1); // if($result){ // echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "succcess"); // }else{ // $arr['msg'] = 'No data found'; // echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); // return; // } // } // function getTempHeadSection($aobj_context){ // $univcode = $aobj_context->mobj_data['univcode']; // $tempcode = $aobj_context->mobj_data['tempcode']; // $query="select fpartcode, fpartdesc from tdvs_qptemphead where ftempcode='{$tempcode}'"; // $res = $aobj_context->pobj_db->GetAll($query); // if($res){ // echo $aobj_context->mobj_output->ToJSONEnvelope($res, 0, "succcess"); // }else{ // $arr['msg'] = 'No data found'; // echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); // return; // } // } function getQuestions($aobj_context){ $univcode = $aobj_context->mobj_data['univcode']; $usertype = $aobj_context->mobj_data['usertype']; $rawData = file_get_contents('php://input'); $data = json_decode($rawData, true); $qpcode = $data['qpcode']; $part = $data['part']; $set = $data['set']; $teachcode = $data['teachcode']; $year = $data['year']; $mode = $data['mode']; $tempcode = $data['tempcode']; $type = $data['type']; $query = "select fpartcode, fpartdesc from tdvs_qptemphead where ftempcode = '{$tempcode}'"; $res = $aobj_context->mobj_db->GetAll($query); if(strtolower($type) === 'mcq'){ $cnd = "order by cast(q.fqnno as unsigned)"; }else{ $cnd = "order by LPAD(q.fqnno, 4, 0)"; } $data = []; if($usertype == 'M'){ foreach ($res as $key => $value) { // $query1 = "select ifnull(fqnno, '')as fqnno from tdvs_qptempdetl where ftempcode = '{$tempcode}' and fpartcode='{$value['fpartcode']}' $cnd"; $query1 = "select distinct ifnull(m.fqpno, '')as fqpno, if(ifnull(m.fmaxmarks, '')='',q.fmaxmarks, m.fmaxmarks)as fmaxmarks, ifnull(m.fmodquestion, '')as fquestion, ifnull(m.fmodopta, '')as fopta, ifnull(m.fmodoptb, '')as foptb, ifnull(m.fmodoptc, '')as foptc, ifnull(m.fmodoptd, '')as foptd, ifnull(m.fmodkeyans, '')as fkeyans, ifnull(m.fmodqnfile, '')as fqnfile, ifnull(m.fmodoptafile, '')as foptafile, ifnull(m.fmodoptbfile, '')as foptbfile, ifnull(m.ftype, 'Both')as ftype, ifnull(m.fmodoptcfile, '')as foptcfile, ifnull(m.fmodoptdfile, '')as foptdfile, ifnull(m.fmodkeyansfile, '')as fkeyansfile, ifnull(m.fmodcreatedate,'')as fmodcreatedate, ifnull(m.fmodremarks, '')as fmodremarks, if(ifnull(m.fmodquestion, '')='','Not Completed', 'Completed')as fqpcomp, ifnull(m.fco,'')as fco,ifnull(m.fpo,'')as fpo, ifnull(m.fblooms,'')as fblooms from mcqqpdet m inner join tdvs_qptempdetl q on q.fqncode = m.fqncode and q.fqnno = m.fqpno where q.ftempcode='{$tempcode}' and q.fpartcode='{$value['fpartcode']}' and m.fnoqp = '{$set}' and m.fteachcode='{$teachcode}' and m.fqpcode='{$qpcode}' and m.fyear='{$year}' and m.fexamtype='{$mode}' and ifnull(q.fsubqp,'F') = 'F' {$cnd}"; $res1 = $aobj_context->mobj_db->GetAll($query1); $arr['fpartcode'] = $value['fpartcode']; $arr['fpartdesc'] = $value['fpartdesc']; $arr['fdata'] = $res1; array_push($data, $arr); } } else { $qry = "insert ignore into mcqqpdet (fqpcode, fyear, fexamtype, fnoqp, fteachcode, fqncode, fqpno, fqna) select '{$qpcode}', '{$year}', '{$mode}', '{$set}', '{$teachcode}', fqncode, fqnno, fqnno from tdvs_qptempdetl where ftempcode = '{$tempcode}' and ifnull(fsubqp,'F') = 'F'"; $result = $aobj_context->mobj_db->Execute($qry); foreach ($res as $key => $value) { // $query1 = "select ifnull(fqnno, '')as fqnno from tdvs_qptempdetl where ftempcode = '{$tempcode}' and fpartcode='{$value['fpartcode']}' $cnd"; $query1 = "select distinct ifnull(m.fqpno, '')as fqpno, if(ifnull(m.fmaxmarks, '')='',q.fmaxmarks, m.fmaxmarks)as fmaxmarks, ifnull(m.fquestion, '')as fquestion, ifnull(m.fopta, '')as fopta, ifnull(m.foptb, '')as foptb, ifnull(m.foptc, '')as foptc, ifnull(m.foptd, '')as foptd, ifnull(m.fkeyans, '')as fkeyans, ifnull(m.fqnfile, '')as fqnfile, ifnull(m.foptafile, '')as foptafile, ifnull(m.foptbfile, '')as foptbfile, ifnull(m.ftype, 'Both')as ftype, ifnull(m.foptcfile, '')as foptcfile, ifnull(m.fkeyansfile, '')as fkeyansfile, ifnull(m.fmodcreatedate,'')as fmodcreatedate, if(ifnull(m.fquestion, '')='','Not Completed', 'Completed')as fqpcomp, ifnull(m.foptdfile, '')as foptdfile, ifnull(m.fteachco,'')as fco, ifnull(m.fteachpo,'')as fpo, ifnull(m.fteachbloom,'')as fblooms from mcqqpdet m inner join tdvs_qptempdetl q on q.fqncode = m.fqncode and q.fqnno = m.fqpno where q.ftempcode='{$tempcode}' and q.fpartcode='{$value['fpartcode']}' and m.fnoqp = '{$set}' and m.fteachcode='{$teachcode}' and m.fqpcode='{$qpcode}' and m.fyear='{$year}' and m.fexamtype='{$mode}' and ifnull(q.fsubqp,'F') = 'F' {$cnd}"; $res1 = $aobj_context->mobj_db->GetAll($query1); $arr['fpartcode'] = $value['fpartcode']; $arr['fpartdesc'] = $value['fpartdesc']; $arr['fdata'] = $res1; array_push($data, $arr); } } if($res){ echo $aobj_context->mobj_output->ToJSONEnvelope($data, 0, "succcess"); }else{ $arr['msg'] = 'No data found'; echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); return; } } function saveQuestions($aobj_context){ // $univcode = $aobj_context->mobj_data['univcode']; $data = json_decode($aobj_context->mobj_data["data"], true); $qpcode = $aobj_context->mobj_data["qpcode"]; $year = $aobj_context->mobj_data["year"]; $mode = $aobj_context->mobj_data["mode"]; $teachcode = $aobj_context->mobj_data["teachcode"]; $set = $aobj_context->mobj_data["set"]; $usertype = $aobj_context->mobj_data["usertype"]; $userid = $aobj_context->mobj_data["userid"]; if($usertype == 'M'){ if($data['fmodcreatedate'] == ''){ $cond = 'fmodcreatedate'; } else { $cond = 'fmodupddate'; } $query = "update mcqqpdet set fmodquestion = '{$data['fquestion']}', fmodopta = '{$data['fopta']}', fmodoptb = '{$data['foptb']}', fmodoptc = '{$data['foptc']}', fmodoptd = '{$data['foptd']}', fmodkeyans = '{$data['fkeyans']}', ftype='{$data['ftype']}', fmodteachcode='{$userid}', $cond = now(), fco='{$data['fco']}', fpo='{$data['fpo']}', fblooms='{$data['fblooms']}', fmodremarks='{$data['fmodremarks']}' where fqpcode = '{$qpcode}' and fyear = '{$year}' and fexamtype = '{$mode}' and fqpno = '{$data['fqpno']}' and fteachcode='{$teachcode}' and fnoqp='{$set}'"; } else if($usertype === "T") { $query = "update mcqqpdet set fmaxmarks = '{$data['fmaxmarks']}', fquestion = '{$data['fquestion']}', fmodquestion = '{$data['fquestion']}', fopta = '{$data['fopta']}', fmodopta = '{$data['fopta']}', foptb = '{$data['foptb']}', fmodoptb = '{$data['foptb']}', foptc = '{$data['foptc']}', fmodoptc = '{$data['foptc']}', foptd = '{$data['foptd']}', fmodoptd = '{$data['foptd']}', fkeyans = '{$data['fkeyans']}', fmodkeyans = '{$data['fkeyans']}', fteachco='{$data['fco']}', fteachpo='{$data['fpo']}', fteachbloom='{$data['fblooms']}', fco='{$data['fco']}', fpo='{$data['fpo']}', fblooms='{$data['fblooms']}', ftype='{$data['ftype']}' where fqpcode = '{$qpcode}' and fyear = '{$year}' and fexamtype = '{$mode}' and fqpno = '{$data['fqpno']}' and fteachcode='{$teachcode}' and fnoqp='{$set}'"; } $result=$aobj_context->mobj_db->Execute($query); if ($result) { $arr['msg'] = "success"; echo $aobj_context->mobj_output->TOJSONEnvelope($arr, 0, "success"); return; }else{ $arr['msg'] = "failed to save "; echo $aobj_context->mobj_output->TOJSONEnvelope($arr, -1, "failed"); return; } } function uploadQnFiles($aobj_context){ $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $univcode = $aobj_context->mobj_data["univcode"]; $qpcode = $aobj_context->mobj_data["qpcode"]; $year = $aobj_context->mobj_data["year"]; $mode = $aobj_context->mobj_data["mode"]; $qnno = $aobj_context->mobj_data["qnno"]; $field = $aobj_context->mobj_data["field"]; $teachcode = $aobj_context->mobj_data["teachcode"]; $noqp = $aobj_context->mobj_data["noqp"]; $modetype = $aobj_context->mobj_data["modetype"]; $userid = $aobj_context->mobj_data["userid"]; $date = date('YmdHis'); $cond = ""; $filedata = $_FILES['file']['tmp_name']; $ext = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION); $filename = $date.'_'.$qpcode.'_'.$year.'_'.$mode.'_'.$noqp.'_'.$field.'.'.$ext; $key = $univcode. '/'. $qpcode. '/'. $year. '/'. $mode .'/'. $filename; if($modetype == 'Mod'){ $cond = ",fmodteachcode='{$userid}',fmodupddate = now()"; } $s3 = S3Client::factory( array( 'credentials' => array( 'key' => IAM_KEY, 'secret' => IAM_SECRET ), 'version' => "latest", 'region' => 'ap-south-1' )); try { $s3->putObject(['Bucket' => "omr-files", 'Key' => $key, 'SourceFile' => $filedata]); $query = "update mcqqpdet set $field = '{$key}' $cond where fqpcode = '{$qpcode}' and fyear = '{$year}' and fexamtype = '{$mode}' and fqpno = '{$qnno}' and fteachcode='{$teachcode}' and fnoqp='{$noqp}'"; $result=$aobj_context->mobj_db->Execute($query); if ($result) { $arr['msg']=$key; echo $aobj_context->mobj_output->TOJSONEnvelope($arr, 0, "success"); }else{ $arr['msg']="failure"; echo $aobj_context->mobj_output->TOJSONEnvelope($arr, -1, "failed"); return; } }catch(S3Exception $e) { $arr['msg'] = 'failure'; echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); return; } } function getModQPOnline($aobj_context){ $teachcode = $aobj_context->mobj_data['teachcode']; $query = "select q.fqpcode, concat(s.fsubname, ' - ', s.fsubshort)as fsubname, q.fset, q.fteachcode, s.fqpsyllabus,q.fpretype, q.fexamtype,q.fyear,ifnull(mc.fmoddate,'') as fmodqpdate,count(h.fqncode) as totcnt, count(mc.fqpno) as qpcnt, q.ftempcode,ifnull(q.ftype,'')as ftype,mc.fnoqp, ifnull(q.fteachcode,'')as fteachcode,ifnull(mc.fmodstatus,'')as fmodstatus, ifnull(q.fmodremarks, '')as fmodremarks from qpseterdet q inner join (select distinct fqpcode, fsubname, fqpsyllabus, fsubshort from subject where ifnull(fqpcode, '') <> '') s on s.fqpcode = q.fqpcode inner join moderator m on m.fqpcode = q.fqpcode inner join tdvs_qptempdetl h on q.ftempcode = h.ftempcode inner join mcqqpdet mc on q.fqpcode = mc.fqpcode and q.fteachcode = mc.fteachcode and q.fyear = mc.fyear and q.fexamtype = mc.fexamtype and mc.fnoqp = q.fset and h.fqnno = mc.fqpno and h.fqncode = mc.fqncode and ifnull(mc.fquestion,'') <> '' where m.fteachcode = '{$teachcode}' and m.flogin = 'T' group by q.fteachcode,q.fqpcode, q.fset, q.fyear, q.fexamtype order by q.fqpcode, q.fset"; //var_dump($query); $result = $aobj_context->mobj_db->GetAll($query); if($result){ echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "succcess"); }else{ $arr['msg'] = 'No data found'; echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); return; } } function saveModConfirm($aobj_context){ $univcode = $aobj_context->mobj_data['univcode']; $qpcode = $aobj_context->mobj_data['qpcode']; $year = $aobj_context->mobj_data["year"]; $mode = $aobj_context->mobj_data["mode"]; $teachcode = $aobj_context->mobj_data["teachcode"]; $set = $aobj_context->mobj_data["set"]; $ftype = $aobj_context->mobj_data["ftype"]; $modetype = $aobj_context->mobj_data["modetype"]; $userid = $aobj_context->mobj_data["userid"]; $modqpdate = $aobj_context->mobj_data["modqpdate"]; $modremarks = $aobj_context->mobj_data["remarks"]; $date = date('Y-m-d H:i:s'); $query = "update mcqqpdet set fmodstatus = 'T',fmoddate = now(),fmoduser='{$userid}' where fqpcode = '{$qpcode}' and fyear = '{$year}' and fexamtype = '{$mode}' and fteachcode='{$teachcode}' and fnoqp='{$set}'"; $result=$aobj_context->mobj_db->Execute($query); $que = "update qpseterdet set fmodqpdate = now(), fmodteach='{$userid}',fmodansdate = now(), fmodremarks='{$modremarks}' where fqpcode = '{$qpcode}' and fyear = '{$year}' and fexamtype = '{$mode}' and fteachcode='{$teachcode}' and fset='{$set}'"; $res = $aobj_context->mobj_db->Execute($que); if ($result) { $arr['msg'] = "success"; echo $aobj_context->mobj_output->TOJSONEnvelope($arr, 0, "success"); }else{ $arr['msg'] = "failed to save "; echo $aobj_context->mobj_output->TOJSONEnvelope($arr, -1, "failed"); return; } } function getQpDeggrp($aobj_context){ $univcode = $aobj_context->mobj_data['univcode']; $query = "select fdeggrp, fdescpn from deggrp where ifnull(fdeleted, '')<>'T'"; $res = $aobj_context->pobj_db->GetAll($query); if ($res) { echo $aobj_context->mobj_output->TOJSONEnvelope($res, 0, "success"); }else{ $arr['msg'] = "failed to load deggrp"; echo $aobj_context->mobj_output->TOJSONEnvelope($arr, -1, "failed"); return; } } function getExamDetails($aobj_context){ $univcode = $aobj_context->mobj_data['univcode']; $deggrp = $aobj_context->mobj_data['deggrp']; $query = "select concat(fdeggrp, '*', fyear, '-', fexamtype) as fexamyear, fexamdate as fdesexam from deggrp where ifnull(fdeleted, '')<>'T' and fdeggrp='{$deggrp}'"; $res = $aobj_context->pobj_db->GetAll($query); if ($res) { echo $aobj_context->mobj_output->TOJSONEnvelope($res, 0, "success"); }else{ $arr['msg'] = "failed to load exam details"; echo $aobj_context->mobj_output->TOJSONEnvelope($arr, -1, "failed"); return; } } function getSelectedMCQFinalPapers($aobj_context){ $univcode = $aobj_context->mobj_data["univcode"]; $data = json_decode($aobj_context->mobj_data["data"], true); $exam = $data['deggrp']; $qpcode = $data['qpcode']; $degree = $data['degree']; $sem = $data['sem']; $query = "select fyear, fexamtype from deggrp where fdeggrp = '{$exam}'"; $result = $aobj_context->mobj_db->GetRow($query); $year = $result['fyear']; $examtype = $result['fexamtype']; $qpcode === "All" ? $qpCond = "" : $qpCond = "and m.fqpcode='{$qpcode}'"; $degree === "All" ? $degreeCond = "" : $degreeCond = "and d.fdegree='{$degree}'"; $sem === "All" ? $semCond = "" : $semCond = "and d.fexamno='{$sem}'"; $query = "select m.fqpcode, s.fsubname, m.fyear, m.fexamtype, m.fexamdate, m.fteachcode, m.fnoqp, m.fmaxmarks, m.fdate, m.ffinalpaper, m.ffinaldate, m.fversions from mcqqp m inner join subject s on s.fqpcode = m.fqpcode #and s.fcsubcode = m.fcsubcode inner join degree d on d.fdegree = s.fdegree and d.fexamno = s.fexamno where ifnull(m.ffinalpaper, '')='T' and ifnull(fonlineqp, 'F') = 'T' {$qpCond} and m.fyear='{$year}' and m.fexamtype='{$examtype}' {$degreeCond} {$semCond} and d.fdeggrp='{$exam}' group by fqpcode, fyear, fexamtype, m.fcsubcode, fteachcode, fnoqp "; $result=$aobj_context->mobj_db->GetAll($query); if($result){ echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "succcess"); return; }else{ $arr['msg'] = 'Failed to get the MCQ details'; echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); return; } } function generateMCQVersions($aobj_context){ $univcode = $aobj_context->mobj_data["univcode"]; $data = json_decode($aobj_context->mobj_data["univcode"], true); $qpcode = $data['fqpcode']; $teachcode = $data['fteachcode']; $year = $data['fyear']; $examtype = $data['fexamtype']; $noqp = $data['fnoqp']; $fversions = intval($data['fversions']); $query = "select if(fmaxqn = '','20',ifnull(fmaxqn, 20)) as fmaxqn from mcqqp where fyear = '{$year}' and fexamtype='{$examtype}' and fteachcode='{$teachcode}' and fqpcode='{$qpcode}' and fnoqp='{$noqp}'"; //var_dump($query); $result = $aobj_context->mobj_db->GetRow($query); $maxqn = intval($result['fmaxqn']); $divide = ceil($maxqn / $fversions); $qnArr = ['fqnb', 'fqnc', 'fqnd']; for($i=0; $i < $fversions - 1; $i++){ $divide = $divide * ($i + 1); for($j = 1; $j <= $maxqn; $j++){ $qn = $divide + 1; $query = "update mcqqpdet set {$qnArr[$i]} = '{$qn}' where fyear = '{$year}' and fexamtype='{$examtype}' and fteachcode='{$teachcode}' and fqpcode='{$qpcode}' and fnoqp='{$noqp}' and fqpno='{$j}' "; $res = $aobj_context->mobj_db->Execute($query); if($qn == $maxqn){ $divide = 0; } else { $divide = $qn; } if($j == $maxqn){ $divide = ceil($maxqn / 4); } } } if($res){ $arr['msg'] = 'Versions generated successfully'; echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "succcess"); return; }else{ $arr['msg'] = 'Failed to get the MCQ details'; echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); return; } } ?>
Close