Location: PHPKode > projects > MembersGear > membersgear/templates/admin_vender_sales_report.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"> 
      
  
   function setDate(c)
   {
         
         var sdate=document.getElementById('ctl00_ContentPlaceHolder1_txtStartDate');
         var edate=document.getElementById('ctl00_ContentPlaceHolder1_txtEndDate');
         var s=c.value.split(",");
         sdate.value=s[0];
         edate.value=s[1];
  }
  function setCheckBoxValueToZero(chkid)
   {
      if(document.getElementById(chkid).checked)
        document.getElementById(chkid).value=1;
      else
        document.getElementById(chkid).value=0;  
        
   }
  </script>
{/literal}  
<div id="content" class="setdiv">
{if $msg neq ''}
            <div class="succmsg" style="width:300px">{$msg}</div>
           {/if} 
    <div id="full-contentdiv">
          <div class="righttop">
                <h2><center>
                    Sales Report</center></h2>
            </div>
         <div class="whole-page clear">
                 
               <!-- Place your content here -->
                  <div style="text-align: center; vertical-align: top;">
                            <center>        
                               <form>
                                <table width="910px" cellspacing="0" cellpadding="0" >
                                    <tbody><tr>
                                        
                                        <td>
                                             <div>
                                             <table width="" cellspacing="0" cellpadding="0" border="0" style="padding-left:10px">
                                                            <tbody>
                                                                <tr>
                                                                    <th colspan="3">
                                                                       Show Transactions -
                                                                       <select id="ddltransaction" name="ddltransaction" class="selectcss" style="width:200px;margin-bottom:0px;">
                                                                          {foreach from=$reporttype item="reporttypeitem" key="k"}
                                                                             <option value="{$k}">{$reporttypeitem}</option> 
                                                                          {/foreach}
                                                                        </select>
                                                                  </th>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                        <div id="ctl00_ContentPlaceHolder1_UpdatePanel1">
                                                             <div style="display:none;" class="borderless" id="ctl00_ContentPlaceHolder1_UpdateProgress1">
                                                             <center>
                                                             <table cellpadding='0' cellspacing='5' border='0'>
                                                             <tr>
                                                               <td align="center">
                                                                <img src="{$ADMIN_IMAGE_DIR}/DBRestoreloader.gif"> 
                                                                 </td>
                                                                 <td align="left" valign="middle" >
                                                                    <span class="Lable" id="ctl00_ContentPlaceHolder1_UpdatePanelProgressLoading1_lblmessage">Please wait while your request is being processed...</span>
                                                                 </td>
                                                               </tr>
                                                               </table>
                                                               </center>
                    
                                                  </div>
                                                  <table cellspacing="2" cellpadding="2" class="contenttableBorder" style="border-width: 0px; width: 910px; padding-top: 5px;">
                                                 <tbody>
                                                 <tr>
                                                  <td class="right-side-text">
                                                  <span style="color: Red;" class="Lable" id="ctl00_ContentPlaceHolder1_lblError"/>
                                                 </td>
                                                 </tr>
                                                   <tr>
                                                    <td class="right-side-text">
                                                     <table style="width: 100%;" cellpadding="0" cellspacing="0">
                                                        <tbody>
                                                        <tr>
                                                           <td style="background:#EDF1F3 url({$ADMIN_IMAGE_DIR}/seprater.gif) no-repeat scroll right center;heigth:162px; width: 16%; padding-right: 0px;">
                                                             <table>
                                                                <tbody>
                                                                <tr>
                                                                    <td class="left-side-text" style="margin-bottom:2px;padding:0px">
                                                                        Transaction Id<br>
                                                                        <input type="text" style="width:94%;" class="txtcss" id="etransid" name="etransid"/>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                  </tr>
                                                                <tr>
                                                                    <td>
                                                                      <center> 
                                                                        <input type="hidden" value="" name="searchClikDetect" id="searchClikDetect">  
                                                                        <input type="button" class="btncss" id="ctl00_ContentPlaceHolder1_btnOrder"  value="Search Transaction" name="ctl00$ContentPlaceHolder1$btnOrder" onclick="return callAjexForDataEytanId();"/>
                                                                       </center> 
                                                                  </td>
                                                                </tr>
                                                                
                                                                 <tr>
                                                                    <td class="left-side-text" style="margin-bottom:2px;padding:0px">
                                                                        Order Id<br>
                                                                        <input type="text" style="width:94%;" class="txtcss" id="orderId" name="orderId"/>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                  </tr>
                                                                <tr>
                                                                    <td>
                                                                    <center> 
                                                                        <input type="button" class="btncss" id="orderSearch"  value="     Search Order     " name="orderSearch" onclick="return callAjexForDataByOrderId();"/>
                                                                     </center>  
                                                                  </td>
                                                                </tr>
                                                                
                                                            </tbody>
                                                           </table>
                                                        </td>
                                                        <td style="width: 85%; padding-left: 1px;">
                                                            <table cellspacing="1" cellpadding="1" style="width: 100%;">
                                                                <tbody><tr>
                                                                    <td align="left" class="left-side-text">
                                                                        Preset
                                                                    </td>
                                                                    <td align="left" class="right-side-text">
                                                                     <select id="ddlReportType" name="ddlReportType" class="selectcss" style="width:125px;" 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>
                                                                    <td class="left-side-text">
                                                                        Customer Last Name
                                                                    </td>
                                                                    <td class="right-side-text">
                                                                        <input type="text" style="width: 120px;" class="txtcss" id="ctl00_ContentPlaceHolder1_txtLastName" name="ctl00$ContentPlaceHolder1$txtLastName"/>
                                                                    </td>
                                                                     <td class="left-side-text">
                                                                        Email
                                                                    </td>
                                                                    <td class="right-side-text">
                                                                        <input type="text" style="width: 120px;" class="txtcss" id="ctl00_ContentPlaceHolder1_txtEmail" name="ctl00$ContentPlaceHolder1$txtEmail"/>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td class="left-side-text">
                                                                        State Date
                                                                    </td>
                                                                    <td class="right-side-text">
                                                                        <input type="text" style="width:90px" class="txtcss" id="ctl00_ContentPlaceHolder1_txtStartDate" name="ctl00_ContentPlaceHolder1_txtStartDate" readonly/>
                                                                       <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].ctl00_ContentPlaceHolder1_txtStartDate,'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"    =>  "ctl00_ContentPlaceHolder1_txtStartDate",
                                                                                 "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>
                                                                    <td class="left-side-text">
                                                                        <span class="Lable" id="ctl00_ContentPlaceHolder1_lblVendor">Vendor</span>
                                                                    </td>
                                                                    <td class="right-side-text">
                                                                        <input type="text" style="width: 120px;" class="txtcss" id="vendor" name="vendor"/>
                                                                    </td>
                                                                    <td class="left-side-text" id="ctl00_ContentPlaceHolder1_tdAffiliateName">
                                                                        <span class="Lable" id="ctl00_ContentPlaceHolder1_lblAffiliate">Affiliate</span>
                                                                    </td>

                                                                    <td class="right-side-text" id="ctl00_ContentPlaceHolder1_tdAffiliatetxt">
                                                                        <input type="text" style="width: 120px;"  class="txtcss"  id="affiliate" name="affiliate"/>
                                                                    </td>

                                                                </tr>
                                                                <tr>
                                                                    <td class="left-side-text">
                                                                        End Date
                                                                    </td>
                                                                    <td class="right-side-text">
                                                                        <input type="text" style="width:90px" class="txtcss" id="ctl00_ContentPlaceHolder1_txtEndDate"  name="ctl00$ContentPlaceHolder1$txtEndDate" readonly/>
                                                                        <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].ctl00$ContentPlaceHolder1$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"    =>  "ctl00_ContentPlaceHolder1_txtEndDate",
                                                                                 "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="left-side-text">
                                                                        Product
                                                                    </td>
                                                                    <td class="right-side-text">
                                                                        <input type="text" style="width: 120px;" class="txtcss" id="product" name="product"/>
                                                                    </td>
                                                                   
                                                                </tr>
                                                                <tr>
                                                                    <td class="right-side-text" colspan="6">
                                                                        <input type="checkbox" name="ctl00_ContentPlaceHolder1_chkBonus" id="ctl00_ContentPlaceHolder1_chkBonus" value="0" onchange="setCheckBoxValueToZero('ctl00_ContentPlaceHolder1_chkBonus')" class="chkcss"/><label for="ctl00_ContentPlaceHolder1_chkBonus">Bonus</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                                                                        <input type="checkbox" name="ctl00_ContentPlaceHolder1_chkRefund" id="ctl00_ContentPlaceHolder1_chkRefund" value="0" onchange="setCheckBoxValueToZero('ctl00_ContentPlaceHolder1_chkRefund')" class="chkcss" /><label for="ctl00_ContentPlaceHolder1_chkRefund">Refund</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                                                                        <input type="checkbox" name="ctl00_ContentPlaceHolder1_chkPaygearCommission" id="ctl00_ContentPlaceHolder1_chkPaygearCommission" value="0" onchange="setCheckBoxValueToZero('ctl00_ContentPlaceHolder1_chkPaygearCommission')" class="chkcss"/><label for="ctl00_ContentPlaceHolder1_chkPaygearCommission">PayGear Fee</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                      <input type="checkbox" name="ctl00_ContentPlaceHolder1_chkAffiliateCommission" id="ctl00_ContentPlaceHolder1_chkAffiliateCommission" value="0" onchange="setCheckBoxValueToZero('ctl00_ContentPlaceHolder1_chkAffiliateCommission')" class="chkcss"/><label for="ctl00_ContentPlaceHolder1_chkAffiliateCommission">Affiliate Commission</label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td align="center" style="padding-top: 10px;" colspan="4">
                                                                        <input type="button"  class="btncss" id="ctl00_ContentPlaceHolder1_btnSearch"  value="Search" name="ctl00$ContentPlaceHolder1$btnSearch" onclick="callAjexForData();" />
                                                                        <div style="color: Red; display: none;" id="ctl00_ContentPlaceHolder1_ValidationSummary1">

                                                                  </div>
                                                                    </td>
                                                                </tr>
                                                            </tbody></table>
                                                        </td>
                                                    </tr>
                                                </tbody></table>
                                          </td>
                                        </tr>
                                  </tbody></table>  
                                   
                    <table style="width: 910px;">
                    <tbody><tr>
                        <td style="width: 910px;">
                            <div>
    
                            </div>
                        </td>
                    </tr>
                </tbody>
                
                </table>
                </form>
         <div id="tblResult" style='width:910px;'>
    </div>
   {literal} 
    <script type="text/javascript" language="javascript">
     var $rn = jQuery.noConflict(); 
                        
     var ctl=document.getElementById('ctl00_ContentPlaceHolder1_btnSearch');
     ctl.setfocus;
    function SwitchBox( id,lnk )
     {
    
                 var o = document.getElementById(id);
                 var l =document.getElementById(lnk);
                 //if( o != null ) o.style.display = (o.style.display == 'none' ? '' : 'none');
                 if (o != null)
                 {
                    if (o.style.display == 'none')
                     {
                        o.style.display='';
                        l.innerHTML='<b>Less Detail</b>';
                     }
                     else
                     {
                        o.style.display='none';
                        l.innerHTML='<b>More Detail</b>';
                     }
                 }
                  
    }
      
      
     function callAjexForDataEytanId()
     {
            if(document.getElementById('etransid').value!='')
             {
                    document.getElementById('searchClikDetect').value="search1";
                   
                    
                     
                      var dataString = 'searchClikDetect='+ $rn('#searchClikDetect').val() + '&etransid='+ $rn('#etransid').val() +  '&ctl00_ContentPlaceHolder1_txtStartDate=' + $rn('#ctl00_ContentPlaceHolder1_txtStartDate').val() +  '&ddltransaction=' + $rn('#ddltransaction').val() +  '&ctl00_ContentPlaceHolder1_txtLastName=' + $rn('#ctl00_ContentPlaceHolder1_txtLastName').val() +  '&ctl00_ContentPlaceHolder1_txtEndDate=' + $rn('#ctl00_ContentPlaceHolder1_txtEndDate').val() +  '&ctl00_ContentPlaceHolder1_txtEmail=' + $rn('#ctl00_ContentPlaceHolder1_txtEmail').val()  +  '&affiliate=' + $rn('#affiliate').val() + '&product=' + $rn('#product').val() + '&vendor=' + $rn('#vendor').val() + '&ctl00_ContentPlaceHolder1_chkBonus=' + $rn('#ctl00_ContentPlaceHolder1_chkBonus').val()  + '&ctl00_ContentPlaceHolder1_chkRefund=' + $rn('#ctl00_ContentPlaceHolder1_chkRefund').val() + '&ctl00_ContentPlaceHolder1_chkPaygearCommission=' + $rn('#ctl00_ContentPlaceHolder1_chkPaygearCommission').val() + '&ctl00_ContentPlaceHolder1_chkAffiliateCommission=' + $rn('#ctl00_ContentPlaceHolder1_chkAffiliateCommission').val() ;
                       var web_url='{/literal}{$WEB_URL}{literal}';
                       $rn.ajax({
                           type: "POST",
                           url: web_url+"/includes/get_vendor_report_data.php",
                           datatype: 'html',
                           data: dataString,
                           success: function(msg){
                           
                               $rn('#tblResult').html(msg);
                 
                             
                           }
                       });  
                        
                   
                   
             }
             else
              {
                alert('Please enter Transaction id.');
                document.getElementById('etransid').focus();
                return false;
              
              }       
    
     }      
     
     
     function callAjexForDataByOrderId()
     {
            if(document.getElementById('orderId').value!='')
             {
                    document.getElementById('searchClikDetect').value="ordersearch";
                   
                    
                     
                      var dataString = 'searchClikDetect='+ $rn('#searchClikDetect').val() + '&orderid='+ $rn('#orderId').val() +  '&ctl00_ContentPlaceHolder1_txtStartDate=' + $rn('#ctl00_ContentPlaceHolder1_txtStartDate').val() +  '&ddltransaction=' + $rn('#ddltransaction').val() +  '&ctl00_ContentPlaceHolder1_txtLastName=' + $rn('#ctl00_ContentPlaceHolder1_txtLastName').val() +  '&ctl00_ContentPlaceHolder1_txtEndDate=' + $rn('#ctl00_ContentPlaceHolder1_txtEndDate').val() +  '&ctl00_ContentPlaceHolder1_txtEmail=' + $rn('#ctl00_ContentPlaceHolder1_txtEmail').val()  +  '&affiliate=' + $rn('#affiliate').val() + '&product=' + $rn('#product').val() + '&vendor=' + $rn('#vendor').val() + '&ctl00_ContentPlaceHolder1_chkBonus=' + $rn('#ctl00_ContentPlaceHolder1_chkBonus').val()  + '&ctl00_ContentPlaceHolder1_chkRefund=' + $rn('#ctl00_ContentPlaceHolder1_chkRefund').val() + '&ctl00_ContentPlaceHolder1_chkPaygearCommission=' + $rn('#ctl00_ContentPlaceHolder1_chkPaygearCommission').val() + '&ctl00_ContentPlaceHolder1_chkAffiliateCommission=' + $rn('#ctl00_ContentPlaceHolder1_chkAffiliateCommission').val() ;
                       var web_url='{/literal}{$WEB_URL}{literal}';
                       $rn.ajax({
                           type: "POST",
                           url: web_url+"/includes/get_vendor_report_data.php",
                           datatype: 'html',
                           data: dataString,
                           success: function(msg){
                           
                               $rn('#tblResult').html(msg);
                 
                             
                           }
                       });  
                        
                   
                   
             }
             else
              {
                alert('Please enter order id.');
                document.getElementById('orderId').focus();
                return false;
              
              }       
    
     }   
    function callAjexForData()
     {
        var tranid=document.getElementById('ddltransaction').options[document.getElementById('ddltransaction').selectedIndex].value;
        var custName=document.getElementById('ctl00_ContentPlaceHolder1_txtLastName').value;
        var startDate=document.getElementById('ctl00_ContentPlaceHolder1_txtStartDate').value;
        var endDate=document.getElementById('ctl00_ContentPlaceHolder1_txtEndDate').value;
        var email=document.getElementById('ctl00_ContentPlaceHolder1_txtEmail').value;
        document.getElementById('searchClikDetect').value="search2";
       
        if(document.getElementById('ctl00_ContentPlaceHolder1_chkBonus').checked)
          document.getElementById('ctl00_ContentPlaceHolder1_chkBonus').value='1';
        if(document.getElementById('ctl00_ContentPlaceHolder1_chkRefund').checked)
              document.getElementById('ctl00_ContentPlaceHolder1_chkRefund').value='1';
        if(document.getElementById('ctl00_ContentPlaceHolder1_chkPaygearCommission').checked)          
              document.getElementById('ctl00_ContentPlaceHolder1_chkPaygearCommission').value='1';
        if(document.getElementById('ctl00_ContentPlaceHolder1_chkAffiliateCommission').checked)      
              document.getElementById('ctl00_ContentPlaceHolder1_chkAffiliateCommission').value='1';
      
      
             
                      var dataString = 'searchClikDetect='+ $rn('#searchClikDetect').val() + '&etransid='+ $rn('#etransid').val() +  '&ctl00_ContentPlaceHolder1_txtStartDate=' + $rn('#ctl00_ContentPlaceHolder1_txtStartDate').val() +  '&ddltransaction=' + $rn('#ddltransaction').val() +  '&ctl00_ContentPlaceHolder1_txtLastName=' + $rn('#ctl00_ContentPlaceHolder1_txtLastName').val() +  '&ctl00_ContentPlaceHolder1_txtEndDate=' + $rn('#ctl00_ContentPlaceHolder1_txtEndDate').val() +  '&ctl00_ContentPlaceHolder1_txtEmail=' + $rn('#ctl00_ContentPlaceHolder1_txtEmail').val()  +  '&affiliate=' + $rn('#affiliate').val() + '&product=' + $rn('#product').val() + '&vendor=' + $rn('#vendor').val() + '&ctl00_ContentPlaceHolder1_chkBonus=' + $rn('#ctl00_ContentPlaceHolder1_chkBonus').val()  + '&ctl00_ContentPlaceHolder1_chkRefund=' + $rn('#ctl00_ContentPlaceHolder1_chkRefund').val() + '&ctl00_ContentPlaceHolder1_chkPaygearCommission=' + $rn('#ctl00_ContentPlaceHolder1_chkPaygearCommission').val() + '&ctl00_ContentPlaceHolder1_chkAffiliateCommission=' + $rn('#ctl00_ContentPlaceHolder1_chkAffiliateCommission').val() ;
                       var web_url='{/literal}{$WEB_URL}{literal}';
                       $rn.ajax({
                           type: "POST",
                           url: web_url+"/includes/get_vendor_report_data.php",
                           datatype: 'html',
                           data: dataString,
                           success: function(msg){
                               
                               $rn('#tblResult').html(msg);
                 
                             
                           }
                       });  
                        
      
                
     }
    
   setDate(document.getElementById('ddlReportType').options[document.getElementById('ddlReportType').selectedIndex]); 
   $rn(document).ajaxStart($rn.blockUI).ajaxStop($rn.unblockUI); 
   
    </script>
    
    {/literal}     


  </td>
 </tr>
</tbody>
</table>
</center>
</div>
</div>
</div>
</div>
{$ADMIN_FOOTER}
Return current item: MembersGear