Location: PHPKode > projects > MembersGear > membersgear/templates/installation_db_session_setting.tpl
{$INSTALLATION_HEADER}
  {literal} 
<script language="javascript" type="text/javascript" >
 function checkSpecialChar()
 {                  
     var error=""
     var altfiled="";    
     var foc=1;
    var db_value=document.getElementById('db_name').value;
    if(!checkSpecialChar_error(db_value))
     {
      error="Invalid character \\ in database name field.\n" ;
      if(foc==1)
       {  
          focus='db_name'; 
          foc=0;
        }
     } 
     
     var db_username=document.getElementById('db_username').value; 
     if(!checkSpecialChar_error(db_username))
     {
      error+="Invalid character \\ in database user name field.\n" ;
      if(foc==1)
       {  
          focus='db_username'; 
          foc=0;
        }
     }
     
     var db_password=document.getElementById('db_password').value; 
     if(!checkSpecialChar_error(db_password))
     {
      error+="Invalid character \\ in database password field.\n" ;
      if(foc==1)
       {  
          focus='db_password'; 
          foc=0;
        }
     } 
     
     var db_hostaddress=document.getElementById('db_hostaddress').value; 
     if(!checkSpecialChar_error(db_hostaddress))
     {
      error+="Invalid character \\ in database host address field.\n" ;
      if(foc==1)
       {  
          focus='db_hostaddress'; 
          foc=0;
        }
     }
    
     var table_prefix=document.getElementById('table_prefix').value; 
     if(!checkSpecialChar_error_uderscore(table_prefix))
     {
      error+="Only Alphabetic characters and Underscore character allowed in table prefix value.\n" ;
      if(foc==1)
       {  
          focus='table_prefix'; 
          foc=0;
        }
     }
     
                   
     
      var session_prefix=document.getElementById('session_prefix').value; 
     if(!checkSpecialChar_error_uderscore(session_prefix))
     {
      error+="Only Alphabetic characters and Underscore character allowed in session prefix value.\n" ;
      if(foc==1)
       {  
          focus='session_prefix'; 
          foc=0;
        }
     }  
     
     var table_field_prefix=document.getElementById('table_field_prefix').value; 
     if(!checkSpecialChar_error_uderscore(table_field_prefix))
     {
      error+="Only Alphabetic characters and Underscore character allowed in table field prefix value.\n" ;
      if(foc==1)
       {  
          focus='table_field_prefix'; 
          foc=0;
        }
     }
     
     var cookie_prefix=document.getElementById('cookie_prefix').value; 
     if(!checkSpecialChar_error_uderscore(cookie_prefix))
     {
      error+="Only Alphabetic characters and Underscore character allowed in cookie prefix value.\n" ;
      if(foc==1)
       {  
          focus='cookie_prefix'; 
          foc=0;
        }
     } 
    if(error=="")
    {
     return true;
    }
   else
    {
      alert(error);
       var FocusControl = document.getElementById(focus);
       FocusControl.focus();
       return false;
                                                                         

    } 
 } 
 
 function checkSpecialChar_error(data)
 {                   
      
   var sts=true;
   var iChars = "\\"; 
   for (var i = 0; i < data.length; i++) {
      if (iChars.indexOf(data.charAt(i)) != -1) {
        sts=false;
     
      }
  }
   return sts;  
 } 
 function checkSpecialChar_error_uderscore(data)
 {                   
      
   var sts=true;
   var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?~";
   for (var i = 0; i < data.length; i++) {
      if (iChars.indexOf(data.charAt(i)) != -1) {
        sts=false;
     
      }
  }
   return sts;  
 }                                           
</script>
{/literal}

