<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblAdmin} : {$language.lblUsersAndOrders} : {$language.lblAffiliateRequest}</title>
{include file='CommonStyles.tpl'} 
{include file='CommonJavaScript.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/grid_listing.css" media="screen" />
<link href="{$view_styles}/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css" />
<link href="{$view_styles}/right-menu.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/ui.daterangepicker.css" />
<link href="{$view_styles}/colorbox.css" rel="stylesheet" type="text/css" media="screen" />

{include file='CommonCustomStyles.tpl'}
</head>

<body>
<div class="outer_container"> {include file='CommonTop.tpl'} 
  
  <!--End:Header Container--> 
  
  <!--**********************************************START CONTAINER SECTION****************************************-->
  <div class="content_container2 clearfix">
    <div class="right-sidebar">
      <div class="side_wrapper"> {html->anchor priv_href="affiliate/new/" href="affiliate/new/" caption="<strong><span class='add'></span>{$language.lblAddNewAffiliate}</strong>" class="custom-btnt"  }
        {include file='AffiliateRightLinks.tpl'} </div>
    </div>
    <!--End: Right Block-->
    <div class="left_wrapper">
      <div class="content_wrapper">
        <h2>{$language.lblAffiliateRequest}</h2>
        <div id="common_message"></div>
        <div id="request_approve_message"></div>
       {form->start id="formBusRequestSearch" name="formBusRequestSearch" action="" method="post"} <div class="search_container">
          <div class="inner">
           <ul class="clearfix">
            	<li class="column">
                	<p class="label-field01">{$language.lblDate}</p>
                    <span class="form-field01"> <div class="text-box-div-date" >{assign var="fromDate" value=$fromDate|customDate|default:''}
                      {form->textbox readonly="readonly" id="affReqDate" name="affReqDate" class="date-field" value=$affReqDate} </div></span>
                </li>
                	<li class="column">
                	<p class="label-field01">{$language.lblAffiliateName}</p>
                    <span class="form-field01">  {form->textbox id="affiliateSeachName"  name="affiliateSeachName" class="text-box"	 value=$hiddenAffiliateSearchName} </span>
                </li>
                 </li>
                	<li class="column">
                	<p class="label-field01">{$language.lblStatus}</p>
                    <span class="form-field01">    {form->select id="affiliateReqStatus" name="affiliateReqStatus"   class="select-box" options="New->"|cat:$language.lblNew|cat:"~*Approved->"|cat:$language.lblApproved|cat:"~*Declined->"|cat:$language.lblDeclined value=$hiddenAffiliateReqStatus} </span>
                </li>
                <li class="column">
                	<p class="label-field01">&nbsp;</p>
                    <span class="form-field01">   {if $hiddenAffiliateReqStatus} {assign var ='listUrl' value="affiliaterequest/index/status/$hiddenAffiliateReqStatus"}
                {else} 
                {assign var ='listUrl' value='affiliaterequest'} {/if} 
                {form->submit name="submitAffiliateRequestSeach"   class="button01"  value=$language.lblSearch} {html->anchor href="affiliaterequest/index/" class="action-link"  content="{$language.lblListAll}"} </span>
                </li>
             </ul>
          </div>
        </div>
        {form->close}
        <!--END:sEARCH cONTAINER-->
         {if !$resListAffiliateRequest|@count eq 0} 
        <div class="grid_table00" >
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <th align="left" valign="middle"  >{$language.lblAffiliateName}</th>
              <th align="left" valign="middle"  >{$language.lblWebsite}</th>
              <th align="left" valign="middle"  >{$language.lblEmailAddress}</th>
              <th align="left" valign="middle"  >{$language.lblPhone}</th>
              <th align="left" valign="middle" >{$language.lblRequestedDate}</th>
			{if $approvePrivilege && $hiddenAffiliateReqStatus!="Approved"}  
				<th align="left" valign="middle" >&nbsp;</th>
			{/if}	
			{if $declinePrivilege && ($hiddenAffiliateReqStatus=="" || $hiddenAffiliateReqStatus=="New")}
				<th align="left" valign="middle" >&nbsp;</th>
			{/if}	
            </tr>
            {form->start name="formaffiliateRequestList" action="" method="post"}
            
            {foreach from=$resListAffiliateRequest item="AffiliateRequest" key="key1"}
            
            {assign var ='currAffiliateReqID' value=$AffiliateRequest.affiliateReqID}
            <tr >
              <td align="left" valign="top">
				{if $showPrivilege}
					{html->anchor href="affiliaterequest/show/id/$currAffiliateReqID/" caption=$AffiliateRequest.affiliateReqName|wordwrap:32:"<br />
                \n":true|strip_tags:true|ucfirst history="yes"  class="normal_link"}
				{else}
					{$AffiliateRequest.affiliateReqName|wordwrap:32:"<br />
                \n":true|strip_tags:true|ucfirst}
				{/if}
				</td>
              <td align="left" valign="top"> {if $AffiliateRequest.affiliateReqWebsiteURL|substr:0:8 == 'https://'} 
                
                {assign var="append" value="https://"} 
                
                {else}
                
                {assign var="append" value="http://"} 
                
                {/if} 
                
                {assign var="urlLink" value=$AffiliateRequest.affiliateReqWebsiteURL|replace:'https://':''}
                
                {assign var="urlLink" value=$urlLink|replace:'http://':''} <a href="{$append}{$urlLink}" target="_blank"> {$AffiliateRequest.affiliateReqWebsiteURL} </a></td>
              <td align="left" valign="top"> <a href="mailto:{$AffiliateRequest.affiliateReqEmail}" > {$AffiliateRequest.affiliateReqEmail|wordwrap:30:"<br />
                \n":true|strip_tags:true} </a></td>
              <td align="left" valign="top">{$AffiliateRequest.affiliateReqPhone|wordwrap:13:"<br />
                \n":true|strip_tags:true}</td>
              <td align="left" valign="top"> {$AffiliateRequest.affiliateReqDate|date_format:$date_format}</td>
				{if $approvePrivilege && $hiddenAffiliateReqStatus!="Approved"} 
				<td align="left" valign="top">
					{if $AffiliateRequest.affiliateReqStatus eq 'New' || $AffiliateRequest.affiliateReqStatus eq 'Declined'}
						{html->anchor href="affiliate/approveaffiliaterequest/rid/$currAffiliateReqID/from/list/"   caption="{$language.lblEditApproveRequest}" class="action-link05"}
					{/if}
				</td>
				{/if}
				{if $declinePrivilege && ($hiddenAffiliateReqStatus=="" || $hiddenAffiliateReqStatus=="New")}
				<td align="left" valign="top">
				{if $AffiliateRequest.affiliateReqStatus eq 'New'}  
					{html->anchor href="affiliaterequest/decline/id/$currAffiliateReqID/from/list/"  caption="{$language.lblDeclineRequest}" title="{$language.lblDeclineRequest}" class="action-link05 decline"}
				{/if}  
				</td>
				{/if} 
            </tr>
            {/foreach}
            </table>
        </div>
        <!--End:Table Listing--> 
        <div class="fixing_right pagination_outer" > {paginate->layout  key="page" label_record="{$language.lblRecorsFound}" label_pages="{$language.lblPages}"} 
              <div class="clear"></div> 
              </div> 
          <div class="clear"></div> 
      
      <!--End:Border 3--> 
      
      {else}
      <div class="message_info" >{$language.lblNoAffiliateRequestForListing}</div>
      {/if} </div>
  </div>
  
  <!--End: left Block-->
  
</div>

<!--***************************************END CONTAINER SECTION******************************************************--> 


<!--End:Content Container--> 
      {include file='CommonBottom.tpl'}
  </div> 

<!--End:Outer Container--> 

{html->messages_script id="common_message"}
{html->messages_script section="Affiliate" id="request_approve_message"}

{form->rootpath_script} 

{form->basepath_script}

{include file='CommonJavaScriptBottom.tpl'} 
<script type="text/javascript" src="{$view_javascript}/daterangepicker.jQuery.js"></script>
<script type="text/javascript" src="{$common_js}/date.js"></script>
<script type="text/javascript" src="{$view_javascript}/jquery.colorbox.js"></script>
<script type="text/javascript">
{literal}
$(document).ready(function(){
	$('#affReqDate').daterangepicker({arrows: false});
	$('.side_wrapper ul li a[rel=affiliate-request]').addClass('selected');
	 setSideMenu(); 
});
{/literal}
</script>	
<script type="text/javascript">
{literal}
$(document).ready(function(){
$(".decline").colorbox({iframe:true, innerWidth:"60%", innerHeight:"60%"
});
});
{/literal}
</script>
</body>
</html>