I am working on one simple program. If I insert two values, rupees and roommate I have to divide rupees/roommate.
How will I get the result? For example I have 5 roommate and I input rupees = 500, and I want it to be display on the page like 100rupee 5times?
// THIS IS THE MODEL
public function insertModel()
{
$data = array(
'm_rupee' => $this->input->post('m_rupee'),
'rommmate' => $this->input->post('roommate')
);
$this->db->insert('tbl_money',$data);
return;
}
// THIS IS THE CONTROLLER
public function insertDate()
{
$this->MoneySplitter->insertModel('$data');
redirect('MoneySpliterController');
}
// THIS IS THE VIEW
<form method="post" action="<?php echo base_url();>index.php/MoneySpliterController/insertDate">
<input type="text" name="m_rupee" />
<input type="text" name="rommmate" />
<input type="submit" value="save">
</form>