Welcome Guest, Not a member yet? Register   Sign In
code flow; how would you structure this in CI?
#4

[eluser]Sumon[/eluser]
I don't think it's too complicated. Lets say we first read all contact info of an user(single row) and applications (multiple row). Now in view lets create an area where we display contact informations and another portion about multiple applications. Moreover, contact info is easy one so it's simple. Display multiple application in such a way that all controls(text boxes, text areas, drop down)are defined as array. i.e
Code:
<input type="text" name="user_address" value="<?=$contact_info['user_address'];?>">
      <input type="text" name="user_contact_no" value="<?=$contact_info['user_contact_no'];?>">
<?php if(count($appliation_info)>0) {?>
<?php foreach($appliation_info as $row):?>    
      <input type="text" name="apply_id[]" value="<?=$row['apply_id'];?>">
      <input type="text" name="apply_date[]" value="<?=$row['apply_date'];?>">
      <input type="text" name="apply_for[]" value="<?=$row['apply_for'];?>">
      <input type="submit" name="submit" value="Update info">
<?php endforeach; ?>
<?php }?>
Now lets read array values(apply_date and apply_for) and update for every records using apply_id per record(not all informations in a single update query).
sorry for my english Wink


Messages In This Thread
code flow; how would you structure this in CI? - by El Forum - 09-23-2008, 07:52 AM
code flow; how would you structure this in CI? - by El Forum - 09-23-2008, 02:43 PM
code flow; how would you structure this in CI? - by El Forum - 09-23-2008, 02:52 PM
code flow; how would you structure this in CI? - by El Forum - 09-23-2008, 03:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB