public function editModelAction($id) { $this->_view->title = 'Model Edit Form'; $this->_view->link = base_url() . 'active-record/user-model/edit-model/' . $id; $peoples = new Peoples(); $row = $peoples->findFirst('user_id = ' . $id); if (empty($row)) { redirect('active-record/user-model/show-model'); } $this->_view->data = $row; if (!empty($_POST)) { $val = new Validation(); $val->source = $_POST; $val->addValidator(array('name' => 'first_name', 'type' => 'string', 'required' => true)); $val->addValidator(array('name' => 'last_name', 'type' => 'string', 'required' => true)); $val->addValidator(array('name' => 'email', 'type' => 'email', 'required' => true)); $val->addValidator(array('name' => 'address', 'type' => 'string', 'required' => true)); $val->run(); if (sizeof($val->errors) == 0) { $data = array('first_name' => $_POST['first_name'], 'last_name' => $_POST['last_name'], 'email' => $_POST['email'], 'address' => $_POST['address']); $row->update('user_id = ' . $id, $data); redirect('active-record/user-model/show-model'); } $this->_view->errorMessage = $val->errorMessage(); $this->_view->data = $_POST; } $this->renderView('active-record/user-model/_form'); }
public function __construct($options = null) { $curators = new Peoples(); $assigned = $curators->getValuers(); ZendX_JQuery::enableForm($this); parent::__construct($options); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $this->setName('provisionalvaluations'); $valuerID = new Zend_Form_Element_Select('valuerID'); $valuerID->setLabel('Valuation provided by: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 25))->addValidator('InArray', false, array(array_keys($assigned)))->addMultiOptions($assigned)->setDecorators($decorators); $value = new Zend_Form_Element_Text('value'); $value->setLabel('Estimated market value: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Float')->setDecorators($decorators); $comments = new Pas_Form_Element_RTE('comments'); $comments->setLabel('Valuation comments: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars')); $dateOfValuation = new ZendX_JQuery_Form_Element_DatePicker('dateOfValuation'); $dateOfValuation->setLabel('Valuation provided on: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addValidator('Date')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag'); $this->addElements(array($valuerID, $value, $dateOfValuation, $comments, $submit)); $this->addDisplayGroup(array('valuerID', 'value', 'dateOfValuation', 'comments'), 'details')->removeDecorator('HtmlTag'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->details->removeDecorator('HtmlTag'); $this->addDisplayGroup(array('submit'), 'submit'); $this->submit->removeDecorator('DtDdWrapper'); $this->submit->removeDecorator('HtmlTag'); }
public function __construct($options = null) { $curators = new Peoples(); $assigned = $curators->getCurators(); ZendX_JQuery::enableForm($this); parent::__construct($options); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $this->setName('actionsForTreasure'); $curatorID = new Zend_Form_Element_Select('curatorID'); $curatorID->setLabel('Curator assigned: ')->setRequired(true)->addValidator('InArray', false, array(array_keys($assigned)))->addMultiOptions($assigned)->setDecorators($decorators); $chaseDate = new ZendX_JQuery_Form_Element_DatePicker('chaseDate'); $chaseDate->setLabel('Chase date assigned: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a chase date')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag'); $this->addElements(array($curatorID, $chaseDate, $submit, $hash)); $this->addDisplayGroup(array('curatorID', 'chaseDate'), 'details')->removeDecorator('HtmlTag'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->details->removeDecorator('HtmlTag'); $this->addDisplayGroup(array('submit'), 'submit'); $this->submit->removeDecorator('DtDdWrapper'); $this->submit->removeDecorator('HtmlTag'); }
public function __construct($options = null) { $countries = new Countries(); $countries_options = $countries->getOptions(); $counties = new Counties(); $counties_options = $counties->getCountyname2(); $peoples = new Peoples(); $people_options = $peoples->getNames2(); parent::__construct($options); $this->setName('organisation'); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li'))); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Organisation name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter an organisation name: ')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $website = new Zend_Form_Element_Text('website'); $website->setLabel('Organisation website: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator(new Pas_Validate_Url())->addErrorMessage('Please enter a valid URL')->setAttrib('size', 60)->setDecorators($decorators); $address1 = new Zend_Form_Element_Text('address1'); $address1->setLabel('Address line one: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $address2 = new Zend_Form_Element_Text('address2'); $address2->setLabel('Address line two: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $address3 = new Zend_Form_Element_Text('address3'); $address3->setLabel('Address line three: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $address = new Zend_Form_Element_Text('address'); $address->setLabel('Full address: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $town_city = new Zend_Form_Element_Text('town_city'); $town_city->setLabel('Town or city: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $county = new Zend_Form_Element_Select('county'); $county->setLabel('County: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Please choose a county', 'Valid counties' => $counties_options))->addValidator('InArray', false, array(array_keys($counties_options)))->setDecorators($decorators); $country = new Zend_Form_Element_Select('country'); $country->SetLabel('Country: ')->setRequired(true)->setValue('GB')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Please choose a country', 'Valid countries' => $countries_options))->addValidator('InArray', false, array(array_keys($countries_options)))->setDecorators($decorators); $postcode = new Zend_Form_Element_Text('postcode'); $postcode->setLabel('Postcode: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 10))->addValidator('ValidPostCode')->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('Please enter a valid postcode')->setAttrib('size', 10)->setDecorators($decorators); $contactperson = new Zend_Form_Element_Text('contact'); $contactperson->setLabel('Organisation\'s lead contact: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setAttrib('size', 50)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators); $contactpersonID = new Zend_Form_Element_Hidden('contactpersonID'); $contactpersonID->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label'); $submit = $this->addElement('submit', 'submit', array('label' => 'Login...')); $submit = $this->getElement('submit'); $submit->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setAttrib('class', 'large'); $this->addElements(array($name, $website, $address1, $address2, $address3, $address, $town_city, $county, $country, $postcode, $contactperson, $contactpersonID)); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800); $this->addElement($hash); $this->addDisplayGroup(array('name', 'website', 'address1', 'address2', 'address3', 'address', 'town_city', 'county', 'country', 'postcode', 'contact', 'contactpersonID'), 'details'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->details->setLegend('Organisation details: '); $this->addDisplayGroup(array('submit'), 'submit'); }
/** Edit a user's account */ public function editAction() { if ($this->_getParam('id', false)) { $form = new EditAccountForm(); $form->submit->setLabel('Edit account details'); $this->view->form = $form; if ($this->_request->isPost()) { $formData = $this->_request->getPost(); if ($form->isValid($formData)) { $id = (int) $this->_getParam('id'); $passwordfield = $form->getValue('password'); $users = new Users(); if (!is_null($passwordfield)) { $config = Zend_Registry::get('config'); $salt = $config->auth->salt; $password = SHA1($salt . $form->getValue('password')); $updateData = array('username' => $form->getValue('username'), 'first_name' => $form->getValue('first_name'), 'last_name' => $form->getValue('last_name'), 'fullname' => $form->getValue('fullname'), 'email' => $form->getValue('email'), 'institution' => $form->getValue('institution'), 'role' => $form->getValue('role'), 'password' => $password, 'peopleID' => $form->getValue('peopleID'), 'updated' => $this->getTimeForForms(), 'updatedBy' => $this->getIdentityForForms()); } else { $updateData = array('username' => $form->getValue('username'), 'first_name' => $form->getValue('first_name'), 'last_name' => $form->getValue('last_name'), 'fullname' => $form->getValue('fullname'), 'email' => $form->getValue('email'), 'institution' => $form->getValue('institution'), 'role' => $form->getValue('role'), 'peopleID' => $form->getValue('peopleID'), 'updated' => $this->getTimeForForms(), 'updatedBy' => $this->getIdentityForForms()); } foreach ($updateData as $key => $value) { if (is_null($value) || $value == "") { unset($updateData[$key]); } } $where = array(); $where[] = $users->getAdapter()->quoteInto('id = ?', $id); $users->update($updateData, $where); $this->_flashMessenger->addMessage('You updated: <em>' . $form->getValue('fullname') . '</em> successfully.'); $this->_redirect('/admin/users/account/username/' . $form->getValue('username')); } else { $form->populate($formData); } } else { $id = (int) $this->_request->getParam('id', 0); if ($id > 0) { $users = new Users(); $user = $users->fetchRow('id =' . $id); if (count($user)) { $data = $user->toArray(); if (isset($data['peopleID'])) { $people = new Peoples(); $person = $people->fetchRow($people->select()->where('secuid = ?', $data['peopleID'])); if ($person) { $person = $person->toArray(); $form->peopleID->setValue($person['secuid']); $form->person->setValue($person['fullname']); } } $form->populate($data); } else { throw new Pas_Exception_Param('No user account found with that id'); } } } } else { throw new Pas_Exception_Param('No parameter found on url string'); } }
public function peoplesearchAction() { $peoples = new Peoples(); $people_options = $peoples->getNamesSearch($this->_getParam('q')); echo Zend_Json::encode($people_options); }
public function SearchParamsUsers($params = NULL) { unset($params['submit']); unset($params['action']); unset($params['controller']); unset($params['module']); if (!is_null($params)) { echo 'You searched for: '; //Objecttype if (array_key_exists('objecttype', $params)) { if (!is_null($params['objecttype'])) { echo 'Object type: ' . $this->view->escape($params['objecttype']) . ' » '; } } //Broadperiod if (array_key_exists('broadperiod', $params)) { if (!is_null($params['broadperiod'])) { echo 'Broadperiod: ' . $this->view->escape($params['broadperiod']) . ' » '; } } //VA type if (array_key_exists('vaType', $params)) { if (!is_null($params['vaType'])) { $va = $params['vaType']; echo 'Van Arsdell Type: ' . $va; } } if (array_key_exists('woeid', $params)) { if (!is_null($params['woeid'])) { $woeid = $params['woeid']; echo 'Where on Earth ID: ' . $woeid; } } if (array_key_exists('recorderID', $params)) { if (!is_null($params['recorderID'])) { $rid = $params['recorderID']; $peoples = new Peoples(); $people = $peoples->fetchRow($peoples->select()->where('secuid = ?', $rid)); echo 'Recorded by: ' . $people->fullname; } } //County if (array_key_exists('county', $params)) { if (!is_null($params['county'])) { echo 'County: ' . $this->view->escape($params['county']) . ' » '; } } //Tribe for IA coins if (array_key_exists('tribe', $params)) { if (!is_null($params['tribe'])) { $tribe = $params['tribe']; $tribes = new Tribes(); $tribe = $tribes->fetchRow($tribes->select()->where('id = ?', (int) $tribe)); echo 'Iron Age Tribe: ' . $tribe->tribe; } } //region if (array_key_exists('regionID', $params)) { if (!is_null($params['regionID'])) { $region = $params['regionID']; $regions = new Regions(); $regions = $regions->getRegion($region); $this->regions = $regions; foreach ($this->regions as $region) { echo 'Region: ' . $this->view->escape($region['region']) . ' » '; } } } if (array_key_exists('material', $params)) { if (!is_null($params['material'])) { $mat = $params['material']; $materials = new Materials(); $materials = $materials->getMaterialName($mat); $this->materials = $materials; foreach ($this->materials as $material) { echo 'Primary material: ' . $this->view->escape($material['term']) . ' » '; } } } if (array_key_exists('parish', $params)) { if (!is_null($params['parish'])) { echo 'Parish: ' . $this->view->escape($params['parish']) . ' » '; } } if (array_key_exists('district', $params)) { if (!is_null($params['district'])) { echo 'District: ' . $this->view->escape($params['district']) . ' » '; } } if (array_key_exists('denomination', $params)) { $denomname = $params['denomination']; $denoms = new Denominations(); $denoms = $denoms->getDenomName($denomname); $this->denoms = $denoms; foreach ($this->denoms as $denom) { echo 'Denomination type: ' . $this->view->escape($denom['denomination']) . ' » '; } } if (array_key_exists('description', $params)) { if (!is_null($params['description'])) { echo 'Description contained: ' . $this->view->escape($params['description']) . ' » '; } } if (array_key_exists('fourFigure', $params)) { if (!is_null($params['fourFigure'])) { echo 'Four figure grid reference: ' . $this->view->escape($params['fourFigure']) . ' » '; } } if (array_key_exists('old_findID', $params)) { if (!is_null($params['old_findID'])) { echo 'Find reference number: ' . $this->view->escape($params['old_findID']) . ' » '; } } if (array_key_exists('fromsubperiod', $params)) { if (!is_null($params['fromsubperiod'])) { $sub = $params['fromsubperiod']; if ($sub == 1) { echo 'Subperiod: Early' . ' » '; } else { if ($sub == 2) { echo 'Subperiod: Middle' . ' » '; } else { if ($sub == 3) { echo 'Subperiod: Late' . ' » '; } } } } } if (array_key_exists('tosubperiod', $params)) { if (!is_null($params['tosubperiod'])) { $sub = $params['tosubperiod']; if ($sub == 1) { echo 'Subperiod: Early' . ' » '; } else { if ($sub == 2) { echo 'Subperiod: Middle' . ' » '; } else { if ($sub == 3) { echo 'Subperiod: Late' . ' » '; } } } } } if (array_key_exists('periodfrom', $params)) { if (!is_null($params['periodfrom'])) { $period = $params['periodfrom']; $periods = new Periods(); $periods = $periods->getPeriodName($period); $this->periods = $periods; foreach ($this->periods as $period) { echo 'Period from: ' . $this->view->escape($period['term']) . ' » '; } } } //Period to key if (array_key_exists('periodto', $params)) { if (!is_null($params['periodto'])) { $period = $params['periodto']; $periods = new Periods(); $periods = $periods->getPeriodName($period); $this->periods = $periods; foreach ($this->periods as $period) { echo 'Period to: ' . $this->view->escape($period['term']) . ' » '; } } } // if (array_key_exists('surface', $params)) { if (!is_null($params['surface'])) { $surfaceterm = $params['surface']; $surfaces = new Surftreatments(); $surfaces = $surfaces->getSurfaceTerm($surfaceterm); $this->surfaces = $surfaces; foreach ($this->surfaces as $surface) { echo 'Surface treatment: ' . $this->view->escape($surface['term']) . ' » '; } } } if (array_key_exists('class', $params)) { if (!is_null($params['class'])) { echo 'Classification term like: ' . $this->view->escape($params['class']) . ' » '; } } //Date from starts if (array_key_exists('from', $params)) { if (!is_null($params['from'])) { $from = $params['from']; $suffix = "BC"; $prefix = "AD"; if ($from < 0) { $date = abs($from) . ' ' . $suffix; } else { if ($from > 0) { $date = $prefix . ' ' . abs($from); } } echo 'Date from greater or equal to: ' . (int) $date . ' » '; } } //Date from ends if (array_key_exists('fromend', $params)) { if (!is_null($params['fromend'])) { $from = $params['fromend']; $suffix = "BC"; $prefix = "AD"; if ($from < 0) { $date = abs($from) . ' ' . $suffix; } else { if ($from > 0) { $date = $prefix . ' ' . abs($from); } } echo 'Date from smaller or equal to: ' . $date . ' » '; } } //Date to starts //Date to ends //Year found if (array_key_exists('discovered', $params)) { if (!is_null($params['discovered'])) { echo 'Year of discovery where known: ' . $this->view->escape($params['discovered']) . ' » '; } } //Found by if (array_key_exists('finder', $params)) { if (!is_null($params['finder'])) { $finder = $params['finder']; $peoples = new Peoples(); $peoples = $peoples->getName($finder); $this->peoples = $peoples; foreach ($this->peoples as $people) { echo 'Item found by: ' . $this->view->escape($people['term']) . ' » '; } } } //Identified by if (array_key_exists('idby', $params)) { if (!is_null($params['idby'])) { $finder = $params['idby']; $peoples = new Peoples(); $peoples = $peoples->getName($finder); $this->peoples = $peoples; foreach ($this->peoples as $people) { echo 'Identified by: ' . $this->view->escape($people['term']) . ' » '; } } } //Recorded by //Identified by if (array_key_exists('recordby', $params)) { if (!is_null($params['recordby'])) { $finder = $params['recordby']; $peoples = new Peoples(); $peoples = $peoples->getName($finder); $this->peoples = $peoples; foreach ($this->peoples as $people) { echo 'Recorded by: ' . $this->view->escape($people['term']) . ' » '; } } } //Issuer if (array_key_exists('ruler', $params)) { if (!is_null($params['ruler'])) { $ruler = $params['ruler']; $rulers = new Rulers(); $rulers = $rulers->getRulersName($ruler); $this->rulers = $rulers; foreach ($this->rulers as $ruler) { echo 'Coin issued by: ' . $this->view->escape($ruler['issuer']) . ' » '; } } } if (array_key_exists('note', $params)) { if ($params['note'] == (int) 1) { echo 'Object is a find of note'; } } if (array_key_exists('treasure', $params)) { if ($params['treasure'] == (int) 1) { echo 'Object is Treasure or potential Treasure'; } } if (array_key_exists('TID', $params)) { if (!is_null($params['TID'])) { echo 'Treasure case number: ' . $this->view->escape($params['TID']); } } if (array_key_exists('created', $params)) { if (!is_null($params['created'])) { echo 'Finds entered on: ' . $this->view->escape($params['created']); } } if (array_key_exists('createdBefore', $params)) { if (!is_null($params['createdBefore'])) { echo 'Finds entered on or before: ' . $this->view->niceShortDate($this->view->escape($params['createdBefore'])) . ' » '; } } if (array_key_exists('createdAfter', $params)) { if (!is_null($params['createdAfter'])) { echo 'Finds entered on or after: ' . $this->view->niceShortDate($this->view->escape($params['createdAfter'])) . ' » '; } } if (array_key_exists('hoard', $params)) { if ((int) $params['hoard'] == (int) 1) { echo 'Object is part of a hoard.' . ' » '; } } if (array_key_exists('hID', $params)) { if ((int) $params['hID']) { $hID = $params['hID']; $hIDs = new Hoards(); $hIDsList = $hIDs->getHoardDetails((int) $hID); $this->hids = $hIDsList; foreach ($this->hids as $hid) { echo 'Part of the ' . $this->view->escape($hid['term']) . ' hoard.' . ' » '; } } } if (array_key_exists('otherref', $params)) { if (!is_null($params['otherref'])) { echo 'Other reference: ' . $this->view->escape($params['otherref']); } } //Workflow if (array_key_exists('workflow', $params)) { if (!is_null($params['workflow'])) { $stage = $params['workflow']; $stages = new Workflows(); $stages = $stages->getStageName($stage); $this->stages = $stages; foreach ($this->stages as $stage) { echo 'Workflow stage: ' . $this->view->escape($stage['workflowstage']) . ' » '; } } } if (array_key_exists('manufacture', $params)) { if (!is_null($params['manufacture'])) { $manufacture = $params['manufacture']; $manufactures = new Manufactures(); $manufactures = $manufactures->getManufactureDetails((int) $manufacture); $this->manufactures = $manufactures; foreach ($this->manufactures as $man) { echo 'Manufacture type: ' . $this->view->escape($man['term']) . ' » '; } } } if (array_key_exists('decoration', $params)) { if (!is_null($params['decoration'])) { $decoration = $params['decoration']; $decorations = new Decmethods(); $decorations = $decorations->getDecorationDetails((int) $decoration); $this->decorations = $decorations; foreach ($this->decorations as $dec) { echo 'Decoration type: ' . $this->view->escape($dec['term']) . ' » '; } } } //Mint if (array_key_exists('mint', $params)) { if (!is_null($params['mint'])) { $id = $params['mint']; $mints = new Mints(); $mints = $mints->getMintName($id); $this->mints = $mints; foreach ($this->mints as $mint) { echo 'Mint issuing coins: ' . $this->view->escape($mint['mint_name']) . ' (' . $mint['term'] . ')' . ' » '; } } } //Category if (array_key_exists('category', $params)) { if (!is_null($params['category'])) { $id = $params['category']; $cats = new CategoriesCoins(); $cats = $cats->getCategory($id); $this->cats = $cats; foreach ($this->cats as $cat) { echo 'Coin category: ' . $this->view->escape($cat['term']) . ' » '; } } } if (array_key_exists('reeceID', $params)) { if (!is_null($params['reeceID'])) { $id = $params['reeceID']; $reeces = new Reeces(); $rs = $reeces->getReecePeriodDetail($id); foreach ($rs as $r) { echo 'Reece Period: ' . $this->view->escape($r['period_name']) . ' ' . $r['date_range'] . ' » '; } } } //Workflow if (array_key_exists('createdby', $params)) { if (!is_null($params['createdby'])) { $createdby = $params['createdby']; $users = new Users(); $names = $users->getCreatedBy($createdby); $this->names = $names; foreach ($this->names as $name) { echo 'Record created by: <a href="' . $this->view->baseUrl() . '/contacts/staff/profile/id/' . $name['i'] . '" title="View profile for ' . $name['fullname'] . '">' . $name['fullname'] . '</a>' . ' » '; } } } //End of function echo '</ul>'; } }