<?php
class call extends Controller
{

	function call()
	{

		parent::Controller();
	}


	function index()
	{
	    if($this->clogin->is_logged_in())
		{
			redirect("admin/cpanel", "Location");
		}
		else
		{
			redirect("login/index", "Location");
		}
	}


/**
 ***********************************************************************
 * @Start Active Call  Section *****************************************
 ***********************************************************************
*/

/**
 * @Show Active Call List
*/

	function activeCallList($errorMessage=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');
			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");
			
			$data['trunkList']		= $this->generallib->getTrunkList($id_trunk='NULL');
			$data['rateList'] = $this->generallib->getTariffList($id_rate='NULL');
			$data['resellerLevel1List'] = $this->generallib->getResellerLeve1List($id_reseller='NULL');
			$data['calledNumnber'] = "NULL";
			$data['clientName'] = "NULL";
			$data['id_trunk'] = "NULL";
			$data['id_reseller'] = "NULL";
			$data['id_rate'] = "NULL";
			$data['clientType'] = "NULL";
			$data['startoffset'] = "0";
			$data['limit'] = LIMIT_PERPAGE;
			$data['total'] = $this->callModel->getTotalnumActiveCall($id_trunk='NULL',$calledNumnber='NULL',$clientName='NULL',$id_rate='NULL',$clientType = 'NULL',$id_reseller = 'NULL');
			$data['callList'] = $this->callModel->activeCallList($startoffset = 0,$limit = LIMIT_PERPAGE,$id_trunk='NULL',$calledNumnber='NULL',$clientName='NULL',$id_rate='NULL',$clientType = 'NULL',$id_reseller = 'NULL');			
			$data['titleMessage'] = TITLE045;
			$data['titleErrorMessage'] = "";
			$this->load->view('call/active_call',$data);
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	
	


/**
 * @Show Active Call List
*/

	function activeCallListPagination($startoffset,$limit,$id_trunk,$id_rate,$calledNumnber,$clientName,$id_reseller,$clientType,$myRandom = 0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$data['calledNumnber'] = $calledNumnber;
			$data['id_reseller'] = $id_reseller;
			$data['clientName'] = $clientName;
			$data['id_trunk'] = $id_trunk;
			$data['id_rate'] = $id_rate;
			$data['clientType'] = $clientType;
			$data['startoffset'] = $startoffset;
			$data['limit'] = $limit;
			$data['total'] = $this->callModel->getTotalnumActiveCall($id_trunk,$calledNumnber,$clientName,$id_rate,$clientType,$id_reseller);
			$data['callList'] = $this->callModel->activeCallList($startoffset,$limit,$id_trunk,$calledNumnber,$clientName,$id_rate,$clientType,$id_reseller);			
	
			$data['titleMessage'] = TITLE045;
			$data['titleErrorMessage'] = "";
			$this->load->view('call/active_call_pagi',$data);
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	
		

/**
 ***********************************************************************
 * @Start Sucess Call  Section *****************************************
 ***********************************************************************
*/

/**
 * @Show Sucess Call List
*/

	function sucessCallList($callType=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');
			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");

			$data['starttime'] = date('Y-m-d');
			$data['stoptime'] = date('Y-m-d');
			$data['trunkList']		= $this->generallib->getTrunkList($id_trunk='NULL');
			$data['rateList'] = $this->generallib->getTariffList($id_rate='NULL');
			$data['calledNumnber'] = "NULL";
			$data['callerID'] = "NULL";
			$data['callType'] = $callType;
			$data['clientName'] = "NULL";
			$data['id_trunk'] = "NULL";
			$data['id_rate'] = "NULL";
			$data['startoffset'] = "0";
			$data['limit'] = LIMIT_PERPAGE;
			$data['total'] = $this->callModel->getTotalnumSucessCall($starttime=date('Y-m-d'),$stoptime=date('Y-m-d'),$id_trunk='NULL',$calledNumnber='NULL',$callerID='NULL',$clientName='NULL',$id_rate='NULL',$callType);
			$data['callList'] = $this->callModel->sucessCallList($startoffset = 0,$limit = LIMIT_PERPAGE,$starttime=date('Y-m-d'),$stoptime=date('Y-m-d'),$id_trunk='NULL',$calledNumnber='NULL',$callerID='NULL',$clientName='NULL',$id_rate='NULL',$callType);			
			$data['titleMessage'] = TITLE044;
			$data['titleErrorMessage'] = "";
			$this->load->view('call/sucess_call',$data);
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	




/**
 * @Show Sucess Call List Pagination
*/

	function sucessCallListPagination($startoffset,$limit,$starttime,$stoptime,$id_trunk,$id_rate,$calledNumnber,$clientName,$callType, $myRandom=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');
			$data['starttime'] = $starttime;
			$data['stoptime'] = $stoptime;
			$data['calledNumnber'] = $calledNumnber;
			$data['callerID'] = "NULL";
			$data['clientName'] = $clientName;
			$data['id_trunk'] = $id_trunk;
			$data['callType'] = $callType;
			$data['id_rate'] = $id_rate;
			$data['startoffset'] = $startoffset;
			$data['limit'] = $limit;
			$data['total'] = $this->callModel->getTotalnumSucessCall($starttime,$stoptime,$id_trunk,$calledNumnber,$callerID ='NULL',$clientName,$id_rate,$callType);
			$data['callList'] = $this->callModel->sucessCallList($startoffset,$limit,$starttime,$stoptime,$id_trunk,$calledNumnber,$callerID='NULL',$clientName,$id_rate,$callType);			
			$data['titleMessage'] = TITLE044;
			$data['titleErrorMessage'] = "";
			$this->load->view('call/sucess_call_pagi',$data);
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	





/**
 * @Show Sucess Call List
*/

	function sucessACDASRCallList($errorMessage=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');
			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");

			$starttime = date('Y-m-d');
			$stoptime=date('Y-m-d');
			$data['starttime'] = $starttime;
			$data['stoptime'] = $stoptime;
			$data['trunkList']		= $this->generallib->getTrunkList($id_trunk='NULL');
			$data['prefix'] = "NULL";
			$data['id_trunk'] = "NULL";
			$data['startoffset'] = "0";
			$data['limit'] = LIMIT_PERPAGE + 100000;
			$data['callList'] = $this->callModel->sucessAsrAcdCallList($startoffset = 0,$limit = LIMIT_PERPAGE,$starttime,$stoptime,$id_trunk='NULL',$prefix='NULL');			
			$data['titleMessage'] = TITLE047;
			$data['titleErrorMessage'] = "";
			$this->load->view('call/sucess_call_asr_acd',$data);
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	

/**
 ***********************************************************************
 * @Start Call Summary Section *****************************************
 ***********************************************************************
*/


/**
 * @Show Sucess Call Summary
*/

	function sucessCallSummary($errorMessage=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');

			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");

				 $callStart = date('Y-m-d');
				 //$callStart = '2010-01-01';
				 $callEnd = date('Y-m-d');
				 $calledPrefix = "NULL";
				 $idTrunk = "NULL";
				 $startoffset = "0";
				 $limit = LIMIT_PERPAGE;
				 $data['startoffset'] = $startoffset;
				 $data['limit'] = $limit;
				 $data['trunkList'] = $this->generallib->getTrunkList($idTrunk);
				 $data['reseller4List'] = $this->generallib->getResellerList('NULL',4);
				 $data['reseller3List'] = $this->generallib->getResellerList('NULL',3);
				 $data['reseller2List'] = $this->generallib->getResellerList('NULL',2);
				 $data['reseller1List'] = $this->generallib->getResellerList('NULL',1);
				 $data['rateList'] = $this->generallib->getTariffList($id_rate='NULL');
				 $data['calledPrefix']=  $calledPrefix;
				 $data['idTrunk']=  $idTrunk;
				 $data['callStart']=  $callStart;
				 $data['callEnd']=  $callEnd;				 
				 //$data['callList'] = "";
				 $data['callList'] = $this->callModel->sucessCallSummary($startoffset,$limit,$callStart,$callEnd,$calledPrefix,$idTrunk);

				 $data['titleMessage'] = "Success Calls Summary";
			     $data['titleErrorMessage'] = "";
			     $this->load->view('call/call_summary',$data); 
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	
	
	


	function sucessCallSummaryPagi($startoffset,$limit,$callStart,$callEnd,$idTrunk,$calledPrefix,$myRandom=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
				 $startoffset = "0";
				 $limit = LIMIT_PERPAGE + 50000;
				 $data['startoffset'] = $startoffset;
				 $data['limit'] = $limit;
				 //$data['trunkList'] = $this->generallib->getTrunkList($idTrunk);
				 $data['calledPrefix']=  $calledPrefix;
				 $data['idTrunk']=  $idTrunk;
				 $data['callStart']=  $callEnd;
				 $data['callEnd']=  $callEnd;				 
				 //$data['callList'] = "";
				 $data['callList'] = $this->callModel->sucessCallSummary($startoffset,$limit,$callStart,$callEnd,$calledPrefix,$idTrunk);

				 $data['titleMessage'] = "Success Calls Summary";
			     $data['titleErrorMessage'] = "";
			     $this->load->view('call/call_summary_pagi',$data); 
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	
		




	function sucessCallSummaryExport($startoffset,$limit,$callStart,$callEnd,$idTrunk,$calledPrefix,$myRandom=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');
			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");

			$callList = $this->callModel->sucessCallSummary($startoffset,$limit,$callStart,$callEnd,$calledPrefix,$idTrunk);
			if($callList !=0)
			{
				$k = 0;
				$strCall = "SL,Date,Prefix,Route, Total Call,Total Duration,ACD"."\n";
				foreach($callList as $row)
				{
					$callDay = $row->callDay;
					$callDurationSec = $row->callDuration;
					$totalCall = $row->totalCall;
					$acdSec = round($callDurationSec/$totalCall,0);
					$callDuration = $this->generallib->sec_to_time($callDurationSec);
					$acd = $this->generallib->sec_to_time($callDuration);
					$prefix = $row->tariff_prefix;
					$routeName = $row->description;
					$strCall .= $k.",".$callDay.",".$prefix.",".$routeName.",".$callDuration.",".$callDuration.",".$acd."\n";
				   $k++;
				}
				   header("Content-type: application/vnd.ms-excel");
  				   header("Content-disposition: csv; filename=calls_" . date("Ymd") .".csv");
  				   print $strCall;
  				   exit;

			}

		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	
	











/**
 * @Show Sucess Call List
*/

	function resellerSucessCall($errorMessage=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');
			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");

			$data['starttime'] = date('Y-m-d');
			$data['stoptime'] = date('Y-m-d');
			$data['rateList'] = $this->generallib->getTariffList($id_rate='NULL');
			$data['resellerLevel3List'] = $this->generallib->getResellerLeve3LoginList($reseller3ID='NULL');
			$data['resellerLevel2List'] = $this->generallib->getResellerLeve2LoginList($reseller2ID='NULL');
			$data['resellerLevel1List'] = $this->generallib->getResellerLeve1LoginList($reseller1ID='NULL');
			$data['calledNumnber'] = "NULL";
			$data['login'] = "NULL";
			$data['level'] = "NULL";
			$data['id_rate'] = "NULL";
			$data['startoffset'] = "0";
			$data['limit'] = LIMIT_PERPAGE;
			$data['total'] = 0;
			$data['callList'] = "";
			/*
			$data['total'] = $this->callModel->getTotalnumResellerSucessCall($starttime=date('Y-m-d'),$stoptime=date('Y-m-d'),$calledNumnber='NULL',$login='NULL',$id_rate='NULL',$level = 'NULL');
			$data['callList'] = $this->callModel->sucessCallList($startoffset = 0,$limit = LIMIT_PERPAGE,$starttime=date('Y-m-d'),$stoptime=date('Y-m-d'),$id_trunk='NULL',$calledNumnber='NULL',$callerID='NULL',$clientName='NULL',$id_rate='NULL');
			*/			
			$data['titleMessage'] = TITLE046;
			$data['titleErrorMessage'] = "";
			$this->load->view('call/reseller_sucess_call',$data);
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	
		



/**
 * @Show Sucess Call Summary
*/

	function wholesaleCallSummary($errorMessage=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');

			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");

				 $callStart = date('Y-m-d');
				 //$callStart = '2010-01-01';
				 $callEnd = date('Y-m-d');
				 $calledPrefix = "NULL";
				 $idTrunk = "NULL";
				 $clientID = "NULL";
				 $startoffset = "0";
				 $limit = LIMIT_PERPAGE;
				 $data['startoffset'] = $startoffset;
				 $data['limit'] = $limit;
				 $data['trunkList'] = $this->generallib->getTrunkList($idTrunk);
				 $data['clientList'] = $this->generallib->getWholesaleList($clientID);
				 $data['calledPrefix']=  $calledPrefix;
				 $data['idTrunk']=  $idTrunk;
				 $data['callStart']=  $callStart;
				 $data['callEnd']=  $callEnd;				 
				 //$data['callList'] = "";
				 $data['callList'] = $this->callModel->wholeSaleCallSummary($callStart,$callEnd,$calledPrefix,$idTrunk,$clientID);

				 $data['titleMessage'] = "Success Calls Summary";
			     $data['titleErrorMessage'] = "";
			     $this->load->view('call/whoesale_call_summary',$data); 
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	


	function wholesaleCallSummaryPagi($callStart, $callEnd, $idTrunk, $calledPrefix, $clientID, $myRandom = 0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');

			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");


				 $data['trunkList'] = $this->generallib->getTrunkList($idTrunk);
				 $data['clientList'] = $this->generallib->getWholesaleList($clientID);
				 $data['calledPrefix']=  $calledPrefix;
				 $data['idTrunk']=  $idTrunk;
				 $data['callStart']=  $callStart;
				 $data['callEnd']=  $callEnd;				 
				 //$data['callList'] = "";
				 $data['callList'] = $this->callModel->wholeSaleCallSummary($callStart,$callEnd,$calledPrefix,$idTrunk,$clientID);

				 $data['titleMessage'] = "Success Calls Summary";
			     $data['titleErrorMessage'] = "";
			     $this->load->view('call/whoesale_call_summary_pagi',$data); 
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	


	function retailCallSummary($errorMessage=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');

			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");

				 $callStart = date('Y-m-d');
				 //$callStart = '2010-01-01';
				 $callEnd = date('Y-m-d');
				 $calledPrefix = "NULL";
				 $idTrunk = "NULL";
				 $clientName = "NULL";
				 $startoffset = "0";
				 $limit = LIMIT_PERPAGE;
				 $data['startoffset'] = $startoffset;
				 $data['limit'] = $limit;
				 $data['trunkList'] = $this->generallib->getTrunkList($idTrunk);
				 //$data['clientList'] = $this->generallib->getWholesaleList($clientID);
				 $data['calledPrefix']=  $calledPrefix;
				 $data['idTrunk']=  $idTrunk;
				 $data['callStart']=  $callStart;
				 $data['callEnd']=  $callEnd;				 
				 $data['clientName'] = $clientName;
				 $data['callList'] = $this->callModel->retailCallSummary($callStart,$callEnd,$calledPrefix,$idTrunk,$clientName);

				 $data['titleMessage'] = "Success Calls Summary";
			     $data['titleErrorMessage'] = "";
			     $this->load->view('call/retail_call_summary',$data); 
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	


	function retailCallSummaryPagi($callStart, $callEnd, $idTrunk, $calledPrefix, $clientName, $myRandom = 0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');

			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");


				 $data['trunkList'] = $this->generallib->getTrunkList($idTrunk);
				 //$data['clientList'] = $this->generallib->getWholesaleList($clientID);
				 $data['calledPrefix']=  $calledPrefix;
				 $data['idTrunk']=  $idTrunk;
				 $data['callStart']=  $callStart;
				 $data['callEnd']=  $callEnd;				 
				 //$data['callList'] = "";
				 $data['callList'] = $this->callModel->retailCallSummary($callStart,$callEnd,$calledPrefix,$idTrunk,$clientName);

				 $data['titleMessage'] = "Success Calls Summary";
			     $data['titleErrorMessage'] = "";
			     $this->load->view('call/retail_call_summary_pagi',$data); 
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
		


	function callingCardCallSummary($errorMessage=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');

			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");

				 $callStart = date('Y-m-d');
				 //$callStart = '2010-01-01';
				 $callEnd = date('Y-m-d');
				 $calledPrefix = "NULL";
				 $idTrunk = "NULL";
				 $clientName = "NULL";
				 $startoffset = "0";
				 $limit = LIMIT_PERPAGE;
				 $data['startoffset'] = $startoffset;
				 $data['limit'] = $limit;
				 $data['trunkList'] = $this->generallib->getTrunkList($idTrunk);
				 //$data['clientList'] = $this->generallib->getWholesaleList($clientID);
				 $data['calledPrefix']=  $calledPrefix;
				 $data['idTrunk']=  $idTrunk;
				 $data['callStart']=  $callStart;
				 $data['callEnd']=  $callEnd;				 
				 $data['clientName'] = $clientName;
				 $data['callList'] = $this->callModel->callingCardCallSummary($callStart,$callEnd,$calledPrefix,$idTrunk,$clientName);

				 $data['titleMessage'] = "Success Calls Summary";
			     $data['titleErrorMessage'] = "";
			     $this->load->view('call/calling_card_call_summary',$data); 
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	



	function callingCardCallSummaryPagi($callStart, $callEnd, $idTrunk, $calledPrefix, $clientName, $myRandom = 0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');

			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");


				 $data['trunkList'] = $this->generallib->getTrunkList($idTrunk);
				 //$data['clientList'] = $this->generallib->getWholesaleList($clientID);
				 $data['calledPrefix']=  $calledPrefix;
				 $data['idTrunk']=  $idTrunk;
				 $data['callStart']=  $callStart;
				 $data['callEnd']=  $callEnd;				 
				 //$data['callList'] = "";
				 $data['callList'] = $this->callModel->callingCardCallSummary($callStart,$callEnd,$calledPrefix,$idTrunk,$clientName);

				 $data['titleMessage'] = "Success Calls Summary";
			     $data['titleErrorMessage'] = "";
			     $this->load->view('call/calling_card_call_summary_pagi',$data); 
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
				




/**
 * @Show Sucess Call Summary
*/

	function wholesaleCallProfitSummary($errorMessage=0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');

			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");

				 $callStart = date('Y-m-d');
				 $callStart = '2010-01-01';
				 $callEnd = date('Y-m-d');
				 $calledPrefix = "NULL";
				 $idTrunk = "NULL";
				 $clientID = "NULL";
				 $startoffset = "0";
				 $limit = LIMIT_PERPAGE;
				 $data['startoffset'] = $startoffset;
				 $data['limit'] = $limit;
				 $data['trunkList'] = $this->generallib->getTrunkList($idTrunk);
				 $data['clientList'] = $this->generallib->getWholesaleList($clientID);
				 $data['calledPrefix']=  $calledPrefix;
				 $data['idTrunk']=  $idTrunk;
				 $data['callStart']=  $callStart;
				 $data['callEnd']=  $callEnd;				 
				 //$data['callList'] = "";
				 $data['callList'] = $this->callModel->wholeSaleProfitCallSummary($callStart,$callEnd,$calledPrefix,$idTrunk,$clientID);

				 $data['titleMessage'] = "Success Calls Summary";
			     $data['titleErrorMessage'] = "";
			     $this->load->view('call/whoesale_profit_call_summary',$data); 
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	



	function wholesaleCallProfitSummaryPagi($callStart, $callEnd, $idTrunk, $calledPrefix, $clientID, $myRandom = 0)
	{
		if($this->clogin->is_logged_in())
		{
			$userID = $this->session->userdata('userID');
			$reportCURD = $this->session->userdata('reportCURD');

			if($reportCURD == NO_ACCESS)
			redirect("admin/cpanel/accessDenied", "Location");


				 $data['trunkList'] = $this->generallib->getTrunkList($idTrunk);
				 $data['clientList'] = $this->generallib->getWholesaleList($clientID);
				 $data['calledPrefix']=  $calledPrefix;
				 $data['idTrunk']=  $idTrunk;
				 $data['callStart']=  $callStart;
				 $data['callEnd']=  $callEnd;				 
				 //$data['callList'] = "";
				 $data['callList'] = $this->callModel->wholeSaleProfitCallSummary($callStart,$callEnd,$calledPrefix,$idTrunk,$clientID);

				 $data['titleMessage'] = "Success Calls Summary";
			     $data['titleErrorMessage'] = "";
			     $this->load->view('call/whoesale_profit_call_summary_pagi',$data); 
		}
		else
		{
			redirect("login/index", "Location");
		}
	}
	
	
				





}
?>