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);
 }
Exemple #2
0
 function currow($lang = '')
 {
     // WRA::debug($lang);
     // WRA::debug($this->_currow);
     // if ( (!isset($this->_currow)) ) {
     $a = $this->getrows($lang, 1, 1);
     if (count($a) > 0) {
         $this->_currow = $a[0];
         // WRA::debug($a[0]);
         foreach ($this->columns as $ac) {
             switch ($ac->editstatus) {
                 case admincolumntype::multiselect:
                     $ilang = $lang;
                     if ($ilang == '') {
                         $ilang = 'ru';
                     }
                     $ac->items = wra_multiselect::getlist($ac->multiselect->table, $ac->multiselect->kfield, $ac->multiselect->tfield, $this->curid, $sO);
                     break;
                 case admincolumntype::images:
                     $ilang = $lang;
                     if ($ilang == '') {
                         $ilang = 'ru';
                     }
                     $items = wra_image::getlistadmin($this->curid, $this->table, $ilang);
                     // WRA::debug($ilang);
                     // WRA::debug($items);
                     if (!empty($items)) {
                         $ac->items[str_replace('_', '', $ilang)] = $items;
                     }
                     break;
             }
         }
         return $this->_currow;
     }
     $this->_currow = new adminrows();
     foreach ($this->columns as $ac) {
         $this->_currow->values[$ac->field] = '';
     }
     // }
     return $this->_currow;
 }