<?php
require_once(__DIR__.'/../includes/sysinit.php');
require(SABLE_WORKING_PATH.'transaction_type/transaction_type_func.php');
//**********************************************************************************
$_SESSION['listParams']['searchVisible'] = 1;
if (isset($_POST))
{
	$_SESSION['listParams']['searchField'][0] = 'txn_debit';
}

$_SESSION['listParams']['listSql'] = "select txn_type_name, txn_debit
									  from txn_type";
$_SESSION['module']['addlink'] = SableSystem::getCallPageLink('/transaction_type/add.php');
$_SESSION['listParams']['module']					= "transaction_type";
$_SESSION['listParams']['page']						= 0;
$_SESSION['listParams']['offset']					= 50; //the number of records to display per page
$_SESSION['listParams']['parentId']					= ""; //
$_SESSION['listParams']['moduleFolder']				= "transaction_type";
$_SESSION['listParams']['moduleFolderDesc']			= "Transaction Type";
$_SESSION['listParams']['modulePage']				= "index.php";
$_SESSION['listParams']['moduleIdField']			= "txn_type_name";
$_SESSION['listParams']['moduleDescField']			= "txn_type_name";
$_SESSION['listParams']['orderField']				= 1;
$_SESSION['listParams']['orderDirection']			= 0;

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

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

$_SESSION['listParams']['listFields'][0]['field']			= "txn_type_name";
$_SESSION['listParams']['listFields'][1]['field']			= "txn_debit";
$_SESSION['listParams']['listFields'][1]['yesNo']			= 1;
$_SESSION['listParams']['listFields'][1]['yesNoYes']			= "Yes";
$_SESSION['listParams']['listFields'][1]['yesNoNo']			= "No";
if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_USER) 
{
	$_SESSION['listParams']['listFields'][2]['field'] = "<i class='fa fa-2x ".SABLE_DATALIST_VIEW."' title='View --!--'></i>";
	$_SESSION['listParams']['listFields'][2]['onClick'] = " onClick='viewTransactionType(\"--#--\")' ";
}
if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_CLERK) 
{
	$_SESSION['listParams']['listFields'][3]['field'] = "<i class='fa fa-2x ".SABLE_DATALIST_EDIT."' title='Modify --!--'></i>";
	$_SESSION['listParams']['listFields'][3]['onClick'] = " onClick='editTransactionType(\"--#--\")' ";
}
if ($_SESSION['user']['access_level'] >= SABLE_ACCESS_MANAGER) 
{
	$_SESSION['listParams']['listFields'][4]['field'] = "<i class='fa fa-2x ".SABLE_DATALIST_DELETE."' title='Delete --!--'></i>";
	$_SESSION['listParams']['listFields'][4]['onClick'] = " onClick='deleteTransactionType(\"--#--\",\"--!--\")' ";
}
SableGeneralFunctions::callDataList();
