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