Location: PHPKode > projects > MembersGear > membersgear/templates/admin_product_m.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"=>"Y-m-d"
    );
    
    $sDate=(!empty($_GET['sDate']))?$_GET['sDate']:date("Ymd");

{/php}
{literal}
<script type="text/javascript">
         var SignupFlag = 0;
         var ExpireFlag = 0;
         
        
         /*function ShowImageUploader(element)
          {
              var CheckBoxControl = document.getElementById(element);  
              var Control = document.getElementById('ImageLogo');
              //alert(value.checked);
              if(!CheckBoxControl.checked)
              {
                    Control.style.display = 'none';
                    CheckBoxControl.value = '0';
              }
              else
              {
                    Control.style.display = '';
                    CheckBoxControl.value = '1';
              }
          }  */
          
          function ShowTemplateBrowse(element,value,str)
          {
                //alert(document.getElementById('hdnSignupTemplateID').value+' '+value);
                //alert(str);
                var SelectControl = document.getElementById(element);
                //alert(flag);
                switch(element)
                {
                    case 'chkCustomized_Signup':
                            
                            var LabelControl = document.getElementById('lblSignupTemplate');
                            var ButtonControl = document.getElementById('btnSignupTemplate');
                            var EditBtnControl = document.getElementById('btnEditSignupTemplate');
                            if(!SelectControl.checked)
                            {
                                if(value == 'CUSTOMIZEDEMAIL')
                                {
                                    if(document.getElementById('hdnSignupTemplateID').value == '' && str == 'DEFAULT')
                                    {
                                        LabelControl.style.display = '';
                                        ButtonControl.style.display = '';
                                    }
                                    else
                                    {           
                                        if(str != 'DEFAULT' && str != 'DONOTSEND' || SignupFlag == 1)
                                        {
                                                EditBtnControl.style.display = '';
                                        }
                                        else
                                        {
                                                ButtonControl.style.display = '';            
                                        }
                                    }
                                }
                                else
                                {
                                    LabelControl.style.display = 'none';
                                    ButtonControl.style.display = 'none';
                                    EditBtnControl.style.display = 'none';
                                }
                            }
                            else
                            {
                                LabelControl.style.display = 'none';
                                ButtonControl.style.display = 'none';
                                EditBtnControl.style.display = 'none';  
                            }
                            
                            break;
                            
                    case 'chkexpnotification':
                            var LabelControl = document.getElementById('lblExpireNotificationTemplate');
                            var ButtonControl = document.getElementById('btnExpireNotificationTemplate');
                            var EditBtnControl = document.getElementById('btnEditExpireNotificationTemplate');
                            
                            if(!SelectControl.checked)
                            {
                                if(value == 'CUSTOMIZEDEMAIL')
                                {
                                    if(document.getElementById('hdnExpireNotifyTemplateID').value == '')
                                    {
                                        LabelControl.style.display = '';
                                        ButtonControl.style.display = '';
                                    }
                                    else
                                    {
                                        if(str != 'DEFAULT' || ExpireFlag == 1)
                                                EditBtnControl.style.display = '';
                                        else
                                                ButtonControl.style.display = ''; 
                                    }
                                }
                                else
                                {
                                    LabelControl.style.display = 'none';
                                    ButtonControl.style.display = 'none';
                                    EditBtnControl.style.display = 'none';
                                }
                                
                            }
                            else
                            {
                                LabelControl.style.display = 'none';
                                ButtonControl.style.display = 'none';
                                EditBtnControl.style.display = 'none';
                            }
                            break;
                }
          }
          
          
          function SetEmailTemplateID(element,templateID,templateName)
          {
               
               //var SelectControl = document.getElementById(element);
               //SelectControl.value = templateID;
               if(element == "chkCustomized_Signup")
               {
                    var LblControl = document.getElementById('lblSignupTemplate');
                    var BtnControl = document.getElementById('btnSignupTemplate');
                    var EditBtnControl = document.getElementById('btnEditSignupTemplate');
                    var HdnSignupTemplateID = document.getElementById('hdnSignupTemplateID');
                    
                    //LblControl.innerHTML = templateName+'&nbsp;&nbsp;&nbsp;&nbsp;';
                    BtnControl.style.display = 'none';
                    EditBtnControl.style.display = '';
                    HdnSignupTemplateID.value = templateID;
                    SignupFlag = 1;
                    //BtnControl.value = 'Edit Template';
               }
               else if(element == 'chkexpnotification')
               {
                    var LblControl = document.getElementById('lblExpireNotificationTemplate');
                    var BtnControl = document.getElementById('btnExpireNotificationTemplate');
                    var EditBtnControl = document.getElementById('btnEditExpireNotificationTemplate');
                    var HdnExpireNotifyTID = document.getElementById('hdnExpireNotifyTemplateID');
                    
                    //LblControl.innerHTML = templateName+'&nbsp;&nbsp;&nbsp;&nbsp;';
                    BtnControl.style.display = 'none';
                    EditBtnControl.style.display = '';
                    HdnExpireNotifyTID.value = templateID;
                    ExpireFlag = 1;
               }
          }
          
           
          /*************************** For Payment Processors ********************************/
          
            function SetValidPaymentProcessors(chkIsRecurring, txtPeriod, ddlPeriodType, txtFrequency)
            {
                     var IsPaypalAvailable='{/literal}{$IsPaypalAvailable}{literal}'; 
                     var IsGoogleCheckoutAvailable='{/literal}{$IsGoogleCheckoutAvailable}{literal}';  
                     var Is2CheckoutAvailable='{/literal}{$Is2CheckoutAvailable}{literal}';
                     var IsAuthorizeDotNetAvailable='{/literal}{$IsAuthorizeDotNetAvailable}{literal}';      
                    // alert(IsPaypalAvailable+"paypal\n"+IsGoogleCheckoutAvailable+"Google\n"+IsAuthorizeDotNetAvailable+"Authorizd"); 
                     
                     //alert(chkIsRecurring.checked);  
                     var chkPaypal=document.getElementById('chkIsPaypalAvailable');
                     var chkAuthorize=document.getElementById('chkIsAuthorizeAvailable');
                     var chk2Checkout=document.getElementById('chkIs2CheckoutAvailable');
                     var chkGoogleCheckout=document.getElementById('chkIsGoogleCheckoutAvailable');

                     var HPaypal=document.getElementById('HDNFIsPaypalAvailable');
                     var HAuthorize=document.getElementById('HDNFIsAuthorizeAvailable');
                     var H2Checkout=document.getElementById('HDNFIs2CheckoutAvailable');
                     var HGoogleCheckout=document.getElementById('HDNFIsGoogleCheckoutAvailable');

                     
                    
                     ////////////////////////Paypal//////////////////////////////////
                    if(HPaypal.value == 0)
                     {
                         chkPaypal.checked=false;
                     }
                     else
                     {
                         chkPaypal.checked=true;
                         //if ddlPeriodType is months and period>12 then uncheck authorize too.
                        if(chkIsRecurring.checked && ddlPeriodType.options[ddlPeriodType.selectedIndex].text.toLowerCase().indexOf('month')>=0 && parseInt(txtPeriod.value)>24) 
                            chkPaypal.checked = false;
                     }

                     ////////////////////////Authorize//////////////////////////////////
                     if(HAuthorize.value == 0)
                     {
                         chkAuthorize.checked=false;
                     }
                     else
                     {
                         chkAuthorize.checked=true;

                         //if ddlPeriodType is year then uncheck authorize too.
                         if(chkIsRecurring.checked && ddlPeriodType.options[ddlPeriodType.selectedIndex].text.toLowerCase().indexOf('year')>=0) 
                            chkAuthorize.checked = false;

                         //if ddlPeriodType is months and period>12 then uncheck authorize too.
                         if(chkIsRecurring.checked && ddlPeriodType.options[ddlPeriodType.selectedIndex].text.toLowerCase().indexOf('month')>=0 && parseInt(txtPeriod.value)>12) 
                            chkAuthorize.checked = false;

                        //if ddlPeriodType is days and period<7 then uncheck authorize too.
                        if(chkIsRecurring.checked && ddlPeriodType.options[ddlPeriodType.selectedIndex].text.toLowerCase().indexOf('day')>=0 && parseInt(txtPeriod.value)<7) 
                            chkAuthorize.checked = false;

                     }

                     if(H2Checkout.value == 1)
                     {
                         chk2Checkout.checked=true;
                        chk2Checkout.disabled=false;
                     }

                     if(HGoogleCheckout.value==1)
                     {
                         chkGoogleCheckout.checked=true;
                        chkGoogleCheckout.disabled=false;
                     }


                     //if(chkIsRecurring.checked && ddlPeriodType.options[ddlPeriodType.selectedIndex].text.toLowerCase().indexOf('year')>=0) chkAuthorize.checked = false;

                     //Google Checkout yet to study to remains always invisible on the page till now
                     //chkGoogleCheckout.checked = false;

                     //General Validation Check
                     //if ddlPeriodType is days and period<7 then uncheck authorize too.
                     if(ddlPeriodType.options[ddlPeriodType.selectedIndex].text.toLowerCase().indexOf('day')>=0 && parseInt(txtPeriod.value)>365)
                     {
                         chkPaypal.checked = false;
                        chkAuthorize.checked = false;
                        chk2Checkout.checked = false;
                        chkGoogleCheckout.checked = false;
                     }

                     //If recurring is found then uncheck 2checkout
                     if(chkIsRecurring.checked)
                     {
                    // chk2Checkout.checked = false;
                    // chkGoogleCheckout.checked = false;
                    // chkAuthorize.checked = false;
                         chk2Checkout.disabled = true;
                        chkGoogleCheckout.disabled = true;
                        chk2Checkout.checked = false;
                        chkGoogleCheckout.checked = false;
             }

            }
            
            function SetPaymentProcessorsEdit(chkIsRecurring)
          {
             var chk2Checkout=document.getElementById('chkIs2CheckoutAvailable');
             var chkGoogleCheckout=document.getElementById('chkIsGoogleCheckoutAvailable');
            if(chkIsRecurring.checked)
            {
                //chk2Checkout.disabled = true;
               // chk2Checkout.checked = false;
                chkGoogleCheckout.disabled = true;    
                chkGoogleCheckout.checked = false; 
            }
          }
            function displayrecurringprice()
            {
                //alert ('helloprice');
                //var price = document.getElementById('ctl00_ContentPlaceHolder1_lblRecurringTimesCharge');
                var productprice = document.getElementById('txtprice');
                var chargeperiod = document.getElementById('txtduration');
                var RecurringTimes = document.getElementById('txtrecuuringtime');
                var PeriodType = document.getElementById('ddlduration');

                var selIndex = PeriodType.selectedIndex;
                var selectedperiodtype = PeriodType.options[selIndex].text;
                var Pricetodbtable = document.getElementById('hdnRecurringPriceCharge');
                
                if (parseFloat(RecurringTimes.value) == 1)
                {
                    alert('Invalid value of times of recur. Please enter value 0 or greater than 1.');
                    RecurringTimes.focus();
                    return false;
                }
                
                   if ((parseFloat(productprice.value) > 0) && (parseFloat(RecurringTimes.value) > 0)) 
                {
                    var tot = (parseFloat(productprice.value)).toFixed(2);
                    Pricetodbtable.value = tot;
                    //price.innerHTML = '$ ' + tot + ' per ' + selectedperiodtype + ' ' + ' will be charged for ' + RecurringTimes.value + ' ' + selectedperiodtype;
                    //price.innerHTML = '$ ' + tot + ' USD for each ' + chargeperiod.value + ' ' + selectedperiodtype  + ', for ' + RecurringTimes.value + ' installments.';
                }
                else
                {
                    var tote = (parseFloat(productprice.value)).toFixed(2);
                    Pricetodbtable.value = tote;
                    if (parseFloat(chargeperiod.value) > 1) 
                    {
                        //price.innerHTML = '$ ' + tote + '  USD for each  ' + chargeperiod.value + ' ' + selectedperiodtype + '.'; 
                    }
                    else
                    {
                        //price.innerHTML = '$ ' + tote + '  USD for each  ' + selectedperiodtype + '.'; 
                    }
                }
            }
            
            function toggleVisibility1(opt)
             {
           
               /*if(opt==0)
                   document.getElementById('affCommision').style.display = 'none';
                 else
                    document.getElementById('affCommision').style.display = '';  */
                    
                 return false;   

             
             }


          
          /**********************************************************************************/


 </script>
{/literal}
  <div id="content" class="setdiv">
    <div id="full-contentdiv">
        <div class="righttop">
            <h2 align="center">
                 {if $IsEdit eq 'yes'}Update Product/Subscription{else}Add Product/Subscription {/if}
            </h2>
        </div>
       

        <div class="whole-page clear">
            {if $IsEdit eq 'yes'}
                    {assign var="action" value="update"}
              {else}
                    {assign var="action" value="insert"}
                    {assign var="idnurl1" value="ipn.php"}
              {/if}
        
            {*  {assign var="todaydate" value=$smarty.now|date_format:"%Y-%m-%d"}*}
            
              <div id="pgdiv" style="display:none">
              <center>
                    <table id='tblcustomloader' name='tblcustomloader' class='borderless' cellpadding='0' cellspacing='5' border='0' style=''>
                        <tr>
                            <td>
                                <img src='{$ADMIN_IMAGE_DIR}/DBRestoreloader.gif' alt='' title=''>
                            </td>
                            <td valign='middle'>
                                <label>&nbsp;Please wait while Product is Updated from PayGear</label>
                            </td>
                        </tr>
                    </table>
                  </center>
              </div>
           <form name="frmproduct" id="frmproduct" action="admin_product_m.php?action={$action}" method="post" enctype="multipart/form-data">  
            <div class="borderless borderless-1"> 
               <table border="1" cellpadding="0" cellspacing="0" style="width:800px" align="center">
                    <tr>
                            <td colspan="2"> 
                                    <div class="horizontal-line">
                                    &nbsp;
                                    </div>
                            </td>
                    </tr>
                                <input type="hidden" id="hdn_product_id" name="hdn_product_id" value="{if $IsEdit eq 'yes'}{$productdata[0].updateproductid}{else}{$post.hdn_product_id}{/if}">
                                <input type="hidden" id="hdn_paygearproduct_id" name="hdn_paygearproduct_id" value="{if $IsEdit eq 'yes'}{$productdata[0].paygear_productid}{else}{$post.paygear_productid}{/if}">
                                <input type="hidden" id="paygear_productpaymentoptionid" name="paygear_productpaymentoptionid" value="{if $IsEdit eq 'yes'}{$productdata[0].paygear_productpaymentoptionid}{else}{$post.paygear_productpaymentoptionid}{/if}">       
                                <input type="hidden" id="hdn_default_value" name="hdn_default_value" value="{if $IsEdit eq 'yes'}{$productdata[0].isdefault}{/if}">
                                 <input type="hidden" id="hdn_thankyoupage_url" name="hdn_thankyoupage_url" value="{if $IsEdit eq 'yes'}{$productdata[0].thankyoupageurl}{/if}">
                    <tr>
                           <td class="right-side-text-borderless space" valign="top" style=""><label>
                              Name : <label class="star">*</label>
                              </label>
                            </td>
                            <td class="left-side-text-borderless">
                               <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].name}{else}{$post.txttitle}{/if}" class="txtcss" maxlength="100" id="txttitle" name="txttitle" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';">   
                                <div class="comment-div" style="width:540px">
                                     Please insert product name.
                                </div>
                            </td>
                    </tr>                                 
                    <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                              Description : <label class="star">*</label>  
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                            <textarea id="txtdesc" name="txtdesc" maxlength="4000" style="padding:3px;width: 554px" class="txtareacss" onmouseover="className='txtareahover';" onmouseout="className='txtareacss';">{if $IsEdit eq 'yes'}{$productdata[0].description}{else}{$post.txtdesc}{/if}</textarea> 
                              
                                <div class="comment-div"  style="width:540px">
                                   Please enter a product description.
                                </div>
                                  
                                
                            </td>
                    </tr>
                   {if $IsEdit eq 'yes' and $productdata[0].islinkedwithpaygear lte "0" } 
                        <tr>    
                            <td class="right-side-text-borderless space" valign="top" style=""><label>
                                 Is Linked with PayGear.com : <label class="star">*</label>   
                                </label>
                                </td>
                                <td class="left-side-text-borderless">
                                   <select id="linkwithpaygear" name="linkwithpaygear" class="selectcss"  style="width: 560px ! important;"  onchange="toggleVisibility1(this.value)" >
                                        <option value=''>select..</option>
                                        {foreach from=$linkwithpaygear item="linkwithpaygearitem" key="k"} 
                                            <option value="{$k}"  
                                                {if $IsEdit eq 'yes'}
                                                    {if $productdata[0].islinkedwithpaygear eq $k}
                                                       selected=""
                                               {/if} 
                                               {elseif $IsEdit eq ''}
                                                    
                                               {elseif $post.linkwithpaygear eq $k} 
                                                       selected=""
                                               {/if} >{$linkwithpaygearitem}</option>
                                        {/foreach}                                    
                                        </select>   
                                    <div class="comment-div"  style="width:540px">
                                     Please select "Yes" if you would like to sell this product through PayGear.com.
                                    </div> 
                                   
                                    <div class="comment-div" name="affCommision" id="affCommision"  style="width:540px;display:none">
                                       {if $IsEdit eq 'yes'}
                                         Please login into PayGear to set affiliate commission for this product. "Is Linked With PayGear" must be set to "Yes".
                                         
                                       {else}
                                         Please login into PayGear to set affiliate commission for this product after you completed adding this product. "Is Linked With PayGear" must be set to "Yes".
                                       {/if}    
                                    </div>
                                </td>
                        </tr>
                        
                    {else}
                        <tr style="display:none" >    
                            <td class="right-side-text-borderless space" valign="top" style=""><label>
                                 Is Linked with PayGear.com : <label class="star">*</label>   
                                </label>
                                </td>
                                <td class="left-side-text-borderless">
                                   <select id="linkwithpaygear" name="linkwithpaygear" class="selectcss"  style="width: 560px ! important;"  onchange="toggleVisibility1(this.value)" >
                                        <option value=''>select..</option>
                                        {foreach from=$linkwithpaygear item="linkwithpaygearitem" key="k"} 
                                            <option value="{$k}" {if $k eq "1" } selected="selected="  {/if} >{$linkwithpaygearitem}</option>
                                        {/foreach}                                    
                                        </select>   
                                    <div class="comment-div"  style="width:540px">
                                     Please select "Yes" if you would like to sell this product through PayGear.com.
                                    </div> 
                                   
                                    <div class="comment-div" name="affCommision" id="affCommision"  style="width:540px;display:none">
                                       {if $IsEdit eq 'yes'}
                                         Please login into PayGear to set affiliate commission for this product. "Is Linked With PayGear" must be set to "Yes".
                                         
                                       {else}
                                         Please login into PayGear to set affiliate commission for this product after you completed adding this product. "Is Linked With PayGear" must be set to "Yes".
                                       {/if}    
                                    </div>
                                </td>
                        </tr>
                    
                    {/if}
                    <tr>
                            <td colspan="2"> 
                                    <div class="horizontal-line">
                                   &nbsp;
                                    </div>
                            </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="subheadtd">
                             <span>PayGear Setting</span>
                        </td>
                    </tr>
                    <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                            Sales Page URL : <label class="star">*</label>  
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].salespageurl}{else}{$post.txtsalepageurl}{/if}" maxlength="1000" id="txtsalepageurl" name="txtsalepageurl"  class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';"> 
                                 <div class="comment-div"  style="width:540px">
                                Customer will be redirected to this Sales Page. Usually this is product signup page.
                                </div>
                            </td>
                    </tr>
                     <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                             Thank You URL : <label class="star">*</label>  
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].thankyoupageurl}{else}{$post.txtthkpageurl}{/if}" maxlength="1000"  id="txtthkpageurl" name="txtthkpageurl"  class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';"> 
                               <div class="comment-div"  style="width:540px"> 
                               Customers will be redirected to thank you page then the above URL. We recommend you use your login URL <b> {$WEB_URL}/user_login.php</b>.
                               </div>
                            </td>
                    </tr>
                    
                    {*<tr>    
                        <td class="right-side-text-borderless space" valign="top" ><label>
                             Display logo on checkout page : 
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="checkbox" id="chkDisplayLogo" value="0" name="chkDisplayLogo" onclick="ShowImageUploader(this.id);" class="chkcss" {if $productdata[0].displaylogooncheckoutpage eq 1}checked{/if}>
                               
                            </td>
                    </tr>
                      
                    <tr id="ImageLogo" style="display:none">    
                        <td class="right-side-text-borderless space" valign="top" style="margin:5px !important"><label>
                             Logo :
                             </label>
                            </td>
                            <td class="left-side-text-borderless" style="margin:5px !important">
                                <input type="hidden" name="MAX_FILE_SIZE" value="10000000">
                                <div style="border:solid 1px #EA7222;width:84px;text-align:center">
                                {if $productdata[0].logo neq ''}
                                        <img src={$WEB_URL}/includes/logothumb.php?id={$productdata[0].updateproductid} alt="Product Logo" style="padding:4px;background:#ccc">
                                        <br/>
                                {else}
                                        <img src="{$ADMIN_IMAGE_DIR}/2.gif" alt="Test Image" width="75" height="75"><br/>
                                {/if}
                                </div>
                                To replace this logo, Please select logo below.<br/>
                                <input type="file" name="imgfile" size="70"/>
                            </td>
                    </tr>  *}
                    
                  {*  {if $productdata[0].displaylogooncheckoutpage eq 1}
                            {php}
                               echo "<script language=javaScript>";
                                echo "ShowImageUploader('chkDisplayLogo');";
                                echo "</script>";
                            {/php}
                    {/if}*}
                    
                    <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                             Keywords : <label class="star">*</label>
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="text " maxlength="200" id="txtkeyword" name="txtkeyword" value="{if $IsEdit eq 'yes'}{$productdata[0].keywords}{else}{$post.txtkeyword}{/if}" class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';"> 
                                 <div class="comment-div"  style="width:540px"> 
                                    Will be used as meta keywords.
                                 </div>
                            </td>
                    </tr>
                    <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                             Display this product in the marketplace :
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                                 {foreach from=$displaymarketplace item="displaymarketplaceitem" key="k"}
                                       <input type="radio" value="{$k}" name="rbldispprodin"  id="rbldispprodin" style="" class="chkcss"
                                        {if $IsEdit eq 'yes'}
                                                {if $productdata[0].productstatusid eq $k}
                                                  checked=""
                                        {/if} 
                                        {elseif $IsEdit eq ''}
                                                {if $k eq '1'}
                                                 checked=""
                                                {/if} 
                                        {elseif $post.rbldispprodin eq $k} 
                                                  checked=""
                                        {/if}>{if $displaymarketplaceitem eq 'Disable this product'}<font color="red">{$displaymarketplaceitem}</font><br/> {else}{$displaymarketplaceitem}<br/>{/if} 
                                 {/foreach}
                                 <div class="comment-div"  style="width:540px"> 
                                     This is related to Payment Marketplace Setting.
                                 <div>
                             </td>
                    </tr>
                     <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                              Approve all affiliates on signup :
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="checkbox" value="1" name="chkallaffiliate"  id="chkallaffiliate" style="" class="chkcss"
                                           {if $IsEdit eq 'yes'}
                                                {if $productdata[0].isallaffiliateapprovedbydefault eq "1"}
                                                  checked=""
                                           {/if} 
                                           {elseif $IsEdit eq ''}
                                                checked="" 
                                           {elseif $post.chkallaffiliate eq "1"} 
                                                  checked=""
                                           {/if}>Approve all affiliates for this product upon signup  
                                           <div class="comment-div"  style="width:540px">
                                            If you click this box, anyone on PayGear can sell your product; they just add their affiliate ID to your URL, and you'll receive notice that they've made a sale for you. Or, you can leave this box empty, and only those affiliates you choose will be able to sell your product. 
                                            </div>
                            </td>
                    </tr>
                     <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                               Request the buyer's shipping address :
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="checkbox" value="1" name="chkbuyershipaddr"  id="chkbuyershipaddr" style="" class="chkcss"
                                            {if $IsEdit eq 'yes'}
                                                {if $productdata[0].isrequiredshippinginformation eq "1"}
                                                  checked=""
                                           {/if} 
                                           {elseif $IsEdit eq ''}
                                                  
                                           {elseif $post.chkbuyershipaddr eq "1"} 
                                                  checked=""
                                           {/if}>Request the buyer's shipping address (Physical Products Only)
                                 <div class="comment-div"  style="width:540px">
                                 Check this box, and the buyer will need to provide a mailing address in order to complete their order.
                                 We'll pass this address along to you, and you can also find it from your merchant account. Of course, 
                                 this option is only available if you're selling a physical product.
                                </div>
                            </td>
                    </tr>
                    <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                              Request extra contact &nbsp; information :
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="checkbox" value="1" name="chkextracontact" id="chkextracontact" style="" class="chkcss"
                                     {if $IsEdit eq 'yes'}
                                     {if $productdata[0].isrequiredpersonalinformation eq "1"}
                                                      checked=""
                                     {/if} 
                                     {elseif $IsEdit eq ''}
                                                      
                                     {elseif $post.chkextracontact eq "1"} 
                                                      checked=""
                                     {/if}>Request extra contact information
                                 <div class="comment-div"  style="width:540px">
                                 If you check this box, the buyer will need to supply their street address, phone number, etc. 
                                 We'll pass this information along to you as part of your sales report.
                                </div>
                            </td>
                    </tr>
                    <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                            IPN URL :
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                                 <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].ipnurl}{else}{$WEB_URL}{/if}" maxlength="4000" id="txtipnurl" name="txtipnurl"  class="txtcss" style="width: 277px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';" readonly=""> 
                                <label style="vertical-align:middle;"> /</label>
                                 <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].ipnurl1}{else}{$idnurl1}{/if}" maxlength="4000" id="txtipnurl1" name="txtipnurl1"  class="txtcss" style="width: 252px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';" readonly=""> 
                                
                            </td>
                    </tr>
                     <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                           IPN Secret Code :
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                                 <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].ipnsecretcode}{else}{$post.txtipnseccode}{/if}" maxlength="100" id="txtipnseccode" name="txtipnseccode"  class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';"> 
                                
                            </td>
                    </tr>
                    <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                           Paypal Page Style :
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                                 <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].paypalpagestyle}{else}{$post.paypalpagestyle}{/if}" maxlength="30" id="txtpaypalpagestyle" name="txtpaypalpagestyle"  class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';"> 
                                
                            </td>
                    </tr>
                    <tr>    <td/>
                            <td colspan=""> 
                                    <div class="comment-div"  style="width:540px">
                                    If you would like to apply Paypal Style on the Paypal checkout page, please enter it here.
                                   </div>
                            </td>
                    </tr>
                    <tr>
                            <td colspan="2"> 
                                    <div class="horizontal-line">
                                   &nbsp;
                                    </div>
                            </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="subheadtd">
                             <span>Subscription Terms</span>
                        </td>
                    </tr>
                     
                     <tr>
                            
                        <td class="right-side-text-borderless space" valign="top" ><label>
                              Price : <label class="star">*</label> 
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].price}{else}{$post.txtprice}{/if}" maxlength="9" onclick="this.select();" id="txtprice" name="txtprice"  class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';" onchange="javascript:displayrecurringprice();SetValidPaymentProcessors(document.getElementById('chkrecurring'),document.getElementById('txtduration'), document.getElementById('ddlduration'), document.getElementById('txtrecuuringtime'));" onblur="isMainUpsellProduct();isLinkedInProduct();"> 
                                <div class="comment-div"  style="width:540px">
                                   Enter only digits and a decimal if necessary. Do NOT enter a dollar sign '$' or other punctuation.
                                </div>
                            </td>
                    </tr>
                  
                  {if $IsEdit eq 'yes'}  
                      {assign var=freePro_count value=$linkedin|@count}  
                      {assign var=prodPrice value=$productdata[0].price|string_format:"%.2f"}
                         {if $freePro_count gt 0}   
                              {if $prodPrice neq "0.00" }  
                                <tr id='linkfreeProducts'>
                           
                              {else}
                                   <tr id='linkfreeProducts' style="display:none">
                          
                              {/if} 
                               <td class="right-side-text-borderless space" valign="top" ><label>
                                Link free products : 
                                    </label>
                                    </td>
                                    <td class="left-side-text-borderless">
                                        <select id='linkedinPro' name="linkedinPro[]" multiple="multiple" size="3" style="width:560px;">
                                        {section name=linkedin loop=$linkedin}
                                          <option value="{$linkedin[$smarty.section.linkedin.index].id}"
                                          {section name=linkedinedit loop=$linkedinedit}
                                             {if $linkedinedit[$smarty.section.linkedinedit.index] eq $linkedin[$smarty.section.linkedin.index].id}
                                                 selected="selected"
                                             {/if}
                                          {/section}
                                          >{$linkedin[$smarty.section.linkedin.index].name}</option>
                                        {/section}
                                        </select>
                                     
                                        <div class="comment-div"  style="width:540px">
                                           Select products that you want to give free with this main product.
                                        </div>
                                    </td>
                               </tr>
                            {/if}
                          
                   {else}
                      {assign var=freePro_count value=$linkedin|@count}  
                      {if $freePro_count gt 0}   
                        <tr id='linkfreeProducts'>
                                
                            <td class="right-side-text-borderless space" valign="top" ><label>
                                  Link free products : <label class="star">*</label> 
                                </label>
                                </td>
                                <td class="left-side-text-borderless">
                                    <select id='linkedinPro' name="linkedinPro[]" multiple="multiple" size="3" style="width:560px;">
                                    {section name=linkedin loop=$linkedin}
                                      <option value="{$linkedin[$smarty.section.linkedin.index].id}">{$linkedin[$smarty.section.linkedin.index].name}</option>
                                    {/section}
                                    </select>
                                 
                                    <div class="comment-div"  style="width:540px">
                                       Select products that you want to give free with this main product.
                                    </div>
                                </td>
                        </tr>
                       {/if}    
                   {/if}
                    