<div id="content" class="setdiv">
  {*  <div id="contentdiv">
        <div class="leftdiv">
            <div class="righttop">
                <h2>
                    Welcome To SafelistProX 3.2.1 Control Panel</h2>
            </div>
            <div class="contant divborder">
                The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the
                lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps
                over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown
                fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick
                brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
                The quick brown fox jumps over the lazy dog.
                <div class="link-set clear">
                    <a href="#">read more...</a></div>
            </div>
        </div>
        <div class="rightdiv">
            <div class="righttop">
                <h2>
                    Your Safelist Overview</h2>
            </div>
            <div class="contant divborder">
                The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the
                lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps
                over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown
                fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick
                brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
                The quick brown fox jumps over the lazy dog.
                <div class="link-set clear">
                    <a href="#">read more...</a></div>
            </div>
        </div>
    </div>  *}
    
    {if $msg neq ''}
            <div class="errormsg" style="width:300px">{$msg}</div>
           {/if} 
    <div id="full-contentdiv">
          <div class="righttop">
                 <h2><center>
                    Step 5. Database Setup and Session,Table,Table field,Cookie Prefix setup </h2>                                     
            </center></div>
         <div class="whole-page clear">
       
            <!-- Place your content here -->
              <form method="post" name="dbconfiguration">
              <div class="formformat">      
                 <table    width="100%"  cellpadding="0" cellspacing="0" >    
                  <tbody>
                         <tr>
                            <td class="right-side-text" width="50%"><label>Database name <label class="star">*</label><div class="FieldLabelNote"></div></td>
                           <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255" size="50"  class="txtcss" id="db_name" name="db_name" value="{$db_name}" />
                            </td>

                        </tr>
                         <tr>
                            <td class="right-side-text" width="50%"><label>Database username <label class="star">*</label></td>
                           <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255" size="50"  class="txtcss" id="db_username" name="db_username" value="{$db_username}"/>
                            </td>

                        </tr>
                          <tr>
                            <td class="right-side-text" width="50%"><label>Database password <label class="star">*</label></td>
                           <td class="left-side-text" width="50%">
                                <input type="password" maxlength="255" size="50"  class="txtcss"  id="db_password" name="db_password" value="{$db_password}"/>
                            </td>

                        </tr>
                         <tr>
                            <td class="right-side-text" width="50%"><label>Database server address <label class="star">*</label><div class="FieldLabelNote">In most cases localhost, if database is on a different server enter IP address or database server name.</div></td>
                           <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255" size="50"  class="txtcss" id="db_hostaddress" name="db_hostaddress" value="{$db_hostaddress}"/>
                            </td>

                        </tr>
                        
                        <tr>
                            <td valign="top" style="padding-top: 5px;" colspan="2">

                                <p style="text-align: center"><b>Database Table and Session,Cookie,Table fields prefix Settings</b>   
                            </td>
                        </tr>
                        
                        <tr>
                            <td class="right-side-text" width="50%"><label>Table prefix  <label class="star">*</label><div class="FieldLabelNote">Enter table prefix which will be use with tablename</div></td>
                            <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255" size="50"  class="txtcss" id="table_prefix" name="table_prefix" value="{$table_prefix}"/>
                            </td>

                        </tr>
                        
                          <tr>
                            <td class="right-side-text" width="50%"><label>Session prefix  <label class="star">*</label><div class="FieldLabelNote">Enter session prefix which will be use with session</div></td>
                            <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255" size="50"  class="txtcss" id="session_prefix" name="session_prefix" value="{$session_prefix}"/>
                            </td>

                        </tr>
                        
                         <tr>
                            <td class="right-side-text" width="50%"><label>Table feild prefix <label class="star">*</label><div class="FieldLabelNote">Enter table filed prefix which will be use with session</div></td>
                            <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255" size="50"  class="txtcss" id="table_field_prefix" name="table_field_prefix" value="{$table_field_prefix}"/>
                            </td>

                        </tr>
                        <tr>
                            <td class="right-side-text" width="50%"><label>Cookie prefix <label class="star">*</label><div class="FieldLabelNote">Enter Cookie prefix which will be use with cookie</div></td>
                            <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255" size="50"  class="txtcss" id="cookie_prefix" name="cookie_prefix" value="{$cookie_prefix}"/>
                            </td>

                        </tr>
                            
                        <tr>
                             <td class="right-side-text" width="50%"> &nbsp;</td>
                           <td class="buttontd" width="50%">
                                <input  type="submit" value="Save"  class="btncss" align="middle">&nbsp;&nbsp;&nbsp;
                                   

                            </td>
                        </tr>
                       
                         
                </tbody>
           </table>
           </div>
        </form>
    </div>
</div>
        {literal}
          <script language="JavaScript" type="text/javascript">
          
            var frmvalidator  = new Validator("dbconfiguration");
              frmvalidator.EnableMsgsTogether();

              frmvalidator.addValidation("db_name","req","Please enter database name.");
              frmvalidator.addValidation("db_username","req","Please enter database username.");
              frmvalidator.addValidation("db_password","req","Please enter database password.");
              frmvalidator.addValidation("db_hostaddress","req","Please enter database host address.");
              frmvalidator.addValidation("table_prefix","req","Please enter table prefix value.");
              frmvalidator.addValidation("session_prefix","req","Please enter session prefix value.");
              frmvalidator.addValidation("table_field_prefix","req","Please enter table field prefix value.");
              frmvalidator.setAddnlValidationFunction("checkSpecialChar");
            
                                                             
            </script>
 
        {/literal}
 
 </div>
{$INSTALLATION_FOOTER}
Return current item: MembersGear