Viewing file: clsUmService.php (2.64 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//--Class umservice--------------------------
//--PK of umservice ::
// 1. SvID
class umservice extends clsDB{
var $result;
var $SvID;
var $SvNameT;
var $SvNameE;
var $SvURL;
var $SvIcon;
var $SvTarget;
function umservice(&$c){
$this->c=$c->c;
$this->DB=$c->db;
}
function Save(){
//--гЄйаБёНґ№ХйаБЧиНµйН§ЎТГєС№·ЦЎўйНБЩЕг№НкНєаЁкЎаўйТКЩи°Т№ўйНБЩЕ
//--вґВЁРµГЗЁКНєК¶Т№РўН§ўйНБЩЕЗиТўйНБЩЕг№НкНєаЁкЎа»з№ўйНБЩЕгЛБиЛГЧНўйНБЩЕаґФБ
//--1 а»з№ўйНБЩЕгЛБи 2 а»з№ўйНБЩЕаґФБ
if ($this->status==1){
$this->SvID=$this->GetNextCode();
$sql = "insert into umservice values('$this->SvID', '$this->SvNameT', '$this->SvNameE', '$this->SvURL', '$this->SvIcon', '$this->SvTarget')";
}else {
$sql = "update umservice set SvNameT='$this->SvNameT', SvNameE='$this->SvNameE', SvURL='$this->SvURL', SvIcon='$this->SvIcon', SvTarget='$this->SvTarget' where SvID='$this->SvID'";
}
return $this->Dml($sql);
}
function Delete(){
//--гЄйаБёНґ№ХйаѕЧиНЕєўйНБЩЕаґФБг№НкНєаЁкЎ
//--а»з№ЎТГЕєўйНБЩЕ·ХЕР 1 аГ¤НГмґ
//--µйН§аГХВЎаБёНґµТБЕУґСєґС§№Хй SearchByKey()-->GetRecord()-->Delete()
return $this->Dml("delete from umservice where SvID='$this->SvID'");
}
function GetNextCode(){
//--гЄйаБёНґ№ХйаѕЧиНЛТ¤иТКЩ§КШґўН§їФЕґм·ХигЄйа»з№¤ХВмўН§µТГТ§ г№ЕСЎЙіР auto increment
//--µйН§а»з№їФЕґм·ХидБидґйЎУЛ№ґГЛСКаН§·Т§ЁНАТѕ
$this->SetQuery("select max(SvID) as num from umservice");
if ($result=$this->GetResult()) {
return $result['num']+1;
}
}
function RSumservice(){
//--аБёНґ·ХиўЦ鹵鹴йЗВ RS (Result Set) БХ¤ЗТБЛБТВЗиТЁРдґйГСєўйНБЩЕЎЕСєБТЁТЎЎТГ select БТЎЎЗиТ 1 аГ¤НГмґ
//--»ЎµФаБЧиНаГХВЎгЄйаБёНґ RSxxxx ЁРµйН§аГХВЎаБёНґ GetRecord() ґйЗВаКБН
//--вґВКТБТГ¶аѕФиБаБёНґдґйµТБµйН§ЎТГ бµиµйН§ўЦ鹵鹴йЗВ RS
$this->SetQuery("select * from umservice order by SvID");
}
function GetRecord(){
//--а»з№аБёНґ·Хи№УўйНБЩЕЁТЎ ResultSet БТЎУЛ№ґгЛйЎСєбНµ·ГФєФЗµмўН§НкНєаЁзЎ
//--аГХВЎ GetRecord() Л№Ц觤ГСй§ ЁРаЕЧиН№µСЗЄХйаГ¤НГмґд»НХЎЛ№Ци§аГ¤НГмґ
if ($this->result = $this->GetResult()) {
$this->SvID = $this->result['SvID'];
$this->SvNameT = $this->result['SvNameT'];
$this->SvNameE = $this->result['SvNameE'];
$this->SvURL = $this->result['SvURL'];
$this->SvIcon = $this->result['SvIcon'];
$this->SvTarget = $this->result['SvTarget'];
return 1;
}else {
return 0;
}
}
function SearchByKey($xKey){
//--гЄйаБёНґ№ХйаѕЧиН¤й№ЛТўйНБЩЕµТБ PK µйН§ГРєШѕТГТБФаµНГмґйЗВ
//--бЕРµйН§µТБґйЗВаБёНґ GetRecord() аКБН
if ($this->SetQuery("select * from umservice where SvID= '$xKey'")){
return 1;
}else {
return 0;
}
}
//****************** You can add new functions below **********************//
} //--End class umservice--
?>
|