Location: PHPKode > projects > MembersGear > membersgear/admin/admin_profitreport.php
<?php
  require_once "../config/config.php";
  require_once INCLUDE_DIR."/users_class.php";  
   $users = new users_class();    
 if($users->IsAdminhavePermission($_SESSION[SESSION_PREFIX.'Admin_UserID'],'Can view Profit Report')==false)
 {
    Redirect('admin_nopermission.php',true);  
    
 }
  require_once INCLUDE_DIR."/report_class.php";
  
  $report=new report_class();
  switch($_action)
 {
    case 'showreport':
    
    default:
        $vendorid=decrypt(PAYGEAR_USERID); 
       $laselectcombo=$report->fillreportcombo();
       //if(!(isset($_SESSION[SESSION_PREFIX.'fillpresetcombo'])))
       {
           $lapreset=$report->fillpresetcombo();
       }
       //$lapreset=$_SESSION[SESSION_PREFIX.'fillpresetcombo'];    
       $reportdate=$lapreset['Last 14 Days'];
       $reportdate=explode(',',$reportdate);
    
       $lagetprofitreport=$PaygearWebserviceClient->GetPaygearVendorTotalProfitData((int)$vendorid,$reportdate[0],$reportdate[1],0);    
        //print_r($lagetprofitreport);
      /*  echo "<br>";
        print_r($lagetprofitreport[0]);
        echo "<br>";
        echo "<br>";
        echo "<br>"; 
        echo "<br>";
        print_r($lagetprofitreport[1]['string']);
        echo "<br>";
        echo "<br>";
        echo "<br>"; */
         
         if(is_array($lagetprofitreport[0]))
         {
            $lashowmainreport=$report->GetPaygearVendorLessProfitData($lagetprofitreport[0]);
            $lsarryformainreport='true';
         }
         else
         {
           $lashowmainreport="No Data Found";
           $lsarryformainreport='false';
         }
         if(is_array($lagetprofitreport[1]['string']))
         {
            $lashowsubreport=$report->GetPaygearVendorMoreProfitData($lagetprofitreport[1]['string']);
            $lsarryforsubreport='true';
         }
         else
         {
           $lashowsubreport="No Data Found"; 
           $lsarryforsubreport='false'; 
         }
          
         $smarty->assign('showmainreport',$lashowmainreport);
         $smarty->assign('isarrayformainreport',$lsarryformainreport);    
         $smarty->assign('isarrayforsubreport',$lsarryforsubreport);          
         $smarty->assign('showsubreeport',$lashowsubreport); 
         $smarty->assign('reporttype',$laselectcombo);
         $smarty->assign('presetarray',$lapreset);
         $smarty->display('admin_profitreport.tpl');
 }    
?>
Return current item: MembersGear