Location: PHPKode > projects > MembersGear > membersgear/templates/admin_pages_m.tpl
{$ADMIN_HEADER}
<div id="content" class="setdiv"> 
{encryptUrl enstring=$hi} 
{if $msg neq ''}  
    <br/><center><span class=errormsg style="">{if $msg neq ''}{$msg}{/if}</span></center>   
{/if}                        
<div id="full-contentdiv">
          <div class="righttop">
                <h2  align="center">
                   {if $IsEdit eq 'yes'}Update Page {else}Add Page {/if}
                </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}
               {assign var="totallemgth" value="1000"} 
              <form method="post" name="frmpage" id="frmpage" action="admin_pages_m.php?action={$action}">
                 <input type="hidden" name="pgid" id="pgid" value="{if $IsEdit eq 'yes'}{$pageinfo[0].id}{/if}">   
                 <div class="formformat">
                 <table  border="0"  cellspacing="0" cellpadding="0" width="85%" align="center">    
                  <tbody>
                           <tr>
                                <td valign="top"  class="right-side-text" style="width:348px"><label>Page Name <label class="star">*</label></label></td>
                                <td class="left-side-text">
                                   <input type="text"  name="pgname" id="pgname" class="txtcss" maxlength="45" size="70" 
                                   value="{if $IsEdit eq 'yes'}{$pageinfo[0].name}{else}{$post.pgname}{/if}">
                                   
                                </td>
                          </tr>
                          <tr>
                                <td valign="top"  class="right-side-text" style="width:348px"><label>Page Title <label class="star">*</label></label></td>
                                <td class="left-side-text">
                                   <input type="text"  name="pgtitle" id="pgtitle" class="txtcss" maxlength="" size="70" 
                                   value="{if $IsEdit eq 'yes'}{$pageinfo[0].title}{else}{$post.pgtitle}{/if}">
                                </td>
                          </tr>
                                    
                                    
                               <td valign="top"  class="right-side-text" style="width:348px"><label>Page Url <label class="star">*</label></label></td>
                                <td class="left-side-text">
                                   <input type="text"  name="pgurl1" id="pgurl1" class="txtcss" maxlength="{$WEB_URL_LENGTH}" size="32" 
                                   value="{$WEB_URL}" readonly="">
                                   <label>/</label>
                                   <input type="text"  name="pgurl2" id="pgurl2" class="txtcss" maxlength="{$totallemgth-$WEB_URL_LENGTH}" size="30" 
                                   value="{if $IsEdit eq 'yes'}{$pageinfo[0].pageurl2}{else}{$post.pgurl2}{/if}">
                                </td>
                          </tr>
                           </tr>
                               <td valign="top"  class="right-side-text" style="width:348px"><label>Metakeywords </label></td>
                                <td class="left-side-text">
                                 <textarea id="pgmetakeyword" name="pgmetakeyword" rows="3" maxlength="500" style="padding:3px;width:370px;" class="txtareacss">{if $IsEdit eq 'yes'}{$pageinfo[0].metakeywords}{else}{$post.pgmetakeyword}{/if}</textarea> 
                                </td>
                          </tr>
                            </tr>
                               <td valign="top"  class="right-side-text" style="width:348px"><label>Metadescription </label></td>
                                <td class="left-side-text">
                                 <textarea id="pgmetadesc" name="pgmetadesc" maxlength="500" rows="3" style="padding:3px;width:370px;" class="txtareacss">{if $IsEdit eq 'yes'}{$pageinfo[0].metadescription}{else}{$post.pgmetadesc}{/if}</textarea> 
                                </td>
                          </tr>
                           <tr>
                           
                                <td  class="right-side-text">&nbsp;</td>
                                <td  class="buttontd">  
                                    <input class="btncss" type="submit" name="submit" {if $IsEdit eq 'yes'}value="Save"{else}value="Submit"{/if}>&nbsp;&nbsp;&nbsp;
                                    <input  class="btncss" type="button" name="btnBack" value="Cancel" onclick="window.history.go(-1);"></td>
                            </tr>
                            
                               
                       
                  </tbody>
                  </table>
                  </div> 
             </form>
          </div>
</div>
{literal} 
          <script language="JavaScript" type="text/javascript">
              var weburllen='{/literal}{$WEB_URL_LENGTH}{literal}';
              var pgurllen=1000-parseInt(weburllen);
              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));
              }
               function DoCustomValidation()
               {
                  var frm = document.forms["frmpage"]; 
                  var pageurl=frm.pgurl1.value+"/"+frm.pgurl2.value;
                   if(!is_valid_URL(pageurl))
                  {
                      alert('Please enter valid Page Url');
                      frm.pgurl.focus();   
                      return false;
                  }
                  else
                  {
                     return true;
                  }
                  
               }
         
              var frmvalidator  = new Validator("frmpage");
                
              frmvalidator.EnableMsgsTogether();
              //frmvalidator.EnableOnPageErrorDisplaySingleBox();
              
              frmvalidator.addValidation("pgname","req","Please enter Page Name.");
              frmvalidator.addValidation("pgname","maxlen=45",    "Max length for Page Name is 45.");
             
              frmvalidator.addValidation("pgtitle","req","Please enter Page Title.");
              frmvalidator.addValidation("pgtitle","maxlen=100",    "Max length for Page Title is 100.");
              frmvalidator.addValidation("pgurl1","req","Please enter Page Url.");
              //frmvalidator.addValidation("pgurl","maxlen=weburllen",    "Max length for Page Url is 1000.");
              frmvalidator.addValidation("pgurl2","req","Please enter  Page Url.");
              frmvalidator.addValidation("pgurl2","maxlen=pgurllen",    "Max length for  Page Url is "+pgurllen);  
              frmvalidator.setAddnlValidationFunction("DoCustomValidation");
          </script>
                
{/literal} 
   </div>                  
{$ADMIN_FOOTER}
Return current item: MembersGear