Location: PHPKode > projects > MembersGear > membersgear/templates/admin_drip_system_m.tpl
{$ADMIN_HEADER}
<div id="content" class="setdiv">
    {if $msg neq ''}
            <div {if $err eq 'true'} class="errormsg" {else} class="succmsg" {/if} style="width:500px">{$msg}</div>
           {/if} 
    <div id="full-contentdiv">
          <div class="righttop">
                <h2><center>
                     {if $IsEdit eq 'yes'}                   
                         Edit Protected / Drip System File
                     {else}
                         Add Protected / Drip System File
                     {/if}   
                    </center></h2>                                      
            </div>
         <div class="whole-page clear">
                
            <!-- Place your content here -->
                {if $IsEdit eq 'yes'}
                     {assign var="action" value="update"}
                {else}
                   
                    {assign var="action" value="insert"}
                  
                {/if}

                    <form name="frmproduct" method="post" action="admin_drip_system_m.php?action={$action}">

                    <div class="formformat">      
                         <table border="0" align="center"  width="88%" cellpadding="0" cellspacing="0" >    

                           <tbody>
                           
                           <tr>

                                <td class="right-side-text"><label>File Name <label class="star">*</label></label></label></td>

                                <td class="left-side-text">

                                <input type="text" name="filename" id="filename"   class="txtcss"  size="45" {if $IsEdit eq 'yes'} value="{$filename}" {else}value="{$filename}" {/if}> 

                                </td>
                                
                            </tr>

                             <tr>

                                <td class="right-side-text"><label>File Url <label class="star">*</label></label></label></td>

                                <td class="left-side-text">

                                <input type="text" name="txtprodurl" id="txtprodurl"   class="txtcss" readonly size="50" {if $IsEdit eq 'yes'} value="{$file}" {else}value="{$file}" {/if}> 

                                 <input type="button" onclick="window.open('../includes/phptreeview/productUrl.php?url=drip','treeview','height=550,width=600');return false;" value="Browse" {if $IsEdit eq 'yes'} disabled  class="btndisabled"{else}class="btncss" {/if}> 

                                </td>
                                
                            </tr>
                                {if $IsEdit eq 'yes'}<input type="hidden" name="editId" value="{$editId}">{/if}
                
                           

                            <tr>

                                <td class="right-side-text"><label>Required Products Subscription <label class="star">*</label></label></label></td>

                               <td class="left-side-text">

                                  <select name="products[]" id="products"  multiple size="3" class="selectcss" style="width:370px;height:100px">
                                      {foreach from=$products item="prod" key="k"}
                                          <option value="{$k}" {foreach from=$editProducts item=prod1}{if $prod1 eq $k }selected{/if}{/foreach}>{$prod}</option>
                                        {/foreach}
                                    </select>
  
                                </td>

                            </tr>

                            
                       <tr>
                           <td class="right-side-text" ><label>Status</label> <label class="star">*</label></td>
                           <td class="left-side-text" > 
                                <select size="1" class="selectcss"  name="ddlstatus" id="ddlstatus">
                                   <option value="0">Select.</option>
                                  {if $status eq '1'}
                                     <option value="1" selected>Active</option>
                                  {else}
                                      <option value="1">Active</option> 
                                   {/if}
                                   {if $status eq '0'}   
                                     <option  value="0" selected >Inactive</option>
                                   {else}
                                      <option  value="0">Inactive</option>  
                                   {/if}
                                     
                                </select>

                            </td>
                         </tr>
                         
                         <tr>
                            <td class="right-side-text" valign="top" ><label>Display on user's home page <label class="star">*</label>
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="radio" id="showHome" name="showHome" value="1" class="chkcss" {if $show_home eq '1'} checked="" {/if}>Yes
                                <input type="radio" id="showHome" name="showHome" value="0" {if $show_home eq '0'} checked="" {/if}  class="chkcss">No
                            </td>
                         </tr>
                         <tr style="display:none;">
                            <td class="right-side-text" valign="top" ><label>Is this file Free <label class="star">*</label>
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                             {*   <input type="radio" id="isfree" onclick="showHideTracking(this.value)" name="isfree" value="1" class="chkcss" {if $isfree eq '1'} checked="" {/if}>Yes
                                <input type="radio" id="isfree" onclick="showHideTracking(this.value)" name="isfree" value="0" {if $isfree eq '0'} checked="" {/if}  class="chkcss">No*}
                                
                                <input type="hidden" name="isfree" id="isfree" value="0"/>
                                
                            </td>
                         </tr>
                        {*changed by Asmita For Directly display  Tracking Type.*} 
                        {* <tr id="TrackingTypetr" name="TrackingTypetr" style="display:none;">*}
                          <tr id="TrackingTypetr" name="TrackingTypetr" style="">
                            <td class="right-side-text" valign="top" ><label>Traking Type <label class="star">*</label>
                            </label>
                            </td>
                            <td class="left-side-text-borderless">
                                <input type="radio" id="acctye" name="trackType" value="1" onclick="showHideCont(this.value);" class="chkcss" {if $trackType eq '1'} checked="" {/if}>By Day
                                <input type="radio" id="acctye"  name="trackType" onclick="showHideCont(this.value);"  value="2" {if $trackType eq '2'} checked="" {/if}  class="chkcss">By Clicks
                                <input type="radio" id="acctye" name="trackType" onclick="showHideCont(this.value);" value="3" {if $trackType eq '3'} checked="" {/if}  class="chkcss">By Date
                                
                               <div id="byday_div" name="byday_div" style="display:none">
                                    <hr style="width:275px;margin-left:10px;" align="left">
                                    <table style="padding-left:10px;" width="100%">
                                       <tr>
                                         <td valign="top">
                                          <label> Start Day</label> <label class="star">*</label> 
                                         </td>  
                                         <td>
                                            <input type="text" name="startday" id="startday"   class="txtcss"  size="10" {if $IsEdit eq 'yes'} value="{$startday}" {else}value="{$startday}" {/if}> 
                                            <br/>(e.g access this resource available from day '2'.)
                                         </td>
                                       </tr>
                                       <tr>
                                         <td valign="top">
                                          <label>End Day </label><label class="star">*</label> 
                                         </td>  
                                         <td>
                                            <input type="text" name="endday" id="endday"   class="txtcss"  size="10" {if $IsEdit eq 'yes'} value="{$endday}" {else}value="{$endday}" {/if}> 
                                            <br/>(e.g access this resource ends on day '3'. <br/>For product to be available  forever enter *)
                                         </td>
                                       </tr>
                                    </table>
                               </div>
                               <div id="byclick_div" name="byclick_div" style="display:none">
                                    <hr style="width:275px;margin-left:10px;" align="left">
                                    <table style="padding-left:20px;">
                                       <tr>
                                         <td valign="top">
                                          <label>Number Of Clicks </label> <label class="star">*</label> 
                                         </td>  
                                         <td>
                                            <input type="text" name="numberOfClicks" id="numberOfClicks"   class="txtcss"  size="10" {if $IsEdit eq 'yes'} value="{$noclicks}" {else} value="{$noclicks}" {/if}> 
                                            <br/>(e.g Resource expired after '5' clicks.)
                                         </td>
                                       </tr>
                                     </table>
                               </div> 
                               
                               <div id="bydate_div" name="bydate_div" style="display:none">
                                    <hr style="width:275px;margin-left:10px;" align="left">
                                    <table style="padding-left:20px;" width="100%">
                                       <tr>
                                         <td width="25%" valign="top">
                                          <label>Start Date</label> <label class="star">*</label> 
                                         </td>  
                                         <td>
                                            <input type="text" name="startdate" id="startdate" readonly=""  class="txtcss"  size="10" {if $IsEdit eq 'yes'} value="{$startdate}" {else}value="{$startdate}" {/if}>  <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].startdate,'mm/dd/yyyy',this)">     
                                             <br/>(e.g access this resource available from 7/7/2010.)
                                         </td>
                                       </tr>
                                       <tr>
                                         <td width="25%" valign="top">
                                          <label>End Date </label><label class="star">*</label> 
                                         </td>  
                                         <td>
                                            <input type="text" name="enddate" id="enddate"  readonly=""  class="txtcss"  size="10" {if $IsEdit eq 'yes'} value="{$enddate}" {else}value="{$enddate}" {/if}> <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].enddate,'mm/dd/yyyy',this)">     
                                            <br/>(e.g access this resource exired on 9/7/2010.) 
                                         </td>
                                       </tr>
                                    </table>
                               </div>
                            </td>
                         </tr>
                         <tr>
                                <td class="right-side-text"><label>Sorting order : </label></td>
                                <td class="left-side-text">
                                <input type="text" maxlength="5" name="txtsortorder" id="txtsortorder"   class="txtcss"  size="45" {if $IsEdit eq 'yes'} value="{$sortorder}" {else}value="{$sortorder}" {/if}> 
                                </td>
                                
                        </tr>
                        <tr>
                             <td class="right-side-text">&nbsp;</td>
                             <td class="buttontd">
                                    
                                    <input class="btncss" type="submit" {if $IsEdit eq 'yes'}value="Save"{else} value="Add"{/if}>
                                    <input type="button" value="Cancel" class="btncss" onclick="javascript:window.history.go(-1);">
                             </td>
                        </tr> 
               
               </tbody>
           </table>            
            </div>

    </form>
    </div>
