public function __construct(array $param = null) { $loginId = $param == null || empty($param[0]) ? "" : $param[0]; $_password = $param == null || empty($param[1]) ? "" : $param[1]; $this->IsOld = false; $this->Balance = 0; if ($loginId != '') { $sql = "select * from " . $this->getTableName() . " where loginId = '" . StringMethods::MakeSave($loginId) . "' and status = 'active';"; //die($sql); $result = OpenSms_Helper_Db::executeReader($sql); foreach ($result as $r) { if ($_password != '') { $this->IsValidated = self::Validate($loginId, $_password); } $this->IsOld = true; $this->Name = StringMethods::GetRaw($r->name); $this->LoginId = StringMethods::GetRaw($r->loginId); $this->Address = StringMethods::GetRaw($r->address); $this->DateRegistered = $r->dateRegistered; $this->Balance = $r->balance; $this->EmailId = StringMethods::GetRaw($r->emailId); $this->MobileNo = StringMethods::GetRaw($r->mobileNo); $this->Role = StringMethods::GetRaw($r->role); } /* if(!$this->IsValidated){ $this->getUserFromJ($loginId, $_password); } */ } }
private function copy($result) { foreach ($result as $r) { $this->Key = $r->key; $this->Body = StringMethods::GetRaw($r->body); $this->Host = StringMethods::GetRaw($r->host); $this->Type = $r->type; $this->Id = $r->id; } }
private function copy($result) { foreach ($result as $r) { $this->Permalink = StringMethods::GetRaw($r->permalink); $this->Title = StringMethods::GetRaw($r->title); $this->Layout = StringMethods::GetRaw($r->layout); $this->Role = StringMethods::GetRaw($r->role); $this->Description = $r->description; $this->Id = $r->id; } }
public function getById($id = -1) { $this->Id = $id; if ($id != '') { $sql = "select * from " . OpenSms::getTableName('contact') . " where id = '" . StringMethods::MakeSave($id) . "';"; $result = OpenSms_Helper_Db::executeReader($sql); foreach ($result as $r) { $this->GroupId = $r->groupId; $this->Name = StringMethods::GetRaw($r->name); $this->Number = StringMethods::GetRaw($r->number); $this->Id = $r->id; } } }
public function __construct($id = -1) { $this->Id = $id; $this->db = new TDataAccess(); if ($id != '') { $sql = "select * from draft where id = '{$id}';"; $result = $this->db->SendQuery($sql); while ($r = $result->fetch_assoc()) { extract($r); $this->LoginId = StringMethods::GetRaw($loginId); $this->DateCreated = $dateCreated; $this->Recipient = StringMethods::GetRaw($recipient); $this->Message = StringMethods::GetRaw($message); $this->Sender = StringMethods::GetRaw($sender); $this->DeliveryType = $deliveryType; } } }
public static function GetBulkSMS($loginId, $offset, $limit) { $bulkSMSs = array(); $sql = "select * from " . OpenSms::getTableName('bulksms') . " where loginId = '{$loginId}' ORDER BY id DESC LIMIT {$offset}, {$limit};"; $result = OpenSms_Helper_Db::executeReader($sql); foreach ($result as $r) { $bulkSMS = new OpenSms_Model_BulkSms(); $bulkSMS->Id = $r->id; $bulkSMS->LoginId = StringMethods::GetRaw($r->loginId); $bulkSMS->DateCreated = $r->dateCreated; $bulkSMS->Message = StringMethods::GetRaw($r->message); $bulkSMS->Sender = StringMethods::GetRaw($r->sender); $bulkSMS->Status = StringMethods::GetRaw($r->status); $bulkSMS->Count = $r->count; $bulkSMSs[] = $bulkSMS; } return $bulkSMSs; }
public static function GetRange($offset, $limit, $loginId = '') { $trans = array(); $sql = "select * from " . OpenSms::getTableName('transactions') . (empty($loginId) ? "" : "where loginId = '{$loginId}'") . " ORDER BY id DESC LIMIT {$offset}, {$limit};"; $result = OpenSms_Helper_Db::executeReader($sql); foreach ($result as $r) { $tran = new OpenSms_Model_Transaction(); $tran->Id = $r->id; $tran->LoginId = StringMethods::GetRaw($r->loginId); $tran->Date = $r->date; $tran->Amount = StringMethods::GetRaw($r->amount); $tran->Unit = StringMethods::GetRaw($r->unit); $tran->Status = StringMethods::GetRaw($r->status); $tran->Description = StringMethods::GetRaw($r->description); $tran->PaymentMethod = StringMethods::GetRaw($r->paymentMethod); $tran->IsValid = StringMethods::GetRaw(TRUE); $tran->Type = $r->type; $tran->Committed = $r->committed; $trans[] = $tran; } return $trans; }