コード例 #1
0
ファイル: trade.cl.php プロジェクト: ut8ia/proBase
 function edit_procurement_form($d_id)
 {
     $ans .= "<input type='hidden' id='d_id' value='" . $d_id . "'>";
     $deal = trade::get_deal_properties($d_id);
     // get deal properties
     //$p_selector=$this->get_partners_selector($deal['2p_id']);
     $d_desc_box = "<textarea rows='3' cols='70' id='d_desc' class='input_text' value='" . $deal['desc'] . "' onchange=\"x_cl_call2('trade','save_deal_description'," . $d_id . ",\$('#d_desc').val(),'show_result');\">" . $deal['desc'] . "</textarea> </td></tr>";
     // add item form
     $selected_prod_name = "<div id='selected_prod_name' class='selected_prod_name'>Товар не выбран</div>";
     $add_button = "<button class='button' onclick=\"x_cl_call5('trade','add_prod_procurement',\$('#sel_pr_id').val()," . $d_id . ",\$('#proc_price').val(),\$('#currency_selector').val(),\$('#product_num').val(),'show_result');\">Добавить</button>";
     $price_box = "<input type='text' size='7' maxlength='7' id='proc_price' class='input_text' value=''>";
     //$cur_selector=trade::get_currency_selector(2);
     // no UAH in procurement !
     $cur_selector = "<select id='currency_selector' onchange='' name='currency_selector' class='select' >\r<option value='2' selected>USD</option>\r<option value='3' >EUR</option>\r\t\t</select>";
     $num_box = "<input type='text' size='2' maxlength='4' id='product_num' class='input_text' value='1'>";
     $add_form = "<table class='multitable'><tr><td>" . $selected_prod_name . "</td><td width=250px> Цена" . $price_box . $cur_selector . "</td><td  width=120px> Кол-во" . $num_box . "</td><td width=50px>" . $add_button . "</td></tr></table>";
     // action buttons
     $do_procurement_button = "<button class='button' onclick=\"x_cl_call('trade','deal_forward'," . $d_id . ",'show_result');\">Провести закупку этих позиций</button>";
     $del_procurement_button = "<button class='button' onclick=\"x_cl_call('trade','delete_procurement'," . $d_id . ",'show_result');\">Удалить весь закупочный список</button>";
     // main form
     $ans .= "\r\t\t<table>\r\t\t<tr><td><div class='headpost'>" . $deal['type']['name'] . " № " . $d_id . "</div></td></tr>\r\t\t<tr><td>Начата : " . $deal['date'] . "</td></tr>\r\t\t<tr><td>Контрагент :" . trade::get_p_name($deal['2p_id']) . "</td></tr>\r\t\t<tr><td>" . trade::edit_procurement_table($d_id) . "</td></tr>\r\t\t<tr><td>Добавить товар :</td></tr>\r\t\t<tr><td>" . $add_form . "</td></tr>\r\t\t<tr><td>Действия :</td></tr>\r\t\t<tr><td>" . $do_procurement_button . $del_procurement_button . "</td></tr>\r\t\t<tr><td>Примечание :</td></tr>\r\t\t<tr><td>" . $d_desc_box . "</td></tr>\r\t\t</table>";
     return $ans;
 }