Exemplo n.º 1
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;
 }
Exemplo n.º 2
0
 static function getlist($table, $kfield, $tfield, $kvalue)
 {
     $result = array();
     $wd = new wra_db();
     $wd->query = "SELECT `{$tfield}`\n FROM `" . WRA_CONF::$db_prefix . "{$table}` where `{$kfield}`='{$kvalue}'";
     $wd->executereader();
     while ($u0 = $wd->read()) {
         $result[$u0[0]] = $u0[0];
     }
     $wd->close();
     unset($wd);
     return $result;
 }
Exemplo n.º 3
0
 static function getlist()
 {
     //получить список
     $result = array();
     $wd = new wra_db();
     $wd->query = "SELECT `email`\n FROM `" . WRA_CONF::$db_prefix . "adminemails` ";
     $wd->executereader();
     while ($u0 = $wd->read()) {
         $result[] = $u0[0];
     }
     $wd->close();
     return $result;
 }
Exemplo n.º 4
0
 static function getlist()
 {
     //получить список
     $result = array();
     $wd = new wra_db();
     $wd->query = 'SELECT `id`,`rutext`
         FROM `' . WRA_CONF::$db_prefix . "rights`";
     $wd->executereader();
     while ($u0 = $wd->read()) {
         $result[$u0[0]] = $u0[1];
     }
     $wd->close();
     unset($wd);
     // WRA::debug($result);
     return $result;
 }
Exemplo n.º 5
0
 function getbypage($url, $lang = "")
 {
     $wd = new wra_db();
     // $this->id = $id;
     $wd->query = "SELECT \n        `id`,\n        `link`,\n        `title`,\n        `meta_keywords`,\n        `meta_description`,\n        `og_image`\n        FROM `" . WRA_CONF::$db_prefix . "meta" . $lang . "` WHERE `link`='{$url}'";
     $wd->executereader();
     if ($u0 = $wd->read()) {
         $this->id = $u0[0];
         $this->link = $u0[1];
         $this->title = $u0[2];
         $this->meta_keywords = $u0[3];
         $this->meta_description = $u0[4];
         $this->og_image = $u0[5];
     }
     $wd->close();
     unset($wd);
 }
Exemplo n.º 6
0
 static function getheaderbykey($key, $lang = "")
 {
     //$id = -1;
     $key = addslashes($key);
     $wd = new wra_db();
     $wd->query = "SELECT `header` FROM `" . WRA_CONF::$db_prefix . "texts" . $lang . "` WHERE `keyx`='{$key}'";
     // die($wd->query);
     $wd->executereader();
     if ($u0 = $wd->read()) {
         $id = $u0[0];
         //die('1'.$id);
     } else {
         $id = false;
     }
     $wd->close();
     unset($wd);
     return $id;
 }
Exemplo n.º 7
0
 function load($id, $lang = '')
 {
     $result = array();
     $wd = new wra_db();
     $wd->query = "SELECT \n        p.id,p.dateadd,p.header,p.path,p.user_id,p.content,p.keywords\n        FROM `" . WRA_CONF::$db_prefix . "pages{$lang}` AS p\n        where p.id = '{$id}'";
     $wd->executereader();
     while ($u0 = $wd->read()) {
         $this->id = $u0[0];
         $this->dateadd = $u0[1];
         $this->header = $u0[2];
         $this->path = $u0[3];
         $this->user_id = $u0[4];
         $this->content = $u0[5];
         $this->keywords = $u0[6];
         // $result[$item->id]= $item;
     }
     $wd->close();
     unset($wd);
     return $this;
 }
Exemplo n.º 8
0
 static function getcount()
 {
     $result = 0;
     $wd = new wra_db();
     $wd->query = "SELECT \n\t\t\t\tcount(`id`)\n\t\t\t\tFROM `" . WRA_CONF::$db_prefix . "adminnotices` where status=0";
     // WRA::debug($wd->query);
     $wd->executereader();
     if ($u0 = $wd->read()) {
         $result = $u0[0];
     }
     $wd->close();
     unset($wd);
     return $result;
 }
