<?php $edit_data = $this->db->get_where('invoice' , array('invoice_id' => $param2) )->result_array();
?>
        <?php foreach($edit_data as $row):?>
        <?php echo form_open(base_url() . 'admin/invoice/do_update/'.$row['invoice_id']);?>
                 
           <div class="form-group row">
            <label class="col-form-label col-sm-4" for=""> <?php echo get_phrase('Client');?></label>
            <div class="col-sm-8">
                <div class="input-group">
                <div class="input-group-addon">
                    <i class="picons-thin-icon-thin-0704_users_profile_group_couple_man_woman"></i>
                </div>
                
                <?php $client_name= $this->db->get_where('client' , array('client_id'=>$row['client_id']))->row()->client_name;?>
                 <input class="form-control" name="client_name" value="<?php echo $client_name;?>" required="" readonly type="text">
                <input class="form-control" name="client_id" value="<?php echo $row['client_id'];?>" required="" type="hidden">
              </div>
            </div>
          </div>

             <div class="form-group row">
              <label class="col-sm-4 col-form-label" for=""> <?php echo get_phrase('total balance');?></label>
              <div class="col-sm-8">
              <div class="input-group">
                <div class="input-group-addon">
                    <i class="picons-thin-icon-thin-0003_write_pencil_new_edit"></i>
                  </div>
                 <?php $balance= number_format(($row['amount']-$row['amount_paid']),2) ?>
                 <?php $amount= number_format(($row['amount']),2) ?>
                    <input class="form-control" name="amount_paid" value="<?php echo $balance;?>" required="" readonly type="text">
                    <input class="form-control" name="amount" value="<?php echo $amount;?>" required="" readonly type="hidden">
                </div>
              </div>
            </div>

              <div class="form-group row">
            <label class="col-form-label col-sm-4" for=""> <?php echo get_phrase('status');?></label>
            <div class="col-sm-8">
                <div class="input-group">
                <div class="input-group-addon">
                    <i class="picons-thin-icon-thin-0704_users_profile_group_couple_man_woman"></i>
                </div>
              <select class="form-control" name="status">
                <option value="paid" <?php if($row['status']=='paid') echo 'selected';?>><?php echo get_phrase('paid');?></option>
                <option value="unpaid" <?php if($row['status']=='unpaid') echo 'selected';?>><?php echo get_phrase('unpaid');?></option>
              </select>
              </div>
            </div>
          </div>

                <div class="form-group">
                  <div class="col-sm-offset-3 col-sm-5">
                      <button type="submit" class="btn btn-info"><?php echo get_phrase('update');?></button>
                  </div>
                </div>
        </form>
        <?php endforeach;?>
</div>