<?php
require_once(__DIR__.'/../includes/sysinit.php');
require(SABLE_WORKING_PATH.'country/country_func.php');

$_SESSION['listParams']['searchVisible']= 1;
/***
$_SESSION['module']['add']= 1;
$_SESSION['module']['addlink']= SableSystem::getSableLinkPath('country/');
***/
$_SESSION['module']['back']				= 1;
$_SESSION['module']['backlink']			= SableSystem::getThemeLinkPath('dashboard/country/');
$_SESSION['listParams']['allowExport']	= 1;
$_SESSION['listParams']['exportAccess']	= SABLE_ACCESS_MANAGER;

if (isset($_POST))
{
}

$_SESSION['listParams']['listSql']="select country_id
									from country";

$_SESSION['listParams']['module']					= "country";
$_SESSION['listParams']['page']						= 0;
$_SESSION['listParams']['offset']					= SABLE_DATALIST_ROWS; //the number of records to display per page
$_SESSION['listParams']['parentId']					= ""; //
$_SESSION['listParams']['moduleFolder']				= "country";
$_SESSION['listParams']['moduleFolderDesc']			= "Country";
$_SESSION['listParams']['modulePage']				= "index.php";
$_SESSION['listParams']['moduleIdField']			= "country_id";
$_SESSION['listParams']['moduleDescField']			= "country_id";
$_SESSION['listParams']['orderField']				= 1;
$_SESSION['listParams']['orderDirection']			= 0;

if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_USER){	$_SESSION['listParams']['listHeadings'][0] = "";} //Add
if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_CLERK){	$_SESSION['listParams']['listHeadings'][1] = "";} //Edit
if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_MANAGER){	$_SESSION['listParams']['listHeadings'][2] = "";} //Delete

if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_USER){	$_SESSION['listParams']['listHeadingWidth'][0] = "5%";} //View
if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_CLERK){	$_SESSION['listParams']['listHeadingWidth'][1] = "5%";} //Edit
if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_MANAGER){	$_SESSION['listParams']['listHeadingWidth'][2] = "5%";} //Delete

if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_USER) 
{
	$_SESSION['listParams']['listFields'][0]['field']	= "<i class='fa fa-2x ".SABLE_DATALIST_VIEW."' title='View --!--'></i>";
	$_SESSION['listParams']['listFields'][0]['onClick']= " onClick='viewCountry(\"--#--\")' ";
}
if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_CLERK) 
{
	$_SESSION['listParams']['listFields'][1]['field']	="<i class='fa fa-2x ".SABLE_DATALIST_EDIT."' title='Modify --!--'></i>";
	$_SESSION['listParams']['listFields'][1]['onClick']= " onClick='editCountry(\"--#--\")' ";
}
if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_MANAGER) 
{
	$_SESSION['listParams']['listFields'][2]['field']	= "<i class='fa fa-2x ".SABLE_DATALIST_DELETE."' title='Delete --!--'></i>";
	$_SESSION['listParams']['listFields'][2]['onClick']= " onClick='deleteCountry(\"--#--\",\"--!--\")' ";
}
SableGeneralFunctions::callDataList();