Exemplo n.º 9
0
 function loadbytw($twid)
 {
     //загрузка объекта
     $wd = new wra_db();
     $wd->query = 'SELECT 
          `id`,
          `userid`,
          `twuserid`,
          `display_name`,
          `regdate`,
          `username`,
          `usersurname`,
          `link`,
          `gender`,
          `photo`,
          `points`,
          `access_token`,
          `email`,
          `phone`,
          `adres`,`team`,`photoplus`
          FROM `' . WRA_CONF::$db_prefix . "twu`  where `twuserid`='{$twid}'";
     $wd->executereader();
     if ($u0 = $wd->read()) {
         $this->id = $u0[0];
         $this->userid = $u0[1];
         $this->twuserid = $u0[2];
         $this->display_name = $u0[3];
         $this->regdate = $u0[4];
         $this->username = $u0[5];
         $this->usersurname = $u0[6];
         $this->link = $u0[7];
         $this->gender = $u0[8];
         $this->photo = $u0[9];
         $this->points = $u0[10];
         $this->access_token = $u0[11];
         $this->email = $u0[12];
         $this->phone = $u0[13];
         $this->adres = $u0[14];
         $this->position = $u0[15];
         $this->photoplus = $u0[16];
     }
     $wd->close();
     unset($wd);
 }
Exemplo n.º 10
0
 function load($id, $lang = '')
 {
     //загрузка объекта
     $wd = new wra_db();
     $this->id = $id;
     $wd->query = "SELECT \n             `id`,\n             `header`,\n             `link`,\n             `sortorder`,\n             `parentid`\n            FROM `" . WRA_CONF::$db_prefix . "menu{$lang}`  where `id`='{$this->id}'";
     $wd->executereader();
     if ($u0 = $wd->read()) {
         $this->id = $u0[0];
         $this->header = $u0[1];
         $this->link = $u0[2];
         $this->sortorder = $u0[3];
         $this->parentid = $u0[4];
     }
     $wd->close();
     unset($wd);
 }
Exemplo n.º 11
0
 static function loadlangeddict()
 {
     $wd = new wra_db();
     $wd->query = "SELECT \n\t\t\t\t`id`,\n\t\t\t\t`table`,\n\t\t\t\t`field`,\n\t\t\t\t`lang`,\n\t\t\t\t`value`,`rowid`,`key`\n\t\t\t\tFROM `" . WRA_CONF::$db_prefix . "langed`";
     $wd->executereader();
     while ($u0 = $wd->read()) {
         //var $obj=array();
         WRA::$langdict[$u0[0]]['table'] = $u0[1];
         WRA::$langdict[$u0[0]]['field'] = $u0[2];
         WRA::$langdict[$u0[0]]['lang'] = $u0[3];
         WRA::$langdict[$u0[0]]['value'] = $u0[4];
         WRA::$langdict[$u0[0]]['rowid'] = $u0[5];
         WRA::$langdict[$u0[0]]['key'] = $u0[6];
         //array_push(wra_dictionary::$langdict
     }
     //die(print_r($langdict));
     $wd->close();
     unset($wd);
 }
Exemplo n.º 12
0
 static function getidbylogin($wf, $login)
 {
     $result = 0;
     $wd = new wra_db($wf);
     $wd->query = 'select id from ' . WRA_CONF::$db_prefix . "users where login='******'";
     $wd->executereader();
     if ($u0 = $wd->read()) {
         $result = $u0[0];
     }
     $wd->close();
     unset($wd);
     return $result;
 }
Exemplo n.º 13
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;
 }
Exemplo n.º 14
0
    function load($sessionid)
    {
        $wd = new wra_db();
        $this->id = $id;
        $this->sessionid = $sessionid;
        $wd->query = 'SELECT 
 `id`,
 `sessionid`,
 `user_id`,
 `begintime`,
 `ip`
 FROM `' . WRA_CONF::$db_prefix . "sessions`  where `sessionid`='{$this->sessionid}'";
        $wd->executereader();
        if ($u0 = $wd->read()) {
            $this->id = $u0[0];
            $this->sessionid = $u0[1];
            $this->user_id = $u0[2];
            $this->begintime = $u0[3];
            $this->ip = $u0[4];
        }
        $wd->close();
        unset($wd);
    }
