Location: PHPKode > projects > Philosopher'Stone Personal > pssp/dvddel.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);


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


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

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

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

$app_navs = $sc->appnavs;
$dvd = $sc->dvd;

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

if (count($_POST) == 0)
	$items = $dvd->get_select_list();
elseif ($_POST['delete'] === 'Delete') {
	$dvd->delete($_POST['id']);
	smsg('Your DVD title has been deleted.');
	$items = $dvd->get_select_list();
}


/* ***** 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' => 'dvdedt.php', 'txt' => 'Edit Title'),
	array('url' => 'dvdadd.php', 'txt' => 'Add Title'),
	array('url' => 'dvd.php', 'txt' => 'List Titles')
);
$meta['return_url'] = 'dvddel.php';
$meta['app_title'] = 'DVD';
$meta['page_title'] = 'Delete DVD';
$meta['view_file'] = fullpath('view', 'dvddel');

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