Click here to Skip to main content
15,890,670 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello,

In my View I have to select Institution, Session and Class to retrieve Students and then by Pressing a Button I want to Generate Fee for each Fee. I want to know that how to send each record along with Institutionid, sessionid and classid to Contorller's insert method.

And the use insert_batch to store to database.

Thanks in advance.

What I have tried:

HTML
<table class="table table-bordered table-striped table-hover">
    <thead>
    <tr class="bg-white"><td colspan="2"><h5 class="text-danger">Discount List</h5></td><td colspan="2">
            </td>
        </tr>
      <tr>
        <th class="w-25">Institute</th>
        <th class="w-25">Session</th>
        <th class="w-25">Class</th>
        <th class="w-25">Section</th>
      </tr>
    </thead>
    <tbody>
        <tr>
        <td>
            <select name="institutionid" id="institutionid" class="form-control">
        <option>Select Institute</option>
      <?php
      foreach ($insts as $inst) {
        ?>
        <option value="<?php echo $inst['id']; ?>"><?php echo $inst['name']; ?></option>
      <?php } ?>
    </select>
    </td>
      <td>
        <select class="form-control" name="sessionid" id="session">
        <option>Select Session</option>
        </select>
        </td>
        <td>
        <select class="form-control" name="classid" id="classes">
        <option>Select Class</option>
        </select>
        </td>
        <td>
        <select class="form-control" name="sectionid" id="sections">
        <option>Select Section</option>
        </select>
        </td>
      </tr>
      <tr>
      <td>Fee Type</td>
      <td><label>Addtional Fee</label></td>
      <td><label>Remarks</label></td>
      <td></td>
      </tr>
      <tr>
      <td>
      <select class="form-control" name="feetypeid" id="feetypeid">
        <option>Select FeeType</option>
        <?php
      foreach ($feetypes as $t) {
        ?>
        <option value="<?php echo $t['id']; ?>"><?php echo $t['name']; ?></option>
      <?php } ?>
        </select>
        </td>
      <td> <!-- <input type="month" name="formonth" id="formonth" required></td>
      <td><button id="addFee">Add</button></td>
      <td><Select name="theFee" id="theFee">
      </Select> -->     
      <input type="text" name= "additionalfee">
      </td>
      <td><input type="text" name= "remarks"></td>
      <td><a href="<?php echo $baseurl; ?>/FeeReceipts/genall" class="btn btn-success btn-sm float-right">Generate Receipts</a></td>
      </tr>
    </tbody>
    </table>
    <div class="row">
      <table class="table table-bordered table-striped table-hover">
        <thead class="bg-primary text-white">
  <th>AdmissionNo</th>
    <th>Name</th>
    <th>Father's Name</th>
    <th>ClassFee</th>
    <th>Discount</th>
    <th>Payable</th>
    <th colspan="2">Actions</th>
  </tr>
</thead>
  <tfoot class="bg-primary text-white">
  <tr>
    <th>AdmissionNo</th>
    <th>Name</th>
    <th>Father's Name</th>
    <th>ClassFee</th>
    <th>Discount</th>
    <th>Payable</th>
    <th colspan="2">Actions</th>
  </tr>
</tfoot>
<tbody id="StuList">
  </tbody>
</table>
</table>
Posted
Updated 13-Jan-21 20:34pm
v4
Comments
nyt1972 13-Jan-21 12:08pm    
Thanks guys I have done, just need to add [] inputs names to make it arrays. e.g


1 solution

OP resolved it by himself.
Quote:
just need to add [] inputs names to make it arrays


Posting to pop it out of unanswered queue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900