profile page

From SkyPHP

Jump to: navigation, search

page | listing page | profile page

A profile page is a page that is used for editing a specific record -- or inserting a new record.

Contents

Anatomy of a Profile Page

Example Intranet Profile Page (editable form)

/admin/person/person-profile.php

<?
$model = 'person';
$r = aql::profile($model,IDE);

$primary_table = aql::get_primary_table($model);
if (is_numeric($r[$primary_table.'_id'])) $title = $r['fname'] . ' ' . $r['lname'];
else $title = 'Add New Person';

template::inc('intranet','top');

aql::form($model);

?>
<input type="button" value="Save" onclick="save_form('<?=$model?>');" />
<?

template::inc('intranet','bottom');
?>

Example Website Profile Page (read-only w/ tabs)

/person/person-profile.php

<?
$model = 'person';
$r = aql::profile($model,IDE);

$title = $r['fname'] . ' ' . $r['lname'];

template::inc('website','top');

snippet::tabs(array(
    'First Tab' => URLPATH . 'first-tab',
    'Second Tab' => URLPATH . 'second-tab'
));

include( INCPATH . 'first-tab.php' );

template::inc('website','bottom');
?>

PHP Functions

Javascript Functions

  • save_form() - submit a form (and optionally redirect to another page)
Personal tools