Beispiel #1
0
 public function init()
 {
     $obj = new Application_Model_DbTable_Admin();
     $primaryKey = $obj->getPrimaryKey();
     $this->setMethod('post');
     $this->setEnctype('multipart/form-data');
     $this->setAttrib('id', $primaryKey);
     $this->setAction('/admin/save');
     //        $e = new Zend_Form_Element_Hidden($primaryKey);
     //        $e = new Zend_Form_Element_Hidden('admin');
     //        $this->addElement($e);
     $e = new Zend_Form_Element_Hidden('picture');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('name');
     $e->setAttrib('class', 'form-control input-sm');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('lastnamepaternal');
     $e->setAttrib('class', 'form-control input-sm');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('lastnamematernal');
     $e->setAttrib('class', 'form-control input-sm');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('phone');
     $e->setAttrib('class', 'form-control input-sm');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('email');
     $e->setAttrib('readonly', 'true');
     $e->setAttrib('class', 'form-control input-sm');
     $this->addElement($e);
     foreach ($this->getElements() as $element) {
         $element->removeDecorator('Label');
         $element->removeDecorator('DtDdWrapper');
         $element->removeDecorator('HtmlTag');
     }
 }
    public function indexAction()
    {
        $statistic = new Application_Model_DbTable_Statistic();
        
        $countActive = $statistic->getActive();
        $countBanned = $statistic->getBanned();
        $countArchived = $statistic->getArchived();
        $countConnections = $statistic->getConnections();
        $countRenewals = $statistic->getRenewals();
        $countForMounth = $statistic->getPaysForMounth();
        $countConnectionsHostel = $statistic->getConnectionsHostel();
        $countChangeMAC = $statistic->getCountChangeMAC();

        $this->view->countActive = $countActive;
        $this->view->countBanned = $countBanned;
        $this->view->countArchived = $countArchived;
        $this->view->countConnections = $countConnections;
        $this->view->countRenewals = $countRenewals;
        $this->view->countForMounth = $countForMounth;
        $this->view->countConnectionsHostel2 = $countConnectionsHostel[2]['count'];
        $this->view->countConnectionsHostel3 = $countConnectionsHostel[3]['count'];
        $this->view->countChangeMAC = $countChangeMAC;
        
        $admin = new Application_Model_DbTable_Admin();
        $admins = $admin->getAdmins();

        foreach ($admins as $key => $value) {
            $data["{$value['login']}"] = $statistic->getAdminsActions($value['admin_id']);
        }
        $this->view->admin_list = $data;

    }
Beispiel #3
0
    public function viewAction() {

        if (Zend_Auth::getInstance()->getIdentity())
            $role = Zend_Auth::getInstance()->getIdentity()->status;

        $acl = new App_Acl();

        if (!$acl->isAllowed($role, App_Resources::VIEW))
            $this->getHelper('Redirector')->gotoSimpleAndExit('index', 'error', '');

        $this->view->title = "HNA - Просмотр пользователя";
        $this->view->headTitle($this->view->title);

        if ($this->getRequest()->isGet()) {

            $user_id = $this->_getParam('user_id');

            $user = new Application_Model_DbTable_Hna();
            $userinfo = $user->getUser($user_id);
            $this->view->user = $userinfo;

            $pay = new Application_Model_DbTable_Pays();
            $userpay = $pay->getUserPays($user_id);
            $this->view->pay = $userpay;

            $log = new Application_Model_DbTable_Logs();
            $userlog = $log->getUserLog($user_id);
            $admin = new Application_Model_DbTable_Admin();
            $admins = $admin->getAdmins();

            foreach ($admins as $key => $value) {
                $admin_list[$value['admin_id']] = $value['login'];
            }
            $this->view->admin = $admin_list;
            $this->view->log = $userlog;


        }


    }