forked from ledongthuc/MangLuoiBDS
/
phuongxa.php
65 lines (61 loc) · 1.6 KB
/
phuongxa.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define('JPATH_BASE', dirname(__FILE__) );
require_once JPATH_BASE.DS.'includes'.DS.'defines.php';
require_once JPATH_BASE.DS.'includes'.DS.'framework.php';
$mainframe =& JFactory::getApplication('site');
require_once('libraries/com_u_re/php/common_utils.php');
$language= $_REQUEST['lang'];
if($language=='')
$language='vi-VN';
$extension = 'com_u_re';
$lang1 = JFactory::getLanguage();
$basePath = JPATH_BASE;
$ten = '';
if(strlen($language)> 5)
{
$extension_id = substr($language,6);
$lang = substr($language,0,5);
switch($extension_id)
{
case '1':
$extension = 'mod_jea_search';
$lang1->load($extension, $basePath, $lang, true);
$ten = JText::_('CHON_PHUONG_XA');
break;
default:
$extension = 'com_u_re';
$lang1->load($extension, $basePath, $lang, true);
$ten = JText::_('CHON_PHUONG_XA');
break;
}
}
else
{
$lang1->load($extension, $basePath, $language, true);
$ten = JText::_('CHON_PHUONG_XA');
}
$quanHuyenId = $_GET['quan_huyen_id'];
$propertyModel = new U_reModelProperties();
$rows = $propertyModel->layDanhSachPhuongXa( $quanHuyenId, substr($language,0,2) );
$ix_phuong_xa_id = JRequest::getVar('phuong_xa_id', 0);
if ($rows)
{
if($ten !='')
{
$title =Array ( 'id' => 0 ,'ten' => $ten);
array_unshift( $rows, $title );
}
echo JHTML::_('select.genericlist', $rows , 'phuong_xa_id', 'class="opt" size="1" ' , 'id', 'ten', $ix_phuong_xa_id);
}
else
{
echo "<select id='phuong_xa_id' name='phuong_xa_id' class='opt' >";
if( $ten!='')
{
echo "<option value='0'>".$ten."</option>";
}
echo "</select>";
}
?>