<div class="content-wrapper">   
    <section class="content-header">
        <h1>
            <i class="fa fa-mortar-board"></i> <?php echo $this->lang->line('academics'); ?> <small><?php echo $this->lang->line('student_fees1'); ?></small>        </h1>
			
											 <a href="<?php  echo base_url(); ?>dailyrates/historyrates" class="col-md pull-right">History Rates</a>
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>											 
								 <a href="<?php  echo base_url(); ?>dailyrates/" class="col-md pull-right">Set Daily Rates</a>
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								 <a href="<?php  echo base_url(); ?>homecurrencies/" class="col-md pull-right">Home Currency</a>
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								 <a href="<?php  echo base_url(); ?>internationalcurrencies/" class="col-md pull-right">Foreign Currency</a> 
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								 <a href="<?php  echo base_url(); ?>currency/" class="col-md pull-right">Add Currency</a>
    </section>
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <?php
            if ($this->rbac->hasPrivilege('section', 'can_add') || $this->rbac->hasPrivilege('section', 'can_edit')) {
                ?>
                <div class="col-md-4">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title"><?php echo $this->lang->line('edit'); ?> Edit Home Currency</h3>
                        </div>
				<?php  
				 foreach ($currency1->result() as $row1)  
				 {   
				?>
						<form action="<?php echo site_url('homecurrencies/edit'.$row1->id;) ?>"  id="employeeform" name="employeeform" method="post" accept-charset="utf-8">
                            <div class="box-body">
                                <?php if ($this->session->flashdata('msg')) { ?>
                                    <?php echo $this->session->flashdata('msg') ?>
                                <?php } ?>   
                                <?php echo $this->customlib->getCSRF(); ?>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">Currency Code</label><small class="req"> *</small>
                                    <input autofocus="" id="currencycode" name="currencycode" placeholder="" type="text" class="form-control"  value="<?php echo  $row1->currencycode; ?>"  />
                                    <span class="text-danger"><?php echo form_error('currencycode'); ?></span>
                                </div>                                  
								<div class="form-group">
                                    <label for="name">Currency</label><small class="req"> *</small>
                                       <select id="name" name="name" placeholder="" type="text" class="form-control" >
											<option value=""><?php echo  $row1->name; ?></option>
											<?php 
												foreach ($currency->result() as $hc) {
												?>
									               <option value="<?php echo $hc->currency; ?>" >  <?php echo $hc->currency; ?></option>
											<?php }
											?>
										</select> 									
                                    <span class="text-danger"><?php echo form_error('name'); ?></span>
                                </div>                            

								<div class="form-group">
                                    <label for="description">Description</label><small class="req"> *</small>
                                    <input autofocus="" id="description" name="description" placeholder="" type="text" class="form-control"  value="<?php echo  $row1->description; ?>" />
                                    <span class="text-danger"><?php echo form_error('description'); ?></span>
                                </div>
                            </div>
                            <div class="box-footer">
                                <button type="submit" class="btn btn-info pull-right"><?php echo $this->lang->line('save'); ?></button>
                            </div>
                        </form>
						<?php 
							}
						?>
                    </div>              
                </div>
            <?php } ?>
            <div class="col-md-<?php
            if ($this->rbac->hasPrivilege('section', 'can_add') || $this->rbac->hasPrivilege('section', 'can_edit')) {
                echo "8";
            } else {
                echo "12";
            }
            ?>">             
                <div class="box box-primary">
                    <div class="box-header ptbnull">
                        <h3 class="box-title titlefix">Home Currency List</h3>
                    </div>
                    <div class="box-body ">
                        <div class="table-responsive mailbox-messages">
                            <div class="download_label">Home Currency List</div>
							<table class="table table-striped table-bordered table-hover example">
                                <thead>
                                    <tr>
                                        <th>Date Captured</th>
                                        <th>Currency Code</th>
                                        <th>Currency Name</th>
                                        <th>Description</th>
                                        <th class="text-right"><?php echo $this->lang->line('action'); ?></th>
                                    </tr>
                                </thead>
                                <tbody>                                   

                                    <?php
                                    $count = 1;
                                    foreach ($homecurrencieslist->result() as $homcurrencylist) {
                                        ?>
                                        <tr>
                                            <td class="mailbox-name"> <?php echo $homcurrencylist->date; ?></td>
                                            <td class="mailbox-name"> <?php echo $homcurrencylist->currencycode; ?></td>
                                            <td class="mailbox-name"> <?php echo $homcurrencylist->name; ?></td>
                                            <td class="mailbox-name"> <?php echo $homcurrencylist->description; ?></td>
                                            <td class="mailbox-date pull-right">
                                                <?php
                                                if ($this->rbac->hasPrivilege('class', 'can_delete')) {
                                                    ?>
                                                    <a href="<?php echo base_url(); ?>homecurrencies/delete/<?php echo $homcurrencylist->id; ?>"class="btn btn-default btn-xs"  data-toggle="tooltip" title="<?php echo $this->lang->line('delete'); ?>" onclick="return confirm('<?php echo $this->lang->line('delete_confirm') ?>');">
                                                        <i class="fa fa-remove"></i>
                                                    </a>
                                                <?php } ?>
                                            </td>
                                        </tr>
                                        <?php
                                    }
                                    $count++;
                                    ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div> 

        </div> 
    </section>
</div>