Location: PHPKode > projects > MembersGear > membersgear/templates/user_edit_profile.tpl
 {php}
 // phpajax_js();
{/php}
    {if $msg neq ''}
                <div {if $err eq 'true'} class="errormsg" {else} class="succmsg" {/if}>
                  <center> {if $msg neq ''}{$msg}{/if}</center>
                </div>
            
    {/if}
 <div id="divheigth">
 </div>   
 <div id="formlayout">
              {if $IsEdit eq 'yes'}
                    {assign var="action" value="update"}
              {elseif $Isdelete eq 'yes'}  
                     {assign var="action" value="delconfirm"}          
              {else}
                   
                    {assign var="action" value="insert"}
              {/if}
 <div id="formlayout-top">
            {*<div style="text-align:center;vertical-align:top;padding-top:7px;">*}
           <div id="divmemberslinkheader"> 
               <ul>
                   {*<li><a href="{$WEB_URL}/member/user_logout.php">Logout</a></li>*}
                             <li><a href="{$WEB_URL}/member/user_default_page.php" >Main Area</a></li>
                             <li><a href="{$WEB_URL}/member/user_edit_profile.php" class="selected">Edit Profile</a></li>
                            {if $MEMBER_SHOW_AFFILIATE eq 'true'}
                              <li><a href="{$WEB_URL}/member/affiliateSettings.php">{$affiliate_text}</a></li>
                             {/if} 
                             <li><a href="{$WEB_URL}/member/user_change_password.php">Change Password</a></li>
                             <li><a href="{$WEB_URL}/member/user_support.php">Support</a></li>
                             <li><a href="{$WEB_URL}/member/user_rotete_logout.php?url={$WEB_URL}/member/user_logout.php">Logout</a></li>
                </ul>
            </div>
          </div>
            <div id="formlayout-bg">
         {* <div     >*}
          <div     id="divMemberPageContent">    
         <table cellpadding="0" cellspacing="20" align="center"      id="tableeditprofile">  
            <form name="frmsignup" method="post" action="user_edit_profile.php?action={$action}">
              <tr>
                 <td colspan="2">
                    <h1>Edit Your Profile</h1>
                           
                </td>
                             
             </tr>
               
               <tr>
                <td class="right-side-text"    ><label>Username</label></td>
                <td class="left-side-text" width="">
                     <label>{$userdata[0].username}</label>
                </td>
             </tr>
                                   
              <tr>
                <td class="right-side-text"    ><label>First Name <label class="star">*</label><div class="FieldLabelNote" ></div></label></td>
                <td class="left-side-text" width="">
                    <input type="text"  name="fname" id="fname" class="txtcss" maxlength="45" size="35" 
                                    value="{$userdata[0].firstname}">
                 </td>
             </tr>
             
                <tr>
                    <td class="right-side-text"    ><label>Last Name <label class="star">*</label><div class="FieldLabelNote" ></div></label></td>
                    <td class="left-side-text" width="">
                        <input type="text"  name="lname" id="lname" class="txtcss" maxlength="45" size="35" 
                                        value="{$userdata[0].lastname}">
                                       
               </tr>
             
              <tr>
                <td class="right-side-text"    ><label>Your EMail Address <label class="star">*</label></label></td>
                <td class="left-side-text" width="">
                   
                     <input  type="text"   name="email" id="email" class="txtcss" maxlength="45" size="35"  value="{$userdata[0].email}" readonly>
                     
                </td>
             </tr>
     
{*--------------------------------------------------------------------------------------------------------------------------*}
                           {$controlresult}  
{*--------------------------------------------------------------------------------------------------------------------------*}
                                 
                            
                            
             
            <tr>
                <td class="right-side-text"    >&nbsp;</td>
                 <td class="left-side-text" width="">
                           
                      <input class="small-button" type="submit" id="Save"  name="Save" value="Save" >  
                      {if $IS_USER_DELETE_BUTTON_VISIBLE eq 'true'}
                      <input class="big-button"  type="button" id="btndelete" name="btndelete"  value="Delete Account" onclick="javascript:if(confirm('Are you sure you want to delete your account?'))Formsubmit();" >
                      {/if}
                      
                    
                </td>
            </tr> 
            <tr>
                <td colspan="2">&nbsp; 
                  
                </td>
                
            </tr> 
            </table>
            
           <table cellpadding="0" cellspacing="20" width="100%" id="tabledeleteprofile" style="display:none;">
              <tr>
                   <td class="right-side-text" colspan="2"><span style="">{$userdeletemsg}</span></td> 
             </tr>
              <tr>
                
                 <td class="left-side-text" style="" colspan="2" id="buttondeleteprofile">
                      <input class="big-button" type="submit" id="Save"  name="Save" value="Confirm Delete">
                      <input class="small-button" type="button" id="Cancel" name="Cancel" value="Cancel" onclick="location.href='./user_edit_profile.php';">
                 </td>
                 
               </tr>       
            </table>                   
                       
        </form>
            
      
        </div>                                 
        </div>
        <div id="formlayout-bottom"></div>        
                  
