Viewing file: clsClassOpenForAssessTmp.php (3.03 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//--Class ClassOpenForAssessTmp--------------------------
//--PK of ClassOpenForAssessTmp ::
// 1. classId
// 2. programId
class ClassOpenForAssessTmp extends clsDB{
var $result;
var $classId;
var $programId;
var $bookSeat;
var $erSeat;
function ClassOpenForAssessTmp(&$c){
$this->c=$c->c;
$this->DB=$c->db;
}
function Save(){
//--ўйНБЩЕг№НкНєаЁкЎа»з№ўйНБЩЕгЛБиЛГЧНўйНБЩЕаґФБ --1:ўйНБЩЕгЛБи 2:ўйНБЩЕаґФБ
if ($this->status==1){
//uncomment a line below if your table use ID as running number
//$this->Array=$this->GetNextCode();
$sql = "insert into ClassOpenForAssessTmp values(
'$this->classId',
'$this->programId',
'$this->bookSeat',
'$this->erSeat'
)";
}else {
$sql = "update ClassOpenForAssessTmp set
bookSeat='$this->bookSeat',
erSeat='$this->erSeat'
where classId='$this->classId' and programId='$this->programId'";
}
return $this->Dml($sql);
}
function Delete(){
//--ЕєўйНБЩЕаґФБг№НкНєаЁкЎ, а»з№ЎТГЕєўйНБЩЕ·ХЕР 1 аГ¤НГмґ
//--µйН§аГХВЎаБёНґµТБЕУґСєґС§№Хй SearchByKey()-->GetRecord()-->Delete()
return $this->Dml("delete from ClassOpenForAssessTmp where classId='$this->classId' and programId='$this->programId'");
}
function GetNextCode(){
//--ЛТ¤иТКЩ§КШґўН§їФЕґм·ХигЄйа»з№¤ХВмўН§µТГТ§ г№ЕСЎЙіР auto increment
//--µйН§а»з№їФЕґмЄ№ФґµСЗаЕўЁУ№З№аµзБа·иТ№Сй№ бЕРдБидґйЎУЛ№ґГЛСКаН§·Т§ЁНАТѕ
$this->SetQuery("select max(classId) as num from ClassOpenForAssessTmp");
if ($result=$this->GetResult()) {
return $result['num']+1;
}
}
function RSClassOpenForAssess(){
//--аБёНґ·ХиўЦ鹵鹴йЗВ RS (ResultSet) БХ¤ЗТБЛБТВЗиТЁРдґйГСєўйНБЩЕЎЕСєБТЁТЎЎТГ select БТЎЎЗиТ 1 аГ¤НГмґ
//--ЁРµйН§аГХВЎаБёНґ GetRecord() ґйЗВаКБН №УўйНБЩЕЁТЎ ResultSet аўйТНкНєаЁкЎ
//--вґВКТБТГ¶аѕФиБаБёНґдґйµТБµйН§ЎТГ бµиµйН§ўЦ鹵鹴йЗВ RS
$this->SetQuery("select * from ClassOpenForAssessTmp");
}
function GetRecord(){
//--№УўйНБЩЕЁТЎ ResultSet БТЎУЛ№ґгЛйЎСєбНµ·ГФєФЗµмўН§НкНєаЁзЎ
//--аГХВЎ GetRecord() Л№Ц觤ГСй§ ЁРаЕЧиН№µСЗЄХйаГ¤НГмґд»НХЎЛ№Ци§аГ¤НГмґ
if ($this->result = $this->GetResult()) {
$this->classId = $this->result['classId'];
$this->programId = $this->result['programId'];
$this->bookSeat = $this->result['bookSeat'];
$this->erSeat = $this->result['erSeat'];
return 1;
}else {
return 0;
}
}
function SearchByKey($xKey1, $xKey2){
//--¤й№ЛТўйНБЩЕµТБ PK µйН§ГРєШѕТГТБФаµНГмґйЗВ бЕРµйН§µТБґйЗВаБёНґ GetRecord() аКБН
if ($this->SetQuery("select * from ClassOpenForAssessTmp where classId='$xKey1' and programId='$xKey2'")){
return 1;
}else {
return 0;
}
}
//****************** You can add new functions below **********************//
function DeleteAll(){
return $this->Dml("delete from ClassOpenForAssessTmp where 1");
}
function SearchByClassId($xKey){
if ($this->SetQuery("select * from ClassOpenForAssessTmp where classId='$xKey'")){
return 1;
}else {
return 0;
}
}
function DeleteByClassId($xKey){
return $this->Dml("delete from ClassOpenForAssessTmp where classId='$xKey'");
}
} //--End class ClassOpenForAssessTmp--
?>
|