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

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

//print_r($list);

$lovmanager = new LovManager();
$recordstatuslist = $lovmanager->getLov_RecordStatus();

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

?>
<div class="row" >
	<div class="col-lg-12" >
            <h3><?= R('page_title_efp_analysedata') ?></h3>
            <p>&nbsp;</p>
			<?php $this->load('common/message',$this) ?>

				<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=""><?= R('label_set') ?> <i class="fa fa-sort"></i></th>
										<th class="header"><?= R('label_organization') ?> <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_period') ?> <i	class="fa fa-sort"></i></th>
										<th class="header"><?= R('label_date') ?> <i	class="fa fa-sort"></i></th>
										<th class="header"><?= R('label_status') ?> <i class="fa fa-sort"></i></th>
									</tr>
								</thead>
								<tbody>
				                <?php foreach($list as $line) { ?>
				                 <tr class="annotation" title="<?=$line->annotation ?>">
									<td><a href="<?= __SITEBASE ?>/setdetail?uid=<?= $line->id ?>&<?=$navurl ?>"><?= $line->id ?></a></td>
									<td><?= $line->organisationname ?></td>
									<td><?= ($line->type == __STATISTICAL_TYPE_TRAFFICKERS) ? D(__STATISTICAL_TYPE_TRAFFICKERS_DESCRITION) : D(__STATISTICAL_TYPE_VICTIMS_DESCRITION) ?></td>
									<td><?= $line->fromperiod.'-'.$line->toperiod ?></td>
									<td><?= $line->setdate ?></td>
									<td><?= D($simpleStatusList[$line->statuscodeid]) ?></td>
								</tr>
				               <?php }?>
				                </tbody>
							</table>

						</div>

					</div>

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