Viewing file: clsbase_StudentEducation.php (3.43 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php //--Class StudentEducation-------------------------- //--PK of StudentEducation :: // 1. studentId // 2. levelId
include_once "Db.php";
class base_StudentEducation extends Db{
var $result; var $status;
var $studentId; var $levelId; var $institution; var $institutionEng; var $provinceId; var $graduatedYear; var $grade;
function AddNew(){ //--гЄйаБёНґ№ХйаБЧиНµйН§ЎТГаѕФиБўйНБЩЕгЛБи //--вґВЁРЎУЛ№ґК¶Т№РўН§ўйНБЩЕўН§НкНєаЁкЎгЛйа»з№ 1 $this->status = 1; }
function Edit(){ //--гЄйаБёНґ№ХйаБЧиНµйН§ЎТГ»ГСє»ГШ§ўйНБЩЕ //--вґВЁРЎУЛ№ґК¶Т№РўН§ўйНБЩЕўН§НкНєаЁкЎгЛйа»з№ 2 $this->status = 2; }
function Save(){ //--гЄйаБёНґ№ХйаБЧиНµйН§ЎТГєС№·ЦЎўйНБЩЕг№НкНєаЁкЎаўйТКЩи°Т№ўйНБЩЕ //--вґВЁРµГЗЁКНєК¶Т№РўН§ўйНБЩЕЗиТўйНБЩЕг№НкНєаЁкЎа»з№ўйНБЩЕгЛБиЛГЧНўйНБЩЕаґФБ //--1 а»з№ўйНБЩЕгЛБи 2 а»з№ўйНБЩЕаґФБ if ($this->status==1){ //$this->Array=$this->GetNextCode(); $sql = "insert into StudentEducation values('$this->studentId', '$this->levelId', '$this->institution', '$this->institutionEng', '$this->provinceId', '$this->graduatedYear', '$this->grade')"; }else { $sql = "update StudentEducation set levelId='$this->levelId', institution='$this->institution', institutionEng='$this->institutionEng', provinceId='$this->provinceId', graduatedYear='$this->graduatedYear', grade='$this->grade' where studentId='$this->studentId' and levelId='$this->levelId'"; } $this->SetQuery($sql); }
function Delete(){ //--гЄйаБёНґ№ХйаѕЧиНЕєўйНБЩЕаґФБг№НкНєаЁкЎ //--а»з№ЎТГЕєўйНБЩЕ·ХЕР 1 аГ¤НГмґ //--µйН§аГХВЎаБёНґµТБЕУґСєґС§№Хй SearchByKey()-->GetRecord()-->Delete() $this->SetQuery("delete from StudentEducation where studentId='$this->studentId' and levelId='$this->levelId'"); }
function GetNextCode(){ //--гЄйаБёНґ№ХйаѕЧиНЛТ¤иТКЩ§КШґўН§їФЕґм·ХигЄйа»з№¤ХВмўН§µТГТ§ г№ЕСЎЙіР auto increment //--µйН§а»з№їФЕґм·ХидБидґйЎУЛ№ґГЛСКаН§·Т§ЁНАТѕ $this->SetQuery("select max(studentId) as num from StudentEducation"); if ($result=$this->GetResult()) { return $result['num']+1; } }
function RSStudentEducation(){ //--аБёНґ·ХиўЦ鹵鹴йЗВ RS (Result Set) БХ¤ЗТБЛБТВЗиТЁРдґйГСєўйНБЩЕЎЕСєБТЁТЎЎТГ select БТЎЎЗиТ 1 аГ¤НГмґ //--»ЎµФаБЧиНаГХВЎгЄйаБёНґ RSxxxx ЁРµйН§аГХВЎаБёНґ GetRecord() ґйЗВаКБН //--вґВКТБТГ¶аѕФиБаБёНґдґйµТБµйН§ЎТГ бµиµйН§ўЦ鹵鹴йЗВ RS $this->SetQuery("select * from StudentEducation"); }
function GetRecord(){ //--а»з№аБёНґ·Хи№УўйНБЩЕЁТЎ ResultSet БТЎУЛ№ґгЛйЎСєбНµ·ГФєФЗµмўН§НкНєаЁзЎ //--аГХВЎ GetRecord() Л№Ц觤ГСй§ ЁРаЕЧиН№µСЗЄХйаГ¤НГмґд»НХЎЛ№Ци§аГ¤НГмґ if ($this->result = $this->GetResult()) { $this->studentId = $this->result['studentId']; $this->levelId = $this->result['levelId']; $this->institution = $this->result['institution']; $this->institutionEng = $this->result['institutionEng']; $this->provinceId = $this->result['provinceId']; $this->graduatedYear = $this->result['graduatedYear']; $this->grade = $this->result['grade']; return 1; }else { return 0; } }
function SearchByKey($xKey1, $xKey2){ //--гЄйаБёНґ№ХйаѕЧиН¤й№ЛТўйНБЩЕµТБ PK µйН§ГРєШѕТГТБФаµНГмґйЗВ //--бЕРµйН§µТБґйЗВаБёНґ GetRecord() аКБН if ($this->SetQuery("select * from StudentEducation where studentId='$xKey1' and levelId='$xKey2'")){ return 1; }else { return 0; } }
function NumRow(){ //--а»з№аБёНґ·Хи¤Ч№¤иТЁУ№З№ўйНБЩЕЁТЎЎТГ select вґВаБёНґ RSxxxx return $this->GetRowSelected(); }
function Destroy(){ //--а»з№аБёНґКУЛГСє»ФґЎТГµФґµиНЁТЎ°Т№ўйНБЩЕ return $this->DestroyDb(); }
//****************** You can add new functions below **********************//
} //--End class base_StudentEducation--
?>
|