Exemple #1
0
 public static function FromUserName($userName)
 {
     $o = NULL;
     $sql = "select UserID , UserName, UserPassWord, FullName, Email, DateOfBirth, Gender, UserCreated, UserLastModified, LastLogon  ,UserPermission   from users where UserName = '******'";
     $resultSet = DataProvider::Load($sql);
     if ($row = $resultSet->fetch_assoc()) {
         $UserID = $row["UserID"];
         $UserName = $row["UserName"];
         $Password = $row["UserPassWord"];
         $FullName = $row["FullName"];
         $Email = $row["Email"];
         $DateOfBirth = new DateTime($row["DateOfBirth"]);
         $Gender = $row["Gender"];
         $UserCreated = new DateTime($row["UserCreated"]);
         $UserLastModified = new DateTime($row["UserLastModified"]);
         $LastLogon = new DateTime($row["LastLogon"]);
         $Permission = $row["UserPermission"];
         $o = new User($UserID, $UserName, $Password, $Email, $FullName, $Gender, $DateOfBirth, $UserCreated, $UserLastModified, $LastLogon, $Permission);
     }
     return $o;
 }
Exemple #2
0
 public static function getValueMaxColName($MaxColName)
 {
     $sql = "select MAX(" . $MaxColName . ") AS Max " . "from products ";
     $resultSet = DataProvider::Load($sql);
     $row = $resultSet->fetch_assoc();
     $max = $row['Max'];
     return $max;
 }
Exemple #3
0
 public static function getOrderDetail($iOrderDetailID)
 {
     $o = null;
     $sql = "select OrderDetailID, OrderID, p.ProID  as ProID, ProName , od.Quantity, od.Price, Amount  from orderdetails od, products p" . " where od.ProID  = p.ProID  and OrderDetailID  = " . $iOrderDetailID;
     $resultSet = DataProvider::Load($sql);
     if ($row = $resultSet->fetch_assoc()) {
         $id = $row["OrderDetailID"];
         $oOrder = new Order($row["OrderID"]);
         $oProduct = new Product($row["ProID"], $row["ProName"]);
         $quantity = $row["Quantity"];
         $price = $row["Price"];
         $amount = $row["Amount"];
         $o = new OrderDetail($id, $oProduct, $oOrder, $price, $quantity, $amount);
     }
     return $o;
 }
Exemple #4
0
 public static function getStatus($iStatusID)
 {
     $o = null;
     $sql = "select StatusID, StatusName, StatusColor " . "from statuses where  StatusID = " . $iStatusID;
     $resultSet = DataProvider::Load($sql);
     if ($row = $resultSet->fetch_assoc()) {
         $iStatusID = $row["StatusID"];
         $strStatusName = $row["StatusName"];
         $strStatusColor = $row["StatusColor"];
         $o = new Status($iStatusID, $strStatusName, $strStatusColor);
     }
     return $o;
 }
 function Load()
 {
     $dataProvider = new DataProvider($this->SessionFile);
     $dataProvider->Load();
     $this->IP = $dataProvider->Result["s_ip"];
     $this->SystemInfo = $dataProvider->Result["s_system"];
     $this->Language = $dataProvider->Result["s_language"];
     $this->Resolution = $dataProvider->Result["s_resolution"];
     $this->Host = $dataProvider->Result["s_host"];
     if (isset($dataProvider->Result["s_geotz"])) {
         $this->GeoTimezoneOffset = $dataProvider->Result["s_geotz"];
     }
     if (isset($dataProvider->Result["s_geolong"])) {
         $this->GeoLongitude = $dataProvider->Result["s_geolong"];
     }
     if (isset($dataProvider->Result["s_geolat"])) {
         $this->GeoLatitude = $dataProvider->Result["s_geolat"];
     }
     if (isset($dataProvider->Result["s_geocity"])) {
         $this->GeoCity = $dataProvider->Result["s_geocity"];
     }
     if (isset($dataProvider->Result["s_geocountry"])) {
         $this->GeoCountryISO2 = $dataProvider->Result["s_geocountry"];
     }
     if (isset($dataProvider->Result["s_georegion"])) {
         $this->GeoRegion = $dataProvider->Result["s_georegion"];
     }
     if (isset($dataProvider->Result["s_visits"])) {
         $this->Visits = $dataProvider->Result["s_visits"];
     }
     if (isset($dataProvider->Result["s_georid"])) {
         $this->GeoResultId = $dataProvider->Result["s_georid"];
     }
     if (isset($dataProvider->Result["s_geoisp"])) {
         $this->GeoISP = $dataProvider->Result["s_geoisp"];
     }
 }
Exemple #6
0
 public static function getDevice($iDeviceID)
 {
     $o = null;
     $sql = "select DeviceID, DeviceName  , Discontinued " . "from devices where  DeviceID = " . $iDeviceID;
     $resultSet = DataProvider::Load($sql);
     if ($row = $resultSet->fetch_assoc()) {
         $iDeviceID = $row["DeviceID"];
         $strDeviceName = $row["DeviceName"];
         $status = $row["Discontinued"];
         $o = new Device($iDeviceID, $strDeviceName, $status);
     }
     return $o;
 }
Exemple #7
0
 public static function getCat($iCatProID)
 {
     $o = null;
     $sql = "select CatProID, CatName, c.DeviceID as DeviceID, d.DeviceName as DeviceName , c.Discontinued as Discontinued , c.BraID as BraID , b.BraName as BraName  " . "from categories as c , devices as d , brands as b where b.BraID = c.BraID and d.DeviceID = c.DeviceID and CatProID = " . $iCatProID;
     $resultSet = DataProvider::Load($sql);
     if ($row = $resultSet->fetch_assoc()) {
         $iCatProID = $row["CatProID"];
         $strCatName = $row["CatName"];
         $iBraID = $row["BraID"];
         $strBraName = $row["BraName"];
         $oBrand = new Brand($iBraID, $strBraName);
         $iDeviceID = $row["DeviceID"];
         $strDeviceName = $row["DeviceName"];
         $oDevice = new Device($iDeviceID, $strDeviceName);
         $status = $row["Discontinued"];
         $o = new Category($iCatProID, $strCatName, $oBrand, $oDevice, $status);
     }
     return $o;
 }
Exemple #8
0
 public static function getBrand($iBraID)
 {
     $sql = "select BraID, BraName, LogoURL  , Discontinued " . "from brands where  BraID = " . $iBraID;
     $resultSet = DataProvider::Load($sql);
     $o = null;
     if ($row = $resultSet->fetch_assoc()) {
         $iBraID = $row["BraID"];
         $strBraName = $row["BraName"];
         $strLogoURL = $row["LogoURL"];
         $status = $row["Discontinued"];
         $o = new Brand($iBraID, $strBraName, $strLogoURL, $status);
     }
     return $o;
 }
 function Load($_chatfile)
 {
     if (isnull($_chatfile)) {
         $dataProvider = new DataProvider($this->TargetFileExternal);
     } else {
         $dataProvider = new DataProvider($_chatfile);
     }
     $dataProvider->Load();
     $this->Id = $dataProvider->Result["s_id"];
     $this->InternalUser = new Operator($dataProvider->Result["s_internal_sessid"], $dataProvider->Result["s_internal_userid"]);
     $this->ExternalUser = new ExternalChat($dataProvider->Result["s_external_userid"], $dataProvider->Result["s_external_browserid"]);
     $this->InternalUser->Fullname = $dataProvider->Result["s_internal_fullname"];
     $this->SetDirectories();
 }