public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setMethod('get');
     $this->setName('filterfinds');
     $decorator = array('TableDecInput');
     $objectType = new Zend_Form_Element_Select('objectType');
     $objectType->setLabel('Filter by object type')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->addErrorMessage('Come on it\'s not that hard, enter a title!')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Filter by broadperiod')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter:')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'largefilter');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($objectType, $broadperiod, $county, $submit));
 }
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setMethod('get');
     $this->setName('filterfinds');
     $decorator = array('TableDecInput');
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('Filter by object type')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 15)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $oldfindID = new Zend_Form_Element_Text('old_findID');
     $oldfindID->setLabel('Filter by find ID #')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 15)->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $TID = new Zend_Form_Element_Text('TID');
     $TID->setLabel('Filter by treasure ID #')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 15)->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Filter by broadperiod')->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose period from' => $periodword_options))->addValidator('InArray', false, array(array_keys($periodword_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $this->addElements(array($objecttype, $oldfindID, $TID, $broadperiod, $county, $submit, $hash));
 }
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $activities = new PrimaryActivities();
     $activities_options = $activities->getTerms();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setName('filterpeople');
     $decorator = array('TableDecInput');
     $name = new Zend_Form_Element_Text('organisation');
     $name->setLabel('Filter by name')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 40)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $contact = new Zend_Form_Element_Text('contact');
     $contact->setLabel('Filter by contact person: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Enter a valid organisation')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $contactpersonID = new Zend_Form_Element_Hidden('contactpersonID');
     $contactpersonID->removeDecorator('Label')->removeDecorator('DtDdWrapper')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('HtmlTag')->addValidator('Alnum');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $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->addElements(array($name, $county, $contact, $contactpersonID, $submit));
 }
Example #4
0
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setMethod('post');
     $this->setName('filterfinds');
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
     $this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator');
     $decorator = array('TableDecInput');
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('Filter by object type')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 10)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $oldfindID = new Zend_Form_Element_Text('old_findID');
     $oldfindID->setLabel('Filter by find ID #')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 11)->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Filter by broadperiod')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose period from' => $periodword_options))->addValidator('InArray', false, array(array_keys($periodword_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter:')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'largefilter');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($objecttype, $oldfindID, $broadperiod, $county, $submit));
 }
 public function __construct($options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getPeriodFromWords();
     $counties = new Counties();
     $counties_options = $counties->getCountyname2();
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('whatwherewhen');
     $this->removeDecorator('HtmlTag');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!')->setDecorators($decorators);
     //Objecttype - autocomplete from thesaurus
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('What: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!')->setDecorators($decorators);
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('When: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose period from' => $period_options))->addValidator('InArray', false, array($period_options))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Where: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $counties_options))->addValidator('InArray', false, array($counties_options))->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Search!')->setAttribs(array('class' => 'large'))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($old_findID, $objecttype, $county, $broadperiod, $submit));
     $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('old_findID', 'objecttype', 'broadperiod', 'county', 'submit'), 'Search');
     $this->Search->removeDecorator('DtDdWrapper');
     $this->Search->removeDecorator('HtmlTag');
     $this->Search->addDecorators(array(array('HtmlTag', array('tag' => 'ul', 'id' => 'www'))))->setLegend('What/Where/When search')->addDecorator('FieldSet');
 }
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFrom();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setMethod('post');
     $this->setName('filterusers');
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
     $this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator');
     $decorator = array('TableDecInput');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Filter by ID #: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 11)->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $label = new Zend_Form_Element_Text('label');
     $label->setLabel('Filter by image label:')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 25)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Filter by broadperiod: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose period from' => $periodword_options))->addValidator('InArray', false, array(array_keys($periodword_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $this->addElements(array($old_findID, $label, $broadperiod, $county, $submit));
 }
