public function getRecord($edit) { $rec = parent::getRecord($edit); $rec[customer] = $this->getCustomer($rec[customer_id]); $rec[customer] = $rec[customer][customer]; $sql = "SELECT * \n FROM blockpos \n JOIN boards ON boards.id=blockpos.board_id \n WHERE blockpos.block_id='{$edit}'"; $rec[blockpos] = sql::fetchAll($sql); $param = multibyte::Json_decode(multibyte::Unescape($this->getComment($rec[comment_id]))); if (empty($param["class"])) { $param["class"] = $rec[blockpos][0]["class"]; } if (empty($param[basemat])) { $basemat = explode("-", $rec[blockpos][0][textolite]); $param[basemat] = $basemat[0]; } $rec["comment"] = $param["coment"]; $wideandgaps = $param["wideandgaps"]; // если слои еще не заполнены заполним из wideandgaps for ($i = 1; $i < 11; $i++) { $sl1 = $wideandgaps[2 * $i - 2][0]; $sl2 = $wideandgaps[2 * $i - 1][0]; $pr1 = $wideandgaps[2 * $i - 2][1]; $pr2 = $wideandgaps[2 * $i - 1][1]; if (!isset($param["sl{$i}"]) || empty($param["sl{$i}"])) { if (!empty($sl1)) { $param["sl{$i}"] = $sl1 . "-" . $sl2; $param["pr{$i}"] = sprintf("%5.3f/%5.3f", $pr1, $pr2); } } } $rec["param"] = $param; $rec[files] = $this->getFilesForId('blocks', $edit); return $rec; }
public function getRecord($edit) { $rec = parent::getRecord($edit); $rec[customer] = $this->getCustomer($rec[customer_id]); $rec[customer] = $rec[customer][customer]; $rec[comment] = $this->getComment($rec[comment_id]); $rec[files] = $this->getFilesForId('boards', $edit); return $rec; }
public function getRecord($edit) { $rec = parent::getRecord($edit); $sql = "SELECT * FROM blockpos JOIN boards ON boards.id=blockpos.board_id WHERE block_id={$rec[block_id]}"; $rec[boards] = sql::fetchAll($sql); foreach ($rec[boards] as &$value) { $value[filelinks] = $this->getFilesForId('boards', $value[board_id]); } return $rec; }
public function getRecord($edit) { // поставщики список для выбора $supply["0"] = "Новый"; $sql = "SELECT * FROM {$this->db}sk_{$this->sklad}_postav"; $res = sql::fetchAll($sql); foreach ($res as $rs) { $supply[$rs["id"]] = $rs["supply"]; } $sql = "SELECT *,sk_{$this->sklad}_dvizh.id,sk_{$this->sklad}_postav.id AS supply_id\n FROM {$this->db}sk_{$this->sklad}_dvizh\n JOIN ({$this->db}sk_{$this->sklad}_postav,{$this->db}coments,{$this->db}sk_{$this->sklad}_spr)\n ON (sk_{$this->sklad}_postav.id=sk_{$this->sklad}_dvizh.post_id\n AND coments.id=sk_{$this->sklad}_dvizh.comment_id\n AND {$this->db}sk_{$this->sklad}_spr.id={$this->db}sk_{$this->sklad}_dvizh.spr_id)\n WHERE sk_{$this->sklad}_dvizh.id='{$edit}'"; $rec = sqltable_model::getRecord($sql); $rec[supply] = $supply; return $rec; }
public function getRecord($edit) { $rec = parent::getRecord($edit); $sql = "SELECT id,operation FROM operations WHERE block_type='{$this->blocktype}' OR block_type='both' ORDER BY priority,id"; $res = sql::fetchAll($sql); foreach ($res as $value) { $rec[operations][$value[id]] = $value[operation]; } $operation = array_shift($res); $operations = multibyte::Json_decode(sqltable_model::getComment($rec[coment_id])); $coment_id = $operations[$operation[id]][comment_id]; $rec[comment] = sqltable_model::getComment($coment_id); $rec[action_date] = $operations[$operation[id]][date]; return $rec; }