我实际上是这个Codeigniter编码中的新手,我试图从2个不同的页面提交一个值并将其放在1个表中,到目前为止,我只能从1个页面提交一个值,是否可以将2个值提交给1张桌子?
我表中的列:
po_no, tgl_po, rev_po, vendor_po, pic_po, tofp_po, kurs_po, location_po, catatan_po
我的模型为我的数据库增加价值
public function addPurchaseOrder()
{
$data = [
"vendor_po" => $this->input->post('vendor',true),
"tgl_po"=>$this->input->post('tanggal',true),
"po_no" =>$this->input->post('po',true),
"rev_po"=>$this->input->post('rev',true),
"ref_po"=>$this->input->post('ref',true),
"pic_po"=>$this->input->post('pic',true),
"location_po"=>$this->input->post('location',true),
"tofp_po"=>$this->input->post('top',true),
"kurs_po"=>$this->input->post('kurs',true),
"catatan_po"=>$this->input->post('catatan',true)
];
$this->db->insert('purchase_order',$data);
}
我的表单结构基本上
<div class="form-group">
<label for="catatan" class="control-label">Notes : </label>
<div class="row mt-4">
<div class="col-lg-12">
<textarea name="catatan" id="catatan" cols="151" rows="15"></textarea>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col-lg-12">
<a href="<?php base_url(); ?>tampil" class="btn btn-primary float-right" id="buton">Submit</a>
</div>
</div>
此页面基本上填充了除tantan_po以外的所有表列,不同的是按钮
<div class="col-lg-12">
<button class="btn btn-primary float-right" type="submit" style="margin-bottom:50px;" id="buton">Save</button>
<a class="btn btn-primary float-right" id="buton" href="<?php base_url(); ?>otorisasi">Back</a>
</div>
我正确吗?