<?php 
/**
 * Screen recordsets\index
 * @version 1.0.1
 * @package Backend\Recordsets
 * 
*/
require_once 'app/class-lov-manager.php';

$list = $this->data['list'];
$navurl = $this->data['navkey'];

$lovmanager = new LovManager();
$rsstatuslist = $lovmanager->getLov_RecordsetStatus();

$simpleStatusList = array();
foreach ($rsstatuslist as $lc){
	$simpleStatusList[$lc->id] = $lc->descriptioncode;
}


?>
<div class="row" >
<div class="col-lg-12" >
            <h3><?= R('page_title_managerecordsets') ?></h3>
			<div class="panel" style="margin-top:20px;">
	             <div class="panel panel-default">
			         <div class="panel-body">
			           	 <div class="table-responsive" >
				            <table id="table1" class="table table-hover table-striped tablesorter">
				                <thead>
				                  <tr>
				                    <th class="header"><?= R('label_UID') ?> <i class="fa fa-sort"></i></th>
				                    <th class="header"><?= R('label_type') ?> <i class="fa fa-sort"></i></th>
				                    <th class="header"><?= R('label_cluster') ?> <i class="fa fa-sort"></i></th>
				                    <th class="header"><?= R('label_status') ?> <i class="fa fa-sort"></i></th>
				                    <th class="header"><?= R('label_user') ?> <i class="fa fa-sort"></i></th>
				                    
				                  </tr>
				                </thead>
				                <tbody>
				                <?php 
				                foreach($list as $line) { ?>
				                 <tr>
				                    <td><a href="<?= __SITEBASE ?>/recordconsolidation?uid=<?= $line->id ?>&<?=$navurl ?>"><?= $line->id ?></a></td>
				                    <td><?= ($line->statisticaltypeid == __STATISTICAL_TYPE_TRAFFICKERS) ? D(__STATISTICAL_TYPE_TRAFFICKERS_DESCRITION) : D(__STATISTICAL_TYPE_VICTIMS_DESCRITION) ?></td>
				                    <td><a href="<?= __SITEBASE ?>/clusterdetail?cid=<?= $line->clusterid ?>&<?=$navurl ?>"><?= $line->clusterid ?></a></td>
				                    <td><?= D($simpleStatusList[$line->statuscodeid]) ?></td>
				                    <td><?= $line->username ?></td>
				                 </tr>
				               <?php }?>
				                </tbody>
				             </table>
			              </div>
		              </div>
	              </div>
			</div>
	</div>
</div>