Skip to content
Snippets Groups Projects
Select Git revision
  • issue-703
  • master default
  • issue-752
  • develop
  • issue-677
  • issue-677-original-with-migrate
  • issue-716
  • issue-654
  • issue-732
  • issue-737
  • issue-735
  • issue-707
  • issue-706
  • issue-705
  • issue-696
  • issue-690
  • issue-675
  • issue-670
  • issue-635
  • issue-404
  • 7.19
  • 2012-04-18
  • 2012-04-03
  • 2012-04-02
  • 2012-03-01
  • 2012-02-07
  • 20120207
  • 2012-01-13
  • 2012-01-12
  • 2011-12-16
  • 2011-12-05
  • 2011-11-17
  • 2011-11-14
  • 2011-11-08.2
  • 2011-11-08
  • 2011-11-01
  • 2011-10-27
  • 2011-10-06
  • 2011-10-03
  • 2011-09-19
40 results

authorize.inc

Blame
  • Forked from UNL Information Services / UNL-CMS
    Source project has a limited visibility.
    TestformController.php 2.67 KiB
    <?php
    
    class TestFormController extends Nmc_Controller_Action
    {
    
        public function indexAction()
        {
            $record = CourseGenerations::fetchBySubjectNumberLetter('CSCE', 155);
            $newRecord = clone $record;
            $newRecord->title = 'Computer Science I, part 2';
            $newRecord->save();
    
            /*
            $sem = new Nmc_Semaphore('tnohu');
            $sem->lock();
            header('Content-type: text');
            echo "doing stuff...\n";
            sleep(10);
            echo "done!\n";
            $sem->unlock();
            */
    
            //return $this->viewAction();
        }
    
        public function listAction()
        {
            $table = new TestAddressBook();
            $recrods = $table->fetchAll();
            $out = new Nmc_View_Unl();
            $out->assign('page', 'listAddress');
            $out->assign('records', $recrods);
            echo $out->render('index.xhtml');
        }
    
        public function viewAction()
        {
            $in = $this->getRequest();
            $id = Zend_Filter_Int::filter($in->getParam(0));
            $table = new TestAddressBook();
            $record = $table->find($id);
    
            $out = new Nmc_View_Unl();
            $out->assign('page', 'viewAddress');
            $out->assign('record', $record);
            echo $out->render('index.xhtml');
        }
    
        public function addAction()
        {
            $out = new Nmc_View_Unl();
            $out->page = 'addAddress';
            echo $out->render('index.xhtml');
        }
    
        public function editAction()
        {
            $in = $this->getRequest();
            $id = Zend_Filter_Int::filter($in->getParam(0));
            $table = new TestAddressBook();
            $record = $table->find($id);
    
            $out = new Nmc_View_Unl();
            $out->assign('page', 'editAddress');
            $out->assign('record', $record);
            echo $out->render('index.xhtml');
        }
    
        public function saveAction()
        {
            $in = $this->getRequest();
            $id = Zend_Filter_Int::filter($in->getPost('id'));
    
            $table = new TestAddressBook();
            if($id < 0) {
                $record = $table->fetchNew();
            } else {
                $record = $table->find($id);
            }
    
            $record->firstName = Zend_Filter_Alnum::filter($in->getPost('firstName'));
            $record->lastName = Zend_Filter_Alnum::filter($in->getPost('lastName'));
            $record->phone = Zend_Filter_Alnum::filter($in->getPost('phone'));
            $record->address = Zend_Filter_Alnum::filter($in->getPost('address'));
            $record->zip = Zend_Filter_Alnum::filter($in->getPost('zip'));
            $record->save();
    
            if($id < 0) {
                $id = $table->getAdapter()->lastInsertId();
            }
    
            $out = new Nmc_View_Unl();
            $out->refresh = '/testform/view/' . $id;
            echo $out->render('index.xhtml');
        }
    }
    
    ?>