Location: PHPKode > projects > MembersGear > membersgear/templates/admin_profitreport.tpl
{$ADMIN_HEADER}
{php}

 require_once INCLUDE_DIR."/datepicker/class/class.oCalendarPicker.php";

     $aMonthNames=array(
         "FR"=>array("Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"),
         "EN"=>array("January","February","March","April","May","June","July","August","September","October","November","December")
     );
     $aDaysNames=array(
         "FR"=>array("Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"),
         "EN"=>array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
    );
     $sDateFormat=array(
         "FR"=>"m/d/Y",
         //"EN"=>"m/d/Y"
         "EN"=>"m/d/Y"
    );
    
    $sDate=(!empty($_GET['sDate']))?$_GET['sDate']:date("Ymd");

{/php}
{literal}
  <script language="javascript"> 
  var $rn = jQuery.noConflict(); 
                        
   function setDate(c)
   {
         
         var sdate=document.getElementById('txtstartdate');
         var edate=document.getElementById('txtenddate');
         var s=c.value.split(",");
         sdate.value=s[0];
         edate.value=s[1];
 }
 
  function get_profit_report_data()
    {
       
             var ddlReportType=document.getElementById('ddlReportType').options[document.getElementById('ddlReportType').selectedIndex].value;
             var txtstartdate=document.getElementById('txtstartdate').value;
             var txtenddate=document.getElementById('txtenddate').value;
      

            var dataString = 'ddlReportType='+ ddlReportType + '&txtstartdate='+ txtstartdate +  '&txtenddate=' + txtenddate;
            var web_url='{/literal}{$WEB_URL}{literal}';
            $rn.ajax({
               type: "POST",
               url: web_url+"/includes/get_profit_report_data.php",
               datatype: 'html',
               data: dataString,
               success: function(msg){
                   $rn('#mainreportdiv').html(msg);
                   document.getElementById('firstload').style.display='none';     
                   document.getElementById('ctl00_ContentPlaceHolder1_UpdateProgress1').style.display='none';
                 
               }
           });

    
   }
  
   $rn(document).ajaxStart($rn.blockUI).ajaxStop($rn.unblockUI);                   
 //setDate(document.getElementById('ddlpreset').options[document.getElementById('ddlpreset').selectedIndex]);
  </script>
{/literal}  
<div id="content" class="setdiv">
    <div id="full-contentdiv">
        <div class="righttop">
            <h2 align="center">
                Profit Report
            </h2>
         </div>
         
         <div class="whole-page clear">
           {*<form name="frmprofitreport" id="frmprofitreport" action="admin_profitreport.php?action=showreport" method="post" enctype="multipart/form-data">  *}
              <div class="formformat" style="">
            
             <center>
                    {* <div id="ctl00_ContentPlaceHolder1_UpdatePanel1"> *}
                     <div style="display:none;" id="ctl00_ContentPlaceHolder1_UpdateProgress1">
                                                             <center>
                                                             <table class="borderless">
                                                             <tr>
                                                               <td align="center">
                                                                <img src="{$ADMIN_IMAGE_DIR}/DBRestoreloader.gif"> 
                                                                 </td>
                                                                 <td align="left" valign="middle">
                                                                    <span style="color: #ea7222;" class="Lable" id="ctl00_ContentPlaceHolder1_UpdatePanelProgressLoading1_lblmessage">Please wait while your request is being processed...</span>
                                                                 </td>
                                                               </tr>
                                                               </table>
                                                               </center>
                    
                   </div>
                   <div>
                   <form>
                      <table border="0" cellpadding="0" cellspacing="0" style="width:100%" class="borderless" align="">
                        
                           <tr>
                                        <td class="right-side-text" style="width:100px;border-left:none;border-right:none;padding-left:80px;"><label>
                                            Select :  
                                        </label>
                                        </td>
                                        <td class="left-side-text" style="border-left:none;border-right:none;width:255px">
                                            <select id="ddlReportType" name="ddlReportType" class="selectcss" style="width:200px;" onchange="get_profit_report_data();">
                                              {foreach from=$reporttype item="reporttypeitem" key="k"}
                                                 <option value="{$k}">{$reporttypeitem}</option> 
                                              {/foreach}
                                            </select>
                                            
                                        </td>
                                          <td class="right-side-text" style="width:100px;border-left:none;border-right:none;"><label>
                                             Preset :   
                                        </label>
                                        </td>
                                        <td class="left-side-text" style="border-left:none;border-right:none;">
                                            <select id="ddlpreset" name="ddlpreset" class="selectcss" style="width:200px;" onchange="setDate(this.options[this.selectedIndex])">
                                              {foreach from=$presetarray item="presetarrayitem" key="k"}
                                                 <option value="{$presetarrayitem}" {if $k eq "Last 14 Days"} selected{/if}>{$k}</option> 
                                              {/foreach}
                                            </select>
                                                   
                                        </td>
                           </tr>
                           <tr>
                                        <td class="right-side-text" style="width:100px;border-left:none;border-right:none;padding-left:80px;"><label>
                                            Start Date :  
                                        </label>
                                        </td>
                                        <td class="left-side-text" style="border-left:none;border-right:none;verticle-align:bottom;">
                                            <input type="text" class="txtcss" id="txtstartdate" value="" name="txtstartdata" readonly="" style="float:left;width:170px;"/>
                                              <input type="button" value='' style='background:url({$ADMIN_IMAGE_DIR}/calendar1.gif) no-repeat;height:20px;width:21px;border:0px;'   onclick="displayCalendar(document.forms[0].txtstartdata,'mm/dd/yyyy',this)">      
                                            {* {php}
                                                     $aCalendarParams=array(
                                                     "sIconPath"     =>  ADMIN_IMAGE_DIR."/calendar1.gif",
                                                     "iAction"       =>  1,   //0=>reloadCurrentPage with get param sDate, 1=>fill field sFieldName
                                                     "sFieldName"    =>  "txtstartdate",
                                                     "iStyle"        =>  1,   //0=>display calendar, 1=>display div on icon click
                                                     "aMonthNames"   =>  $aMonthNames["EN"],
                                                     "aDaysNames"    =>  $aDaysNames["EN"],
                                                     "sDateFormat"   =>  $sDateFormat["EN"]

                                                     );
                                                     new oCalendarPicker("calFixe1",$sDate,$aCalendarParams);
                                             {/php}   *}
                                              
                                        </td>
                                          <td class="right-side-text" style="width:100px;border-left:none;border-right:none;"><label>
                                             End Date :   
                                        </label>
                                        </td>
                                        <td class="left-side-text" style="border-left:none;border-right:none;">
                                            <input type="text" class="txtcss" id="txtenddate" value="" name="txtenddate"  readonly="" style="float:left;width:170px;"/>
                                             <input type="button" value='' style='background:url({$ADMIN_IMAGE_DIR}/calendar1.gif) no-repeat;height:20px;width:21px;border:0px;'   onclick="displayCalendar(document.forms[0].txtenddate,'mm/dd/yyyy',this)">      
                                            {* {php}
                                                     $aCalendarParams=array(
                                                     "sIconPath"     =>  ADMIN_IMAGE_DIR."/calendar1.gif",
                                                     "iAction"       =>  1,   //0=>reloadCurrentPage with get param sDate, 1=>fill field sFieldName
                                                     "sFieldName"    =>  "txtenddate",
                                                     "iStyle"        =>  1,   //0=>display calendar, 1=>display div on icon click
                                                     "aMonthNames"   =>  $aMonthNames["EN"],
                                                     "aDaysNames"    =>  $aDaysNames["EN"],
                                                     "sDateFormat"   =>  $sDateFormat["EN"]

                                                     );
                                                     new oCalendarPicker("calFixe2",$sDate,$aCalendarParams);
                                             {/php} *}
                                        </td>
                           </tr>
                           <tr>
                               
                             
                                <td colspan="3" style="text-align:center;padding-left:300px">
                                   
                                   <input type="button" class="btncss" name="Search" value="Search" onclick="get_profit_report_data();"/>
                              
                                </td>
                                <td>
                                   &nbsp;
                                </td>
                            </tr>
                              <tr>
                                <td colspan="4">
                                <br/>
                                </td>
                            </tr>
                     </table>
                   </div>
                  <div id="mainreportdiv">
                  </div> 
                  <div id="firstload"> 
                                <table border="0" cellpadding="0" cellspacing="0" style="width:897px;" class="borderless">
                                        <tbody>
                                        <tr align="left" class="reportgridmain">
                                            <th class="reportgrid">CreditedFees</th>
                                            <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>
                                      {if $isarrayformainreport=='false'}
                                                     <tr class="GridRowStyle"> 
                                                          <td class="reportgrid" colspan="12" style="border: 1px solid rgb(204, 204, 204) !important;"><center>No data Found</center></td>
                                                     </tr>     
                                                           
                                      {else}
                                          <tr class="GridRowStyle" id="">
                                            {foreach from=$showmainreport item="showmainreportitem" key="k"} 
                                            <td class="reportgrid">
                                                {$showmainreportitem}   
                                            </td>
                                            {/foreach}
                                          </tr>
                                      {/if}
                              
                                    <tr>
                                    <td colspan="12">
                                     <div id="ctl00_ContentPlaceHolder1_PanelSaveAdsLink">
                                         <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="1" style="width: 95%;border: 1px solid rgb(204, 204, 204) !important;" id="" class="borderless"">
                                            <tbody>
                                                {if $isarrayforsubreport=='false'}
                                                     <tr class="GridRowStyle"> 
                                                          <td class="reportgrid" colspan="11"><center>No data Found</center></td>
                                                     </tr>     
                                                                  
                                                {else}   
                                                {foreach from=$showsubreeport item="showsubreeportitem" key="k"} 
                                                         {if $k eq '0'} 
                                                          <tr class="GridRowStyle_new"> 
                                                         {else} 
                                                            {if $k mod 2 eq 0}
                                                               <tr class="GridRowStyle"> 
                                                            {else}
                                                              <tr class="contentRow1_grid"> 
                                                            {/if}        
                                                         {/if} 
                                                            {foreach from=$showsubreeportitem item="showsubreeportitem1" key="k1"}  
                                                                      {if $k1 eq 0}
                                                                           {assign var="reportstyle" value="width:30%;text-align:left;"}  
                                                                      {elseif $k1 eq 1}
                                                                        {assign var="reportstyle" value="width:100%;"}    
                                                                      {elseif $k1 eq 2} 
                                                                        {assign var="reportstyle" value=""}    
                                                                      {elseif $k1 eq 3} 
                                                                        {assign var="reportstyle" value=""}    
                                                                      {elseif $k1 eq 4}
                                                                        {assign var="reportstyle" value=""}     
                                                                      {elseif $k1 eq 5}                                   
                                                                        {assign var="reportstyle" value=""}    
                                                                      {elseif $k1 eq 6} 
                                                                       {assign var="reportstyle" value=""} 
                                                                        {elseif $k1 eq 7} 
                                                                       {assign var="reportstyle" value=""} 
                                                                      {/if}
                                                                         
                                                                      {if $k eq 0}
                                                                            <th class="reportgrid" style="{$reportstyle}">
                                                                      {else}
                                                                            <td class="reportgrid" style="{$reportstyle}">
                                                                      {/if}
                                                                        {$showsubreeportitem1}
                                                                     {if $k eq 0}
                                                                            </th>
                                                                     {else}
                                                                            </td>
                                                                     {/if}   
                                                        {/foreach}  
                                                          </tr>           
                                                {/foreach}
                                                 {/if}
                                             </tbody>
                                       </table>
                                   </div>
                                 </div>
                            </td>
                       </tr>    
                       </table>
                   </form>
                  </div>    
              </center>
              
           </div>
          {* </form>*}
{*---------------------------------------------validation-------------------------------------------------------*}           
                   {literal}
                   <script language="JavaScript" type="text/javascript">
                      setDate(document.getElementById('ddlpreset').options[document.getElementById('ddlpreset').selectedIndex]); 
                      function visibletruefalse(pvalue)
                      {
                        
                        if(pvalue=='morelink')
                        {
                            document.getElementById('morelink').style.display='none';
                            document.getElementById('lesslink').style.display=''; 
                            document.getElementById('moredata').style.display='';
                            
                        }
                        else if(pvalue=='lesslink')
                        {
                            document.getElementById('lesslink').style.display='none';
                            document.getElementById('morelink').style.display='';  
                            document.getElementById('moredata').style.display='none';
                        
                        } 
                      }
                    </script>   
                {/literal}
      
{*---------------------------------------------validation over---------------------------------------------------*}           

    </div>
</div>
</div>
{$ADMIN_FOOTER} 

Return current item: MembersGear