Example #1
0
        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;
}
$view->edit($action);
class PersonModel
{
    var $id;
    var $name;
    var $addr;
    var $country;
    var $status;
    function setData($id, $name, $addr, $country, $status)
    {