Esempio n. 1
0
 static function add($table, $kfield, $tfield, $kvalue, $tvalue)
 {
     if (wra_multiselect::isexist($table, $kfield, $tfield, $kvalue, $tvalue)) {
         return;
     }
     $wd = new wra_db();
     $wd->query = 'INSERT INTO `' . WRA_CONF::$db_prefix . "{$table}` (`id`,`{$kfield}`,`{$tfield}`)\n                                values(null,'{$kvalue}' ,'{$tvalue}')";
     $wd->execute();
     $wd->close();
     unset($wd);
 }
 function add()
 {
     //добавление нового объекта
     $wd = new wra_db();
     $this->id = WRA::getnewkey("" . WRA_CONF::$db_prefix . 'adminnotices');
     $wd->query = "INSERT INTO `" . WRA_CONF::$db_prefix . "adminnotices` (\n `id`,\n `dateadd`,\n `ip`,\n `message`,\n `status`,`header`\n )VALUES(\n '{$this->id}',\n '{$this->dateadd}',\n '{$this->ip}',\n '{$this->message}',\n '{$this->status}', '{$this->header}'\n )";
     $wd->execute();
     if (!WRA_CONF::$usegetkey) {
         $this->id = $wd->getlastkey();
     }
     $wd->close();
     unset($wd);
 }
Esempio n. 3
0
 function query($request)
 {
     $wd = new wra_db();
     $ip = WRA::getip();
     $time = time();
     $wd->query = 'INSERT INTO `' . WRA_CONF::$db_prefix . "requests` (\n             `request`,\n             `ip`,\n             `time`\n             )VALUES(\n             '{$request}',\n             '{$ip}',\n             '{$time}'\n             )";
     $wd->execute();
     $id = $wd->getlastkey();
     $wd->close();
     // $this->currentobjid = wra_objects::addnewobject('wra_fbu', $this->id, $this->objectadres);
     unset($wd);
     return $id;
 }
 function delete()
 {
     $wd = new wra_db();
     $wd->query = 'DELETE FROM `' . WRA_CONF::$db_prefix . "foursqvenues` where `id`='{$this->id}'";
     $wd->execute();
     $wd->close();
     unset($wd);
     return true;
 }
Esempio n. 5
0
 function delete()
 {
     //удаление объекта
     $wd = new wra_db();
     $wd->query = 'DELETE FROM `' . WRA_CONF::$db_prefix . "usersrights` where `id`='{$this->id}'";
     $wd->execute();
     $wd->close();
     unset($wd);
 }
Esempio n. 6
0
 function update()
 {
     $wd = new wra_db($wf);
     $wd->query = 'UPDATE `' . WRA_CONF::$db_prefix . "users`\n\t\t\t\tSET    `login`='{$this->login}'  ,  `email`='{$this->email}' , \n\t\t\t\t`password`='{$this->password}' ,  `active`= '{$this->active}' , \n\t\t\t\t`displayname` ='{$this->displayname}',  `namei`= '{$this->namei}' ,  `namef`='{$this->namef}'  ,\n\t\t\t\t`nameo`='{$this->nameo}' ,  `cellphone`= '{$this->cellphone}' ,  `cityid`='{$this->cityid}'  ,\n\t\t\t\t`lasttime`='{$this->lasttime}'  ,  `dolg`='{$this->dolg}' ,  `icq`='{$this->icq}'  ,  `twitter`='{$this->twitter}' ,  `web`='{$this->web}'  ,\n\t\t\t\t`adresid`='{$this->adresid}', `groupid`='{$this->groupid}', `avatar`='{$this->avatar}',`adres`='{$this->adres}', `tmbavatar`='{$this->tmbavatar}',\n\t\t\t\t`issotr`='{$this->issotr}',`company`='{$this->company}',\n\t\t\t\t`bday`='{$this->bday}',`description`='{$this->description}',`gender`='{$this->gender}',\n\t\t\t\t`interests`='{$this->interests}',`infor`='{$this->infor}',\n\t\t\t\t`fromwhere`='{$this->fromwhere}',`signin`='{$this->signin}',`discount`='{$this->discount}'\n\t\tWHERE `id`='{$this->id}' \n\t\t\t\t";
     $wd->execute();
     $wd->close();
     unset($wd);
     return true;
 }
Esempio n. 7
0
 function delete()
 {
     $wd = new wra_db();
     $wd->query = "DELETE FROM `" . WRA_CONF::$db_prefix . "langed`  where `id`='{$this->id}'";
     $wd->execute();
     $wd->close();
     unset($wd);
     return true;
 }
Esempio n. 8
0
 function delete()
 {
     //удаление объекта
     $wd = new wra_db();
     $wd->query = "DELETE FROM `" . WRA_CONF::$db_prefix . "virtualpage` where `id`='{$this->id}'";
     $wd->execute();
     $wd->close();
     unset($wd);
     wra_objects::deleteobj($this->currentobjid);
     return true;
 }
Esempio n. 9
0
 static function getnewkey($table)
 {
     //получаем новый ключ для таблицы table
     if (!WRA_CONF::$usegetkey) {
         return '';
     }
     $result = 1;
     $wd = new wra_db();
     $wd->query = 'select value from ' . WRA_CONF::$db_prefix . "keys where tablename='{$table}'";
     $wd->executereader();
     if ($wd->error == '' && $wd->rows_count != 0) {
         if ($u0 = $wd->read()) {
             $result = $u0[0] + 1;
         }
         $wd->query = 'update ' . WRA_CONF::$db_prefix . "keys set value='{$result}' where tablename='{$table}'";
         $wd->execute();
         $wd->close();
     } else {
         WRA::insertkey($table);
     }
     unset($wd);
     return $result;
 }
Esempio n. 10
0
 function deletefirst($lang)
 {
     $wd = new wra_db();
     $wd->query = 'DELETE FROM `' . WRA_CONF::$db_prefix . $this->table . $lang . "` where `id`='{$this->curid}'";
     $wd->execute();
     $wd->close();
     unset($wd);
     return true;
 }