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


PHP Branch::fetchAll方法代码示例

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


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

示例1: baseInit

 /**
  * Inicjalizacja formularza
  */
 public function baseInit()
 {
     $this->_atModel = $atModel = new AddonType();
     $this->_bModel = $bModel = new Branch();
     $rows = $atModel->fetchAll('not ghost', 'name asc');
     $addons = array();
     foreach ($rows as $row) {
         $addons[Base_Convert::strToHex($row->id)] = $row->name;
     }
     $this->addElement('MultiCheckbox', 'addons', array('label' => 'Uzwględnij następujące dodatki:', 'MultiOptions' => $addons, 'value' => array_keys($addons), 'required' => true));
     $this->addons->getDecorator('row')->setOption('class', 'row widerow');
     $rows = $bModel->fetchAll('not ghost', 'web_name asc');
     $branches = array();
     foreach ($rows as $row) {
         $branches[Base_Convert::strToHex($row->id)] = $row->branch_name;
     }
     $this->addElement('MultiCheckbox', 'branches', array('label' => 'Uwzględnij następujące brandy:', 'MultiOptions' => $branches, 'value' => array_keys($branches), 'required' => true));
     $dic = new Logic_Dictionary();
     $cTypes = array();
     $this->_cDic = $cDic = $dic->getDictionaryEntriesByCode('client_type');
     foreach ($cDic as $ct) {
         $cTypes[Base_Convert::strToHex($ct->id)] = ucfirst($ct->entry);
     }
     $rows = $bModel->fetchAll('not ghost', 'web_name asc');
     $branches = array();
     foreach ($rows as $row) {
         $branches[Base_Convert::strToHex($row->id)] = $row->branch_name;
     }
     $this->addElement('MultiCheckbox', 'clients', array('label' => 'Uwzględnij nastepujących klientów:', 'MultiOptions' => $cTypes, 'value' => array_keys($cTypes), 'required' => true));
     $this->addElement('Select', 'timepoint', array('label' => 'Wyeksportuj wartości:', 'MultiOptions' => array('now' => 'Aktualne', 'archive' => 'Archiwalne'), 'required' => true));
     $this->datee(false, 'date', 'Data:', true, array('value' => date('Y-m-d'), 'required' => true));
     $this->addElement('text', 'time', array('label' => 'Godzina:', 'class' => 'timeentry', 'required' => true, 'value' => date('H:00:00'), 'validators' => array(array('validator' => 'Date', 'options' => array('format' => 'H:i:s')))));
     $this->submit(false, 'submitbtn', 'Eksportuj');
 }
开发者ID:knatorski,项目名称:SMS,代码行数:37,代码来源:Print.php

示例2: getBrands

 protected function getBrands()
 {
     $brandModel = new Branch();
     $brandsResult = $brandModel->fetchAll();
     $brands = array();
     foreach ($brandsResult as $brand) {
         $brands[$brand->id] = $brand->branch_name;
     }
     return $brands;
 }
开发者ID:knatorski,项目名称:SMS,代码行数:10,代码来源:Calculate.php

示例3: getBranches

 public function getBranches()
 {
     $branchModel = new Branch();
     $branches = $branchModel->fetchAll();
     $branchOptions = array();
     foreach ($branches as $branch) {
         $branchOptions[$branch->id] = $branch->web_name;
     }
     return $branchOptions;
 }
开发者ID:knatorski,项目名称:SMS,代码行数:10,代码来源:Add.php

示例4: getTable

 public function getTable($customerType, $addonType, $version = null)
 {
     $tableData = new stdClass();
     $tableData->header = array('');
     $tableData->data = array();
     $addonTypeModel = new AddonType();
     $addonTypeRow = $addonTypeModel->findOne($addonType);
     $addonTypeCode = $addonTypeRow->code;
     $branchModel = new Branch();
     $branches = $branchModel->fetchAll();
     foreach ($branches as $branch) {
         $tableData->header[] = $branch->branch_name;
     }
     $addon = new Addon();
     $addonResults = $addon->getOrderedAddons($customerType, $addonType, $version);
     $previousStep = null;
     $rowArray = array();
     foreach ($addonResults as $addonResult) {
         if ($addonResult->step_description !== $previousStep) {
             if ($previousStep !== null) {
                 $tableData->data[] = $rowArray;
             }
             $previousStep = $addonResult->step_description;
             switch ($addonTypeCode) {
                 case 'deposit_period':
                     $rowArray = array($previousStep);
                     break;
                 case 'deposit_amount':
                 case 'customer_engagement':
                     $rowArray = array(number_format($previousStep, 0, '.', ' '));
                     break;
                 case 'new_old_money':
                     if ($previousStep == 0) {
                         $rowArray = array('Stare środki');
                     } else {
                         $rowArray = array('Nowe środki');
                     }
                     break;
                 case 'brand':
                     $rowArray = array('Dodatek');
                     break;
             }
         }
         $rowArray[] = $addonResult->interest_value;
     }
     $tableData->data[] = $rowArray;
     return $tableData;
 }
开发者ID:knatorski,项目名称:SMS,代码行数:48,代码来源:Internalbase.php

