Home arrow PHP arrow Page 4 - The Design of an Intranet Application Framework

More on Templates - PHP

This article is the second part of a series on intranet application frameworks. Now that we know what the application framework is all about and how it is going to work in an intranet environment, we are going to look at the overall structure and design of the intranet and the applications. Keep reading to see how this will be done.

TABLE OF CONTENTS:
  1. The Design of an Intranet Application Framework
  2. Intranet File Structure
  3. Design Code/Templates
  4. More on Templates
By: Chris Neeman
Rating: starstarstarstarstar / 6
July 25, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

The next two HTML pages are the templates that are going to be used to display the intranet and application pages respectively. The templates give the applications a uniform, neat and presentable look. They also, like the CSS sheet, make it easy to apply cosmetic changes in one place for all pages to accept those changes. In other words, it makes it very easy to maintain web pages.

Fig1. Intranet template

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<link href="intranet.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
body {
   background-color: #a4c2c2;
}
-->
</style>
</head>
<body>
 
<table width="100%" border="0" cellspacing="2">
 
  <tr>
 
    <td colspan="2" valign="top" class="logo">DAMARA NAMA PUBLISHING </td>
 
  </tr>
    <tr>
 
    <td width="16%" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
 
    <td width="84%" valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="welcome" -->welcome<!-- TemplateEndEditable --></td>
 
  </tr>
 
  <tr>
 
    <td width="16%" valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="navigate" -->navigate<!-- TemplateEndEditable --></td>
 
    <td valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="main" -->main<!-- TemplateEndEditable --></td>
 
  </tr>
 
  <tr>
 
    <td valign="top">&nbsp;</td>
 
    <td valign="top" class="copyright">copyright&copy;2007</td>
 
  </tr>
 
</table>
</body>
</html>

Fig2. Application template

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<link href="intranet.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
   background-color: #a4c2c2;
}
-->
</style></head>
<body>
 
<table width="100%" border="0" cellspacing="2">
 
  <tr>
 
    <td colspan="2" valign="top" class="logo">DAMARA NAMA PUBLISHING </td>
 
  </tr>  
 
  <tr>
 
    <td width="13%" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
 
    <td width="87%" valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="welcome" -->welcome<!-- TemplateEndEditable --></td>
 
  </tr>
 
  <tr>
 
    <td width="13%" valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="navigate" -->navigate<!-- TemplateEndEditable --></td>
 
    <td valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="main" -->main<!-- TemplateEndEditable --></td>
 
  </tr>
 
  <tr>
 
    <td valign="top">&nbsp;</td>
 
    <td valign="top" class="copyright">copyright&copy;2007</td>
 
  </tr>
 
</table>
</body>
</html>

Since we are discussing the wider intranet components, I thought we could deal with the validation class before moving on to the application framework components. The validation class is mainly used to validate form data. It has five functions:

  • filledin() - This function checks to see if the form variables are filled in.
  • isadmin() - This function checks to see if a user has admin level access.
  • checkemail() - This function checks to see if the email address supplied is valid.
  • savepass() - This function saves a password in hash form.
  • genpass() - This function generates a seven character password.

Below is a fuller outline of the validation class:

<?php
class validate{
   function filledin($form_vars){
    
foreach($form_vars as $key=> $value)
    
{
      
if(empty($key) || ($value == ''))
        
return FALSE;
     
}
    
return TRUE;
  
}

   function isadmin($sesslevel){
    
if($sesslevel == "admin"){
      
return TRUE;
    
}else{
      
return FALSE;
    
}
  
}

   function checkemail($aEmail){
    
if(eregi("^([a-z.])+([a-z])+@([a-z])+(.)([a-z]{3})$",$aEmail))
      
return TRUE;
    
else
      
return FALSE;
  
}//end function

   /*password functions*/
  
function savepass($apass){
 
    $salt = 'SHIFLETT';
 
    $password_hash = md5($salt . md5($apass . $salt));

     return $password_hash;
  
}

   function genpass(){
 
   $chars = "1234567890abcdefghij345678klmnopqrs1234tuvwxyz1234567890";
 
   $thepass = '';
 
   for($i=0;$i<7;$i++){
 
     $thepass .= $chars{rand() % 39};
 
   }
 
   return $thepass;
 
  }
}
?>

Conclusion

This article discussed the design of the intranet as well as the applications that it will host. The next article will discuss the components of the application framework.



 
 
>>> More PHP Articles          >>> More By Chris Neeman
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: