function add_prod_procurement($pr_id, $d_id, $i_price, $i_cur_id, $pr_num) { while ($pr_num) { $new_i_id = $this->insert_new_item($pr_id, 2); // insert new item with 'prepare to procurement' status $sql = "INSERT INTO `DEAL_ITEMS_LIST` (\r`DIL_ID`,\r`DIL_D_ID`,\r`DIL_I_ID`,\r`DIL_PRICE`,\r`DIL_CUR_ID`\r) VALUES ('0','" . $d_id . "','" . $new_i_id . "','" . trade::getnumber($i_price) . "','" . $i_cur_id . "');"; $result = $this->mysqli->query($sql); $pr_num--; } $ans = trade::edit_procurement_form($d_id); return $ans; }
function save_margin($m_val, $m_id) { $result = $this->mysqli->query("UPDATE MARGINS SET M_VALUE = '" . trade::getnumber($m_val) . "' WHERE M_ID =" . $m_id . ";"); }