示例5: User

} else {
    echo "\n\nParametr app_env jest wymagany!";
    echo "\n\n" . $opts->getUsageMessage() . "\n\n";
    exit;
}
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
Base_Controller_Action_Helper_Currentip::$_unitTestEnabled = true;
$application->bootstrap();
$application->getBootstrap()->runForCmd();
Zend_Controller_Front::getInstance()->setParam('bootstrap', $application->getBootstrap());
Zend_registry::set('config', $application->getOptions());
$user = $application->getOption('bin');
$u = new User();
$u_data = $u->fetchAll("login = '" . $user['user'] . "'", "id DESC", 1);
if (null == $u_data) {
    throw new Exception('Brak użytkownika o podanym ID');
}
$u_data = $u_data->toArray();
$storageRow = new stdClass();
foreach ($u_data[0] as $key => $value) {
    $storageRow->{$key} = $value;
}
$auth = Zend_Auth::getInstance();
$storage = $auth->getStorage();
$o = new Branch();
$data = $o->fetchAll("branch_name = '" . $user['branch'] . "'", "id DESC", 1)->toArray();
$storageRow->jednostka = $data[0];
$storage->write($storageRow);
开发者ID:knatorski,项目名称:SMS,代码行数:31,代码来源:init.php

示例6: __construct

 public function __construct($options = null)
 {
     $model = new Branch();
     $this->braches = $model->fetchAll();
     parent::__construct($options);
 }
开发者ID:knatorski,项目名称:SMS,代码行数:6,代码来源:BranchAcceptance.php

示例7: updateBranch

 public function updateBranch($form, $id)
 {
     $values = $form->getValues();
     $branch = new Branch();
     $row = $branch->findOne($id);
     if ($values['desk'] == 0) {
         $values['desk'] = new Zend_Db_Expr("0");
     }
     $row->setFromArray($values);
     $form_groups = $values['groups'];
     $form_groups = $form_groups ? $form_groups : array();
     $branch_groups = $this->getGroupsForBranch($id);
     foreach ($branch->fetchAll($branch_groups) as $group) {
         if (false === ($key = array_search($group->id, $form_groups))) {
             $this->removeBranchFromGroup($id, $group->id);
         }
         unset($form_groups[$key]);
     }
     foreach ($form_groups as $group) {
         $this->addBranchToGroup($id, $group);
     }
     $row->save();
 }
开发者ID:knatorski,项目名称:SMS,代码行数:23,代码来源:Branch.php

示例8: __construct

 public function __construct($options = null)
 {
     $o = new Branch();
     $this->oddzialy = $o->fetchAll(array('ghost = false and id != ' . $options['id_branch']))->toArray();
     parent::__construct($options);
 }
开发者ID:knatorski,项目名称:SMS,代码行数:6,代码来源:Branches.php

示例9: getDataToUserReport

 public function getDataToUserReport()
 {
     $profileModel = new Profile();
     $select = $profileModel->select()->order('id_user');
     $profileDataArray = $profileModel->fetchAll($select)->toArray();
     $groupModel = new Group();
     $select = $groupModel->select();
     $groupDataArray = $groupModel->fetchAll($select)->toArray();
     foreach ($groupDataArray as $key => $value) {
         $tmp[$value['id']] = $value;
     }
     $groupDataArray = $tmp;
     unset($tmp);
     $branchModel = new Branch();
     $select = $branchModel->select();
     $branchDataArray = $branchModel->fetchAll($select)->toArray();
     foreach ($branchDataArray as $key => $value) {
         $tmp[$value['id']] = $value;
     }
     $branchDataArray = $tmp;
     unset($tmp);
     $userModel = new User();
     $select = $userModel->select();
     $userDataArray = $userModel->fetchAll($select)->toArray();
     foreach ($userDataArray as $key => $value) {
         $tmp[$value['id']] = $value;
     }
     $userDataArray = $tmp;
     unset($tmp);
     $roleModel = new Role();
     $select = $roleModel->select();
     $roleDataArray = $roleModel->fetchAll($select)->toArray();
     foreach ($roleDataArray as $key => $value) {
         $tmp[$value['id']] = $value;
     }
     $roleDataArray = $tmp;
     unset($tmp);
     $groupArray = array();
     foreach ($profileDataArray as $key => $value) {
         $data = $this->getAuthorizationsForProfile($value['id']);
         foreach ($data as $key2 => $values) {
             foreach ($values as $key3 => $privs) {
                 /* if ($privs['ghost'] === true) {
                     unset($data[$key2][$key3]);
                     continue;
                     }
                    */
                 $tmp = array('login' => '', 'surname' => '', 'first_name' => '', 'group' => '', 'role' => '', 'branch' => '', 'ghost' => '');
                 if ($key2 === 'group') {
                     $tmp['group'] = $groupDataArray[$privs['id_group']]['group_name'];
                 }
                 if ($key2 === 'role') {
                     $tmp['role'] = $roleDataArray[$privs['id_role']]['description'];
                 }
                 $tmp['login'] = $userDataArray[$value['id_user']]['login'];
                 $tmp['surname'] = $userDataArray[$value['id_user']]['surname'];
                 $tmp['first_name'] = $userDataArray[$value['id_user']]['first_name'];
                 $tmp['branch'] = $branchDataArray[$value['id_branch']]['branch_name'];
                 $tmp['ghost'] = $userDataArray['ghost'] ? 'NIEAKTYWNY' : 'AKTYWNY';
                 $groupArray[] = $tmp;
             }
         }
     }
     return $groupArray;
 }
开发者ID:knatorski,项目名称:SMS,代码行数:65,代码来源:User.php

示例10: __construct

 public function __construct($options = null)
 {
     $oddzialModel = new Branch();
     $this->branches = $oddzialModel->fetchAll(array('ghost = false'))->toArray();
     parent::__construct($options);
 }
开发者ID:knatorski,项目名称:SMS,代码行数:6,代码来源:Profiles.php


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