Location: PHPKode > projects > MembersGear > membersgear/templates/admin_login.tpl
{$ADMIN_HEADER}
 <div id="content" class="setdiv">
  {if $msg neq ''}
            <div class="errormsg" style="width:250px">{$msg}</div>
           {/if} 

     <div id="full-contentdiv">
          <div class="righttop">
                <h2>
                   <center>
                          Admin Login
                   </center>
                </h2>                                      
            </div>
            <div class="whole-page clear">
                   <div class="formformat">      
                      <table border="0" cellpadding="0" cellspacing="0"  width="68%" align="center" style="position:relative">    
                        <form name="frmlogin" method="post" action="{php}echo GET_URL($_SERVER['REQUEST_URI']){/php}action=dologin">
                          <tbody>
                             <tr>
                                 <td class="right-side-text" width="33%"><label>User Name <label class="star">*</label></label></td>
                                 <td class="left-side-text" width="40%">
                                        <input type="text" name="username_textbox"  id="username_textbox"  class="txtcss"  size="30"> 
                                 </td>
                             </tr>
                            <tr>

                               <td class="right-side-text" width="30%"><label>Password <label class="star">*</label></label></td>
                               <td class="left-side-text" width="40%">
                                     <input type="password" name="password_textbox"  id="password_textbox"  class="txtcss"  size="30">        
                                     <input type="hidden" value="{$modUrl}" name="url" >
                                 </td>
                            </tr>
                           {if $CAPTCHA_ENABLE_ON_ADMINSTRATOR_LOGIN_PAGE eq 'true'} 
                                    <tr>
                                        <td class="right-side-text" style="width:160px"><label>Enter Captcha Code <label class="star">*</label></label></td>
                                        <td class="left-side-text">
                                             <img src="../includes/securimage/securimage_show.php?sid={php} echo md5(uniqid(time())); {/php}" style="border: 1px solid #7D9CB0; margin-bottom: 5px;"><br />
                                        </td>
                                    </tr>                
                                 
                                 <tr>
                                      <td class="right-side-text" style="width:150px"></td>
                                      <td class="left-side-text">
                                             <input type="text" name="txtSecretCode" id="txtSecretCode" maxlength="4" class="txtcss" style="text-transform:uppercase;"/>
                                      </td>
                                 </tr> 
                            {/if} 
                             <tr>
                                 <td class="right-side-text" width="30%">&nbsp;</td>
                                  <td class="left-side-text" width="40%"><input class="btncss" type="submit" value="Login">
                                    <input type="button" value="Reset" class="btncss" onClick="document.frmlogin.reset();return false">
                                  </td>
                             </tr>
                         </form> 
                   
                       <form name="frmforgotpass" id="frmforgotpass" action="?action=forgotPassword" method="post" onsubmit="return ValidateUsernameOrEmail();">
                       <tr>    
                                <td class="right-side-text" ><label>Did you forgot your password?<label class="star">*</label></td>
                            <td class="left-side-text" >
                                <input type="text" value="Enter your User Name or Email Address" size="40" onblur="restoreInput(this,'Enter your User Name or Email Address')" onfocus="return clearInput(this,'Enter your User Name or Email Address');" class="txtcss" id="txtForgotPasswordValue" name="txtForgotPasswordValue"/>
                                <!--<br /><b>OR</b><br style="margin-bottom:5px;" />
                             <input type="text" value="Enter your Email Address" size="30" onblur="restoreInput(this,'Enter your Email Address');" onfocus="return clearInput(this,'Enter your Email Address');" class="txtcss" id="email" name="email"/><br/>        -->
                                    
                             </td>
                       </tr>
                       
                        <tr>
                            <td class="right-side-text" width="30%">&nbsp;</td>
                            <td class="left-side-text" width="40%">
                                <input class="btncss" type="submit" value="Get Password">
                            </td>
                        </tr>
                  </form>    
               </tbody>
           </table>            
            </div>
    </div>
</div>
</div>
{literal}
 <script language="JavaScript" type="text/javascript">
              var username_not_enter ="{/literal}{$MESSAGE_NO_USERNAME_NORMAL}{literal}";
              var pass_not_enter ="{/literal}{$MESSAGE_NO_PASSWORD_NORMAL}{literal}";
              var secretcode_not_enter_msg ="{/literal}{$MESSAGE_INVALID_SECURITY_CODE}{literal}";
              var secretcode_not_enter ="{/literal}{$CAPTCHA_ENABLE_ON_ADMINSTRATOR_LOGIN_PAGE}{literal}";
              
              var frmvalidator  = new Validator("frmlogin");
              frmvalidator.EnableMsgsTogether();
              frmvalidator.addValidation("username_textbox","req",username_not_enter);
              frmvalidator.addValidation("password_textbox","req",pass_not_enter);
              if(secretcode_not_enter=='true')
              {
                frmvalidator.addValidation("txtSecretCode","req","Please enter captcha code");
              }
              
              
              //var frmvalidator  = new Validator("frmforgotpass");
//              frmvalidator.EnableMsgsTogether();
//              frmvalidator.addValidation("txtForgotPasswordValue","req","Please enter either Username or Email Address to recover your password.","document.getElementById('txtForgotPasswordValue').value == 'Enter your User Name or Email Address'");
              //frmvalidator.addValidation("email","email","Please enter valid Email Address.");
//              frmvalidator.addValidation("username","req","Please enter Username.");                                 
 </script>
                    <!--   Update by jayesh           -->
                    <script language="JavaScript" type="text/javascript">
                            function ValidateUsernameOrEmail()
                            {
                                if(document.getElementById('txtForgotPasswordValue').value == 'Enter your User Name or Email Address')
                                {
                                    alert('Please enter either Username or Email to recover your password');
                                    document.getElementById('txtForgotPasswordValue').focus();
                                    return false;
                                }
                               // else if(document.getElementById('username1').value != 'Enter your User Name' && document.getElementById('email').value != 'Enter your Email Address')
//                                {
//                                      var pattern = "[^A-Za-z0-9\\s]";
//                                      var error = '';
//                                      var controlfocus = '';
//                                      var flag = 0;
//                                      
//                                      if(document.getElementById('username1').value.search(pattern) >= 0)
//                                      {
//                                            error += 'Please enter valid username'+'\r\n';
//                                            controlfocus = 'username1';
//                                            flag = 1;
//                                      }
//                                      
//                                      if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('email').value))){
//                                             error += 'Please enter valid email address.';
//                                             if(flag == 0)
//                                                    controlfocus = 'email';
//                                      }                                                         
//                                      if(error != '')
//                                      {
//                                            alert(error);
//                                            document.getElementById(controlfocus).focus();
//                                            return false;
//                                      }
//                                } 
//                                else if(document.getElementById('username1').value != 'Enter your User Name')
//                                {
//                                      var pattern = "[^A-Za-z0-9\\s]";
//                                      if(document.getElementById('username1').value.search(pattern) >= 0)
//                                      {
//                                            alert('Please enter valid username.');
//                                            document.getElementById('username1').focus();
//                                            return false;
//                                      }
//                                }
//                                else if(document.getElementById('email').value != 'Enter your Email Address')
//                                {
//                                      if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('email').value))){
//                                             alert('Please enter valid email address.');
//                                             document.getElementById('email').focus();
//                                             return false;
//                                      }
//                                } 
                                return true;
                            }
                     </script>
 {/literal}

 {$ADMIN_FOOTER} 
Return current item: MembersGear