{*************************************************************************************************************************************************}                    
                    <tr>
                            
                        <td class="right-side-text-borderless space" valign="top" ><label>
                              Is life time : <label class="star">*</label> 
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <select  class="selectcss"  name="product_lftime" id="product_lftime"  style="width:560px" onchange="setlifetimeduration();">
                                      <option value="" selected>Select.</option>
                                      <option value="1" {if $IsEdit eq 'yes'}{if $productdata[0].islifetime eq '1'}selected{/if}{/if}>YES</option>
                                      <option value="0" {if $IsEdit eq 'yes'}{if $productdata[0].islifetime eq '0'}selected{/if}{/if}>NO</option> 
                                </select>
                                
                                <div class="comment-div"  style="width:540px">
                                   Select YES for product lifetime else select NO
                                </div>
                            </td>
                    </tr>
                    <tr>
                    <tr  style="display:none;"  id="durationtr">    
                        <td class="right-side-text-borderless space" valign="top" style="" ><label>
                            Duration   : <label class="star">*</label>  
                            </label>
                        </td>
                        <td class="left-side-text-borderless">
                               <table cellpadding="0" cellpadding="0" class="borderless"> 
                                <tr>
                                  <td valign="top" class="left-side-text-borderless"> 
                                    <select class="selectcss" name="ddlliftimeduration" id="ddlliftimeduration" style="width: 300px ! important;" onchange="javascript:setexactdate();">
                                       <option value="0">select</option>
                                     {foreach from=$lalifttimeduration item="lifttimedurationitem" key="k"}
                                     <option value="{$lifttimedurationitem}"
                                         {if $IsEdit eq 'yes'}
                                            {if $productdata[0].duration_type eq $lifttimedurationitem}
                                                selected=""
                                            {/if} 
                                          {elseif $IsEdit eq ''}
                                                              
                                          {elseif $post.ddlliftimeduration eq $k} 
                                                selected=""
                                          {/if}>{$lifttimedurationitem}</option>
                                     {/foreach}
                                    </select>
                                    </td>
                                    <td  class="left-side-text-borderless">
                                      
                                        <input type="text"  value="{if $IsEdit eq 'yes'}{$lsupdateexactdate}{else}{$post.txtlifetimeduration}{/if}" id="txtlifetimeduration" name="txtlifetimeduration"  class="txtcss" style="width: 150px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';" onchange=""> 
                                    </td>
                                    <td valign="top" class="left-side-text-borderless"> 
                                     <div style="width:30px;display:none;" id="calendardiv">
                                      <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].txtlifetimeduration,'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"    =>  "txtlifetimeduration",
                                                         "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}
                                      *}
                                
                                      </div>
                                     </td>
                               
                               </tr> 
                              
                                </table>
                             <div class="comment-div"  style="width:540px">
                                   Please enter subscription period for this product
