/*_________________________________________________________________________
FILE: template.c by -
date -
Copyright
(c) April, 2005 : Intec Automation Inc.
PURPOSE:
Interface to
NOTES:
This file will build a template HTML pa
+-------------------------------------------------------------------+
| Header |
+-------------------------------------------------------------------+
| |
|
| | |
| Left |
|
| Column | Content |
| |
|
|
|
|
| |
|
| |
|
+-------------------------------------------------------------------+
| Footer |
+-------------------------------------------------------------------+
Each of the section are to be filled in
by the implementation of the
followin
1. add_pa
2. add_left_column
3. add_pa
4. add_pa
These function implementations should
use printf/puts to
which will be added to
the pa
Template is used with Cascadin
to be present in the
root web directory. The template
expects the
followin
.main (main outer table)
.header (header section)
.main-core (core table inside main table with 2
columns)
.left-nav (left column)
.content (content column)
.footer (footer section)
___________________________________________________________________________*/
#include
<stdio.h> // printf
#include
<template.h> // add_pa
#include
<c
//-------------
Implementation --------------------------------------------
// TYPE: Local
Utility
void // No return
build_pa
// elements like
header, footer, content, ...
{
RequestType request; // Request parameters such as post
variables
//
// request is a
POST, or GET
// initialize the request by readin
// by the web server
request.postvars = NULL;
request.
request.form_method =
if(request.form_method
== POST) {
request.
request.postvars =
} else if(request.form_method
== GET) {
request.
}
//
printf("Content-type: text/html\n\n");
// Pa
printf("<html>"
);
printf(
"<head>"
);
printf( "<title>"
);
add_pa
printf(
"</title>"
);
// Stylesheet
printf( "<link href=\"/site.css\" rel=\"stylesheet\" \
type=\"text/css\">" );
printf(
"</head>"
);
printf(
"<body>"
);
printf( "<table
class=\"main\" cellspacin
printf( "<tr>"
);
printf( "<td
class=\"header\">" );
add_pa
printf(
"</td>"
);
printf( "</tr>"
);
printf( "<tr>"
);
printf( "<td>"
);
printf(
"<table class=\"main-core\" cellspacin
printf(
"<tr>"
);
printf( "<td class=\"left-nav\">" );
add_left_column(&request);
printf(
"</td>" );
printf(
"<td class=\"content\">" );
add_pa
printf(
"</td>" );
printf(
"</tr>"
);
printf(
"</table>"
);
printf(
"</td>"
);
printf( "</tr>"
);
printf( "<tr>" );
printf( "<td
class=\"footer\">" );
add_pa
printf(
"</td>"
);
printf( "</tr>" );
printf(
"</table>"
);
printf(
"</body>"
);
printf("</html>" );
// Free allocated memory
cleanUp(request.form_method, request.
}