<?php 

// Include main file
include_once('../libs/main.php');

// Check user Login
include_once('checkLogin.php');

// Logical section of page
$userObj =  new  user();


$successMsg = '';

if(isset($_REQUEST['successMsg'])){
	$successMsg = $_REQUEST['successMsg'];
}

if(isset($_REQUEST['failedMsg'])){
	$failedMsg = $_REQUEST['failedMsg'];
}

if(isset($_REQUEST['act']) && $_REQUEST['act']=='export'){
	exportTableToCSV('tbl_user','user.csv',array('0','4','14'),'');
	exit;
}
if(isset($_REQUEST['act']) && $_REQUEST['act']=='export-free'){
	exportTableToCSV('tbl_user','user-free.csv',array('0','4','14'),"payment_status='Free'");
	exit;
}
if(isset($_REQUEST['act']) && $_REQUEST['act']=='export-paid'){
	exportTableToCSV('tbl_user','user-paid.csv',array('0','4','14'),"payment_status='Paid'");
	exit;
}
if(isset($_REQUEST['act']) && $_REQUEST['act']=='export-free-male'){
	exportTableToCSV('tbl_user','user-free-male.csv',array('0','4','14'),"payment_status='Free' AND gender='male'");
	exit;
}
if(isset($_REQUEST['act']) && $_REQUEST['act']=='export-free-female'){
	exportTableToCSV('tbl_user','user-free-female.csv',array('0','4','14'),"payment_status='Free' AND gender='female'");
	exit;
}
if(isset($_REQUEST['act']) && $_REQUEST['act']=='export-paid-male'){
	exportTableToCSV('tbl_user','user-paid-male.csv',array('0','4','14'),"payment_status='Paid' AND gender='male'");
	exit;
}
if(isset($_REQUEST['act']) && $_REQUEST['act']=='export-paid-female'){
	exportTableToCSV('tbl_user','user-paid-female.csv',array('0','4','14'),"payment_status='Paid' AND gender='female'");
	exit;
}

// Include Template 
include_once('../libs/routs.php')

?>