Example #1
0
 function getRadioList()
 {
     $html = '';
     $featuresModel = new JeaModelFeatures();
     $featuresModel->setTableName('kinds');
     $res = $featuresModel->getItems(true);
     foreach ($res['rows'] as $k => $row) {
         $checked = "";
         $loai = JFactory::getURI()->getVar("cat");
         switch ($loai) {
             case "selling":
                 $kinks = 1;
                 break;
             case "renting":
                 $kinks = 2;
                 break;
             case "needbuying":
                 $kinks = 3;
                 break;
             case "needrenting":
                 $kinks = 4;
                 break;
             default:
                 $kinks = 1;
                 break;
         }
         if ($row->id == $kinks) {
             $checked = 'checked';
         }
         $html .= '<label class="radio_dangtin">' . PHP_EOL . '<input type="radio" name="kind_id" value="' . $row->id . '" ' . $checked . '>' . PHP_EOL . $row->value . PHP_EOL . '</label>' . PHP_EOL;
     }
     return $html;
 }
Example #2
0
 function getHtmlList($tableName, $default = 1, $grid = false, $isTown = false, $parentChild = false, $idInner = '')
 {
     static $lists = null;
     if (!is_array($lists)) {
         $t_department = '- ' . JText::_('Department') . ' -';
         $t_condition = '- ' . JText::_('Condition') . ' -';
         $t_area = '- ' . JText::_('Area') . ' -';
         $t_slogan = '- ' . JText::_('Slogan') . ' -';
         $t_town = '- ' . JText::_('Town') . ' -';
         $t_direction = '- ' . JText::_('Direction') . ' -';
         $t_property_type = '- ' . JText::_('Property type') . ' -';
         $t_heating_type = '- ' . JText::_('Heating type') . ' -';
         $t_hotwater_type = '- ' . JText::_('Hot water type') . ' -';
         $t_kinds = '- ' . JText::_('Chongiatri') . ' -';
         $t_planchilds = '- ' . JText::_('Plan Childs') . ' -';
         $t_plans = '- ' . JText::_('Plans') . ' -';
         $lists = array('departments' => array($t_department, 'department_id'), 'conditions' => array($t_condition, 'condition_id'), 'areas' => array($t_area, 'area_id'), 'slogans' => array($t_slogan, 'slogan_id'), 'towns' => array($t_town, 'town_id'), 'directions' => array($t_direction, 'direction_id'), 'types' => array($t_property_type, 'type_id'), 'heatingtypes' => array($t_heating_type, 'heating_type'), 'hotwatertypes' => array($t_hotwater_type, 'hot_water_type'), 'kinds' => array($t_kinds, 'kind_id'), 'planchilds' => array($t_planchilds, 'plan_id'), 'plans' => array($t_planchilds, 'plan_parent_id'));
     }
     if (isset($lists[$tableName])) {
         if ($grid) {
             if ($tableName == 'types') {
                 //$onChange =	'onchange="jea_types_filter(this.value);"';
                 $onChange = 'onchange="jea_types_filter(this.value); onchange=getonchangvalue(\'type_id\',\'divtype\',\'\',0)"';
             } else {
                 $onChange = 'onchange="document.adminForm.submit();"';
             }
         } else {
             $onChange = '';
         }
         if ($parentChild) {
             if ($tableName == 'towns') {
                 $onChange = 'onchange="jea_change_form_towns(this.value,\'' . $idInner . '\',\'' . $default . '\');"';
             }
             if ($tableName == 'plans') {
                 $onChange = 'onchange="jea_change_form_plans(this.value,\'' . $idInner . '\',\'' . $default . '\');"';
             }
         }
         $featuresModel = new JeaModelFeatures();
         $featuresModel->setTableName($tableName);
         return JHTML::_('select.genericlist', $featuresModel->getListForHtml($lists[$tableName][0]), $lists[$tableName][1], 'class="inputbox" size="1" style="width:100px" ' . $onChange, 'value', 'text', $default);
     }
     return 'list Error';
 }
Example #3
0
 function getUpdateOrdering()
 {
     $cid = JRequest::getVar('cid', array(0), '', 'array');
     if ($cid[0]) {
         list($id) = explode('@#$%^', $cid[0]);
     }
     $ordering = 'ordering_' . $id;
     $orderingvalue = JRequest::getVar("{$ordering}", '');
     $paramvalue = "ordering = '{$orderingvalue}'";
     //		print_r($paramvalue);
     //		exit;
     //		$language = ilandCommonUtils::getLanguage();
     $language = 'vi';
     $ModelFeatures = new JeaModelFeatures();
     $DanhSachBDS = $ModelFeatures->layDanhSachBatDongSan($language);
     $this->assignRef('tenBang', $DanhSachBDS['name']);
     $ModelFeatures->ordering($this->tenBang, $id, $paramvalue);
 }