Fee receipt updated successfully popsup but record not updating
<table class="table table-bordered table-striped table-hover"> <form method="POST" action="<?php echo base_url(); ?>/FeeReceipts/updatereceipt" > <?php foreach($results as $row){ ?> <tr> <th>Institution: </th> <td><?php echo $row->institutionname; ?> <input type="hidden" name = "id" value="<?php echo $row->receiptno; ?>" /> </td> <th>Session: </th> <td><?php echo $row->sessionname; ?></td> </tr> <th>Class: </th> <td><?php echo $row->classname; ?></td> <th>Section: </th> <td><?php echo $row->sectionname; ?></td> </tr> <tr> <th>Admission No: </th> <td><?php echo $row->admissionno; ?></td> <th>Name: </th> <td><?php echo $row->studentname; ?></td> </tr> <tr> <th>Class Fee: </th> <td><?php echo $row->classfee; ?></td> <th>Discount: </th> <td><?php echo $row->totaldiscount; ?></td> </tr> <tr> <?php $payable = $row->classfee - $row->totaldiscount; ?> <th>Payable: </th> <td><?php echo $payable; ?></td> <?php $p = ""; if($row->paid==0){ $p = '<input type="checkbox" checked="false" class="form-control" onclick="return false;" />'; } else { $p = '<input type="checkbox" checked="true" class="form-control" onclick="return false;" />'; } ?> <th>Paid: </th> <td><?php echo $p; ?></td> </tr> <tr> <th>Addition Fee: </th> <td><input type="text" name = "additionalfee" value="<?php echo $row->additionalfee; ?>" /> </td> <th>Instant Discount: </th> <td><input type="text" name = "instantdisc" value="<?php echo $row->instantdisc; ?>" /></td> </tr> <tr> <th>Remarks: </th> <td><input type="text" name = "remarks" value="<?php echo $row->remarks; ?>" /> </td> <th>Paid Amount: </th> <td><input type="text" name = "paidamount" value="<?php echo $row->paidamount; ?>" /></td> </tr> <?php } ?> <button type="submit" class="btn btn-success">Update Receipt</button> </form> </table>
public function updatereceipt() { $model = new FeeReceiptModel(); $id = $this->request->getVar('id'); $data = ['additionalfee' => $this->request->getVar('additionalfee'), 'instantdisc' => $this->request->getVar('instantdisc'), 'remarks' => $this->request->getVar('remarks'), 'paidamount' => $this->request->getVar('paidamount')]; if($model->update($id,$data)){ echo "<script>alert('Fee receipt updated successfully!');window.location.href='".base_url()."/feereceipts';</script>"; } }
$model->update($id,$data)){
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)