Exemplo n.º 15
0
 static function getbypath($path)
 {
     $result = new wra_virtualpage();
     $wd = new wra_db();
     $wd->query = "SELECT\n                `id`\n\n                FROM `" . WRA_CONF::$db_prefix . "virtualpage`\n                WHERE `link`='{$path}'";
     $wd->executereader();
     if ($u0 = $wd->read()) {
         $r0 = new wra_virtualpage();
         $r0->loadid($u0[0]);
         //  if($r0->header!="")
         $result = $r0;
     }
     $wd->close();
     unset($wd);
     return $result;
 }
Exemplo n.º 16
0
    function load($id)
    {
        $wd = new wra_db();
        $this->id = $id;
        $wd->query = 'SELECT 
 `id`,
 `version`,
 `merchant_id`,
 `result_url`,
 `server_url`,
 `order_id`,
 `amount`,
 `currency`,
 `description`,
 `default_phone`,
 `pay_way`,
 `goods_id`,
 `dateadd`,
 `ipadd`,
 `cartid`,
 `statusid`,
 `exp_time`,
 `pays_count`,
 `status`,
 `code`,
 `transaction_id`,
 `pay_way_paid`,
 `pays_count_return`,
 `returndate`
 FROM `' . WRA_CONF::$db_prefix . "liqpay`  where `id`='{$this->id}'";
        $wd->executereader();
        if ($u0 = $wd->read()) {
            $this->id = $u0[0];
            $this->version = $u0[1];
            $this->merchant_id = $u0[2];
            $this->result_url = $u0[3];
            $this->server_url = $u0[4];
            $this->order_id = $u0[5];
            $this->amount = $u0[6];
            $this->currency = $u0[7];
            $this->description = $u0[8];
            $this->default_phone = $u0[9];
            $this->pay_way = $u0[10];
            $this->goods_id = $u0[11];
            $this->dateadd = $u0[12];
            $this->ipadd = $u0[13];
            $this->cartid = $u0[14];
            $this->statusid = $u0[15];
            $this->exp_time = $u0[16];
            $this->pays_count = $u0[17];
            $this->status = $u0[18];
            $this->code = $u0[19];
            $this->transaction_id = $u0[20];
            $this->pay_way_paid = $u0[21];
            $this->pays_count_return = $u0[22];
            $this->returndate = $u0[23];
        }
        $wd->close();
        unset($wd);
    }
Exemplo n.º 17
0
 static function isloginexist($wf, $username)
 {
     $result = false;
     $wd = new wra_db();
     $username = addslashes($username);
     $wd->query = 'SELECT login FROM `' . WRA_CONF::$db_prefix . "users` WHERE login = '******'";
     $wd->executereader();
     $result = $u0 = $wd->read();
     $wd->close();
     unset($wd);
     return $result;
 }
Exemplo n.º 18
0
 function load($id)
 {
     //загрузка объекта
     $wd = new wra_db();
     $this->id = $id;
     $wd->query = 'SELECT 
      `id`,
      `user_id`,
      `right_id`
      FROM `' . WRA_CONF::$db_prefix . "usersrights`  where `id`='{$this->id}'";
     $wd->executereader();
     if ($u0 = $wd->read()) {
         $this->id = $u0[0];
         $this->user_id = $u0[1];
         $this->right_id = $u0[2];
     }
     $wd->close();
     unset($wd);
 }
Exemplo n.º 19
0
    function load($id)
    {
        $wd = new wra_db();
        $this->id = $id;
        $wd->query = 'SELECT 
 `id`,
 `title`,
 `ruicon`,
 `alicon`,
 `style`,
 `img`
 FROM `' . WRA_CONF::$db_prefix . "cats`  where `id`='{$this->id}'";
        $wd->executereader();
        if ($u0 = $wd->read()) {
            $this->id = $u0[0];
            $this->title = $u0[1];
            $this->ruicon = $u0[2];
            $this->alicon = $u0[3];
            $this->style = $u0[4];
            $this->img = $u0[5];
        }
        $wd->close();
        unset($wd);
    }