Example #7
0
 public function regionsAction()
 {
     if ($this->_getParam('term', false)) {
         $regions = new Counties();
         $response = $regions->getRegions($this->_getParam('term'));
     } else {
         $response = array('id' => NULL, 'term' => 'No county specified');
     }
     echo Zend_Json::encode($response);
 }
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $crimes = new CrimeTypes();
     $crimeoptions = $crimes->getTypes();
     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')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('rally');
     $crimeType = new Zend_Form_Element_Select('crimeType');
     $crimeType->setLabel('Crime type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set crime type or no point entering it!')->addMultiOptions(array(NULL => 'Choose a crime type', 'Valid types' => $crimeoptions))->addValidator('inArray', false, array(array_keys($crimeoptions)))->setDecorators($decorators);
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setLabel('Title: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setAttrib('size', 50)->addErrorMessage('You must enter a subject for this crime');
     $reporterID = new Zend_Form_Element_Hidden('reporterID');
     $reporterID->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You do not appear to have chosen a reporter');
     $reporter = new Zend_Form_Element_Text('reporter');
     $reporter->setLabel('Source: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setDescription('Name and address of person providing intelligence.')->addErrorMessage('You must enter a reporter name');
     $reportingPerson = new Zend_Form_Element_Text('reportingPerson');
     $reportingPerson->setLabel('Person making the report: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setDescription('Name of person providing intelligence.')->addErrorMessage('You must enter a reporter name');
     $reportSubject = new Zend_Form_Element_Text('reportSubject');
     $reportSubject->setLabel('Subject of report: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setDescription('Name of suspect if known.')->addErrorMessage('You must enter a reporter name');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a county', 'Valid counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose district after county'));
     $reliability = new Zend_Form_Element_Select('reliability');
     $reliability->setLabel('Source Evaluation: ')->addMultiOptions(array('1' => 'Always reliable', '2' => 'Mostly reliable', '3' => 'Sometimes reliable', '4' => 'Unreliable', '5' => 'Don\'t know'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->setDecorators($decorators);
     $intellEvaluation = new Zend_Form_Element_Select('intellEvaluation');
     $intellEvaluation->setLabel('Intelligence Evaluation: ')->addMultiOptions(array('1' => 'Known to be true', '2' => 'Known to be true by the source, but not by the person making the report', '3' => 'Not known, but is corroborated', '4' => 'Cannot be judged', '5' => 'Suspected to be false!'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setDescription('What you know about the intelligence itself.')->setOptions(array('separator' => ''))->setDecorators($decorators);
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose parish after district'))->addFilters(array('StripTags', 'StringTrim'));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Associated NGR: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setAttrib('maxlength', 16)->setDecorators($decorators);
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Description of crime - Main report: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $subjectDetails = new Pas_Form_Element_RTE('subjectDetails');
     $subjectDetails->setLabel('Subject details: ')->setRequired(false)->setDescription('DOB,address,description,etc if known.')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $evaluation = new Pas_Form_Element_RTE('evaluation');
     $evaluation->setLabel('Offences: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $incidentDate = new ZendX_JQuery_Form_Element_DatePicker('incidentDate');
     $incidentDate->setLabel('Date of incident: ')->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Date'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $sam = new Zend_Form_Element_Text('sam');
     $sam->setLabel('Associated with scheduled monument: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setAttrib('size', 35);
     $samID = new Zend_Form_Element_Hidden('samID');
     $samID->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($crimeType, $incidentDate, $samID, $sam, $reporter, $reporterID, $county, $district, $parish, $gridref, $description, $reliability, $evaluation, $subject, $reliability, $intellEvaluation, $subjectDetails, $reportSubject, $reportingPerson, $submit));
     $this->addDisplayGroup(array('subject', 'crimeType', 'description', 'incidentDate', 'evaluation', 'reportingPerson', 'reporter', 'reporterID', 'reliability', 'intellEvaluation', 'reportSubject', 'subjectDetails', 'sam', 'samID', 'gridref', 'county', 'district', 'parish'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Crime details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 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');
 }
Example #10
0
 public function __construct($options = null)
 {
     $countries = new Countries();
     $countries_options = $countries->getOptions();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $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('coroner');
     $firstname = new Zend_Form_Element_Text('firstname');
     $firstname->setLabel('First name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Come on it\'s not that hard, enter a firstname!')->setDecorators($decorators);
     $lastname = new Zend_Form_Element_Text('lastname');
     $lastname->setLabel('Last name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $email = new Zend_Form_Element_Text('email');
     $email->SetLabel('Email address: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addValidator('EmailAddress', false)->setDecorators($decorators);
     $address_1 = new Zend_Form_Element_Text('address_1');
     $address_1->SetLabel('Address line one: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $address_2 = new Zend_Form_Element_Text('address_2');
     $address_2->SetLabel('Address line two: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $town = new Zend_Form_Element_Text('town');
     $town->SetLabel('Town: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => 'Choose county', 'Valid county' => $county_options))->setDecorators($decorators);
     $region_name = new Zend_Form_Element_Text('region_name');
     $region_name->SetLabel('Administrative region: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $postcode = new Zend_Form_Element_Text('postcode');
     $postcode->SetLabel('Postcode: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addValidator('ValidPostCode')->setDecorators($decorators);
     $country = new Zend_Form_Element_Select('country');
     $country->SetLabel('Country: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 4))->addValidator('InArray', false, array(array_keys($countries_options)))->addMultiOptions($countries_options)->setValue('GB')->setDecorators($decorators);
     $telephone = new Zend_Form_Element_Text('telephone');
     $telephone->SetLabel('Telephone number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $fax = new Zend_Form_Element_Text('fax');
     $fax->SetLabel('Fax number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($firstname, $lastname, $email, $address_1, $address_2, $town, $postcode, $county, $country, $telephone, $fax, $region_name, $submit));
     $this->addDisplayGroup(array('firstname', 'lastname', 'region_name', 'email', 'address_1', 'address_2', 'town', 'postcode', 'county', 'country', 'telephone', 'fax'), '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');
     $this->details->setLegend('Submit Coroner\'s details ');
 }
Example #11
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $copyrights = new Copyrights();
     $copy = $copyrights->getStyles();
     $auth = Zend_Auth::getInstance();
     $this->_auth = $auth;
     if ($this->_auth->hasIdentity()) {
         $user = $this->_auth->getIdentity();
         $this->_copyright = $user->copyright;
     } else {
         $this->_copyright = 'The Portable Antiquities Scheme';
     }
     parent::__construct($options);
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setName('imagetofind');
     $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')));
     $image = new Zend_Form_Element_File('image');
     $image->setLabel('Upload an image: ')->setRequired(true)->setAttrib('size', 20)->addValidator('Extension', false, 'jpeg,tif,jpg,png,gif,tiff,JPG,JPEG,GIF,PNG,TIFF,TIF')->addDecorator('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li'))->addDecorator('Label')->addDecorator('HtmlTag', array('tag' => 'li'))->addDecorator('file')->setDescription('Filename should not include spaces,commas,( or )')->addErrorMessage('You must upload a file with the correct file extension in this array - jpeg,tif,jpg,png,gif');
     $imagelabel = new Zend_Form_Element_Text('label');
     $imagelabel->setLabel('Image label: ')->setRequired(true)->setAttrib('size', 60)->addErrorMessage('You must enter a label')->setDescription('This must be descriptive text about the image - NOT THE FILE or FIND NUMBER/NAME')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'));
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Period: ')->setRequired(true)->setDecorators($decorators)->addErrorMessage('You must enter a period for the image')->addMultiOptions(array(NULL => 'Select a period', 'Valid periods' => $period_options))->addValidator('inArray', false, array(array_keys($period_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->setRequired(true)->setDecorators($decorators)->addErrorMessage('You must enter a county of origin')->addMultiOptions(array(NULL => 'Select a county of origin', 'Valid counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)));
     $copyright = new Zend_Form_Element_Select('copyrighttext');
     $copyright->setLabel('Image copyright: ')->setRequired(true)->addErrorMessage('You must enter a licence holder')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Select a licence holder', 'Valid copyrights' => $copy))->setValue($this->_copyright);
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Image type: ')->setRequired(true)->addMultiOptions(array(NULL => 'Select the type of image', 'Image types' => array('digital' => 'Digital image', 'illustration' => 'Scanned illustration')))->setValue('digital')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper');
     $this->addElements(array($image, $imagelabel, $county, $period, $copyright, $type, $submit));
     $this->setMethod('post');
     $this->addDisplayGroup(array('image', 'label', 'county', 'period', 'copyrighttext', 'type'), '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')->removeDecorator('HtmlTag');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
     $this->details->setLegend('Attach an image');
 }
Example #12
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     ZendX_JQuery::enableForm($this);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('rally');
     $rally_name = new Zend_Form_Element_Text('rally_name');
     $rally_name->setLabel('Rally name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', 60)->addErrorMessage('Come on it\'s not that hard, enter a name for the rally!')->setDecorators($decorators);
     $organisername = new Zend_Form_Element_Text('organisername');
     $organisername->setLabel('Rally Organiser: ')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $organiser = new Zend_Form_Element_Hidden('organiser');
     $organiser->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addFilters(array('StripTags', 'StringTrim'));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addMultiOptions(array(NULL => 'Choose a county', 'Valid counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose district after county'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after district'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Centred on field at NGR: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('maxlength', 16)->setDecorators($decorators)->addValidators(array('NotEmpty', 'ValidGridRef'));
     $record_method = new Pas_Form_Element_RTE('record_method');
     $record_method->setLabel('Recording methodology employed: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 80)->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
     $comments = new Zend_Form_Element_Textarea('comments');
     $comments->setLabel('Comments on rally: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 80)->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
     //Date found from
     $date_from = new ZendX_JQuery_Form_Element_DatePicker('date_from');
     $date_from->setLabel('Start date of rally: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->setDecorators($decorators);
     //Date found to
     $date_to = new ZendX_JQuery_Form_Element_DatePicker('date_to');
     $date_to->setLabel('End date of rally: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($rally_name, $date_from, $date_to, $organiser, $organisername, $county, $district, $parish, $gridref, $comments, $record_method, $submit));
     $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('rally_name', 'comments', 'record_method', 'date_from', 'date_to', 'organiser', 'organisername', 'county', 'district', 'parish', 'gridref'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Rally details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Example #13
0
 function stock_level()
 {
     $data['title'] = "Stock level";
     $data['content_view'] = "stock";
     $data['scripts'] = array("FusionCharts/FusionCharts.js");
     $data['banner_text'] = "Stock Level";
     $data['quick_link'] = "load_stock";
     $data['link'] = "home";
     $data['counties'] = Counties::getAll();
     $data['categories'] = Drug_category::getAll();
     $data['quick_link'] = "load_stock";
     $this->load->view("template", $data);
 }
Example #14
0
 public function manage_users()
 {
     $permissions = 'super_permissions';
     $data['title'] = "Users";
     $data['content_view'] = "Admin/users_v";
     $data['listing'] = Users::get_user_list_all();
     $data['counts'] = Users::get_users_count();
     $data['counties'] = Counties::getAll();
     $data['facilities'] = Facilities::getAll();
     $data['sub_counties'] = Districts::getAll();
     $data['user_types'] = Access_level::get_access_levels($permissions);
     $this->load->view("shared_files/template/dashboard_v", $data);
 }
Example #15
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setName('filtersams');
     $decorator = array('TableDecInput');
     $monumentName = new Zend_Form_Element_Text('monumentName');
     $monumentName->setLabel('Filter by name:')->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Filter by parish')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('Filter by district: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter:')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'largefilter');
     $this->addElements(array($monumentName, $county, $district, $parish, $submit, $hash));
 }
Example #16
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     parent::__construct($options);
     $this->setName('imageeditfind');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $imagelabel = new Zend_Form_Element_Text('label');
     $imagelabel->setLabel('Image label')->setRequired(true)->setAttrib('size', 70)->addErrorMessage('You must enter a label')->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators);
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Period: ')->setRequired(true)->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose a period' => $period_options))->addValidator('inArray', false, array(array_keys($period_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->setRequired(true)->setDecorators($decorators)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose a county' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)));
     $copyright = new Zend_Form_Element_Text('imagerights');
     $copyright->setLabel('Image copyright')->setAttrib('size', 70)->setDecorators($decorators)->addFilters(array('StringTrim', 'StripTags'));
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Image type: ')->setRequired(true)->addMultiOptions(array('Please choose publish state' => array('digital' => 'Digital image', 'illustration' => 'Scanned illustration')))->setValue('digital')->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators);
     $rotate = new Zend_Form_Element_Radio('rotate');
     $rotate->setLabel('Rotate the image: ')->setRequired(false)->addValidator('Int')->addMultiOptions(array('-90' => '90 degrees anticlockwise', '-180' => '180 degrees anticlockwise', '-270' => '270 degrees anticlockwise', '90' => '90 degrees clockwise', '180' => '180 degrees clockwise', '270' => '270 degrees clockwise'));
     $regenerate = new Zend_Form_Element_Checkbox('regenerate');
     $regenerate->setLabel('Regenerate thumbnail: ')->setDecorators($decorators);
     $filename = new Zend_Form_Element_Hidden('filename');
     $filename->removeDecorator('label')->removeDecorator('HtmlTag')->addFilters(array('StringTrim', 'StripTags'))->removeDecorator('DtDdWrapper');
     $imagedir = new Zend_Form_Element_Hidden('imagedir');
     $imagedir->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper');
     $this->addElements(array($imagelabel, $county, $period, $copyright, $type, $rotate, $regenerate, $filename, $imagedir, $submit));
     $this->setMethod('post');
     $this->addDisplayGroup(array('label', 'county', 'period', 'imagerights', 'type', 'rotate', 'regenerate'), 'details');
     $this->addDisplayGroup(array('submit'), 'submit')->removeDecorator('HtmlTag');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Attach an image');
     $this->details->setLegend('Attach an image')->addDecorators(array('FieldSet', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
 }
Example #17
0
 public function district_orders($msg = NULL)
 {
     //$district_id=$this -> session -> userdata('district');
     $district_id = $this->session->userdata('district1');
     $data['title'] = "Subcounty Orders";
     $data['content_view'] = "district/district_orders_v";
     $data['banner_text'] = "Subcounty Orders";
     $data['order_counts'] = Counties::get_county_order_details(null, $district_id, null);
     $data['delivered'] = Counties::get_county_received(null, $district_id, null);
     $data['pending'] = Counties::get_pending_county(null, $district_id, null);
     $data['approved'] = Counties::get_approved_county(null, $district_id, null);
     $data['rejected'] = Counties::get_rejected_county(null, $district_id, null);
     $this->load->view("template", $data);
 }
 public function optionsAddClone()
 {
     $findspots = new Findspots();
     $findspot = $findspots->getLastRecord($this->_getIdentity());
     $data = $findspot[0];
     $this->_view->form->populate($data);
     Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->addMessage('Your last record data has been cloned');
     if (!is_null($data['county'])) {
         $districts = new Places();
         $district = $districts->getDistrictList($data['county']);
         if ($district) {
             $this->_view->form->district->addMultiOptions(array(NULL => 'Choose district', 'Available districts' => $district));
         }
         if (!is_null($data['district'])) {
             $parishes = $districts->getParishList($data['district']);
             $this->_view->form->parish->addMultiOptions(array(NULL => 'Choose parish', 'Available parishes' => $parishes));
         }
         if (!is_null($data['county'])) {
             $cnts = new Counties();
             $region_list = $cnts->getRegionsList($data['county']);
             $this->_view->form->regionID->addMultiOptions(array(NULL => 'Choose region', 'Available regions' => $region_list));
         }
     }
     if (!is_null($data['landusevalue'])) {
         $landcodes = new Landuses();
         $landusecode_options = $landcodes->getLandusesChildList($data['landusevalue']);
         $this->_view->form->landusecode->addMultiOptions(array(NULL => 'Choose code', 'Available landuses' => $landusecode_options));
     }
     if (!is_null($findspot['landowner'])) {
         $finders = new Peoples();
         $finders = $finders->getName($findspot['landowner']);
         foreach ($finders as $finder) {
             $form->landownername->setValue($finder['term']);
         }
     }
 }
Example #19
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $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('mapsearch');
     $latitude = new Zend_Form_Element_Text('declat');
     $latitude->setLabel('Latitude: ')->setDecorators($decorators);
     $longitude = new Zend_Form_Element_Text('declong');
     $longitude->setLabel('Longitude: ')->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setRegisterInArrayValidator(false)->setDecorators($decorators);
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->setDecorators($decorators);
     $distance = new Zend_Form_Element_Select('distance');
     $distance->setLabel('Distance from point: ')->addMultiOptions(array(NULL => NULL, 'Choose distance' => array('0.05' => '50 metres', '0.1' => '100 metres', '0.25' => '250 metres', '0.5' => '500 metres', '1' => '1 kilometre', '2' => '2 kilometres', '3' => '3 kilometres', '4' => '4 kilometres', '5' => '5 kilometres', '10' => '10 kilometres')))->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('Object type: ')->setRequired(false)->setAttrib('size', 20)->addFilter('StripTags')->addFilter('StringTrim')->setDecorators($decorators)->addErrorMessage('You must enter an object type and it must be valid');
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Nat. Grid Reference: ')->setRequired(false)->setAttrib('size', 16)->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('maxlength', 16)->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $this->addElements(array($objecttype, $distance, $county, $district, $parish, $gridref, $latitude, $longitude, $submit));
     $this->addDisplayGroup(array('objecttype', 'county', 'district', 'parish', 'gridref', 'declat', 'declong', 'distance'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('ListWrapper');
     $this->removeDecorator('HtmlTag');
     $this->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div', 'id' => 'mapsearchcontainer'));
     $this->details->setLegend('Spatial data: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Example #20
0
 public function submit()
 {
     $id = $this->input->post('id');
     $password = $this->input->post('password');
     $use_id = $id;
     if ($this->_submit_validate() === FALSE) {
         $this->index($use_id);
         return;
     }
     $pass = Doctrine::getTable('user')->findOneById($id);
     $pass->password = $password;
     $pass->save();
     $data['title'] = "View Users";
     $data['content_view'] = "users_facility_v";
     $data['banner_text'] = "Facility Users";
     $data['result'] = User::getAll2();
     $data['counties'] = Counties::getAll();
     $this->load->view("template", $data);
 }
Example #21
0
 public function get_facility_bin_card_pdf($facility_code, $report_type, $commodity_id)
 {
     $county_id = $this->session->userdata('county_id');
     $district_id = $this->session->userdata('district_id');
     $param = implode('/', func_get_args());
     $args = array();
     $args = func_get_args();
     $facility_code = $args[0];
     $commodity_id = $args[1];
     $from_ = array($args[2], $args[3], $args[4]);
     $to_ = array($args[5], $args[6], $args[7]);
     $from = implode('/', $from_);
     $to = implode('/', $to_);
     $commodity_name = Commodities::get_commodity_name($commodity_id);
     $county = Counties::get_county_name($county_id);
     $district = Districts::get_district_name_($district_id);
     $county_name = $county['county'];
     $district_name = $district['district'];
     $bin_card_data = Facility_issues::get_bin_card($facility_code, $commodity_id, $from, $to);
     $myobj = Doctrine::getTable('Facilities')->findOneByfacility_code($facility_code);
     $facility_name = $myobj->facility_name;
     $bin_card_data_count = count(Facility_issues::get_bin_card($facility_code, $commodity_id, $from, $to));
     //create the table for displaying the order details
     $html_body = "<table class='data-table' width=100%>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>MFL No: {$facility_code}</td> \n\t\t\t\t\t\t\t<td>Health Facility Name:<br/> {$facility_name}</td>\n\t\t\t\t\t\t\t<td>Level:</td>\n\t\t\t\t\t\t\t<td>Dispensary</td>\n\t\t\t\t\t\t\t<td>Health Centre</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>County: {$county_name}</td> \n\t\t\t\t\t\t\t<td> District: {$district_name}</td>\n\t\t\t\t\t\t\t<td >Reporting Period <br/>\n\t\t\t\t\t\t\t\tStart Date:  <br/>  End Date: " . date('d M, Y') . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>";
     $html_body .= "\n\t\t\t\t\t<table class='data-table'>\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th><b>Commodity Name</b></th>\n\t\t\t\t\t\t\t\t<th><b>Date of Issue</b></th>\n\t\t\t\t\t\t\t\t<th><b>Reference No/S11 No</b></th>\n\t\t\t\t\t\t\t\t<th ><b>Commodity Unit Size</b></th>\n\t\t\t\t\t\t\t\t<th ><b>Batch No -Issued</b></th>\n\t\t\t\t\t\t\t\t<th ><b>Expiry Date</b></th>\n\t\t\t\t\t\t\t\t<th ><b>Opening Bal.</b></th>\n\t\t\t\t\t\t\t\t<th ><b>+ADJ</b></th>\n\t\t\t\t\t\t\t\t<th ><b>-ADJ</b></th>\n\t\t\t\t\t\t\t\t<th ><b>Receipts/Issues</b></th>\n\t\t\t\t\t\t\t\t<th ><b>Closing Bal.</b></th>\n\t\t\t\t\t\t\t\t<th ><b>Service Point</b></th>\n\t\t\t\t\t\t\t\t<th ><b>Issuing/Receiving Officer</b></th>\n\t\t\t\t\t\t\t</tr> \n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>";
     $html_body .= '<ol type="a">';
     for ($i = 0; $i < $bin_card_data_count; $i++) {
         $closing_balance = $bin_card_data[$i]['balance_as_of'] - $bin_card_data[$i]['qty_issued'];
         $mydrug_name = $commodity_name;
         $html_body .= "<tr>";
         $html_body .= "<td>" . $commodity_name[0]['commodity_name'] . "</td>";
         $html_body .= "<td>" . $bin_card_data[$i]['date_issued'] . "</td>";
         $html_body .= "<td>" . $bin_card_data[$i]['s11_No'] . "</td>";
         $html_body .= "<td>" . $bin_card_data[$i]['unit_size'] . "</td>";
         $html_body .= "<td>" . $bin_card_data[$i]['batch_no'] . "</td>";
         $html_body .= "<td>" . $bin_card_data[$i]['expiry_date'] . "</td>";
         $html_body .= "<td>" . $bin_card_data[$i]['balance_as_of'] . "</td>";
         $html_body .= "<td>" . $bin_card_data[$i]['adjustmentpve'] . "</td>";
         $html_body .= "<td>" . $bin_card_data[$i]['adjustmentnve'] . "</td>";
         $html_body .= "<td>" . $bin_card_data[$i]['qty_issued'] . "</td>";
         $html_body .= "<td>" . $closing_balance . "</td>";
         $html_body .= "<td>" . $bin_card_data[$i]['service_point_name'] . "</td>";
         $html_body .= "<td>" . $bin_card_data[$i]['fname'] . " " . $bin_card_data[$i]['fname'] . "</td>";
         $html_body .= "</tr>";
     }
     $html_body .= '</tbody></table></ol>';
     $pdf_body = $html_body;
     //end of bin card pdf
     $file_name = $facility_name . '_facility_program_report_date_created_' . date('d-m-y');
     $pdf_data = array("pdf_title" => "Program Report For {$facility_name}", 'pdf_html_body' => $pdf_body, 'pdf_view_option' => 'download', 'file_name' => $file_name);
     $this->hcmp_functions->create_pdf($pdf_data);
     redirect();
 }
 public function __construct($options = null)
 {
     //Get data to form select menu for primary and secondary material
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     //Get data to form select menu for periods
     //Get Rally data
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Hoard data
     $hoards = new Hoards();
     $hoard_options = $hoards->getHoards();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $denominations = new Denominations();
     $denom_options = $denominations->getOptionsIronAge();
     $rulers = new Rulers();
     $ruler_options = $rulers->getIronAgeRulers();
     $mints = new Mints();
     $mint_options = $mints->getIronAgeMints();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $geog = new Geography();
     $geog_options = $geog->getIronAgeGeographyDD();
     $regions = new Regions();
     $region_options = $regions->getRegionName();
     $tribes = new Tribes();
     $tribe_options = $tribes->getTribes();
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     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('Advanced');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid number!')->setDecorators($decorators);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     if (in_array($this->getRole(), $this->_higherlevel)) {
         $workflow->addMultiOptions(array(NULL => 'Choose a workflow stage', 'Available workflow stages' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published')));
     }
     if (in_array($this->getRole(), $this->_restricted)) {
         $workflow->addMultiOptions(array(NULL => 'Choose a workflow stage', 'Available workflow stages' => array('4' => 'Awaiting validation', '3' => 'Published')));
     }
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $geographyID = new Zend_Form_Element_Select('geographyID');
     $geographyID->setLabel('Geographic area: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a geography', 'Available geographies' => $geog_options))->addValidator('inArray', false, array(array_keys($geog_options)))->addValidator('Int');
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a rally', 'Available rallies' => $rally_options))->setDecorators($decorators)->addValidator('inArray', false, array(array_keys($rally_options)))->addValidator('Int');
     $hoard = new Zend_Form_Element_Checkbox('hoard');
     $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $hoardID = new Zend_Form_Element_Select('hID');
     $hoardID->setLabel('Part of this hoard: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a hoard', 'Available hoards' => $hoard_options))->setDecorators($decorators)->addValidator('inArray', false, array(array_keys($hoard_options)))->addValidator('Int');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a county', 'Available counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose district after county'))->setDecorators($decorators)->disabled = true;
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators)->disabled = true;
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Available regions' => $region_options))->addValidator('Int');
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->setDecorators($decorators)->addValidator('ValidGridRef')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum');
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('ValidGridRef')->addValidator('Alnum');
     ###
     ##Numismatic data
     ###
     //	Denomination
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose denomination type', 'Available denominations' => $denom_options))->addValidator('inArray', false, array(array_keys($denom_options)))->setDecorators($decorators);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose primary ruler', 'Available rulers' => $ruler_options))->addValidator('inArray', false, array(array_keys($denom_options)))->setDecorators($decorators);
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose issuing mint', 'Available mints' => $mint_options))->addValidator('inArray', false, array(array_keys($mint_options)))->setDecorators($decorators);
     //Secondary ruler
     $ruler2 = new Zend_Form_Element_Select('ruler2');
     $ruler2->setLabel('Secondary ruler / issuer: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose secondary ruler', 'Available rulers' => $ruler_options))->addValidator('inArray', false, array(array_keys($ruler_options)))->setDecorators($decorators);
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obverseLegend');
     $obverseinsc->setLabel('Obverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obverseDescription');
     $obversedesc->setLabel('Obverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('reverseLegend');
     $reverseinsc->setLabel('Reverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('reverseDescription');
     $reversedesc->setLabel('Reverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose measurement', 'Available die axes' => $axis_options))->addValidator('inArray', false, array(array_keys($axis_options)))->addErrorMessage('That option is not a valid choice')->addValidator('Int')->setDecorators($decorators);
     //Tribe
     $tribe = new Zend_Form_Element_Select('tribe');
     $tribe->setLabel('Iron Age tribe: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a tribe', 'Available tribes' => $tribe_options))->addValidator('inArray', false, array(array_keys($tribe_options)))->addErrorMessage('That option is not a valid choice')->addValidator('Int')->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('COIN')->setAttrib('class', 'none')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('IRON AGE')->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('class', 'none')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $mack_type = new Zend_Form_Element_Text('mackType');
     $mack_type->setLabel('Mack Type: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $bmc_type = new Zend_Form_Element_Text('bmc');
     $bmc_type->setLabel('British Museum catalogue number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $allen_type = new Zend_Form_Element_Text('allenType');
     $allen_type->setLabel('Allen Type: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $va_type = new Zend_Form_Element_Text('vaType');
     $va_type->setLabel('Van Arsdell Number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $rudd_type = new Zend_Form_Element_Text('ruddType');
     $rudd_type->setLabel('Ancient British Coinage number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $phase_date_1 = new Zend_Form_Element_Text('phase_date_1');
     $phase_date_1->setLabel('Phase date 1: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $phase_date_2 = new Zend_Form_Element_Text('phase_date_2');
     $phase_date_2->setLabel('Phase date 2: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $context = new Zend_Form_Element_Text('context');
     $context->setLabel('Context of coins: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $depositionDate = new Zend_Form_Element_Text('depositionDate');
     $depositionDate->setLabel('Date of deposition: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $numChiab = new Zend_Form_Element_Text('numChiab');
     $numChiab->setLabel('Coin hoards of Iron Age Britain number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->setLabel('Submit your search...');
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose institution' => $inst_options))->setDecorators($decorators);
     $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->addElements(array($old_findID, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $ruler2, $tribe, $objecttype, $broadperiod, $geographyID, $bmc_type, $mack_type, $allen_type, $va_type, $rudd_type, $numChiab, $context, $depositionDate, $phase_date_1, $phase_date_2, $submit, $institution));
     $this->addDisplayGroup(array('denomination', 'geographyID', 'ruler', 'ruler2', 'tribe', 'mint', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription', 'bmc', 'vaType', 'allenType', 'ruddType', 'mackType', 'numChiab', 'context', 'phase_date_1', 'phase_date_2', 'depositionDate'), 'numismatics')->removeDecorator('HtmlTag');
     $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->numismatics->removeDecorator('DtDdWrapper');
     $this->numismatics->setLegend('Numismatic details: ');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Object details: ');
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial')->removeDecorator('HtmlTag');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->spatial->setLegend('Spatial details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
Example #23
0
 public function user_create()
 {
     //get user details in session
     $identifier = $this->session->userdata('user_indicator');
     $user_type_id = $this->session->userdata('user_type_id');
     $district = $this->session->userdata('district_id');
     $county = $this->session->userdata('county_id');
     $facility = $this->session->userdata('facility_id');
     //query to get user listing by type of user
     switch ($identifier) {
         case 'moh':
             $permissions = 'moh_permissions';
             $template = 'shared_files/template/dashboard_template_v';
             break;
         case 'facility_admin':
             $permissions = 'facilityadmin_permissions';
             $data['listing'] = Users::get_user_list_facility($facility);
             $template = 'shared_files/template/template';
             break;
         case 'district':
             $permissions = 'district_permissions';
             $data['listing'] = Users::get_user_list_district($district);
             $data['facilities'] = Facilities::getFacilities($district);
             $data['counts'] = Users::get_users_district($district);
             $template = 'shared_files/template/template';
             break;
         case 'moh_user':
             $data['listing'] = Users::get_user_list($user_type_id);
             $template = 'shared_files/template/dashboard_template_v';
             break;
         case 'district_tech':
             $data['listing'] = Users::get_user_list($user_type_id);
             $template = 'shared_files/template/template';
             break;
         case 'rtk_manager':
             $data['listing'] = Users::get_user_list($user_type_id);
             $template = 'shared_files/template/template';
             break;
         case 'super_admin':
             $permissions = 'super_permissions';
             $data['title'] = "Users";
             $data['content_view'] = "Admin/users_v";
             $data['listing'] = Users::get_user_list_all();
             $data['counts'] = Users::get_users_count();
             $data['counties'] = Counties::getAll();
             $template = 'shared_files/template/dashboard_v';
             break;
         case 'allocation_committee':
             $data['listing'] = Users::get_user_list($user_type_id);
             $template = 'shared_files/template/template';
             break;
         case 'county':
             $permissions = 'county_permissions';
             $data['listing'] = Users::get_user_list_county($county);
             $data['district_data'] = districts::getDistrict($county);
             $data['counts'] = Users::get_users_county($county);
             $template = 'shared_files/template/template';
             break;
     }
     $data['title'] = "User Management";
     $data['user_types'] = Access_level::get_access_levels($permissions);
     $data['banner_text'] = "User Management";
     $data['content_view'] = "shared_files/user_creation_v";
     $this->load->view($template, $data);
 }
Example #24
0
 public function __construct($options = null)
 {
     // Construct the select menu data
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $origins = new MapOrigins();
     $origin_options = $origins->getValidOrigins();
     $landusevalues = new Landuses();
     $landuse_options = $landusevalues->getUsesValid();
     $landusecodes = new Landuses();
     $landcodes_options = $landusecodes->getCodesValid();
     parent::__construct($options);
     $this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator');
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $decorator = array('SimpleInput');
     $decoratorButton = array('NormalDecButton');
     $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('findspots');
     // Object specifics
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose county', 'Valid counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setRequired(false)->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose district after county'));
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRequired(false)->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after district'));
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addValidator('Digits')->addMultiOptions(array(NULL => 'Choose region after county'));
     $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->addValidator('Alnum', array('allowWhiteSpace' => true))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'));
     $gridrefsrc = new Zend_Form_Element_Select('gridrefsrc');
     $gridrefsrc->setLabel('Grid reference source: ')->addMultioptions(array(NULL => NULL, 'Choose source' => $origin_options))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($origin_options)))->addValidator('Int');
     $gridrefcert = new Zend_Form_Element_Radio('gridrefcert');
     $gridrefcert->setLabel('Grid reference certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     if ($action == 'edit') {
         $fourFigure = new Zend_Form_Element_Text('fourFigure');
         $fourFigure->setLabel('Four figure grid reference: ')->addValidator('NotEmpty', 'ValidGridRef')->addValidator('Alnum')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->disabled = true;
         $easting = new Zend_Form_Element_Text('easting');
         $easting->setLabel('Easting: ')->addValidator('NotEmpty', 'Digits')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->disabled = true;
         $northing = new Zend_Form_Element_Text('northing');
         $northing->setLabel('Northing: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->setDecorators($decorators)->disabled = true;
         $map10k = new Zend_Form_Element_Text('map10k');
         $map10k->setLabel('10 km map: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Alnum')->setDecorators($decorators)->disabled = true;
         $map25k = new Zend_Form_Element_Text('map25k');
         $map25k->setLabel('25 km map: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Alnum')->setDecorators($decorators)->disabled = true;
         $declong = new Zend_Form_Element_Text('declong');
         $declong->setLabel('Longitude: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Float')->setDecorators($decorators)->disabled = true;
         $declat = new Zend_Form_Element_Text('declat');
         $declat->setLabel('Latitude: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Float')->setDecorators($decorators)->disabled = true;
         $woeid = new Zend_Form_Element_Text('woeid');
         $woeid->setLabel('Where on Earth ID: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->setDecorators($decorators)->disabled = true;
         $elevation = new Zend_Form_Element_Text('elevation');
         $elevation->setLabel('Elevation: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->setDecorators($decorators)->disabled = true;
     }
     $depthdiscovery = new Zend_Form_Element_Select('depthdiscovery');
     $depthdiscovery->setLabel('Depth of discovery')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->addMultiOptions(array(NULL => NULL, 'Approximate depth' => array('10' => '0 - 10cm', '20' => '10 - 20cm', '30' => '20 - 30cm', '40' => '30 - 40cm', '50' => '40 - 50cm', '60' => 'Over 60 cm')));
     $soiltype = new Zend_Form_Element_Select('soiltype');
     $soiltype->setLabel('Type of soil around findspot: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->addMultiOptions(array(NULL => NULL));
     $landusevalue = new Zend_Form_Element_Select('landusevalue');
     $landusevalue->setLabel('Landuse type: ')->addValidators(array('NotEmpty'))->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose landuse', 'Valid landuses' => $landuse_options));
     $landusecode = new Zend_Form_Element_Select('landusecode');
     $landusecode->setLabel('Specific landuse: ')->setRegisterInArrayValidator(false)->addValidators(array('NotEmpty'))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Specific landuse will be enabled after type'));
     $address = new Zend_Form_Element_Textarea('address');
     $address->setLabel('Address: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 5)->setAttrib('cols', 40)->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'))->setAttrib('class', 'expanding')->setAttrib('class', 'privatedata');
     $postcode = new Zend_Form_Element_Text('postcode');
     $postcode->setLabel('Postcode: ')->addValidators(array('NotEmpty', 'ValidPostcode'))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'));
     $knownas = new Zend_Form_Element_Text('knownas');
     $knownas->setLabel('Findspot to be known as: ')->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setAttrib('class', 'privatedata')->addFilters(array('StripTags', 'StringTrim'));
     $landownername = new Zend_Form_Element_Text('landownername');
     $landownername->setLabel('Landowner: ')->addValidators(array('NotEmpty'))->setDecorators($decorators)->setAttrib('class', 'privatedata')->addFilters(array('StripTags', 'StringTrim'));
     $landowner = new Zend_Form_Element_Hidden('landowner');
     $landowner->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label')->addFilters(array('StripTags', 'StringTrim'));
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Findspot description: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $comments = new Pas_Form_Element_RTE('comments');
     $comments->setLabel('Findspot comments: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(600);
     $this->addElement($hash);
     if ($action == 'edit') {
         $this->addElements(array($county, $district, $parish, $knownas, $description, $comments, $regionID, $gridref, $fourFigure, $easting, $northing, $map10k, $map25k, $declong, $declat, $woeid, $elevation, $address, $gridrefsrc, $gridrefcert, $depthdiscovery, $postcode, $landusevalue, $landusecode, $landownername, $landowner, $submit, $hash));
     } else {
         $this->addElements(array($county, $district, $parish, $knownas, $depthdiscovery, $description, $comments, $regionID, $gridref, $findsecuid, $gridrefsrc, $gridrefcert, $address, $postcode, $landusevalue, $landusecode, $landownername, $landowner, $submit, $hash));
     }
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'knownas', 'address', 'postcode', 'landownername', 'landowner'), 'details');
     $this->details->setLegend('Findspot information');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     if ($action == 'edit') {
         $this->addDisplayGroup(array('gridref', 'gridrefcert', 'gridrefsrc', 'fourFigure', 'easting', 'northing', 'map25k', 'map10k', 'declat', 'declong', 'woeid', 'elevation', 'landusevalue', 'landusecode', 'depthdiscovery'), 'spatial');
     } else {
         $this->addDisplayGroup(array('gridref', 'gridrefcert', 'gridrefsrc', 'landusevalue', 'landusecode', 'depthdiscovery', 'soiltype'), 'spatial');
     }
     $this->spatial->setLegend('Spatial information');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('description', 'comments'), 'commentary');
     $this->commentary->setLegend('Findspot comments');
     $this->commentary->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->commentary->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Example #25
0
 public function __construct($options = null)
 {
     $users = new Users();
     $users_options = $users->getOptions();
     $countries = new Countries();
     $countries_options = $countries->getOptions();
     $counties = new Counties();
     $counties_options = $counties->getCountyname2();
     $activities = new PrimaryActivities();
     $activities_options = $activities->getTerms();
     $organisations = new Organisations();
     $organisations_options = $organisations->getOrgs();
     parent::__construct($options);
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->setName('people');
     $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')));
     $title = new Zend_Form_Element_Select('title');
     $title->setLabel('Title: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setValue('Mr')->addErrorMessage('Choose title of person')->addMultiOptions(array('Mr' => 'Mr', 'Mrs' => 'Mrs', 'Miss' => 'Miss', 'Ms' => 'Ms', 'Dr' => 'Dr.', 'Prof' => 'Prof.', 'Sir' => 'Sir', 'Lady' => 'Lady', 'Other' => 'Other', 'Captain' => 'Captain', 'Master' => 'Master', 'Dame' => 'Dame', 'Duke' => 'Duke'))->setDecorators($decorators);
     $forename = new Zend_Form_Element_Text('forename');
     $forename->setLabel('Forename: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter person\'s forename')->setDecorators($decorators)->addFilter(new Zend_Filter_Callback(array('callback' => 'ucfirst')));
     $surname = new Zend_Form_Element_Text('surname');
     $surname->setLabel('Surname: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addFilter(new Zend_Filter_Callback(array('callback' => 'ucfirst')))->addErrorMessage('Please enter person\'s surname')->setDecorators($decorators);
     $fullname = new Zend_Form_Element_Text('fullname');
     $fullname->setLabel('Fullname: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter person\'s fullname')->setDecorators($decorators);
     $email = new Zend_Form_Element_Text('email');
     $email->SetLabel('Email address: ')->setRequired(false)->addFilters(array('StringTrim', 'StringToLower', 'StripTags'))->addValidator('StringLength', false, array(1, 200))->addValidator('EmailAddress', false, array('mx' => true))->setAttrib('size', '60')->setDecorators($decorators);
     $dbaseID = new Zend_Form_Element_Select('dbaseID');
     $dbaseID->setLabel('User account: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addValidator('InArray', false, array(array_keys($users_options), null))->addMultiOptions(array(NULL => 'Choose a user account', 'Existing accounts' => $users_options))->addErrorMessage('You must enter a database account.')->setDecorators($decorators);
     $address = new Zend_Form_Element_Text('address');
     $address->SetLabel('Address: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $town_city = new Zend_Form_Element_Text('town_city');
     $town_city->SetLabel('Town: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->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))->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $postcode = new Zend_Form_Element_Text('postcode');
     $postcode->SetLabel('Postcode: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->addValidator('StringLength', false, array(1, 200))->addValidator('ValidPostCode')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $country = new Zend_Form_Element_Select('country');
     $country->SetLabel('Country: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 4))->addValidator('InArray', false, array(array_keys($countries_options)))->addMultiOptions(array(NULL => 'Please choose a country of residence', 'Valid countries' => $countries_options))->setValue('GB')->setDecorators($decorators);
     $hometel = new Zend_Form_Element_Text('hometel');
     $hometel->SetLabel('Home telephone number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 30))->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $worktel = new Zend_Form_Element_Text('worktel');
     $worktel->SetLabel('Work telephone number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 30))->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $fax = new Zend_Form_Element_Text('faxno');
     $fax->SetLabel('Fax number: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 30))->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $comments = new Pas_Form_Element_RTE('comments');
     $comments->SetLabel('Comments: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $organisationID = new Zend_Form_Element_Select('organisationID');
     $organisationID->SetLabel('Organisation attached to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Please choose an organisation', 'Valid organisations' => $organisations_options))->addValidator('InArray', false, array(array_keys($organisations_options)))->setDecorators($decorators);
     $primary_activity = new Zend_Form_Element_Select('primary_activity');
     $primary_activity->SetLabel('Person\'s primary activity: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addValidator('InArray', false, array(array_keys($activities_options)))->addMultiOptions(array(NULL => 'Choose a primary activity', 'Valid activities' => $activities_options))->addErrorMessage('You must enter an activity for this person.')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($title, $forename, $surname, $fullname, $email, $address, $town_city, $county, $postcode, $country, $dbaseID, $hometel, $worktel, $fax, $comments, $organisationID, $primary_activity, $submit));
     $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('title', 'forename', 'surname', 'fullname', 'email', 'address', 'town_city', 'county', 'postcode', 'country', 'dbaseID', 'hometel', 'worktel', 'faxno', 'comments', 'organisationID', 'primary_activity'), 'details');
     $this->details->setLegend('Person details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
 }
 public function program_reports()
 {
     $malaria_report_data = '';
     $user_indicator = $this->session->userdata('user_indicator');
     switch ($user_indicator) {
         case facility_admin:
         case facility:
             $facility_id = $this->session->userdata('facility_id');
             $report_malaria = Malaria_Data::get_facility_report_details($facility_id);
             $report_RH = RH_Drugs_Data::get_facility_report_details($facility_id);
             $report_TB = tb_data::get_facility_report_details($facility_id);
             $facility_details = Facilities::get_facility_name2($facility_id);
             $facility_mfl = $facility_id;
             $facility_name = $facility_details['facility_name'];
             // $malaria_report_data = '<tr><td>'.$facility_name.'</td><td>'.$facility_mfl.'</td><td>HCMP</td><td><a href = "'.base_url().'divisional_reports/malaria_report" class = "btn btn-primary btn-sm">View Malaria Report</a></td></tr>';
             if (!empty($report_RH) && !empty($report_malaria) && !empty($report_TB)) {
                 $report_RH_report[$index] = $report_RH;
                 $report_malaria_report[$index] = $report_malaria;
                 $report_tuberculosis_report[$index] = $report_TB;
             } else {
             }
             $data['fac_mfl'] = $facility_mfl;
             $data['mal_report_data'] = $this->createmalariareport($facility_mfl);
             $data['page_header'] = "Program Reports";
             $data['malaria'] = $report_malaria_report;
             $data['RH'] = $report_RH_report;
             $data['TB'] = $report_tuberculosis_report;
             $data['title'] = "Facility Program Reports";
             $data['banner_text'] = "Facility Program Reports";
             $data['report_view'] = "subcounty/reports/program_reports_v";
             $data['sidebar'] = "shared_files/report_templates/side_bar_v";
             $data['active_panel'] = "program_reports";
             break;
         case district:
             $district_id = $this->session->userdata('district_id');
             $facilities = Facilities::get_district_facilities($district_id);
             $index = 0;
             foreach ($facilities as $ids) {
                 $facility_id = $ids['facility_code'];
                 $report_malaria = Malaria_Data::get_facility_report_details($facility_id);
                 $report_RH = RH_Drugs_Data::get_facility_report_details($facility_id);
                 $report_TB = tb_data::get_facility_report_details($facility_id);
                 $facility_details = Facilities::get_facility_name2($facility_id);
                 $facility_mfl = $facility_id;
                 $facility_name = $facility_details['facility_name'];
                 $malaria_report_data .= '<option value = "' . $facility_mfl . '">' . $facility_name . '</option>';
                 if (!empty($report_RH) && !empty($report_malaria)) {
                     $report_RH_report[$index] = $report_RH;
                     $report_malaria_report[$index] = $report_malaria;
                     $report_tuberculosis[$index] = $report_TB;
                 } else {
                 }
                 $index++;
             }
             $data['mal_report_data'] = $malaria_report_data;
             $data['page_header'] = "Program Reports";
             $data['title'] = "District Program Reports";
             $data['banner_text'] = "District Program Reports";
             $data['sidebar'] = "shared_files/report_templates/side_bar_sub_county_v";
             break;
         case county:
             $county_id = $this->session->userdata('county_id');
             // $facilities = Facilities::get_all_facilities_in_county($county_id);
             $subcounties = Counties::get_subcounties_in_county($county_id);
             $subcounties_listing = '';
             foreach ($subcounties as $key => $value) {
                 $subcounties_listing .= '<option value = "' . $value['id'] . '">' . $value['district'] . '</option>';
             }
             $index = 0;
             // foreach ($facilities as $ids)
             // {
             // $facility_id = $ids['facilities'];
             // $report_malaria = Malaria_Data::get_facility_report_details($facility_id);
             // $report_RH = RH_Drugs_Data::get_facility_report_details($facility_id) ;
             // $report_TB = tb_data::get_facility_report_details($facility_id);
             // $facility_details = Facilities::get_facility_name2($facility_id);
             // $facility_mfl = $facility_id;
             // $facility_name = $facility_details['facility_name'];
             // $malaria_report_data .= '<option value = "'.$facility_mfl.'">'.$facility_name.'</option>';
             // if ((!empty($report_RH))&&(!empty($report_malaria)))
             // {
             // 	$report_RH_report[$index] = $report_RH;
             // 	$report_malaria_report[$index] = $report_malaria;
             // 	$report_tuberculosis[$index] = $report_TB;
             // }else{
             // }
             // $index++;
             // }
             $data['sub_counties'] = $subcounties_listing;
             $data['mal_report_data'] = $malaria_report_data;
             $data['page_header'] = "Program Reports";
             $data['title'] = "County Program Reports";
             $data['banner_text'] = " County Program Reports";
             $data['sidebar'] = "shared_files/report_templates/side_bar_sub_county_v";
             break;
     }
     $data['malaria'] = $report_malaria_report;
     $data['RH'] = $report_RH_report;
     $data['TB'] = $report_tuberculosis_report;
     $data['report_view'] = "subcounty/reports/program_reports_v";
     $data['active_panel'] = 'divisional';
     if ($this->input->is_ajax_request()) {
         return $this->load->view("subcounty/reports/program_reports_v", $data);
     }
     $data['content_view'] = "facility/facility_reports/reports_v";
     $this->load->view('shared_files/template/template', $data);
 }
Example #27
0
 public function user_create_multiple($facility_code = null)
 {
     //get user details in session
     $identifier = $this->session->userdata('user_indicator');
     $user_type_id = $this->session->userdata('user_type_id');
     $district = $this->session->userdata('district_id');
     $county = $this->session->userdata('county_id');
     $facility = $this->session->userdata('facility_id');
     //query to get user listing by type of user
     switch ($identifier) {
         case 'moh':
             $permissions = 'moh_permissions';
             $template = 'shared_files/template/dashboard_template_v';
             break;
         case 'facility_admin':
             $permissions = 'facilityadmin_permissions';
             $data['listing'] = Users::get_user_list_facility($facility);
             $template = 'shared_files/template/template';
             break;
         case 'district':
             $permissions = 'district_permissions';
             $data['listing'] = Users::get_user_list_district($district);
             if ($facility_code == 0) {
                 $data['facilities'] = Facilities::getFacilities($district);
                 $facility_name = null;
                 $facility_banner_text = null;
                 $no_of_facilities = 0;
             } else {
                 $data['facilities'] = Facilities::getFacilities_from_facility_code($facility_code);
                 $facility_banner_text = ' to: ' . $data['facilities'][0]['facility_name'];
                 $facility_name = $data['facilities'][0]['facility_name'];
                 $no_of_facilities = 1;
             }
             $data['counts'] = Users::get_users_district($district);
             $template = 'shared_files/template/template';
             break;
         case 'moh_user':
             $data['listing'] = Users::get_user_list($user_type_id);
             $template = 'shared_files/template/dashboard_template_v';
             break;
         case 'district_tech':
             $data['listing'] = Users::get_user_list($user_type_id);
             $template = 'shared_files/template/template';
             break;
         case 'rtk_manager':
             $data['listing'] = Users::get_user_list($user_type_id);
             $template = 'shared_files/template/template';
             break;
         case 'super_admin':
             $permissions = 'super_permissions';
             $data['title'] = "Users";
             $data['content_view'] = "Admin/users_v";
             $data['listing'] = Users::get_user_list_all();
             $data['counts'] = Users::get_users_count();
             $data['counties'] = Counties::getAll();
             $template = 'shared_files/template/dashboard_v';
             break;
         case 'allocation_committee':
             $data['listing'] = Users::get_user_list($user_type_id);
             $template = 'shared_files/template/template';
             break;
         case 'county':
             $permissions = 'county_permissions';
             if ($facility_code == 0) {
                 $data['facilities'] = Facilities::getFacilities($district);
                 $facility_name = null;
                 $facility_banner_text = null;
                 $district_name = null;
                 $district_id = null;
                 $no_of_facilities = 0;
             } else {
                 $data['facilities'] = Facilities::getFacilities_from_facility_code($facility_code);
                 $facility_banner_text = ' to: ' . $data['facilities'][0]['facility_name'];
                 $facility_name = $data['facilities'][0]['facility_name'];
                 $district_id = $data['facilities'][0]['district'];
                 $district_data = Districts::get_district_name($district_id);
                 $district_name = $district_data[0]['district'];
                 $no_of_facilities = 1;
             }
             $data['listing'] = Users::get_user_list_county($county);
             $data['district_data'] = districts::getDistrict($county);
             $data['counts'] = Users::get_users_county($county);
             $template = 'shared_files/template/template';
             break;
     }
     $data['title'] = "Add Multiple Users";
     $data['user_types'] = Access_level::get_access_levels($permissions);
     $data['banner_text'] = "Multiple User Addition";
     $data['facility_name'] = $facility_name;
     $data['facility_code'] = $facility_code;
     $data['facility_banner_text'] = $facility_banner_text;
     $data['district_name'] = $district_name;
     $data['district_id'] = $district_id;
     $data['no_of_facilities'] = $no_of_facilities;
     $data['content_view'] = "shared_files/add_users_multiple";
     $this->load->view($template, $data);
 }
Example #28
0
 function rtk_county_sidebar()
 {
     $counties = Counties::getAll();
     $table_data = "";
     $allocation_rate = 0;
     $total_facilities_in_county = 0;
     $total_facilities_allocated_in_county = 1;
     $total_facilities = 0;
     $total_allocated = 0;
     foreach ($counties as $county_detail) {
         $countyid = $county_detail->id;
         $facilities_in_county = $this->db->query('SELECT * 
         FROM facilities, districts, counties
         WHERE facilities.district = districts.id
         AND districts.county = counties.id
         AND counties.id =' . $countyid . '
         AND facilities.rtk_enabled =1');
         $facilities_num = $facilities_in_county->num_rows();
         $sql = "SELECT DISTINCT lab_commodity_orders.id, lab_commodity_orders.facility_code\n        FROM lab_commodity_details, counties, facilities, districts, lab_commodity_orders\n        WHERE lab_commodity_details.facility_code = facilities.facility_code\n        AND counties.id = districts.county\n        AND counties.id ={$countyid} \n        AND facilities.district = districts.id\n        AND lab_commodity_details.order_id = lab_commodity_orders.id\n        AND lab_commodity_details.allocated >0";
         $allocated_facilities = $this->db->query($sql);
         $allocated_facilities_num = $allocated_facilities->num_rows();
         // $county_map_id=$county_detail->kenya_map_id;
         $countyname = trim($county_detail->county);
         $county_detail = rtk_stock_status::get_allocation_rate_county($countyid);
         //     $total_facilities_in_county=$county_detail['total_facilities_in_county'];
         $total_facilities_in_county = $total_facilities_in_county + $facilities_num;
         $total_facilities_allocated_in_county = $county_detail['total_facilities_allocated_in_county'];
         $total_facilities = $total_facilities + $facilities_num;
         $total_allocated = $total_allocated + $allocated_facilities_num;
         $table_data .= "<tr><td><a href=" . site_url() . "rtk_management/allocation_county_detail_zoom/{$countyid}> {$countyname}</a> </td><td>{$allocated_facilities_num} / {$facilities_num}</td></tr>";
     }
     return $table_data .= "<tr><td>TOTAL </td><td>  {$total_allocated} |  {$total_facilities_in_county}  </td><tr>";
 }
 public function __construct($options = null)
 {
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     //Get data to form select menu for primary and secondary material
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     //Get data to form select menu for periods
     //Get Rally data
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Hoard data
     $hoards = new Hoards();
     $hoard_options = $hoards->getHoards();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $rulers = new Rulers();
     $ruler_options = $rulers->getRulersByzantine();
     $denominations = new Denominations();
     $denomination_options = $denominations->getDenomsByzantine();
     $mints = new Mints();
     $mint_options = $mints->getMintsByzantine();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $reece = new Reeces();
     $reece_options = $reece->getReeces();
     $regions = new Regions();
     $region_options = $regions->getRegionName();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->clearDecorators();
     $decorator = array('SimpleInput');
     $decoratorButton = array('NormalDecButton');
     $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('byzantine-search');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addErrorMessage('Please enter a valid number!')->setDecorators($decorators)->setDisableTranslator(true);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addErrorMessage('Please enter a valid term')->setDecorators($decorators)->setDisableTranslator(true);
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(NULL => NULL, 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '3' => 'Awaiting validation', '4' => 'Published')))->setDecorators($decorators)->setDisableTranslator(true);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->setUncheckedValue(NULL)->setDecorators($decorators)->setDisableTranslator(true);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $rally_options))->setDecorators($decorators)->setDisableTranslator(true);
     $hoard = new Zend_Form_Element_Checkbox('hoard');
     $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->setUncheckedValue(NULL)->setDecorators($decorators);
     $hoardID = new Zend_Form_Element_Select('hID');
     $hoardID->setLabel('Part of this hoard: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $hoard_options))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->addMultiOptions(array(NULL => 'Choose district after county'))->setRegisterInArrayValidator(false)->setDecorators($decorators)->disabled = true;
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators)->disabled = true;
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Choose region' => $region_options))->setDecorators($decorators);
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators);
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators);
     ###
     ##Numismatic data
     ###
     //Denomination
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose denomination type' => $denomination_options))->setDecorators($decorators);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose primary ruler' => $ruler_options))->setDecorators($decorators);
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose denomination type' => $mint_options))->setDecorators($decorators);
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obverseLegend');
     $obverseinsc->setLabel('Obverse inscription contains: ')->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obverseDescription');
     $obversedesc->setLabel('Obverse description contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('reverseLegend');
     $reverseinsc->setLabel('Reverse inscription contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('reverseDescription');
     $reversedesc->setLabel('Reverse description contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose measurement' => $axis_options))->setDecorators($decorators);
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose institution' => $inst_options))->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('coin');
     $objecttype->removeDecorator('HtmlTag')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('label');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('Byzantine')->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('label');
     //	Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($old_findID, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $objecttype, $broadperiod, $institution, $submit));
     $this->addDisplayGroup(array('denomination', 'ruler', 'mint', 'moneyer', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details');
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial');
     $this->numismatics->setLegend('Numismatic details');
     $this->numismatics->removeDecorator('DtDdWrapper');
     $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->setLegend('Artefact details');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->setLegend('Spatial details');
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->addDecorator('FormElements')->addDecorator('Form')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div'));
     $this->removeDecorator('DtDdWrapper');
 }
Example #30
0
 public function edit_facility()
 {
     $use_id = $_POST['user_id'];
     //echo $use_id;
     /*$myobj = Doctrine::getTable('user')->findOneById($use_id);
         	$disto=$myobj->district;
     		$faci=$myobj->facility;
     		$type=$myobj->usertype_id;
     		$data['counties'] = Counties::getAll3($type);
     		echo $faci;*/
     $fname = $_POST['fname'];
     $lname = $_POST['lname'];
     $tell = $_POST['tell'];
     $email = $_POST['email'];
     $username = $_POST['username'];
     $type = $_POST['type'];
     //$use_id=$_POST['user_id'];
     $state = Doctrine::getTable('user')->findOneById($use_id);
     $state->fname = $fname;
     $state->lname = $lname;
     $state->telephone = $tell;
     $state->email = $email;
     $state->username = $username;
     $state->usertype_id = $type;
     $state->save();
     $facility = $this->session->userdata('news');
     $id = $this->session->userdata('user_db_id');
     $data['title'] = "View Users";
     $data['content_view'] = "users_facility_v";
     $data['banner_text'] = "Facility Users";
     $data['result'] = User::getAll2($facility, $id);
     $data['quick_link'] = "users_facility_v";
     $data['counties'] = Counties::getAll();
     $this->load->view("template", $data);
 }