Computer Operations/Database/General Rules

From MFIWiki
(Difference between revisions)
Jump to: navigation, search
 
Line 6: Line 6:
 
|}
 
|}
 
<div align=left>
 
<div align=left>
 +
 +
Basic Layout:
 +
:Initial Setup
 +
:Calculations
 +
:HTML body code
 +
:Final output
  
 
All DB pages need to start with the following code:
 
All DB pages need to start with the following code:
Line 34: Line 40:
 
// Create HTML  
 
// Create HTML  
 
://Set header variables
 
://Set header variables
::$pic = picture("member",$view);
+
::$pic = picture(<i>type</i>,$view);
::$nav = navigationbuttons2("member",$view);
+
::$nav = navigationbuttons(<i>2</i>(<i>type</i>,$view) );
::if (isccmember()) {
+
:::$title = <i>title of page</i>;
:::$title = "Reset Password for".rankandname($view);
+
::}else{
+
:::$title = "Changing My Password";
+
::}
+
 
://Create Header and Footer
 
://Create Header and Footer
 
::$header = htmlheader($title,$nav,$updated,$pic);
 
::$header = htmlheader($title,$nav,$updated,$pic);
 
::$footer = htmlfooter($nav);
 
::$footer = htmlfooter($nav);
 +
 +
The picture types will either be "member" or "cell".  $view is the number associated with the record being viewed, either the member id or the cell id.  Only the numeric portion of this id is used.
 +
 +
The navigation button function will depend upon whether the page is to return to a specific record or not.  See the Button Placement Functions page for more details. The types used in the navigationbuttons2 function are the same as the ones in the picture function.  These are important to ensure the proper module is called. The navigationbuttons() function send no data.
 +
 +
$update is usually done in the calculations section of the module.

Latest revision as of 13:40, 16 March 2009

23 September 2020
Pd naval.jpg Pd marine.jpg SOC Pd hq.jpg SSD KTF Romulan_Legion
Trek Bar

Computer Operations Seal, designed by Samuel Cummings

MFI Computer Operations

MFI Database General Programming Rules


Basic Layout:

Initial Setup
Calculations
HTML body code
Final output

All DB pages need to start with the following code:

//Initial setup

session_start();
//Address error handling
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
// Include required files
include_once("include/db.inc.php");
include_once("include/error_handler.php");
// Start up our wonderful db connection
$conn = db_connect();

//Check user is logged into the DB system

if (! (isset($_SESSION['id']))) {
header("Location: dblogin.php");
exit;
}


The following code is used to start the HTML section of the page:

// Create HTML

//Set header variables
$pic = picture(type,$view);
$nav = navigationbuttons(2(type,$view) );
$title = title of page;
//Create Header and Footer
$header = htmlheader($title,$nav,$updated,$pic);
$footer = htmlfooter($nav);

The picture types will either be "member" or "cell". $view is the number associated with the record being viewed, either the member id or the cell id. Only the numeric portion of this id is used.

The navigation button function will depend upon whether the page is to return to a specific record or not. See the Button Placement Functions page for more details. The types used in the navigationbuttons2 function are the same as the ones in the picture function. These are important to ensure the proper module is called. The navigationbuttons() function send no data.

$update is usually done in the calculations section of the module.

Personal tools