/** * set position select form (target branch) * @param int $_branch_no * @param string $_type */ public function setSelectPosition($_branch_no, $_type = null) { if ($_branch_no) { $db = new PositionTable(); $where = array('position_no <> 0', 'branch_no' => (int) $_branch_no); $row = $db->getPairs(null, null, 0, $where); } else { $row = array(); } $this->add(array('name' => ($_type == 'search' ? 'search-' : '') . 'position_no', 'type' => 'select', 'attributes' => array('id' => ($_type == 'search' ? 'search-' : '') . 'position_no'), 'options' => array('label' => 'Name', 'value_options' => $row, 'empty_option' => 'Select position'))); }
/** * get position select form * @param int $_branch_no * @return array */ public function getPositionList($_branch_no) { if (!$_branch_no) { return array(); } $where = array('branch_no' => (int) $_branch_no); $db = new PositionTable(); return $db->getPairs(null, null, 0, $where); }
public function getPostionSelection() { $where = array('position_no <> 0'); $db = new PositionTable(); return $db->getPairs(null, null, 0, $where); }