Viewing file: processRadioQuestion.php (2.02 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once "../global1.php";
include_once "../../class/clsDB.php";
include_once "../../class/clsConnection.php";
include_once "../class/clsRadioQuestion.php";
//echo "<br> **** levelRQ = ".$levelRQ;
//echo "method = ".$method;
//echo "<br> subtract = ".$setSubtract;
$oC = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB_EASS'], $GLOBALS['USER_EASS'], $GLOBALS['PASSWORD_EASS']);
if($setSubtract == "0"){
$oRQ = new RadioQuestion($oC);
$oRQ->updateSubtract($RQid,0);
}
$obj = new RadioQuestion($oC);
if($method=="add"){
$obj->AddNew();
$obj->RQid=$RQid;
$obj->assid=$assid;
$obj->sectionRQid=$sectionRQid;
$obj->nameRQ=$nameRQ;
$obj->parrentRQid=$parrentRQid;
$obj->levelRQ=$levelRQ;
$obj->subtract=$subtract;
$obj->sequence=$sequence;
$obj->Save();
echo "<meta http-equiv='refresh' content='0; URL=createForm.php?assid=$assid;'>";
}else if($method=="edit"){
$obj->SearchByKey($RQid);
$obj->GetRecord();
$obj->Edit();
$obj->RQid=$RQid;
$obj->assid=$assid;
$obj->sectionRQid=$sectionRQid;
$obj->nameRQ=$nameRQ;
$obj->parrentRQid=$parrentRQid;
$obj->levelRQ=$levelRQ;
$obj->subtract=$subtract;
$obj->sequence=$sequence;
$obj->Save();
echo "<meta http-equiv='refresh' content='0; URL=createForm.php?assid=$assid;'>";
}else if($method=="delete"){
//echo "Q = ".$Q;
if($Q=='mainRQ'){
$numSubRQ = $obj->RSCountParrentRQid($RQid);
//echo "<br> numSubRQ = ".$numSubRQ;
if($numSubRQ > 0){
$obj->SearchByKey($RQid);
$obj->GetRecord();
$obj->DeleteSubRQ();
}
$obj->SearchByKey($RQid);
$obj->GetRecord();
$obj->DeleteRQ();
}else if($Q=='subRQ'){
$obj->SearchByKey($RQid);
$obj->GetRecord();
$obj->DeleteRQ();
}
echo "<meta http-equiv='refresh' content='0; URL=createForm.php?assid=$assid;'>";
}else if($method=="updown"){
$obj->swapQuestion($ud,$assid,$RQid,$sectionRQid,$parrentRQid,$levelRQ,$sequence);
echo "<meta http-equiv='refresh' content='0; URL=createForm.php?assid=$assid;'>";
}
$obj->Close();
$oC->Disconnect();
?>
|