<?php
/**
 * @package		Ad Platform
 * @author		Uta Marian - Alexandru ( -uMarian- )
 * @license		http://codecanyon.net/licenses
 * @link		http://www.uta-marian.com
 * @version		Version 1.0
 */
require_once(dirname(__FILE__).'/../../config.php');
require_once(DIR_SYSTEM.'/admin/session.admin.php');





$withdrawalList	=	$db->Query("SELECT `pub_withdrawal_id`, `pub_withdrawal_user_id`, `pub_withdrawal_type`, `pub_withdrawal_email`, `pub_withdrawal_amount`, `pub_withdrawal_details`, `pub_withdrawal_date`, `pub_withdrawal_status`, `up_user_id`, `up_first_name`, `up_last_name` FROM publishers_withdrawals left join users_profiles on users_profiles.up_user_id = publishers_withdrawals.pub_withdrawal_user_id order by pub_withdrawal_id DESC");
$numbers = count ($withdrawalList);

//PAGINATION
$page		=	$prepare->sanitize($_GET['p'], 'input');
$on_page	=	"10";
$page=!empty($page)?$page:"1";
$limitfrom=($page-1)*$on_page;
$limitto=($page*$on_page)-($page-1)*$on_page;
$itemsPerPage=$on_page;
$upsy = $paginator['rows']=$numbers;	 // rows
	  $paginator['pager']=$prepare->page($page,$upsy,$itemsPerPage);
	  $paginator['limitfrom']=$limitfrom+1;
	  $paginator['limitto']=$limitfrom+$upsy;
	  $paginator['itemsnum']=$upsy;
	  $paginator['page']=$page;
$view->paginator	=	$paginator;
//END PAGINATION
$view->withdrawals = array_slice($withdrawalList, $limitfrom, $limitto);
//***********************************************************************//









//**DEFINE CUSTOM CSS/JS FILLES**//
$view->customCode = '<link href="'.HTTP_SERVER_WEBSITE.'templates/'.ADMIN_TEMPLATE.'/assets/css/dashboard.css" rel="stylesheet">';

/* set page title */
$view->title = $LANG["WBS_ADMIN_REQUESTS_SEO"];
$view->description = $LANG["WBS_ADMIN_REQUESTS_SEO"];
$view->keywords = $LANG["WBS_ADMIN_REQUESTS_SEO"];

$view->header = $view->render(DIR_TEMPLATE.ADMIN_TEMPLATE.'/header.php');
$view->footer = $view->render(DIR_TEMPLATE.ADMIN_TEMPLATE.'/footer.php');

echo $view->render(DIR_TEMPLATE.ADMIN_TEMPLATE.'/requests/index.php');
?>