<?php
require_once("../config/config.php");
require_once("../includes/report_class.php");
if(isset($_POST))
{
// $b = & $this->state;
$PaygearWebserviceClient=new PaygearWebserviceClient();
$report=new report_class();
//js("alert('Please select your State.');");
$vendorid=decrypt(PAYGEAR_USERID);
$startDate = $_POST['txtstartdate'];;
$endDate = $_POST['txtenddate'];
$pReportType=$_POST['ddlReportType'];
$lagetprofitreport=$PaygearWebserviceClient->GetPaygearVendorTotalProfitData((int)$vendorid,$startDate,$endDate,(int)$pReportType);
if(is_array($lagetprofitreport[0]))
$lashowmainreport=$report->GetPaygearVendorLessProfitData($lagetprofitreport[0]);
else
$lashowmainreport="No Data Found";
if(is_array($lagetprofitreport[1]['string']))
$lashowsubreport=$report->GetPaygearVendorMoreProfitData($lagetprofitreport[1]['string']);
else
$lashowsubreport="No Data Found";
$table='';
$morelink="'morelink'";
$lesslink="'lesslink'";
$table.='<table border="0" cellpadding="0" cellspacing="0" style="width:896px;" class="borderless"><tbody><tr align="left" class="reportgridmain">';
$table.='<th class="reportgrid">CreditedFees</th>';
$table.='<th class="reportgrid">PrePayment</th><th class="reportgrid">EarnedFees</th><th class="reportgrid">SalesCount</th>
<th class="reportgrid">GrossSales</th>
<th class="reportgrid">AffiliateEarnings</th>
<th class="reportgrid">GrossEarnings</th>
<th class="reportgrid">Refunds</th>
<th class="reportgrid">GrossRefunds</th>
<th class="reportgrid">ChargeBack</th>
<th class="reportgrid">NetRefund</th>
<th class="reportgrid">TotalProfit</th>
</tr>';
$table.='<tr class="GridRowStyle">';
if(is_array($lashowmainreport))
{
foreach($lashowmainreport as $key=>$value)
{
$table.='<td class="reportgrid">'.$value.'</td>';
}
}
else
{
$table.='<td class="reportgrid" colspan="12" style="border: 1px solid rgb(204, 204, 204) !important;"><center>No data Found</center></td>';
}
$table.='</tr>';
$table.='<tr><td colspan="12">
<div>
<a style="text-decoration: none;" id="morelink" href="javascript:visibletruefalse('.$morelink.');">
<img style="border-width: 0px;" src="./images/dn.gif" id="ctl00_ContentPlaceHolder1_imgCollapse" title="More Detail"/>
<span style="font-size: 10px; font-weight: bold;" class="Lable" id="ctl00_ContentPlaceHolder1_lblStatus">More Detail</span>
</a>
<a style="text-decoration: none;display:none" id="lesslink" href="javascript:visibletruefalse('.$lesslink.');">
<img style="border-width: 0px;" src="./images/lf.gif" id="ctl00_ContentPlaceHolder1_imgCollapse" title="More Detail"/>
<span style="font-size: 10px; font-weight: bold;" class="Lable" id="ctl00_ContentPlaceHolder1_lblStatus">Less Detail</span>
</a>
</div>
</td>
</tr>
<tr>
<td align="right" colspan="12">
<div id="moredata" style="overflow-y: hidden; height: auto; display: none;"><div id="" style="height: auto;">
<div>
<table cellspacing="0" cellpadding="3" border="0" style="width: 95%; border: 1px solid rgb(204, 204, 204) !important; " id="">
<tbody>';
if(is_array($lashowsubreport))
{
foreach ($lashowsubreport as $key=>$value)
{
if($key=="0")
$table.='<tr class="GridRowStyle_new">';
else
{
if($key % 2 == 0)
$table.='<tr class="GridRowStyle">';
else
$table.='<tr class="contentRow1_grid">';
}
foreach ($value as $key1=>$value1)
{
if($key1=="0")
$reportstyle="width:30%;text-align:left;";
elseif($key1=="1")
$reportstyle="width:100%";
elseif($key1=="1")
$reportstyle="";
elseif($key1=="1")
$reportstyle="";
elseif($key1=="1")
$reportstyle="";
elseif($key1=="1")
$reportstyle="";
elseif($key1=="1")
$reportstyle="";
elseif($key1=="1")
$reportstyle="";
if($key=="0")
$table.='<th class="reportgrid" style='.$reportstyle.'>';
else
$table.='<td class="reportgrid" style='.$reportstyle.'>';
$table.=trim($value1);
if($key1=="0")
$table.='</th>';
else
$table.='</td>';
}
$table.='</tr>';
}
}
else
{
$table.='<td class="reportgrid" colspan="11" style="text-align:center;"><center>No data Found</center></td>';
}
$table.='</tbody>
</table>
</div>
</div>
</td>
</tr></tbody></table>';
// $table=str_replace("\r\n ","",$table);
echo $table;
exit;
}
?>