</div>
        
 
 </div>


{literal}
 <script language="JavaScript" type="text/javascript">
              var $j = jQuery.noConflict();  
              var frmvalidator  = new Validator("frmproduct");
              frmvalidator.EnableMsgsTogether();
              var isedit='{/literal}{$IsEdit}{literal}'; 
              var ispostback='{/literal}{$postback}{literal}'; 
              
              if(isedit=="yes" || ispostback=="true")
              {
                  

                  var selectedTracking=$j('input:radio[name=trackType]:checked').val();
                  var selectedAsfreeorNot=$j('input:radio[name=isfree]:checked').val();
                  showHideCont(selectedTracking);
                  showHideTracking(selectedAsfreeorNot);
              }
              
              frmvalidator.addValidation("txtprodurl","req","Please select File..");
              frmvalidator.addValidation("products","selone_option","Please select Product."); 
              frmvalidator.addValidation("ddlstatus","dontselect=0","Please select Status of drip system file."); 
              frmvalidator.addValidation("showHome","selone_radio","Please select Display on user's home page.");   
              //frmvalidator.addValidation("isfree","selone_radio","Please select is this file Free.");   
             /* frmvalidator.addValidation("acctye","selone_radio","Please select traking type.","$j('input:radio[name=isfree]:checked').val()=='0'");*/
             frmvalidator.addValidation("acctye","selone_radio","Please select traking type.");
              frmvalidator.addValidation("txtsortorder","lt=65536","Max length for Sort order is 65535."); 
              frmvalidator.setAddnlValidationFunction("trackingtypeValidation");    
             
              function trackingtypeValidation()
                {
                  var selectedTracking=$j('input:radio[name=trackType]:checked').val();
                  if(selectedTracking=="1")
                   {
                   
                         if($j("#startday").val()=="" && $j("#endday").val()=="")
                          {
                                var err="Please enter start day.\nPlease enter end day.";
                                $j('#startday').focus()
                                alert(err);
                                return false; 
                              
                          }
                          
                          if($j("#startday").val()=="")
                           {
                                var err="Please enter start day.";
                                $j('#startday').focus()
                                alert(err);
                                return false; 
                           }
                          else
                           {
                             if ($j("#startday").val() != parseInt($j("#startday").val()) || parseInt($j("#startday").val())<0 )
                              {
                                 var err="Please enter valid start day.";
                                $j('#startday').focus()
                                alert(err);
                                return false; 
                              }
                           } 
                           
                           
                          if($j("#endday").val()=="")
                           {
                                var err="Please enter end day.";
                                $j('#endday').focus()
                                alert(err);
                                return false; 
                           }
                          else
                           {
                              if($j("#endday").val()!='*')
                              {
                                 if ($j("#endday").val() != parseInt($j("#endday").val()) || parseInt($j("#endday").val())<=0)
                                  {
                                     var err="Please enter valid end day.";
                                    $j('#endday').focus()
                                    alert(err);
                                    return false; 
                                  }
                               }
                           }
                          
                          if($j("#endday").val()!='*')
                              { 
                                  if(parseInt($j("#startday").val()) >  parseInt($j("#endday").val()))
                                  {
                                        var err="start day must be lessthen end day.";
                                        $j('#startday').focus()
                                        alert(err);
                                        return false; 
                                      
                                  }
                              }       
                       
                 
                   
                   }
                  else if(selectedTracking=="2")
                   {
                   
                          if($j("#numberOfClicks").val()=="")
                           {
                                var err="Please enter number of click.";
                                $j('#numberOfClicks').focus()
                                alert(err);
                                return false; 
                           }
                          else
                           {
                             if ($j("#numberOfClicks").val() != parseInt($j("#numberOfClicks").val()) || parseInt($j("#numberOfClicks").val()) <=0 )
                              {
                                 var err="Please enter valid number of click value.";
                                $j('#numberOfClicks').focus()
                                alert(err);
                                return false; 
                              }
                           } 
                   
                   }
                   
                  else if(selectedTracking=="3")
                   {
                        
                              if($j("#startdate").val()=="" && $j("#enddate").val()=="")
                              {
                                    var err="Please enter start date.\nPlease enter end date.";
                                    $j('#startdate').focus()
                                    alert(err);
                                    return false; 
                                  
                              }
                              
                              if($j("#startdate").val()=="")
                               {
                                    var err="Please enter start date.";
                                    $j('#startdate').focus()
                                    alert(err);
                                    return false; 
                               }
                               
                               
                              if($j("#enddate").val()=="")
                               {
                                    var err="Please enter end date.";
                                    $j('#enddate').focus()
                                    alert(err);
                                    return false; 
                               }
                              
                               
                              if($j("#startdate").val() > $j("#enddate").val())
                              {
                                    var err="start date must be lessthen end date.";
                                    $j('#startdate').focus()
                                    alert(err);
                                    return false; 
                                  
                              }  
                           
                   
                   }  
                          
                }                                                    
              
              function showHideTracking(valueOfchk)
              {
                    if(valueOfchk==1)
                    {
                       
                       for (var i=0; i<document.frmproduct.acctye.length; i++)
                       document.frmproduct.acctye[i].checked = false;

                        $j("#bydate_div").fadeOut(500);  
                        $j("#byday_div").fadeOut(500);
                        $j("#byclick_div").fadeOut(500);
                          
                       $j("#TrackingTypetr").fadeOut(500); 
                       
                    
                    }
                   else if(valueOfchk==0)
                    {
                       $j("#TrackingTypetr").fadeIn(500); 
                    } 
                  
              }
              function showHideCont(id)
               {
                     
                     if(id=="1")
                     {
                        $j("#byday_div").fadeIn(500);
                        $j("#byclick_div").fadeOut(500); 
                        $j("#bydate_div").fadeOut(500); 
                        $j("#calendarDiv").fadeOut(500);
                        
                     }
                    else if(id=="2") 
                     {
                        $j("#byclick_div").fadeIn(500);  
                        $j("#bydate_div").fadeOut(500);  
                        $j("#byday_div").fadeOut(500);
                    
                        $j("#calendarDiv").fadeOut(500);
                      } 
                    else if(id=="3")
                     {
                          $j("#bydate_div").fadeIn(500);  
                          $j("#byday_div").fadeOut(500);
                          $j("#byclick_div").fadeOut(500); 
                     }           
               }  
            </script>
       

 {/literal}

{$ADMIN_FOOTER}
Return current item: MembersGear