it can also be set to lifetime, or to fixed date
                                    </div>     
                        </td>
                    </tr>
                    
                    
{***************************************************************************************************************************************************}
                     <tr id="account-expire-notification" style="">
                            <td class="right-side-text-borderless space" valign="top" id="" style=""><label>
                              Recurring Subscription : 
                            </label>
                            </td>
                            <td class="left-side-text-borderless" valign="top">
                                    <table cellpadding="2" cellspacing="2" style="marging:5px !important;">
                                            <tr>
                                                 <td valign="top">
                                                        <input type="checkbox" value="1" name="chkrecurring"  id="chkrecurring" style="" class="chkcss" onclick="Change(this.checked,'tr1');Change(this.checked,'tr2');Change(this.checked,'tr3');Change(this.checked,'tr4');Change(this.checked,'tr5');SetValidPaymentProcessors(document.getElementById('chkrecurring'),document.getElementById('txtduration'), document.getElementById('ddlduration'), document.getElementById('txtrecuuringtime'));"
                                                              {if $IsEdit eq 'yes'}
                                                                {if $productdata[0].issubscription eq "1"}
                                                                    checked=""
                                                                {/if} 
                                                              {elseif $IsEdit eq ''}
                                                                                  
                                                              {elseif $post.chkrecurring eq "1"} 
                                                                    checked=""
                                                              {/if}>
                                                             <div class="comment-div"  style="width:310px">
                                                                  Should subscription automatically be renewed when it expires  
                                                             </div>
                                                 </td>
                                                 
                                                 <td>
                                                         <div style="background-color: #E2E2E2; z-index: 10000; width: 220px; height: auto;border:solid 1px #BFBFBF"
                                                                class="pagegate" id="div1">
                                                                <table cellspacing="2" cellpadding="3">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td align="center" colspan="2">
                                                                                <span style="color: rgb(198, 128, 56); font-weight: bold;" id="Label1">
                                                                                    Available Payment Processors</span>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                                <input type="checkbox" style=""  id="chkIsPaypalAvailable" name="chkIsPaypalAvailable" value="1"
                                                                                  {if $IsEdit eq 'yes'}  
                                                                                        {if $productdata[0].ispaypalavailable eq 1 &&  $IsPaypalAvailable eq "true"} 
                                                                                            checked="checked"  
                                                                                        {/if}   
                                                                                  {elseif  $IsPaypalAvailable eq "true"} 
                                                                                          checked="checked" 
                                                                                  {/if}
                                                                                  {if  $IsPaypalAvailable neq "true"}
                                                                                         disabled="disabled"  unchecked="" 
                                                                                  {/if}/>
                                                                            </td>
                                                                            <td>
                                                                                <label id="lblPaypal">
                                                                                    Paypal:</label>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                                <input type="checkbox"  style="" id="chkIsAuthorizeAvailable" name="chkIsAuthorizeAvailable" value="1"
                                                                                    {if $IsEdit eq 'yes'}   
                                                                                        {if $productdata[0].isauthorizeavailable eq 1 && $IsAuthorizeDotNetAvailable eq "true"} 
                                                                                          checked="checked" 
                                                                                        {/if}
                                                                                   {elseif $IsAuthorizeDotNetAvailable eq "true"} 
                                                                                          checked="checked" 
                                                                                   {/if}
                                                                                   {if  $IsAuthorizeDotNetAvailable neq "true"}
                                                                                             disabled="disabled" unchecked=""
                                                                                            
                                                                                   {/if}/>
                                                                              </td>
                                                                            <td>
                                                                                <label id="lblAuthorize">
                                                                                    Authorize:</label>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                                <input type="checkbox"   style="" id="chkIsGoogleCheckoutAvailable" name="chkIsGoogleCheckoutAvailable" value="1" 
                                                                                {if $IsEdit eq 'yes'}    
                                                                                    {if $productdata[0].isgooglecheckoutavailable eq 1 && $IsGoogleCheckoutAvailable eq "true"} 
                                                                                           checked="checked"   
                                                                                    {/if}
                                                                                {elseif $IsGoogleCheckoutAvailable eq "true"} 
                                                                                          checked="checked" 
                                                                                {/if}    
                                                                                {if  $IsGoogleCheckoutAvailable neq "true"}
                                                                                          disabled="disabled" 
                                                                                          
                                                                                {/if}/>
                                                                                
                                                                            </td>
                                                                            <td>
                                                                                <label id="lblGoogleCheckout">
                                                                                    Google Checkout:</label>
                                                                            </td>
                                                                        </tr>
                                                                       
                                                                        <tr style="display: none;">
                                                                            <td>
                                                                                <input type="checkbox" style="" id="chkIs2CheckoutAvailable" name="chkIs2CheckoutAvailable" {if $productdata[0].is2checkoutavailable eq 1} checked="checked" {/if} value=""/>
                                                                            </td>
                                                                            <td>
                                                                                <label id="lbl2Checkout">
                                                                                    2Checkout:</label>
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                                <input type="hidden" value="{if $IsPaypalAvailable eq 'true'}1{else}0{/if}" id="HDNFIsPaypalAvailable"
                                                                    name="HDNFIsPaypalAvailable" />
                                                                <input type="hidden" value="{if $IsAuthorizeDotNetAvailable eq 'true'}1{else}{/if}" id="HDNFIsAuthorizeAvailable"
                                                                    name="HDNFIsAuthorizeAvailable" />
                                                                <input type="hidden" value="{if $IsGoogleCheckoutAvailable eq 'true'}1{else}{/if}" id="HDNFIsGoogleCheckoutAvailable"
                                                                    name="HDNFIsGoogleCheckoutAvailable" />
                                                                <input type="hidden" value="{if $Is2CheckoutAvailable eq 'true'}1{else}{/if}" id="HDNFIs2CheckoutAvailable"
                                                                    name="HDNFIs2CheckoutAvailable" />
                                                            </div>
                                                 </td>
                                            </tr>
                                    </table>
                                 <input type="hidden" id="hdnRecurringPriceCharge" name="hdnRecurringPriceCharge" value="0.00"/>
                            </td>
                    </tr>
                  
                    
                   <tr  style="display:none;"  element="tr1">    
                        <td class="right-side-text-borderless space" valign="top" style="" ><label>
                            Charge Period   : <label class="star">*</label>  
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="text"  value="{if $IsEdit eq 'yes'}{$productdata[0].recurringchargeperiod}{else}{$post.txtduration}{/if}" maxlength="3" id="txtduration" name="txtduration"  class="txtcss" style="width: 275px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';" onchange="javascript:displayrecurringprice();SetValidPaymentProcessors(document.getElementById('chkrecurring'),document.getElementById('txtduration'), document.getElementById('ddlduration'), document.getElementById('txtrecuuringtime'));"> 
                              
                                <select class="selectcss" name="ddlduration" id="ddlduration" style="width: 275px ! important;" onchange="javascript:displayrecurringprice();SetValidPaymentProcessors(document.getElementById('chkrecurring'),document.getElementById('txtduration'), document.getElementById('ddlduration'), document.getElementById('txtrecuuringtime'));">
                                   <option value="0">select</option>
                                 {foreach from=$durationarry item="durationarryitem" key="k"}
                                 <option value="{$k}"
                                     {if $IsEdit eq 'yes'}
                                        {if $productdata[0].recurringchargeperiodtypeid eq $k}
                                            selected=""
                                        {/if} 
                                      {elseif $IsEdit eq ''}
                                                          
                                      {elseif $post.ddlduration eq $k} 
                                            selected=""
                                      {/if}>{$durationarryitem}</option>
                                 {/foreach} 
                                </select>
                                
                                <div class="comment-div"  style="width:540px">
                                  Please enter a fixed date subscription period for this product. 
                                </div>
                            </td>
                    </tr>
                     <tr element="tr2" style="display:none;">
                            <td class="right-side-text-borderless space" valign="top" style=""><label>
                               Recurring Times : <label class="star">*</label>  
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                              
                                  <input type="text" maxlength="3"   value="{if $IsEdit eq 'yes'}{$productdata[0].recurringtimes}{else}{$post.txtrecuuringtime}{/if}" id="txtrecuuringtime" name="txtrecuuringtime"  class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';" onchange="javascript:displayrecurringprice();SetValidPaymentProcessors(document.getElementById('chkrecurring'),document.getElementById('txtduration'), document.getElementById('ddlduration'), document.getElementById('txtrecuuringtime'));"> 
                             
                                <div class="comment-div"  style="width:540px">
                                    The number of times payments will occur.Note :- If times of recur is infinity / till user cancels enter 0.
                                </div>
                            </td>
                    </tr>
                     <tr element="tr3" style="display:none;">
                        <td colspan="2" class="right-side-text-borderless space" valign="top" style="padding-bottom:15px;"> 
                            <span>PayPal-Only Options (Optional) </span>   
                        </td>
                    </tr>
                     <tr element="tr4" style="display:none;">    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                                Trial Price :
                          </label>
                            </td>
                            <td class="left-side-text-borderless" valign="top">
                                <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].producttrialamount}{else}{$post.txttotprice1}{/if}" maxlength="5" id="txttotprice1" name="txttotprice1"  class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';"> 
                             
                                <div class="comment-div"  style="width:540px">
                                  Please set to 0 if you wish to offer your user a free trial.
                                </div>
                            </td>
                    </tr>
                    <tr element="tr5" style="display:none;">
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                           Trial Period :       
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                 <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].producttrialperiod}{else}{$post.txttotduration1}{/if}"  maxlength="5" id="txttotduration1" name="txttotduration1"  class="txtcss" style="width: 275px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';"> 
                                <select class="selectcss" name="ddltotduration1" id="ddltotduration1" style="width: 275px ! important;">
                                 <option value="0">select</option>
                                 {foreach from=$totalduration1array item="totduration1arryitem" key="k"}
                                 <option value="{$k}"
                                 {if $IsEdit eq 'yes'}
                                        {if $productdata[0].producttrialperiodtypeid eq $k}
                                            selected=""
                                        {/if} 
                                      {elseif $IsEdit eq ''}
                                                          
                                      {elseif $post.ddltotduration1 eq $k} 
                                            selected=""
                                      {/if}>{$totduration1arryitem}</option>
                                 {/foreach}
                                </select>
                                
                                <div class="comment-div"  style="width:540px">
                                  If offering a free trial please select how long you would like the trial to last.    
                                </div>
                            </td>
                    </tr>
                    <tr>
                            <td colspan="2"> 
                                    <div class="horizontal-line">
                                  &nbsp;
                                    </div>
                            </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="subheadtd">
                             <span>Product Protected URL</span>
                        </td>
                    </tr>
                    <tr>
                         <td class="right-side-text-borderless space"><label>Do Not Link </label></td>
                        <td class="left-side-text-borderless" style="padding-top:5px;padding-bottom:5px;">
                         <table><tr><td><input type="checkbox" {if $donotlink eq 'true'} checked="checked" {/if} value="1" name="donotlink" id="donotlink" onclick="showCheckUncheckMessage(this);" ></td></tr></table>
                        </td>
                    </tr>
                   <tr id='productUrlSetting' {if $donotlink eq 'true'} style="display:none" {/if}>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                              Product URL: <label class="star">*</label>  
                            </label>
                            </td>
                            <td class="left-side-text-borderless" >
                                <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].protectedurl}{else}{$post.txtprodurl}{/if}" maxlength="500" id="txtprodurl" name="txtprodurl"  readonly class="txtcss" style="width: 455px ! important;*width:455px  ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';">
                                <input type="button"  class="btncss" onclick="window.open('../includes/phptreeview/productUrl.php','treeview','height=550,width=600');return false;" value="browse" > 
                               <div class="comment-div" style="width:540px">
                                   Please select the protected area URL. This is where you want your customer access when selecting the purchased product link from the members area.  Example:  /mydir/protected_dir/abc.html  
                                </div>
                            </td>
                    </tr>
                    <tr style="display:none">    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                              File Name:
                            </label>
                            </td>
                            <td class="left-side-text-borderless" >
                                <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].filename}{else}{$post.filename}{/if}" maxlength="500" id="filename" name="filename"  class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';">
                               <div class="comment-div" style="width:540px">
                                   Please enter file name for above Product Protected URL 
                                  </div>
                            </td>
                    </tr>
                      <tr>
                            <td colspan="2"> 
                                    <div class="horizontal-line">
                                  &nbsp;
                                    </div>
                            </td>
                    </tr> 
                    <tr>
                        <td colspan="2" class="subheadtd">
                             <span>Product Availability/Visibility</span>
                        </td>
                    </tr>
                    {*========================================================================================================================================================*}                    
                      <tr>
                        <td class="right-side-text-borderless space" valign="top" style="">
                             <label>
                              Product Categories :
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                                 <div>
                                    {php}
                              
                                        require_once "../admin/admin_treeview.php";
                                     {/php}
                                </div> 
                                     
                            </td>
                    </tr>
                 
                    
                    
                    
                    
                    
{*========================================================================================================================================================*}                    <tr>
                        <td class="right-side-text-borderless space" valign="top" style="">
                             <label>
                              Scope :
                             </label>
                            </td>
                            <td class="left-side-text-borderless">
                               
                                <select class="selectcss" name="ddlscope" id="ddlscope"  style="width:560px">
                                 {foreach from=$scope item="scopeitem" key="k"}
                                 <option value="{$k}"
                                     {if $IsEdit eq 'yes'}
                                        {if $productdata[0].scop eq $k}
                                            selected=""
                                        {/if} 
                                      {elseif $IsEdit eq ''}
                                                          
                                      {elseif $post.ddlscope eq $k} 
                                            selected=""
                                     {/if}>{$scopeitem}</option>
                                 {/foreach}
                                </select>
                                
                                <div class="comment-div"  style="width:540px">
                                      Who is allowed to order your product. 
                                </div>
                            </td>
                    </tr>
                      <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                             Sorting order : <label class="star">*</label>  
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].sortorder}{else}{$post.txtsortorder}{/if}"  maxlength="4" id="txtsortorder" name="txtsortorder"  class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';"> 
                               <div class="comment-div" style="width:540px">
                                  This is a numeric field. Products will be sorted by this number then alphabetically.
                                </div>
                            </td>
                    </tr>
                    <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                             Price Group ID : <label class="star">*</label>  
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].pricegroup}{elseif $IsEdit eq ''}0{else}{$post.txtpricegpid}{/if}"  maxlength="10" id="txtpricegpid" name="txtpricegpid"  class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';"> 
                               <div class="comment-div" style="width:540px">
                             This is a numeric field. Products with a negative price_group will not be displayed on the default Signup page. You can link to an alternate Signup page like this user_signup.php?group=-1 to display products ONLY from Price Group -1. You can enter comma-separated ',' lists of pricegroups as well 
                                </div>
                            </td>
                    </tr>
                    {if $IsEdit eq 'yes'}  
                      <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                            Renewal Group : 
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                {*<input type="text" maxlength="100" id="txtrenewalgp" name="txtrenewalgp"  class="txtcss" style="width: 554px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';"> *}
                               <select id="ddlrenewalgp" name="ddlrenewalgp" class="selectcss"  style="width: 560px ! important;" >
                                    <option value=''>select..</option>
                                    {foreach from=$productarry item="productarryitem" key="k"} 
                                        <option value="{$k}"  
                                            {if $IsEdit eq 'yes'}
                                                {if $productdata[0].renewalgroup eq $k}
                                                   selected=""
                                                {/if} 
                                           {elseif $post.ddlrenewalgp eq $k} 
                                                   selected=""
                                           {/if} >{$productarryitem}</option>
                                    {/foreach}                                    
                                    </select> 
                               <div class="comment-div" style="width:540px">
                                    This field identifies how MembersGear determines subscription start date when a customer renews their membership. 
                                </div>
                            </td>
                    </tr>
                    {/if}
                    <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                          Display Agreement : 
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                               <input type="checkbox" value="1" name="chkneed_agreement" id="chkneed_agreement" style="" class="chkcss"
                               {if $IsEdit eq 'yes'}
                                    {if $productdata[0].displayagreement eq "1"}
                                                   checked=""
                                    {/if} 
                                    {elseif $post.chkneed_agreement eq "1"} 
                                                   checked=""
                               {/if}><div class="comment-div" style="width:540px">
                                    Select if you require your customer to check a box stating they have read and agree to your terms. 
                                    Update your agreement product at templates/agreement.html 
                                </div>
                            </td>
                    </tr>
                     <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                          Require another subscription
