bonjour tous le monde,
j'explique mon probleme,dans un page dapratement.php j'ai le code suivant:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
<?php
	echo "<select name='departement'>";
	if(isset($_POST["idTown"])){
		mysql_connect("localhost","root","");
		mysql_select_db("marocimmobilier");
		$res = mysql_query("SELECT id,value FROM jos_jea_departments 
			WHERE idTown=".$_POST["idTown"]." ORDER BY value");
		while($row = mysql_fetch_assoc($res)){
			echo "<option value='".$row["id"]."'>".$row["value"]."</option>";
		}
	}
	echo "</select>";
?>
exactement dans cette page je veux appler une methode d'une classe view.html.php:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
 
<?php
 
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
 
require_once JPATH_COMPONENT.DS.'view.php';
require_once JPATH_COMPONENT.DS.'models'.DS.'properties.php';
require_once JPATH_COMPONENT_ADMINISTRATOR .DS.'models'.DS.'features.php';
 
class JeaViewManage extends JeaView 
{
 
 
    function &getModel()
    {
        static $model = null;
        if ($model === null){
            $model = new JeaModelProperties();
        }
        return $model;
    }
 
 
	function display( $tpl = null )
	{
        $access =& ComJea::getAccess();
 
	    if(!($access->canEdit || $access->canEditOwn)){
            echo JText::_('Unauthorized access');
            return;
        }
 
		if( $this->getLayout() == 'form'){
 
			$this->getItemDetail();
 
		} else {
 
			$this->getItemsList();
		}
 
        $this->assignRef('access', $access);
		parent::display($tpl);
	}
 
 
	function getItemsList()
	{
	    $model =& $this->getModel();
	    $res = $model->getUserProperties();
		jimport('joomla.html.pagination');
 
		$this->pagination = new JPagination($res['total'], $res['limitstart'], $res['limit']);
 
		$this->assign($res);
	}
 
	function getItemDetail()
	{
 
	    $model =& $this->getModel();
 
	    $row =& $model->getRow();
 
		$this->assignRef('row', $row);
 
		$res = ComJea::getImagesById($row->id);
 
 
	    if (!empty($res['main_image']) && is_array($res['main_image'])) {
            $res['main_image']['delete_url'] = JRoute::_('&task=deleteimg&id='.$row->id ) ;
        }
 
        foreach ( $res['secondaries_images']  as $k => $v) {
            $res['secondaries_images'][$k]['delete_url'] = JRoute::_(   '&task=deleteimg&image='.$v['name'] 
                                                                       . '&id='.$row->id ) ;
        }
 
        if($row->id){
            $page_title = ucfirst( JText::sprintf('Edit property', $this->escape($row->ref)));
        } else {
            $page_title = ucfirst( JText::_('New property'));
        }
 
		$this->assignRef('main_image', $res['main_image']);
		$this->assignRef('secondaries_images', $res['secondaries_images']);
 
		$this->assign( 'page_title', $page_title );
 
		$mainframe =& JFactory::getApplication();
		$pathway =& $mainframe->getPathway();
		$pathway->addItem( $page_title );
 
		$document=& JFactory::getDocument();
		$document->setTitle( $page_title );
 
	}
 
 
    function getHtmlList($tableName, $default=0 )
    {   
        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_property_type = '- ' . JText::_( 'Property type' ).' -' ;
            $t_heating_type  = '- ' . JText::_( 'Heating type' ).' -' ;
            $t_hotwater_type = '- ' . JText::_( 'Hot water type' ).' -' ;
 
            $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' ),
                            'types' => array( $t_property_type , 'type_id' ),
                            'heatingtypes' => array( $t_heating_type , 'heating_type' ),
                            'hotwatertypes' => array( $t_hotwater_type , 'hot_water_type' ),
                          );
        }
 
        if ( isset($lists[$tableName]) ) {
 
            $featuresModel = new JeaModelFeatures();
            $featuresModel->setTableName( $tableName );
 
            return JHTML::_('select.genericlist', 
                            $featuresModel->getListForHtml($lists[$tableName][0]) , 
                            $lists[$tableName][1], 
                            'class="inputbox" size="1" name="idTown" id="idTown" onchange="go(this.value)" ' , 
                            'value', 
                            'text', 
                            $default );
        }
 
        return 'list Error';    
    }
 
    function getAdvantagesRadioList()
    {
        $html = '';
 
        $featuresModel = new JeaModelFeatures();
        $featuresModel->setTableName( 'advantages' );
        $res = $featuresModel->getItems(true);
 
        $advantages = array();
 
        if ( !empty( $this->row->advantages ) ) {
            $advantages = explode( '-' , $this->row->advantages );
        }
 
        foreach ( $res['rows'] as $k=> $row ) {
 
            $checked = '';
 
            if ( in_array($row->id, $advantages) ) {
                $checked = 'checked="checked"' ;
            }
 
            $html .= '<label class="advantage">' . PHP_EOL 
                  .'<input type="checkbox" name="advantages[' . $k . ']" value="' 
                  . $row->id . '" ' . $checked . ' />' . PHP_EOL 
                  . $row->value . PHP_EOL 
                  . '</label>' . PHP_EOL ;
        }
        return $html;
    }
 
    function is_checkout( $checked_out )
    {
        if ($this->user && JTable::isCheckedOut( $this->user->get('id'), $checked_out ) ) {
            return true;
        }
        return false;
    }
 
 
}
comment faire svp??