The writing off a page for displaying/modifying/deleting entries of a view is quite straightforward. You must only care of checking the user rights and then modify the view's options.
Here is what you can write for the vacance.php3 file:
<?
include("local.inc");
include("auth.inc");
include("miseEnPage.inc");
include("sgbd.inc");
include("form.inc");
include("tables.inc");
include("gestFields.inc");
include("tableEdit.inc");
entete($titre_vacance);
//ouvre la connection avec Postgres et test les droits de l'utilisateur
openSGBD($DATABASE);
if(!canModif()) {
$table_vacance[0]["options"]=$table_vacance[0]["options"]|
($READONLY+$PASEFFACER);
}
tableEdit($table_vacance, "vacance.php3");
closeSGBD();
piedPage();
?>
First we have some includes:
Secondly we display the page header with the entete("title of page") function and we open a connection with database (openSGBD("name of database")).
If the user don't have the rights to modify this view, we add the $READONLY and the $PASEFFACER options to the view.
Then we can call the magic function tableEdit($def_of_view) who will display the form and do any required operations on the database.
Finally we can close the database and display the footer.
The original version of vacance.php3 have some add-ons for having the monthly view updated. It's not relevant in this sample, so it's not shown here.