Exemplo n.º 20
0
    static function findlast($name, $cat)
    {
        $wd = new wra_db();
        $me = false;
        $wd->query = 'SELECT 
 `id`,
 `time`,
 `name`,
 `address`,
 `city`,
 `ttl`,
 `source`,
 `lat`,
 `lng`,
 `color_id`,
 `cat_id`,
 `picture`,
 `link`,
 `description`,
 `status`,
 `updated`, `resource`,
 `points`,
 `type_id`,
 `strokeweight`,
 `strokeopacity`,
 `strokecolor`,
 `symbolpath`,
 `fillcolor`,
 `fillopacity`,
 `twitpic`,
 `user_added`,
 `tts`,
 `status_id`
 FROM `' . WRA_CONF::$db_prefix . "foursqvenues`  where `name`='{$name}' and `type_id`='{$cat}' order by id desc";
        $wd->executereader();
        if ($u0 = $wd->read()) {
            $me = new wra_foursqvenues();
            $me->id = $u0[0];
            $me->time = $u0[1];
            $me->name = $u0[2];
            $me->address = $u0[3];
            $me->city = $u0[4];
            $me->ttl = $u0[5];
            $me->source = $u0[6];
            $me->lat = $u0[7];
            $me->lng = $u0[8];
            $me->color_id = $u0[9];
            $me->cat_id = $u0[10];
            $me->picture = $u0[11];
            $me->link = $u0[12];
            $me->description = $u0[13];
            $me->status = $u0[14];
            $me->updated = $u0[15];
            $me->resource = $u0[16];
            $me->points = $u0[17];
            $me->type_id = $u0[18];
            $me->strokeweight = $u0[19];
            $me->strokeopacity = $u0[20];
            $me->strokecolor = $u0[21];
            $me->symbolpath = $u0[22];
            $me->fillcolor = $u0[23];
            $me->fillopacity = $u0[24];
            $me->twitpic = $u0[25];
            $me->user_added = $u0[26];
            $me->tts = $u0[27];
            $me->status_id = $u0[28];
        }
        $wd->close();
        unset($wd);
        return $me;
    }
Exemplo n.º 21
0
    function load($id)
    {
        $wd = new wra_db();
        $this->id = $id;
        $wd->query = 'SELECT 
			 `id`,
			 `title`,
			 `description`,
			 `filename`
 		FROM `' . WRA_CONF::$db_prefix . "upfiles`  where `id`='{$this->id}'";
        $wd->executereader();
        if ($u0 = $wd->read()) {
            $this->id = $u0[0];
            $this->title = $u0[1];
            $this->description = $u0[2];
            $this->filename = $u0[3];
        }
        $wd->close();
        unset($wd);
    }
Exemplo n.º 22
0
 function load($wf = null, $saveid = -1, $pid = -1, $page = 0)
 {
     if ($this->query == "") {
         return;
     }
     $this->pid = $pid;
     $this->page = $page;
     $wd = new wra_db($wf);
     $wd->query = $this->query;
     $wd->executereader();
     while ($u0 = $wd->read()) {
         $this->rows[count($this->rows)] = $u0;
     }
     $wd->close();
     unset($wd);
 }
Exemplo n.º 23
0
 function getcount($lang = "")
 {
     $result = 0;
     if ($this->curid != 0) {
         $this->where = " where id=" + $this->curid;
     }
     if (!empty($this->where)) {
         if (!strpos($this->where, 'where')) {
             $this->where = ' where ' . $this->where;
         }
     }
     $sqlquery = "select count(id) from `" . WRA_CONF::$db_prefix . $this->table . $lang . "` " . $this->where;
     if (!empty($this->selectquery)) {
         $sqlquery = $this->selectquery;
     }
     $wd = new wra_db();
     $wd->query = $sqlquery;
     $wd->executereader();
     if ($u0 = $wd->read()) {
         $result = $u0[0];
     }
     $wd->close();
     return $result;
 }