<?php include_once 'db.php'; $model = new PersonModel(); if (isset($submit)) { $model->setData($id, $name, $addr, $country, $status); switch ($action) { case 1: $model->update(); break; default: $model->insert(); break; } header("Location: {$PHP_SELF}?id={$model->id}&action=1"); } include 'header.php'; echo '<p><font class=title>Person</font></p>'; if (isset($find)) { $result = $model->result($find); $view = new PersonView(&$model); $view->browse($result); die; } if (isset($id)) { $model->select($id); } $view = new PersonView(&$model); if (!isset($action)) { $action = 0; }