<?= $this->extend('Modules\Admin\Views\index'); ?>
<?= $this->section('content');?>
<div class="container-fluid">
    <div class="row mb-md-3">
        <div class="col">
            <h4>UGA REDD+ CARBON DATA</h4>
            <nav aria-label="breadcrumb"><small>
                <ol class="breadcrumb mb-0">
                    <li class="breadcrumb-item"><a href="<?= base_url('administrator') ?> ">Home</a></li>
                    <li class="breadcrumb-item active" aria-current="page"><?= esc($bcrumb) ?> </li>
                </ol></small>
            </nav>
        </div>
    </div><!-- breadcrumb !-->
    <div class="row mb-2">
        <div class="col">
            <!-- print success message !-->
            <?php if(session()->getTempdata('success')): ?>
                <div class="alert alert-success" role="alert"><?= session()->getTempdata('success');?></div>
            <?php endif;?>
            <!-- print failure message !-->
            <?php if(session()->getTempdata('error')): ?>
                <div class="alert alert-danger" role="alert"><?= session()->getTempdata('error');?></div>
            <?php endif;?>
            <?php if(isset($validation)): ?>
                <div class="alert alert-danger"><?= $validation->listErrors()?></div>
            <?php endif;?>
        </div>
    </div> 
    <!-- END print success message !-->
    <div class="row">
        <div class="col-md-12 mb-3">
            <div class="table-responsive">
                    <table id="datalist" class="table table-hover w-100">
                        <thead class="bg-dark text-white" style="font-size: 12px">
                            <tr>
                                <th>Project_ID</th>
                                <th>Project_Name</th>
                                <th>Proponent</th>
                                <th>Estimated_ER</th>
                                <th>Buffer_Credit</th>
                                <th>Credit_Period</th>
                                <th>Reff_Period</th>
                                <th>Uncertainty</th>
                                <th>Registry</th>
                            </tr>
                        </thead>
                        <tbody style="font-size: 12px">
                            <?php foreach($carbondata as $carbon):?>
                              <tr>
                                  <td><?= $carbon->project_number; ?></td>
                                  <td><?= $carbon->name; ?></td>
                                  <td><a href="<?= base_url('administrator/redd/single-client/id='.$carbon->client_id);?>"><?= $carbon->fname.' '.$carbon->lname; ?></a></td>
                                  <td><?= number_format($carbon->estimated_er); ?></td>
                            <td><?= number_format($carbon->buffer_credit); ?></td>
                            <td><?= date('Y', strtotime($carbon->credit_period_start)); ?> to <?= date('Y', strtotime($carbon->credit_period_end)); ?></td>
                            <td><?= date('Y', strtotime($carbon->reff_period_start)); ?> to <?= date('Y', strtotime($carbon->reff_period_end)); ?></td>
                            <td><?= $carbon->uncertainty; ?></td>
                            <td><?=  $carbon->registry; ?></td>
                              </tr>
                            <?php endforeach;?>
                        </tbody>
                    </table>
                </div><!-- responsive !-->
        </div>
    </div>
    
    
    
</div><!-- container !-->

<!-- Modals!-->
<?= view('Modules\Redd\Views\\modals\\edit-clientModal') ?>

<!-- JS !-->
<script src="<?= base_url();?>assets/js/modules/members.js"></script>
<script src="<?= base_url();?>assets/js/countryselection.js"></script>
 
<?= $this->endSection();?>