First shot at an actual working form to enter contact information. It only handles phone numbers at the moment, and it does NOT handle existing ones. It's a decent start though, and worth checking in. Next I'll have to handle existing phone numbers, and then addresses and emails. Of course, after that, I'll have to actually save everything to the database.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@209 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-05 15:01:18 +00:00
parent 6c656b07c3
commit bb5c44f19f
6 changed files with 245 additions and 147 deletions

View File

@@ -0,0 +1,31 @@
<?php /* -*- mode:PHP -*- */
/* form_table.ctp */
/*
*
* @filesource
* @copyright Copyright 2009, Abijah Perkins
* @package pmgr
*/
$rows = array();
foreach ($fields AS $field => $config) {
if (!isset($config['name']))
$config['name'] = implode(' ', array_map('ucfirst', explode('_', $field)));
if (!isset($config['opts']))
$config['opts'] = null;
if (isset($field_prefix))
$field = $field_prefix . '.' . $field;
$config['opts']['label'] = false;
$rows[] = array($config['name'],
$form->input($field, $config['opts']));
}
echo $this->element('table',
compact('class', 'caption', 'headers',
'rows', 'row_class', 'suppress_alternate_rows') +
array('column_class' => array('field', 'value'),
));