当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::fetchAll方法代码示例

本文整理汇总了PHP中Client::fetchAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::fetchAll方法的具体用法?PHP Client::fetchAll怎么用?PHP Client::fetchAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Client的用法示例。


在下文中一共展示了Client::fetchAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: allAction

 function allAction()
 {
     $this->view->title = $this->view->translate->_("Clients");
     $clients = new Client();
     $order = array('Name');
     $this->view->clients = $clients->fetchAll(null, $order);
     $this->view->meta_refresh = 300;
     // meta http-equiv="refresh"
 }
开发者ID:staser,项目名称:webacula,代码行数:9,代码来源:ClientController.php

示例2: init

 public function init()
 {
     $this->translate = Zend_Registry::get('translate');
     //Zend_Form::setDefaultTranslator( Zend_Registry::get('translate') );
     // Set the method for the display form to POST
     $this->setMethod('post');
     $from_form = $this->addElement('hidden', 'from_form', array('decorators' => $this->elDecorators, 'value' => '1'));
     // load models
     Zend_Loader::loadClass('Client');
     Zend_Loader::loadClass('FileSet');
     Zend_Loader::loadClass('Storage');
     /*
      *  Job Name
      */
     $table_job = new Job();
     $jobs = $table_job->getListJobs();
     // select
     $jobname = $this->createElement('select', 'jobname', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Job Name'), 'required' => true, 'class' => 'ui-select', 'style' => 'width: 25em;'));
     foreach ($jobs as $v) {
         $jobname->addMultiOption($v, $v);
     }
     /*
      * Client
      */
     $table_client = new Client();
     //$order  = array('ClientId', 'Name');
     $order = array('Name');
     $clients = $table_client->fetchAll(null, $order);
     // select
     $client = $this->createElement('select', 'client', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Client'), 'required' => false, 'class' => 'ui-select', 'style' => 'width: 25em;'));
     $client->addMultiOption('', $this->translate->_("Default"));
     foreach ($clients as $v) {
         $client->addMultiOption($v['name'], $v['name']);
     }
     /*
      * Fileset
      */
     $table_filesets = new Fileset();
     $order = array('Fileset');
     $filesets = $table_filesets->fetchAll(null, $order);
     // select
     $fileset = $this->createElement('select', 'fileset', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Fileset'), 'required' => false, 'class' => 'ui-select', 'style' => 'width: 25em;'));
     $fileset->addMultiOption('', $this->translate->_("Default"));
     foreach ($filesets as $v) {
         $fileset->addMultiOption($v['fileset'], $v['fileset']);
     }
     /*
      * Storage
      */
     $table_storages = new Storage();
     $order = array('Name');
     $storages = $table_storages->fetchAll(null, $order);
     // select
     $storage = $this->createElement('select', 'storage', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Storage'), 'required' => false, 'class' => 'ui-select', 'style' => 'width: 25em;'));
     $storage->addMultiOption('', $this->translate->_("Default"));
     foreach ($storages as $v) {
         $storage->addMultiOption($v['name'], $v['name']);
     }
     /*
      * Level
      */
     // select
     $level = $this->createElement('select', 'level', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Level'), 'required' => false, 'class' => 'ui-select', 'style' => 'width: 20em;'));
     $level->addMultiOptions(array('' => $this->translate->_("Default"), "Full" => $this->translate->_("Full level"), "Incremental" => $this->translate->_("Incremental level"), "Differential" => $this->translate->_("Differential level")));
     /*
      * Spool
      */
     // select
     $spool = $this->createElement('select', 'spool', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Spool'), 'required' => false, 'class' => 'ui-select', 'style' => 'width: 15em;'));
     $spool->addMultiOptions(array('' => $this->translate->_("Default"), "yes" => $this->translate->_("Yes"), "no" => $this->translate->_("No")));
     /*
      * checkbox Now
      */
     $checkbox_now = $this->createElement('checkbox', 'checkbox_now', array('decorators' => $this->elDecorators, 'label' => 'Now', 'onclick' => 'whenNow(this)', 'checked' => 1));
     /*
      * When : date/time
      */
     // date
     $date_when = $this->createElement('text', 'date_when', array('decorators' => $this->elDecorators, 'label' => '', 'required' => false, 'size' => 10, 'maxlength' => 10, 'disabled' => 'true', 'value' => date('Y-m-d', time())));
     $date_when->addValidator('StringLength', false, array(1, 10));
     // time
     $time_when = $this->createElement('text', 'time_when', array('decorators' => $this->elDecorators, 'label' => '', 'required' => false, 'size' => 8, 'maxlength' => 8, 'disabled' => 'true', 'value' => date('H:i:s', time())));
     $time_when->addValidator('StringLength', false, array(1, 8));
     /*
      * submit button
      */
     $submit = new Zend_Form_Element_Submit('submit', array('decorators' => $this->elDecorators, 'id' => 'ok1', 'class' => 'prefer_btn', 'label' => $this->translate->_('Run Job')));
     /*
      *  add elements to form
      */
     $this->addElements(array($jobname, $client, $fileset, $storage, $level, $spool, $checkbox_now, $date_when, $time_when, $submit));
 }
开发者ID:neverstoplwy,项目名称:contrib-webacula,代码行数:92,代码来源:FormJobrun.php

示例3: findFormAction

 /**
  * For FORM SELECT
  *
  */
 function findFormAction()
 {
     $this->view->title = $this->view->translate->_("Search Jobs");
     // get data for form
     Zend_Loader::loadClass('Client');
     $clients = new Client();
     $order = array('Name');
     $this->view->clients = $clients->fetchAll(null, $order);
     Zend_Loader::loadClass('FileSet');
     $filesets = new FileSet();
     $order = array('Fileset');
     $this->view->filesets = $filesets->fetchAll(null, $order);
     // type search
     switch ($this->db_adapter) {
         case 'PDO_SQLITE':
             //regexp not implemented by default
             $this->view->atype_file_search = array('ordinary' => $this->view->translate->_("Ordinary"), 'like' => $this->view->translate->_("LIKE operator"));
             break;
         default:
             $this->view->atype_file_search = array('ordinary' => $this->view->translate->_("Ordinary"), 'like' => $this->view->translate->_("LIKE operator"), 'regexp' => $this->view->translate->_("Regular expression"));
             break;
     }
 }
开发者ID:staser,项目名称:webacula,代码行数:27,代码来源:JobController.php

示例4: init

 public function init()
 {
     $this->translate = Zend_Registry::get('translate');
     //Zend_Form::setDefaultTranslator( Zend_Registry::get('translate') );
     // set method to POST
     $this->setMethod('post');
     /*
      * hidden fields
      */
     $from_form = $this->addElement('hidden', 'from_form', array('decorators' => $this->elDecorators, 'value' => '1'));
     $type_restore = $this->addElement('hidden', 'type_restore', array('decorators' => $this->elDecorators));
     $jobid = $this->addElement('hidden', 'jobid', array('decorators' => $this->elDecorators));
     // for restore single file
     $fileid = $this->addElement('hidden', 'fileid', array('decorators' => $this->elDecorators));
     // load models
     Zend_Loader::loadClass('Client');
     Zend_Loader::loadClass('Storage');
     Zend_Loader::loadClass('Pool');
     Zend_Loader::loadClass('FileSet');
     // ACLs
     $this->bacula_acl = new MyClass_BaculaAcl();
     /******* standard options ******/
     /*
      * client_name / client
      * client_name_to / restoreclient
      *
      */
     $table_client = new Client();
     $order = array('Name');
     $clients = $table_client->fetchAll(null, $order);
     $client_name = $this->createElement('select', 'client_name', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Client'), 'required' => true, 'class' => 'ui-select', 'style' => 'width: 18em;'));
     $client_name_to = $this->createElement('select', 'client_name_to', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Restore client'), 'required' => false, 'class' => 'ui-select', 'style' => 'width: 18em;'));
     $client_name->addMultiOption('', $this->translate->_("Default"));
     $client_name_to->addMultiOption('', $this->translate->_("Default"));
     foreach ($clients as $v) {
         $client_name->addMultiOption($v['name'], $v['name']);
         $client_name_to->addMultiOption($v['name'], $v['name']);
     }
     /*
      * pool
      */
     $table_pool = new Pool();
     $order = array('Name', 'PoolId');
     $pools = $table_pool->fetchAll(null, $order);
     $pool = $this->createElement('select', 'pool', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Pool'), 'required' => false, 'class' => 'ui-select', 'style' => 'width: 18em;'));
     $pool->addMultiOption('', $this->translate->_("Default"));
     foreach ($pools as $v) {
         $pool->addMultiOption($v['name'], $v['name']);
     }
     /*
      * fileset
      */
     $table_fileset = new FileSet();
     $order = array('Fileset');
     $filesets = $table_fileset->fetchAll(null, $order);
     $fileset = $this->createElement('select', 'fileset', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Fileset'), 'required' => false, 'class' => 'ui-select', 'style' => 'width: 18em;'));
     $fileset->addMultiOption('', $this->translate->_("Default"));
     foreach ($filesets as $v) {
         $fileset->addMultiOption($v['fileset'], $v['fileset']);
     }
     /*
      * storage
      */
     $table_storage = new Storage();
     $order = array('Name');
     $storages = $table_storage->fetchAll(null, $order);
     $storage = $this->createElement('select', 'storage', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Storage'), 'required' => false, 'class' => 'ui-select', 'style' => 'width: 18em;'));
     $storage->addMultiOption('', $this->translate->_("Default"));
     foreach ($storages as $v) {
         $storage->addMultiOption($v['name'], $v['name']);
     }
     /*
      * restore_job_select
      * if have multiple Restore Job resources
      */
     $config = Zend_Registry::get('config');
     if ($config->general->bacula_restore_job) {
         $restore_job_select = $this->createElement('select', 'restore_job_select', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Restore Job Resource'), 'required' => true, 'class' => 'ui-select', 'style' => 'width: 18em;'));
         $bacula_restore_jobs = $config->general->bacula_restore_job->toArray();
         $restore_job_select->addMultiOption('', $this->translate->_("Default"));
         $i = 1;
         foreach ($bacula_restore_jobs as $v) {
             if ($this->bacula_acl->doOneBaculaAcl($v, 'job')) {
                 $restore_job_select->addMultiOption($i++, $v);
             }
         }
         // add element to form
         $this->addElement($restore_job_select);
     }
     /******* advanced options ******/
     /*
      * where
      */
     $where = $this->createElement('text', 'where', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Where'), 'required' => false, 'size' => 50, 'maxlength' => 255, 'value' => ''));
     $where->addValidator('StringLength', false, array(0, 255));
     /*
      * strip_prefix
      */
     $strip_prefix = $this->createElement('text', 'strip_prefix', array('decorators' => $this->elDecorators, 'label' => $this->translate->_('Strip prefix'), 'required' => false, 'size' => 24, 'maxlength' => 64, 'value' => ''));
     $strip_prefix->addValidator('StringLength', false, array(0, 64));
//.........这里部分代码省略.........
开发者ID:staser,项目名称:webacula,代码行数:101,代码来源:FormRestoreOptions.php

示例5: mainFormAction

 public function mainFormAction()
 {
     // do Bacula ACLs
     $command = 'restore';
     if (!$this->bacula_acl->doOneBaculaAcl($command, 'command')) {
         $msg = sprintf($this->view->translate->_('You try to run Bacula Console with command "%s".'), $command);
         $this->_forward('bacula-access-denied', 'error', null, array('msg' => $msg));
         // action, controller
         return;
     }
     $this->view->unit_test = $this->_request->getParam('test', null);
     // for tests
     // get data for form
     Zend_Loader::loadClass('Client');
     $clients = new Client();
     $order = array('Name');
     $this->view->clients = $clients->fetchAll(null, $order);
     // do Bacula ACLs
     Zend_Loader::loadClass('FileSet');
     $filesets = new FileSet();
     $order = array('Fileset');
     $this->view->filesets = $filesets->fetchAll(null, $order);
     // do Bacula ACLs
     $this->view->title = $this->view->translate->_("Restore Job");
     $this->view->jobid = intval($this->_request->getParam('jobid', null));
     /*
      * перенаправления из др. форм (RestoreAll и т.п.)
      */
     // выдача сообщения, что такого joid не существует
     $this->view->msgNoJobId1 = $this->_request->getParam('msgNoJobId1', null);
     $this->view->msgNoJobId2 = $this->_request->getParam('msgNoJobId2', null);
     // какая закладка д.б. активной, def = 0 (first child)
     $this->view->accordion_active = $this->_request->getParam('accordion_active', 0);
     // do view
     $this->render();
 }
开发者ID:staser,项目名称:webacula,代码行数:36,代码来源:RestorejobController.php

示例6: adminmessageaddAction

 function adminmessageaddAction()
 {
     $this->_helper->layout->setLayout("layout_admin");
     $clientModel = new Client();
     $order = "id desc";
     $this->view->clients = $clientModel->fetchAll(null, $order);
 }
开发者ID:omusico,项目名称:wildfire_php,代码行数:7,代码来源:DashboardController.php


注:本文中的Client::fetchAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。