to order this product : 
 
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                 <select class="selectcss" name="ddlrequire_other[]" id="ddlrequire_other"  style="width:560px" multiple="">
                                    {*<option value="0">Don't require anything (default)</option>*}
                                     {foreach from=$require_other item="require_otheritem" key="k"}
                                     <option value="{$k}"
                                        {foreach from="$reqanothersub" item="reqanothersubdata1item" key="k1"} 
                                            {if $reqanothersubdata1item eq $k}
                                               selected=""
                                            {/if} 
                                        {/foreach}>{$require_otheritem}</option>
                                     {/foreach}
                                    </select>
                                       <div class="comment-div" style="width:540px">
                                              MembersGear will check to see if the customer meets the following criteria to allow purchase. Hold down Control key to select more than one option 
                                        </div>
                            </td>
                    </tr>
                     <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                         Do not allow subscription to this product if the following conditions are not met : 
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                
                                 <select class="selectcss" name="prevent_if_other[]" id="prevent_if_other"  style="width:560px" multiple="">
                                     {*<option value="0">Don't prevent anything (default)</option> *}
                                     {foreach from=$prevent_if_other item="prevent_if_other_item" key="k"}
                                     <option value="{$k}"
                                        {foreach from="$disallowsub" item="disallowsubitem" key="k1"} 
                                            {if $disallowsubitem eq $k}
                                               selected=""
                                            {/if} 
                                        {/foreach}>{$prevent_if_other_item}</option>
                                     {/foreach} </select>
                                       <div class="comment-div" style="width:540px">
                                    MembersGear will check to see if the customer meets the following criteria to allow purchase. Hold down Control key to select more than one option
                                        </div>
                            </td>
                    </tr>
                    
                    <tr>
                            <td colspan="2"> 
                                    <div class="horizontal-line">
                                  &nbsp;
                                    </div>
                            </td>
                    </tr> 
                    <tr>
                        <td colspan="2" class="subheadtd">
                             <span>Email Settings</span>
                        </td>
                    </tr> 
                     <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                            Customized Signup Email  : 
                            </label>
                            </td>
                            <td class="left-side-text-borderless" >
                               {foreach from=$Customized_Signup item="Customized_Signup_item" key="k"} 
                                    <input type="radio"  name="chkCustomized_Signup"  id="chkCustomized_Signup" style="" onclick="ShowTemplateBrowse(this.id,this.value,'{$productdata[0].singupemail}');" class="chkcss" value="{$k}"
                                            {if $IsEdit eq 'yes'}
                                                {if $productdata[0].singupemail eq $k}
                                                   checked=""
                                                {/if} 
                                           {elseif $IsEdit eq ''}
                                                 {if $k eq 'DEFAULT'}
                                                    checked=""
                                                 {/if}
                                                 {if $k eq 'CUSTOMIZEDEMAIL'}
                                                      disabled="disabled"  
                                                 {/if}
                                           {elseif $post.chkCustomized_Signup eq $k} 
                                                  checked=""
                                           {/if}>
                                    {$Customized_Signup_item}<br/>
                                {/foreach}
                               <label id="lblSignupTemplate" style="display:none"></label>
                               
                               <input type="button" class="btncss" id="btnSignupTemplate" name="btnSignupTemplate" style="display:none" value="Add Template" onclick="window.open('admin_product_canned_email_m.php?emailfor=chkCustomized_Signup&pid={$productdata[0].updateproductid}','','dependent=1,scrollbars=1,directories=0,height=600,width=1000,location=0');">
                               
                               <input type="hidden" id="hdnSignupTemplateID" name="hdnSignupTemplateID" {if $productdata[0].singupemail neq 'DEFAULT'}value="{$productdata[0].singupemail_cannedemailid}"{/if}>
                               
                                <input type="button" class="btncss" id="btnEditSignupTemplate" name="btnEditSignupTemplate" style="display:none" value="Edit Template" onclick="window.open('admin_product_canned_email_m.php?action=edit&emailfor=chkCustomized_Signup&pid={$productdata[0].updateproductid}&id='+document.getElementById('hdnSignupTemplateID').value,'','dependent=1,scrollbars=1,directories=0,height=600,width=1000,location=0');">
                               
                               <div class="comment-div" style="width:540px">
                                 Customer can receive automatic Emails after sign up. If there is a template entered on the MembersGear Email system the sign up Email will be ignored for this product.
                                  
                                </div>
                            </td>
                    </tr>
                    
                    {if $IsEdit neq '' and $productdata[0].singupemail eq 'CUSTOMIZEDEMAIL'}
                          {php}
                                echo "<script language=javascript>";
                                //echo "SetEmailTemplateID();";
                                echo "SetEmailTemplateID('chkCustomized_Signup',document.getElementById('hdnSignupTemplateID').value,'');";
                                //echo "alert('hehe');";
                                echo "</script>";
                          {/php}
                    {/if}
                    
                    <tr>    
                        <td class="right-side-text-borderless space" valign="top" style=""><label>
                              Expire Notifications : 
                            </label>
                            </td>
                            <td class="left-side-text-borderless" >
                               {foreach from=$Expire_Notifications item="Expire_Notificationsitem" key="k"} 
                                    <input type="radio"  name="chkexpnotification"  id="chkexpnotification" style="" onclick="ShowTemplateBrowse(this.id,this.value,'{$productdata[0].expirationemail}');" class="chkcss" value="{$k}"
                                    {if $IsEdit eq 'yes'}
                                                {if $productdata[0].expirationemail eq $k}
                                                   checked=""
                                                {/if} 
                                    {elseif $IsEdit eq ''}
                                                 {if $k eq 'DEFAULT'}
                                                    checked=""
                                                 {/if}
                                                 {if $k eq 'CUSTOMIZEDEMAIL'}
                                                      disabled="disabled"  
                                                 {/if}
                                    {elseif $post.chkCustomized_Signup eq $k} 
                                                  checked=""
                                    {/if}
                                    
                                    >{$Expire_Notificationsitem}<br/>
                                {/foreach}
                                <label id="lblExpireNotificationTemplate" style="display:none"></label>
                                
                                <input type="button" class="btncss" id="btnExpireNotificationTemplate" name="btnExpireNotificationTemplate" style="display:none" value="Add Template" onclick="window.open('admin_product_canned_email_m.php?emailfor=chkexpnotification&pid={$productdata[0].updateproductid}','','dependent=1,scrollbars=1,directories=0,height=600,width=1000,location=0');">
                                
                                <input type="hidden" id="hdnExpireNotifyTemplateID" name="hdnExpireNotifyTemplateID" {if $productdata[0].expirationemail neq 'DEFAULT'}value="{$productdata[0].expirationemail_cannedemailid}"{/if}>
                                
                                <input type="button" class="btncss" id="btnEditExpireNotificationTemplate" name="btnEditExpireNotificationTemplate" style="display:none" value="Edit Template" onclick="window.open('admin_product_canned_email_m.php?action=edit&emailfor=chkexpnotification&pid={$productdata[0].updateproductid}&id='+document.getElementById('hdnExpireNotifyTemplateID').value,'','dependent=1,scrollbars=1,directories=0,height=600,width=1000,location=0');">
                                
                               <div class="comment-div" style="width:540px">
                                  Customer can receive automatic Emails after the subscription expires. If there is a template entered on the MembersGear Email system the expiration Email will be ignored for this product.
                                   
                                </div>
                            </td>
                    </tr>
                    {if $IsEdit neq '' and $productdata[0].expirationemail eq 'CUSTOMIZEDEMAIL'}
                          {php}
                                echo "<script language=javascript>";
                                //echo "SetEmailTemplateID();";
                                echo "SetEmailTemplateID('chkexpnotification',document.getElementById('hdnExpireNotifyTemplateID').value,'','');";
                                //echo "alert('hehe');";
                                echo "</script>";
                          {/php}
                    {/if}
                   
                     <tr >
                            <td class="right-side-text-borderless space" valign="top" style=""><label>
                             Set as "One-Time-Offer" 
<br/>Product: <label class="star">*</label> 
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                             <select id="isonetimeoffer" name="isonetimeoffer" class="selectcss"  style="width: 560px ! important;" >
                                    <option value=''>select..</option>
                                    {foreach from=$laisonetimeoffer item="laisonetimeofferitem" key="k"} 
                                         <option value="{$k}"
                                        {if $IsEdit eq 'yes'}
                                                {if $productdata[0].isonetimeoffer eq $k}
                                                   selected=""
                                           {/if} 
                                           {elseif $IsEdit eq ''}
                                                   selected=""   
                                           {elseif $post.isonetimeoffer eq $k} 
                                                   selected=""
                                           {/if}>{$laisonetimeofferitem}</option>
                                    {/foreach}                                    
                                    </select> 
                                    <!--<select style="width: 560px ! important;" class="selectcss" name="isonetimeoffer" id="isonetimeoffer">
                                         <option value="">select..</option>
                                         <option  value="1">Yes</option>
                                         <option value="0" selected="selected">No</option>
                                                                        
                                    </select>--> 
                                     <div class="comment-div" style="width:540px">
                                   Set to Yes if this product is to be offered as a One-Time-Offer after purchase of another product. Only use this feature when original product is free, otherwise use the "One-Click-Upsell" tool. Note, if One-Time-Offer is disabled in global configuration then this setting is not applicable.
                                </div>   
                                 </td>
                             </tr>
              
                    {*<tr>
                                <td  class="right-side-text-borderless space"><label>Is Approved</label> </td>
                                <td class="left-side-text-borderless">
                                     <input class="chkcss" type="checkbox" id="isapproved" value="1" name="isapproved"
                                     {if $IsEdit eq 'yes'}
                                            {if $productdata[0].isapproved eq "1"}
                                                checked=""
                                           {/if} 
                                     {elseif $IsEdit eq ''}
                                                checked=""
                                     {elseif $post.isapproved eq "1"} 
                                      checked=""   
                                      {/if}/> 
                                </td>
                      </tr>  *}
                      <input type="hidden" id="hdn_isapproved" name="hdn_isapproved" value="{if $IsEdit eq 'yes'}{$productdata[0].isapproved}{else}{$post.hdn_isapproved}{/if}">
                       <input type="hidden" id="hdn_isactive" name="hdn_isactive" value="{if $IsEdit eq 'yes'}{$productdata[0].isactive}{else}{$post.hdn_isactive}{/if}">
                     {*  <tr>
                                <td  class="right-side-text-borderless space"><label>Is Default</label> </td>
                                <td class="left-side-text-borderless">
                                     <input class="chkcss" type="checkbox" id="isdefault" value="1" name="isdefault"
                                     {if $IsEdit eq 'yes'}
                                            {if $productdata[0].isdefault eq "1"}
                                                checked=""
                                           {/if} 
                                     {elseif $IsEdit eq ''}
                                                checked=""
                                     {elseif $post.isdefault eq "1"} 
                                      checked=""   
                                      {/if}/> 
                                </td>
                      </tr>*}
                      {if $IsEdit eq 'yes'}
                       <tr>
                                <td  class="right-side-text-borderless space"><label>Delete Product</label> </td>
                                <td class="left-side-text-borderless">
                                     <input class="chkcss" type="checkbox" id="isdeleted" value="1" name="isdeleted"
                                     {if $IsEdit eq 'yes'}
                                            {if $productdata[0].isdeleted eq "1"}
                                                checked=""
                                           {/if} 
                                     {elseif $IsEdit eq ''}
                                                checked=""
                                     {elseif $post.isdeleted eq "1"} 
                                      checked=""   
                                      {/if}/> 
                                </td>
                      </tr>
                      {/if}
                      
                    
                       <tr>
                            <td colspan="2"> 
                                    <div class="horizontal-line">
                                  &nbsp;
                                    </div>
                            </td>
                    </tr> 
                {* updated by nikunj for listmailpro integration *}     
                   {if $LIST_MAIL_PRO eq 'true'} 
                        
                        
                         <tr>
                                <td class="right-side-text-borderless space" valign="top" style=""><label>
                                 Select ListMailPro List : <label class="star">*</label> 
                                </label>
                                </td>
                                <td class="left-side-text-borderless">
                                  <select id="listmailpro" name="listmailpro" class="selectcss"  style="width: 560px ! important;" >
                                       {if $IsEdit eq 'yes'}
                                          {if $listmailEdit eq 'null'}
                                             <option value='' selected>select..</option>
                                           {else}
                                              <option value=''>select..</option>
                                          {/if}
                                       {else}
                                          <option value=''>select..</option>       
                                       {/if}  
                                         <option value='0' {if $IsEdit eq 'yes'} {if $listmailEdit eq '0'} selected {/if}{/if}>No intigration to this product</option> 
                                        {if $listMailProResult neq 'false'}
                                            {foreach from=$listMailProResult item="listMailProResultItem" key="k"} 
                                                 <option value="{$listMailProResult[$k].listnum}"  {if $IsEdit eq 'yes'} {if $listmailEdit eq $listMailProResult[$k].listnum} selected {/if}{/if} >{$listMailProResult[$k].title}</option>
                                            {/foreach} 
                                        {/if}                                    
                                  </select>  
                                          
                                     </td>
                         </tr>                
                        
                  {/if}  
                   {* ************************************************** *}                         
     
                {* updated by nikunj for aweber integration *}     
                   {if $AWEBER eq 'true'} 
                     
                        
                         <tr>
                                <td class="right-side-text-borderless space" valign="top" style=""><label>
                                 Aweber listname :
                                </label>
                                </td>
                                <td class="left-side-text-borderless">
                                 <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].aweber_listname}{else}{$post.txtaweber}{/if}" id="txtaweber" name="txtaweber"   class="txtcss" style="width: 553px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';">         
                               </td>
                         </tr>                
                                                                                                                
                  {/if}  
                   {* ************************************************** *}     
                {* updated by nikunj for getresponse integration *}     
                   {if $GETRESPONSE eq 'true'} 
                  
                        
                         <tr>
                                <td class="right-side-text-borderless space" valign="top" style=""><label>
                                 Getresponse listname :
                                </label>
                                </td>
                                <td class="left-side-text-borderless">
                                 <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].getresponse_listname}{else}{$post.txtgetresponse}{/if}" id="txtgetresponse" name="txtgetresponse"   class="txtcss" style="width: 553px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';">         
                               </td>
                         </tr>                
                                                                                                                
                  {/if}  
                   {* ************************************************** *}
                   
                 {* updated by nikunj for imnicamail integration *}     
                   {if $IMNICAMAIL eq 'true'} 
                  
                        
                         <tr>
                                <td class="right-side-text-borderless space" valign="top" style=""><label>
                                 Imnicamail List Id :
                                </label>
                                </td>
                                <td class="left-side-text-borderless">
                                 <input type="text" value="{if $IsEdit eq 'yes'}{$productdata[0].imnica_listname}{else}{$post.txtimnicamail}{/if}" id="txtimnicamail" name="txtimnicamail"   class="txtcss" style="width: 553px ! important;" onmouseover="className='txthover';" onmouseout="className='txtcss';">         
                               </td>
                         </tr>                
                                                                                                                
                  {/if}  
                   {* ************************************************** *}            
                   <tr>
                         <td>&nbsp;</td> 
                         <td class="buttontd">
                                <input type="submit" class="btncss" name="save" {if $IsEdit eq 'yes'}value="Save"{else}value="Submit"{/if}>
                                {if $productdata[0].islinkedwithpaygear neq 0}{if $IsEdit eq 'yes'}&nbsp;&nbsp;&nbsp;<input onclick="javascript:Formsubmit();" type="button" class="btncss" name="UpdatefromPaygear" value="Update from Paygear" >{/if}{/if}&nbsp;&nbsp;&nbsp; 
                                <input type="button" class="btncss" name="btnBack" value="Cancel" {if $IsEdit neq 'yes'}onclick="javascript:window.history.go(-1);"{else}onclick="goprevpage('admin_product_v.php','{$lsprevpageqs}')"{/if}/>
                               <input type="hidden" id="hdn_UpdatefromPaygear" name="hdn_UpdatefromPaygear" value="">
                               <input type="hidden"  id="hdn_prevpage_qs" name="hdn_prevpage_qs" value="{$lsprevpageqs}">
                         </td>
                    </tr>
              
              </table>
            
            
        </div>
           </form>
             {literal}
           <script language="JavaScript" type="text/javascript">
                 
                 var isedit='{/literal}{$IsEdit}{literal}';
                 var isLinkedProduct='{/literal}{$islinkedProduct}{literal}';
                 
                 
                   
                 var iseditrecurring ='{/literal}{$productdata[0].issubscription}{literal}'; 
                 var isliftime='{/literal}{$productdata[0].islifetime}{literal}';
                 var duration_type='{/literal}{$productdata[0].duration_type}{literal}';       
                //update by nikunj for listmail pro
                 var listmailpro ='{/literal}{$LIST_MAIL_PRO}{literal}'; 
                
                
                 if(document.getElementById('linkwithpaygear').value==1)
                   toggleVisibility1('1');
                 else
                   toggleVisibility1('0');  
                
                 //var todaydate='{/literal}{$todaydate}{literal}';   
                
                 function goprevpage(pagename,qs)
                 {
                   location.href=pagename+qs;
                 
                 } 
                 if(isedit=='yes')
                 {
                     
                     if(trim(document.getElementById('txtprodurl').value)=="")
                        document.getElementById('txtprodurl').value="";
                     SetPaymentProcessorsEdit(document.getElementById('chkrecurring'));
                     if(iseditrecurring=='1')
                     {
                        Change(document.getElementById('chkrecurring').checked,'tr1');
                        Change(document.getElementById('chkrecurring').checked.checked,'tr2');
                        Change(document.getElementById('chkrecurring').checked.checked,'tr3');
                        Change(document.getElementById('chkrecurring').checked.checked,'tr4');
                        Change(document.getElementById('chkrecurring').checked.checked,'tr5');
                     
                     }
                     if(isliftime=="0")
                     {
                       
                       document.getElementById('durationtr').style.display='';
                     }
                     if(duration_type=="Exact date (mm-dd-yyyy)")
                     {
                           document.getElementById('txtlifetimeduration').readOnly=true; 
                           document.getElementById('calendardiv').style.display='';
                     
                     }
                 }
                 function setexactdate()
                 {                                      
                       var selvalue=document.getElementById('ddlliftimeduration').options[document.getElementById('ddlliftimeduration').selectedIndex].value;
                      document.getElementById('txtlifetimeduration').value='';
                   
                       if(selvalue=="Exact date (mm-dd-yyyy)")
                      {
                          document.getElementById('txtlifetimeduration').readOnly=true;
                          document.getElementById('calendardiv').style.display='';
                      
                      }
                      else
                      {
                          
                             document.getElementById('txtlifetimeduration').readOnly=false;
                             document.getElementById('calendardiv').style.display='none'; 
                      
                      }
                 }
                 function setlifetimeduration()
                 {
                       var selvalue=document.getElementById('product_lftime').options[document.getElementById('product_lftime').selectedIndex].value;
                     // alert(selvalue);
                     // document.getElementById('txtlifetimeduration').value='';
                      if(selvalue=="0")
                      {
                          //document.getElementById('txtlifetimeduration').readOnly=true;;
                          document.getElementById('durationtr').style.display='';
                      
                      }
                      else
                      {
                          //document.getElementById('txtlifetimeduration').readOnly=false;     
                          document.getElementById('durationtr').style.display='none'; 
                      
                      }
                 }
                 
                 function checkuncheckrecurring()
                 {
                      var frm = document.forms["frmproduct"];
                      var result2;
                       result2= frm.chkrecurring.checked;
                       if(result2==true)
                       {
                            for(i=1;i<=5;i++)
                            {
                                document.getElementById('tr'+i).style.display='block';
                            }
                       }
                       else if(result2==false)
                       {
                            for(i=1;i<=5;i++)
                            {
                                document.getElementById('tr'+i).style.display='none';
                            }
                       
                       }
                 
                 
                 }
                  function Change(value,element)
                  {
                        elems = document.getElementsByTagName('TR');
                       // alert(elems);
                         for (j=0;j<elems.length;j++)
                         {
                             
                             
                             if (element == elems[j].getAttribute("element"))
                             {
                                 elems[j].style.display = (value == false)?"none":"";
                             }
                         }
                     
                  }
                  function checkProductpaymentoption()
                  {
                       var chkPaypal=document.getElementById('chkIsPaypalAvailable');
                       var chkAuthorize=document.getElementById('chkIsAuthorizeAvailable');
                       var chkGoogleCheckout=document.getElementById('chkIsGoogleCheckoutAvailable');
                       
                     ////////////////////////Paypal//////////////////////////////////
                     if(chkPaypal.checked==false && chkAuthorize.checked==false &&  chkGoogleCheckout.checked==false)
                     {
                              return false; 
                     
                     }
                     else
                     {
                            return true; 
                     }
                     
                  }
                  function displayrecurringpriceonsubmit()
                  {
                    var RecurringTimes1 = document.getElementById('txtrecuuringtime');
                    if(parseFloat(RecurringTimes1.value) == 1)
                     {  
                        return false;
                     }
                     else
                     {
                       return true;
                     }


                 }
                 function checkexactdate()
                 {
                 
                     var exactdate=document.getElementById('txtlifetimeduration').value;
                     var exactdate1=exactdate.replace('-','/');  
                     exactdate=exactdate1.replace('-','/');
                     var todaydate = new Date();  
                     var exactdateobj = new Date(exactdate);
                     if(exactdateobj>todaydate)
                     {
                       return true;
                     
                     }
                     else
                     {
                       
                          return false; 
                     }                
                 }
                 function checkpricegroupid()
                 {
                    var result=true;
                    var pricegroupid=document.getElementById('txtpricegpid').value;
                    for(k=0;k<pricegroupid.length-1;k++)
                    {
                        if(pricegroupid[k]==" ")
                        {
                            return false;
                        }
                        else
                        {
                           result=true;
                        }
                     
                    
                    }
                    var pricegroupid = pricegroupid.split(",") 
                   //alert(pricegroupid.length);
                   if(pricegroupid.length>0)
                    {
                        for(i = 0; i < pricegroupid.length; i++)
                        {
                           val = pricegroupid[i].replace(/^\s+|\s+$/g,"");//trim
                           if(eval(val.length)!= 0) 
                           { 
                               if(!(isNaN(pricegroupid[i]))==false)
                               {
                                 
                                 result=false;   
                                 break 
                               }
                               else
                               {  
                                  result=true;
                               }
                           }
                           else
                           {
                                result=false;   
                                 break 
                           }
                        }
                    }
                    else
                    {
                          // alert(!(isNaN(pricegroupid))); 
                          if(!(isNaN(pricegroupid))==false)
                           {
                             result=false; 
                             
                           }
                           else
                           {
                              result=true;
                           } 
                    
                    }
                    return result;
 
                 
                 }
                function weburlValidation()
                {
                  var frm = document.forms["frmproduct"];
                  var foc=1;
                  var error="";
                   var focus='';
                  if(!is_valid_URL(frm.txtsalepageurl.value))
                  {
                    
                        error += 'Please enter valid Sales Page Url.'+'\r\n'; 
                        if(foc==1)
                        {
                           
                            focus='txtsalepageurl';
                            foc=0;
                        }
                   
                  }
                  if(!is_valid_URL(frm.txtthkpageurl.value))
                  {
                       error += 'Please enter valid Thank You URL.'+'\r\n'; 
                            if(foc==1)
                            {
                               
                                focus='txtthkpageurl';
                                foc=0;
                            }
                  } 
                   /*if(!is_valid_URL(frm.txtprodurl.value))
                   {
                       error += 'Please enter valid Product Url.'+'\r\n'; 
                            if(foc==1)
                            {
                               
                                focus='txtprodurl';
                                foc=0;
                            }
                    }*/
                      if(frm.txtipnurl.value!='')
                    {
                        if(!is_valid_URL(frm.txtipnurl.value+"/"+frm.txtipnurl1.value))
                       {
                           error += 'Please enter valid IPN Url.'+'\r\n'; 
                                if(foc==1)
                                {
                                   
                                    focus='txtipnurl';
                                    foc=0;
                                }
                        }
                    
                    }
                 if(document.getElementById('product_lftime').options[document.getElementById('product_lftime').selectedIndex].value=='0' &&
                    document.getElementById('ddlliftimeduration').options[document.getElementById('ddlliftimeduration').selectedIndex].value=='Exact date (mm-dd-yyyy)')
                 {
                                
                   if(checkexactdate()==false)
                   {         
                        error += 'Duration must be greater than current date.'+'\r\n'; 
                        if(foc==1)
                        {
                                     //var exactdate=document.getElementById('txtlifetimeduration').value;     
                                    focus='txtlifetimeduration';
                                    foc=0;
                        }    
                   }
                 }
                    if(checkProductpaymentoption()==false)
                    {
                    
                           error += 'Please select atleast one payment processor.'+'\r\n'; 
                            if(foc==1)
                            {    
                            //chkIsAuthorizeAvailable
                              var chkPaypal=document.getElementById('chkIsPaypalAvailable');
                              var chkAuthorize=document.getElementById('chkIsAuthorizeAvailable');
                              var chkGoogleCheckout=document.getElementById('chkIsGoogleCheckoutAvailable');
                             
                              if(chkPaypal.disabled==false)
                              {
                                focus='chkIsPaypalAvailable';
                              }  
                              else if(chkAuthorize.disabled==false)
                              {
                                focus='chkIsAuthorizeAvailable';
                              }  
                              else if(chkGoogleCheckout.disabled==false)
                              {
                                focus='chkIsGoogleCheckoutAvailable';
                              }
                              else
                              {
                                focus='div1';
                              }  
                              foc=0;
                            }
                    
                    }
                     if(document.getElementById('chkrecurring').checked==true)
                     {
                           
                          if(displayrecurringpriceonsubmit()==false)
                            {
                                 error +='Invalid value of times of recur. Please enter value 0 or greater than 1.'+'\r\n';  
                                  if(foc==1)
                                  {
                                    focus='txtrecuuringtime';
                                    foc=0;     
                                  }
                            }
                     }
                     if(checkpricegroupid()==false)
                     {
                     
                         error +='Please enter valid Price Group ID.'+'\r\n';  
                         if(foc==1)
                         {
                                    focus='txtpricegpid';
                                    foc=0;     
                         }
                     
                     }
                  
                   /*var chks = document.getElementsByName('Categories[]');
                   var totalCatChecked=0;
                   for (var i = 0; i < chks.length; i++)
                    {
                        
                        if (chks[i].checked)
                        {

                           totalCatChecked=totalCatChecked+1;
                            
                        }
                      
                    }
                    if (totalCatChecked!=2)
                    {
                            
                         error +='Please select Product Categories.'+'\r\n';  
                         if(foc==1)
                         {
                                    focus='Categories';
                                    foc=0;     
                         }   
                                

                    } */
                    
                    if(error!='')
                     {
                           alert(error);
                           var FocusControl = document.getElementById(focus);
                           FocusControl.focus();
                            
                            return false;
                     }
                     else
                     {
                              return true;
                     }  
                    
                }
                
                
                function isMainUpsellProduct()
                {
                   /* free product hide show */
       
                   
                   var productPrice=document.frmproduct.txtprice.value;
                   var FloatProductPrice=parseFloat(productPrice);
                   var $jn = jQuery.noConflict();  
                  if(FloatProductPrice<=0)
                   {
                     $jn("#linkfreeProducts").fadeOut('show');
                   }
                   else 
                    $jn("#linkfreeProducts").fadeIn('show');
                    
                    /* upsell setting*/
                   var isedit_status='{/literal}{$IsEdit}{literal}';               
                   if(isedit_status=='yes')
                   var isMainUpsellProdict='{/literal}{$isMainUpsellProduct}{literal}';
                   if(isMainUpsellProdict=='true')
                    {
                      if(FloatProductPrice<=0)
                        alert("If you set price to $0, upsell flow for this product will be disabled.")
                    }
                
                }
                
                function isLinkedInProduct(){
                
                   var productPrice=document.frmproduct.txtprice.value;
                   var FloatProductPrice=parseFloat(productPrice);
                  if(isLinkedProduct=='yes' && FloatProductPrice>0)
                  {
                     alert('This product is free and linked with other product.changing price greater than 0 will remove this product from linked product.');
                     return true;
                   }
                }
                
                function is_valid_URL(url) 
                  {
                   // alert(url);
                    //var regexp = "/^(((ht|f)tp(s?))\:\/\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\/:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$/";
                    var regexp=/https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?/;
                    // var regexp = /^(http[s]?:\/\/|ftp:\/\/)?(www\.)?[a-zA-Z0-9-\.]+\.(com|net|org|edu|mil|gov|arpa|biz|aero|name|coop|info|pro|museum|tv|([a-z]{2}))$/;
                     
                     return(regexp.test(url));
                   }
                  var frmvalidator  = new Validator("frmproduct");

                  frmvalidator.EnableMsgsTogether();
                  //frmvalidator.EnableOnPageErrorDisplaySingleBox();

                  frmvalidator.addValidation("txttitle","req","Please enter Product Name.");
                  frmvalidator.addValidation("txttitle","maxlen=100",    "Max length for Product Name is 100 character.");
              //    frmvalidator.addValidation("txttitle","alpha","Alphabetic chars only");
                  
                  frmvalidator.addValidation("txtdesc","req","Please enter Product Description.");
                  frmvalidator.addValidation("txtdesc","maxlen=4000","Max length for Product Description is 4000 character.");
                  
                  frmvalidator.addValidation("linkwithpaygear","dontselect=''","Please select  Is Linked with PayGear.com.");  
                
                  frmvalidator.addValidation("txtsalepageurl","req","Please enter Sales Page Url.");
                  frmvalidator.addValidation("txtsalepageurl","maxlen=1000",    "Max length for Sales Page Url is 1000 character.");
                  frmvalidator.addValidation("txtthkpageurl","req","Please enter Thank You Url.");
                  frmvalidator.addValidation("txtthkpageurl","maxlen=1000",    "Max length for Sales Thank You URL is 1000 character.");
                  
                  frmvalidator.addValidation("txtkeyword","req","Please enter Keywords.");      
                  frmvalidator.addValidation("txtkeyword","maxlen=200","Max length for Keywords is 45.");
                  
                  frmvalidator.addValidation("txtprice","req","Please enter Price.");   
                  frmvalidator.addValidation("txtprice","decimal","Enter only digits in Price."); 
                   frmvalidator.addValidation("txtprice","lt=100000","Max length for Price is 99999.");    
                  
                  frmvalidator.addValidation("product_lftime","dontselect=''","Please select product life time."); 
                  
                  frmvalidator.addValidation("ddlliftimeduration","dontselect=''","Please Select Duration type.","document.getElementById('product_lftime').options[document.getElementById('product_lftime').selectedIndex].value=='0'");
                  frmvalidator.addValidation("txtlifetimeduration","req","Please Enter Duration.","document.getElementById('product_lftime').options[document.getElementById('product_lftime').selectedIndex].value=='0'");  
                  frmvalidator.addValidation("txtlifetimeduration","num","Please valid Duration.","document.getElementById('ddlliftimeduration').options[document.getElementById('ddlliftimeduration').selectedIndex].value!='Exact date (mm-dd-yyyy)'");
                  frmvalidator.addValidation("txtlifetimeduration","gt=0","Please enter Duration between 1 to 999.","document.getElementById('ddlliftimeduration').options[document.getElementById('ddlliftimeduration').selectedIndex].value=='Days'");
                  frmvalidator.addValidation("txtlifetimeduration","lt=1000","Please enter Duration between 1 to 999.","document.getElementById('ddlliftimeduration').options[document.getElementById('ddlliftimeduration').selectedIndex].value=='Days'");  
                  frmvalidator.addValidation("txtlifetimeduration","gt=0","Please enter Duration between 1 to 50.","document.getElementById('ddlliftimeduration').options[document.getElementById('ddlliftimeduration').selectedIndex].value=='Months'");
                  frmvalidator.addValidation("txtlifetimeduration","lt=51","Please enter Duration between 1 to 50.","document.getElementById('ddlliftimeduration').options[document.getElementById('ddlliftimeduration').selectedIndex].value=='Months'");  
                  frmvalidator.addValidation("txtlifetimeduration","gt=0","Please enter Duration between 1 to 10.","document.getElementById('ddlliftimeduration').options[document.getElementById('ddlliftimeduration').selectedIndex].value=='Years'");
                  frmvalidator.addValidation("txtlifetimeduration","lt=11","Please enter Duration between 1 to 10.","document.getElementById('ddlliftimeduration').options[document.getElementById('ddlliftimeduration').selectedIndex].value=='Years'");  
                
                  //frmvalidator.addValidation("txtprice","maxlen=5",    "Max length for Price is 5 character.");
                  
                     
                  frmvalidator.addValidation("txtduration","req","Please enter Charge Period.","document.getElementById('chkrecurring').checked==true"); 
                  frmvalidator.addValidation("txtduration","num","Please enter valid Charge Period.","document.getElementById('chkrecurring').checked==true"); 
                  frmvalidator.addValidation("txtduration","gt=6","Please enter Charge Period between 7 to 365.","document.getElementById('chkrecurring').checked==true && document.getElementById('ddlduration').options[document.getElementById('ddlduration').selectedIndex].value==1" );
                  frmvalidator.addValidation("txtduration","lt=366","Please enter Charge Period between 7 to 365.","document.getElementById('chkrecurring').checked==true  && document.getElementById('ddlduration').options[document.getElementById('ddlduration').selectedIndex].value==1");  
                  frmvalidator.addValidation("txtduration","gt=0","Please enter Charge Period between 1 to 12.","document.getElementById('chkrecurring').checked==true && document.getElementById('ddlduration').options[document.getElementById('ddlduration').selectedIndex].value==2" );
                  frmvalidator.addValidation("txtduration","lt=13","Please enter Charge Period between 1 to 12.","document.getElementById('chkrecurring').checked==true  && document.getElementById('ddlduration').options[document.getElementById('ddlduration').selectedIndex].value==2");  
                  frmvalidator.addValidation("ddlduration","dontselect=''","Please enter Charge Period Type.","document.getElementById('chkrecurring').checked==true && document.getElementById('txtduration').value!=''"); 
                  
                  frmvalidator.addValidation("txtrecuuringtime","req","Please enter Times of recur.","document.getElementById('chkrecurring').checked==true"); 
                  frmvalidator.addValidation("txtrecuuringtime","num","Please enter valid Times of recur.","document.getElementById('chkrecurring').checked==true");
                  
                  frmvalidator.addValidation("txttotprice1","decimal","Enter only digits in  Product Trial Price.");
                  
                  frmvalidator.addValidation("txttotduration1","num","Please enter valid Product Trial Period.","document.getElementById('chkrecurring').checked==true && document.getElementById('txttotprice1').value!=''"); 
                  frmvalidator.addValidation("txttotduration1","gt=0","Please enter Product Trial Period between 1 to 365.","document.getElementById('chkrecurring').checked==true && document.getElementById('txttotprice1').value!='' && document.getElementById('ddltotduration1').options[document.getElementById('ddltotduration1').selectedIndex].value==1");
                  frmvalidator.addValidation("txttotduration1","lt=366","Please enter Product Trial Period between 1 to 365.","document.getElementById('chkrecurring').checked==true && document.getElementById('txttotprice1').value!='' && document.getElementById('ddltotduration1').options[document.getElementById('ddltotduration1').selectedIndex].value==1");  
                   frmvalidator.addValidation("txttotduration1","gt=0","Please enter Product Trial Period between 1 to 12.","document.getElementById('chkrecurring').checked==true && document.getElementById('txttotprice1').value!='' && document.getElementById('ddltotduration1').options[document.getElementById('ddltotduration1').selectedIndex].value==2");
                  frmvalidator.addValidation("txttotduration1","lt=13","Please enter Product Trial Period between 1 to 12.","document.getElementById('chkrecurring').checked==true && document.getElementById('txttotprice1').value!='' && document.getElementById('ddltotduration1').options[document.getElementById('ddltotduration1').selectedIndex].value==2");  
                  frmvalidator.addValidation("ddltotduration1","dontselect=''","Please enter  Product Trial Type.","document.getElementById('chkrecurring').checked==true && document.getElementById('txttotduration1').value!='' &&  document.getElementById('txttotprice1').value!=''"); 
                 
                  frmvalidator.addValidation("txtprodurl","req","Please select Product Folder.");
                  //frmvalidator.addValidation("filename","req","Please enter Filename.");
                  frmvalidator.addValidation("txtprodurl","maxlen=500",    "Max length for Product Url is 500 character.");
                  
                  frmvalidator.addValidation("txtsortorder","req","Please enter Sort order.");
                  frmvalidator.addValidation("txtsortorder","num","Please enter valid Sort order."); 
                  frmvalidator.addValidation("txtsortorder","maxlen=4",    "Max length for Sort order is 4 digit.");
                  
                  frmvalidator.addValidation("txtpricegpid","req","Please enter Price Group ID.");
                  frmvalidator.addValidation("txtpricegpid","maxlen=10","Max length for Price Group ID  is 10 character.");
                
                 
                  //frmvalidator.addValidation("ddlrequire_other","dontselect=0","Please select  Require another subscription.");  
                 // frmvalidator.addValidation("prevent_if_other","dontselect=0","Please select  Disallow subscription.");
                  frmvalidator.addValidation("isonetimeoffer","dontselect=''",'Please select Set as "One-Time-Offer" Product.'); 
                 
                 //update by nikunj for listmail pro intigration
                  if(listmailpro=='true')
                     frmvalidator.addValidation("listmailpro","dontselect=''",'Please select listMailPro Product List.'); 
                 
                  frmvalidator.setAddnlValidationFunction("weburlValidation");
                 
                 if(isedit=='yes')
                 { 
                        var prodString='{/literal}{$prodCate}{literal}';
                        myArray = prodString.split(",");
                        var len=myArray.length;
                        var inputs = document.frmproduct.Categories.length;
                       
                        for(var j=0;j<len;j++)
                         {
                             for(var i=0;i<inputs;i++)
                            {
                                if(myArray[j]== document.frmproduct.Categories[i].value )
                                 {
                                
                                    document.frmproduct.Categories[i].checked=true;
                                 }
                                
                            }
                          
                         }
                 }
                  function Formsubmit()
                  {                  
                      document.getElementById('pgdiv').style.display='';  
                    document.frmproduct.action='admin_product_m.php?action=edit'; 
                    document.getElementById('hdn_UpdatefromPaygear').value="Update from Paygear";
                  
                    document.frmproduct.submit();
               
         }
         
         function showCheckUncheckMessage(htmlCtr)
          {
              var $j = jQuery.noConflict();  
              if(htmlCtr.checked==true)
             {
               alert('Only check if you are setting up the link to your product under the protect / drip system otherwise this product will not appear on signup page or under your subscriptions.');
               if( $j.trim($j('#txtprodurl').val()) == '') 
                {
                    $j('#txtprodurl').val('/your-folder/your-product.html');
                }
                
                $j("#productUrlSetting").fadeOut('slow');
                return true;
               
             }
             else
              {
                   if( $j.trim($j('#txtprodurl').val()) == '' ||  $j.trim($j('#txtprodurl').val())=='/your-folder/your-product.html')
                    {
                       $j('#txtprodurl').val('') ;
                    }
                    $j("#productUrlSetting").fadeIn('slow');
              
              }
          
          }
                      
 </script>
                                           
           {/literal}
    </div>
</div>
</div>
{$ADMIN_FOOTER}
Return current item: MembersGear