Location: PHPKode > projects > Philosopher'Stone Personal > pssp/abkshow.php
<?php

// Copyright (c) 2010 by Paul M. Foster <hide@address.com>
// Licensed under PostgreSQL License (see LICENSE file)

include('setup.php');

allowed(127, 5);

$id = get_or_post('id', 'You must select an address first', 'abkpick.php');

/* ***** FIELDS TO BE VALIDATED ***** */

/* ***** CLASS REGISTRATION ***** */

$sc->register('abook', array('class' => 'abook', 'shared' => true, 'depends' => 'db', 'arguments' => '%db%'));


/* ***** INSTANTIATE CLASSES HERE ***** */

$app_navs = $sc->appnavs;
$abk = $sc->abook;

/* ***** VALIDATE USER DATA ***** */

$a = $abk->get_record_by_id($id);

if (isset($_POST['edit']) && $_POST['edit'] === 'Edit') {
	redirect('abkedt.php?id=' . $_POST['id']);
}
elseif (isset($_POST['delete']) && $_POST['delete'] === 'Delete') {
	redirect('abkdel.php?id=' . $_POST['id']);
}

/* ***** PAGE SETUP ***** */

$meta['app_navs'] = $app_navs->get();
$meta['file_mtime'] = date('d F Y H:i:s', getlastmod());
$meta['mod_navs'] = array(
	array('url' => 'abkadd.php', 'txt' => 'Add Address'),
	array('url' => 'abkpick.php', 'txt' => 'Select Address')
);
$meta['return_url'] = 'abkshow.php';
$meta['app_title'] = 'Addresses';
$meta['page_title'] = 'Show Address';
$meta['view_file'] = fullpath('view', 'abkshow');

include('generic.php');
Return current item: Philosopher'Stone Personal