</div>    
{literal} 
   <script language="JavaScript" type="text/javascript">
      var mem_user_add_info='{/literal}{$MEMBER_USE_ADDRESS_INFO1}{literal}';
      var mem_generate_email='{/literal}{$MEMBER_UNIQUE_EMAIL}{literal}'; 
      var email='{/literal}{$userdata[0].email}{literal}';
      var isdelete='{/literal}{$Isdelete}{literal}';  
    //  alert(isdelete);
       if(isdelete=='yes')
       {
              document.getElementById('tableeditprofile').style.display='none'; 
              document.getElementById('tabledeleteprofile').style.display=''; 
       
       }
        function Formsubmit()
        {                  
                  
                    document.frmsignup.action='user_edit_profile.php?action=delete'; 
                 
                  
                    document.frmsignup.submit();
               
         }
        function emailavailablecheck()
        {
          var frm = document.forms["frmsignup"];    
          var editemail=frm.email.value;
          var result=true;
          var emailavailable=document.getElementById('spnemailavailablelink').innerHTML;
          var availabel=emailavailable.substring(0,15);
          if(isedit=='yes')
          {   
                    
              if(editemail!=email)
              {
                
                  if(availabel=='Congratulations')
                  {
                     
                      result=true;
                  }
                  else
                  {
                     result=false;
                  
                  }
              
              }
          }
          else
          {
              if(availabel=='Congratulations')
                  {
                      result=true;
                  }
                  else
                  {
                     result=false;
                  
                  }
          
          }
          return result;
        
        }
          function DoCustomValidation()
         {   
              var finalresult=true; 
              var frm = document.forms["frmsignup"];
              
              /*Confirm Password*/
               var error="";
               var focus=''; 
               var foc=1;
                /* Email availability*/
              if(mem_generate_email=='true')
              {
               
                if(false == emailavailablecheck())
                {
                    //alert('Please check Email Address availability');
                   // document.getElementById('spnemailavailablelink');
                    error += 'Please check Email Address availability.'+'\r\n'; 
                      if(foc==1)
                      {
                        focus='spnemailavailablelink';
                        foc=0;
                      } 
                    finalresult=false;
                }
              }
              else
              {
                finalresult=true;
              }
              if(error!='')
              {
                    alert(error);
                    var FocusControl = document.getElementById(focus);
                     FocusControl.focus();
                     return false;
              }
              //return finalresult;
              
        }  
     if(isdelete!='yes')
     {
      var frmvalidator  = new Validator("frmsignup");
    
      frmvalidator.EnableMsgsTogether();
      
   
      frmvalidator.addValidation("fname","req","Please enter Firstname.");
      frmvalidator.addValidation("fname","maxlen=45",    "Max length for Firstname is 45.");
     // frmvalidator.addValidation("fname","alpha","Firstname:alphabetic chars only.");
      
      frmvalidator.addValidation("lname","req","Please enter Lastname.");
      frmvalidator.addValidation("lname","maxlen=45",    "Max length for lastName is 45.");
      //frmvalidator.addValidation("lname","alpha","Lastname:alphabetic chars only.");
      /*if(mem_user_add_info=='yes')
      {
        
        frmvalidator.addValidation("country","dontselect=0","Please select County.");
      
        frmvalidator.addValidation("state","dontselect='0'","Please select State.");
          
        frmvalidator.addValidation("city","req","Please enter City.");
        frmvalidator.addValidation("city","maxlen=45","Max length for City  is 45.");
        frmvalidator.addValidation("zipcode","req","Please enter Zipcode.");  
        frmvalidator.addValidation("zipcode","alnum","Please enter Zipcode.");
        frmvalidator.addValidation("zipcode","maxlen=15");
      
        frmvalidator.addValidation("address","req","Please enter Street Address.");
        frmvalidator.addValidation("address","maxlen=200",    "Max length for  Street Address is 200.");
     
      } */
         
     // frmvalidator.addValidation("phone","req","Please enter Phone Number.");
      //frmvalidator.addValidation("phone","maxlen=45");
      //frmvalidator.addValidation("phone","numeric","Please enter valid Phone Number.");
      {/literal}{$controlvalidationresult}{literal}; 
     }
</script>
{/literal}
Return current item: MembersGear