IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

Changer une liste déroulante par des checkbox [MySQL]


Sujet :

PHP & Base de données

  1. #1
    Nouveau Candidat au Club
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Septembre 2012
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loiret (Centre)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Septembre 2012
    Messages : 2
    Points : 1
    Points
    1
    Par défaut Changer une liste déroulante par des checkbox
    Bonjour à tous,

    Je ne sais pas si je poste dans la bonne catégorie mais je poste à l'endroit qui me parait le plus approprié.

    Voici donc mon problème: J'ai un script ( pour joomla ) qui m'affiche le contenu d'une table sous forme de liste déroulante. Mais pour mes besoins il me faudrait le même contenu mais en checkbox ( une par entrée ), et je vous avoue que cela dépasse malheureusement mes compétences.

    Voici le contenu du premier fichier:
    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
    <?php
    
    defined('_JEXEC') or die( 'Restricted access' );
    
    jimport( 'joomla.application.component.view');
    
    
    class RecruitViewSearch extends JView
    {
    	function display($tpl = null)
    	{
    		$mainframe	=& JFactory::getApplication();
    		$document	=& JFactory::getDocument();
    		$pathway	=& $mainframe->getPathway();
    		
    		$catid 		= JRequest::getInt('catid');
    		$contract 	= JRequest::getInt('contract');
    		$experience = JRequest::getInt('experience');
    		$level	 	= JRequest::getInt('level');
    		$location	= JRequest::getVar('location',null,'GET','string');
    		$keywords	= JRequest::getVar('keywords',null,'GET','string');
    		
    		// Global params
    		$params =& RecruitHelperParams::getParams();
    		
    		$menus	= &JSite::getMenu();
    		$menu	= $menus->getActive();
    		
    		// Menu params
    		$menuParams = new JParameter( $menu->params );		
    		
    		$params->merge( $menuParams );
    		
    		// Get the data
    		$data 		=& $this->get( 'data' );
    		$pagination	=& $this->get( 'pagination' );
    	
    	
    		$lists = array();
    		
    		$lists['catid'] 		= RecruitHelperlist::categories( $catid, false, 'catid', 'class="inputbox" size="1"' );
    		$lists['contract'] 		= RecruitHelperlist::contracts( $contract, 'contract', 'class="inputbox" size="1"' );
    		$lists['level'] 		= RecruitHelperlist::levels( $level, 'level', 'class="inputbox" size="1"' );
    		$lists['experience'] 	= RecruitHelperlist::experiences( $experience, 'experience', 'class="inputbox" size="1"' );
    		$lists['location']		= $location;
    		$lists['keywords']		= $keywords;
    		
    		
    
    		$document->setTitle( $params->get('meta_title') ? $params->get('meta_title') : JText::_( 'COM_RECRUIT_SEARCH_OFFER' ) );
    		
    
    		$document->setMetaData( 'description', $this->escape( $offer->meta_description ) );
    		
    
    		$document->setMetaData( 'keywords', $this->escape( $offer->meta_keywords ) );
    		
    
    		if ( $keywords ) {
    			$pathway->addItem( $keywords );
    		}
    		
    		
    		$this->assignRef( 'data',		$data );
    		$this->assignRef( 'pagination',	$pagination );
    		$this->assignRef( 'lists',		$lists );
    		$this->assignRef( 'Itemid',		$menu->id );
    		$this->assignRef( 'params',		$params );
    		
    		parent::display($tpl);
    	}
    }
    ?>
    Le second fichier:
    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
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    <?php
    defined('_JEXEC') or die('Restricted access');
    ?>
    	
    <h1 class="contentheading"><?php echo JText::_( 'COM_RECRUIT_SEARCH_OFFER' ); ?></h1>
    
    <form name="searchForm" method="GET" action="index.php">
    
    	<fieldset class="search">
    		
    		<dl>
    			<?php if ( $this->params->get( 'show_category_field' ) ) { ?>
    				<dt width="40%"><?php echo JText::_( 'COM_RECRUIT_CATEGORY' ); ?></dt>
    				<dd><?php echo $this->lists['catid']; ?></dd>
    			<?php } if ( $this->params->get( 'show_contract_field' ) ) { ?>
    				<dt><?php echo JText::_( 'COM_RECRUIT_CONTRACT_TYPE' ); ?></dt>
    				<dd><?php echo $this->lists['contract']; ?></dd>
    			<?php } if ( $this->params->get( 'show_experience_field' ) ) { ?>
    				<dt><?php echo JText::_( 'COM_RECRUIT_EXPERIENCE' ); ?></dt>
    				<dd><?php echo $this->lists['experience']; ?></dd>
    			<?php } if ( $this->params->get( 'show_level_field' ) ) { ?>
    				<dt><?php echo JText::_( 'COM_RECRUIT_LEVEL' ); ?></dt>
    				<dd><?php echo $this->lists['level']; ?></dd>
    			<?php } if ( $this->params->get( 'show_location_field' ) ) { ?>
    				<dt><?php echo JText::_( 'COM_RECRUIT_LOCATION' ); ?></dt>
    				<dd><input type="text" class="inputbox" name="location" value="<?php echo $this->lists['location']; ?>" /></dd>
    			<?php } ?>
    			<dt><?php echo JText::_( 'COM_RECRUIT_KEYWORDS' ); ?></dt>
    			<dd><input type="text" class="inputbox" name="keywords" value="<?php echo $this->lists['keywords']; ?>" /></dd>
    		</dl>
    		
    		<div class="clr"></div>
    		
    		<div class="buttonbox">
    			<input class="button" type="submit" onclick="return verif();" value="<?php echo JText::_( 'COM_RECRUIT_SEARCH' ); ?>" />
    		</div>
    		
    	</fieldset>
    
    	<input type="hidden" name="option" value="com_RECRUIT" />
    	<input type="hidden" name="view" value="search" />
    	<input type="hidden" name="Itemid" value="<?php echo $this->Itemid; ?>" />
    	
    </form>
    
    <?php if ( is_array( $this->data ) ) { ?>
    
    	<?php if ( count($this->data) > 0 ) { ?>
    		
    		<table class="admin">
    			<thead> 
    				<tr>
    					<td width="2%" class="sectiontableheader" align="center">#</td>
    					<td class="sectiontableheader">					
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "offerasc" ) ? "offerdesc" : "offerasc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_OFFERS' ); ?>
    						</a>						
    					</td>
    					<?php if ( $this->params->get( 'show_category_column' ) ) { ?>
    					<td class="sectiontableheader" width="16%" nowrap="nowrap">	
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "catasc" ) ? "catdesc" : "catasc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_CATEGORY' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_reference_column' ) ) { ?>
    					<td class="sectiontableheader" width="8%" nowrap="nowrap">						
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "ansdesc" ) ? "ansasc" : "ansdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_REFERENCE' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_contract_column' ) ) { ?>
    					<td class="sectiontableheader" width="10%" nowrap="nowrap">											
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "pubdesc" ) ? "pubasc" : "pubdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_CONTRACT' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_openings_column' ) ) { ?>
    					<td class="sectiontableheader" width="7%" nowrap="nowrap">
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "hitsdesc" ) ? "hitsasc" : "hitsdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_NUMBER_OF_OPENINGS' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_level_column' ) ) { ?>
    					<td class="sectiontableheader" width="7%" nowrap="nowrap">
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "hitsdesc" ) ? "hitsasc" : "hitsdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_LEVEL' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_experience_column' ) ) { ?>
    					<td class="sectiontableheader" width="7%" nowrap="nowrap">
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "hitsdesc" ) ? "hitsasc" : "hitsdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_EXPERIENCE' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_wage_column' ) ) { ?>
    					<td class="sectiontableheader" width="7%" nowrap="nowrap">
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "hitsdesc" ) ? "hitsasc" : "hitsdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_WAGE' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_location_column' ) ) { ?>
    					<td class="sectiontableheader" width="7%" nowrap="nowrap">
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "hitsdesc" ) ? "hitsasc" : "hitsdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_LOCATION' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_duration_column' ) ) { ?>
    					<td class="sectiontableheader" width="7%" nowrap="nowrap">
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "hitsdesc" ) ? "hitsasc" : "hitsdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_DURATION' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_begin_column' ) ) { ?>
    					<td class="sectiontableheader" width="7%" nowrap="nowrap">
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "hitsdesc" ) ? "hitsasc" : "hitsdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_BEGIN_DATE' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_hits_column' ) ) { ?>
    					<td class="sectiontableheader" width="7%" nowrap="nowrap">
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "hitsdesc" ) ? "hitsasc" : "hitsdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_HITS' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_contact_column' ) ) { ?>
    					<td class="sectiontableheader" width="7%" nowrap="nowrap">
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "hitsdesc" ) ? "hitsasc" : "hitsdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_CONTACT' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_version_column' ) ) { ?>
    					<td class="sectiontableheader" width="7%" nowrap="nowrap">
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "hitsdesc" ) ? "hitsasc" : "hitsdesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_VERSION' ); ?>
    						</a>						
    					</td>
    					<?php } if ( $this->params->get( 'show_created_column' ) ) { ?>
    					<td class="sectiontableheader" width="20%" nowrap="nowrap">					
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "datedesc" ) ? "dateasc" : "datedesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_CREATED' ); ?>
    						</a>				
    					</td>
    					<?php } if ( $this->params->get( 'show_modified_column' ) ) { ?>
    					<td class="sectiontableheader" width="20%" nowrap="nowrap">					
    						<a href="javascript:void(0);" onClick="reorder( '<?php echo ( $order == "datedesc" ) ? "dateasc" : "datedesc"; ?>' );">
    							<?php echo JText::_( 'COM_RECRUIT_MODIFIED' ); ?>
    						</a>						
    					</td>
    					<?php } ?>
    				</tr>
    			</thead>
    			<?php 
    			$i = 0;
    			foreach( $this->data as $offer ) { ?>
    				<tr class="<?php echo ($i%2) ? "sectiontableentry2" : "sectiontableentry1"; ?>">
    					<td align="center">
    						<?php echo $i+$this->pagination->limitstart+1; ?>
    					</td>
    					<td align="left">
    						<a href="<?php echo RECRUITHelperRoute::getOfferRoute( $offer->id ); ?>">
    							<?php echo htmlspecialchars( $offer->title ); ?>
    						</a>						
    					</td>
    					<?php if ( $this->params->get( 'show_category_column' ) ) { ?>
    					<td align="left">
    						<?php echo htmlspecialchars( $offer->category_name ); ?>
    					</td>
    					<?php } if ( $this->params->get( 'show_reference_column' ) ) { ?>
    					<td align="center">
    						<?php echo htmlspecialchars( $offer->reference ); ?>
    					</td>
    					<?php } if ( $this->params->get( 'show_contract_column' ) ) { ?>
    					<td align="center">
    						<?php echo htmlspecialchars( $offer->contract_name ); ?>						
    					</td>
    					<?php } if ( $this->params->get( 'show_openings_column' ) ) { ?>
    					<td align="center">
    						<?php echo htmlspecialchars( $offer->nb_openings ); ?>
    					</td>
    					<?php } if ( $this->params->get( 'show_level_column' ) ) { ?>
    					<td align="center">					
    						<?php echo htmlspecialchars( $offer->level_name ); ?>
    					</td>
    					<?php } if ( $this->params->get( 'show_experience_column' ) ) { ?>
    					<td align="center">					
    						<?php echo htmlspecialchars( $offer->experience_name ); ?>
    					</td>
    					<?php } if ( $this->params->get( 'show_wage_column' ) ) { ?>
    					<td align="center">					
    						<?php echo htmlspecialchars( $offer->wage ); ?>
    					</td>
    					<?php } if ( $this->params->get( 'show_location_column' ) ) { ?>
    					<td align="center">					
    						<?php echo htmlspecialchars( $offer->location ); ?>
    					</td>
    					<?php } if ( $this->params->get( 'show_duration_column' ) ) { ?>
    					<td>
    						<?php echo htmlspecialchars( $offer->duration ); ?>						
    					</td>
    					<?php } if ( $this->params->get( 'show_begin_column' ) ) { ?>
    					<td align="center">
    						<?php echo JHTML::_( 'date', $offer->begin_date, JText::_( 'COM_RECRUIT_DATE_FORMAT_SHORT' ) ); ?>
    					</td>
    					<?php } if ( $this->params->get( 'show_hits_column' ) ) { ?>
    					<td align="cneter">
    						<?php echo htmlspecialchars( $offer->hits ); ?>						
    					</td>
    					<?php } if ( $this->params->get( 'show_contact_column' ) ) { ?>
    					<td align="center">					
    						<?php echo htmlspecialchars( $offer->contact_name ); ?>
    					</td>
    					<?php } if ( $this->params->get( 'show_version_column' ) ) { ?>
    					<td align="center">					
    						<?php echo htmlspecialchars( $offer->version ); ?>
    					</td>
    					<?php } if ( $this->params->get( 'show_created_column' ) ) { ?>
    					<td align="center">					
    						<?php echo JHTML::_( 'date', $offer->created_datetime, JText::_( 'COM_RECRUIT_DATE_FORMAT_SHORT' ) ); ?>
    					</td>
    					<?php } if ( $this->params->get( 'show_modified_column' ) ) { ?>
    					<td align="center">					
    						<?php echo JHTML::_( 'date', $offer->modified_datetime, JText::_( 'COM_RECRUIT_DATE_FORMAT_SHORT' ) ); ?>
    					</td>
    					<?php } ?>
    				</tr>
    				<?php
    				$i++;
    			}
    			?>
    			<tfoot>
    				<tr>
    					<td colspan="8" class="sectiontablefooter">
    						<div style="text-align: center">
    							<?php echo $this->pagination->getPagesLinks( $link ); ?><br />
    							<?php echo $this->pagination->getPagesCounter(); ?>
    						</div>
    					</td>
    				</tr>
    			</tfoot>
    		</table>
    	
    	<?php } else { ?>
    		
    		<div class="no-data"><?php echo JText::_( 'COM_RECRUIT_NO_OFFER_FOUND' ); ?></div>
    		
    	<?php } ?>
    	
    <?php } else { ?>
    	
    	<div class="no-selection"><?php echo JText::_( 'COM_RECRUIT_PLEASE_SELECT_AT_LEAST_ONE_CRITERIA' ); ?></div>
    	
    <?php } ?>
    
    <div class="back_button">
    	<a href='javascript:history.go(-1)'>[&nbsp;<?php echo JText::_( 'COM_RECRUIT_BACK' ); ?>&nbsp;]</a>
    </div>
    J'ai mis en rouge les morceaux qui m’intéresse, il s'agit de sélectionner le type de contrat en checkbox et non en menu déroulant.
    J'arrive pas a comprendre comment faire...
    Si vous aviez une idée de fonction qui remplace celle qui est utilisé ... ( C'est un script que j'ai payé j'ai demandé le support au dev, mais il m'a indiquer le fichier concerné. Pour la modification c'est à moi de le faire )

  2. #2
    Nouveau Candidat au Club
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Septembre 2012
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loiret (Centre)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Septembre 2012
    Messages : 2
    Points : 1
    Points
    1
    Par défaut
    Résolu, le dev du composant m'a corrigé cela

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [XL-2003] Créer une liste déroulante par VBA
    Par lil404 dans le forum Macros et VBA Excel
    Réponses: 8
    Dernier message: 29/05/2009, 17h17
  2. [ODBC] Alimenter une liste déroulante par un lien ODBC
    Par Mut dans le forum PHP & Base de données
    Réponses: 3
    Dernier message: 27/08/2007, 15h06
  3. Activation d'une Liste déroulante par un bouton
    Par martoune dans le forum Langage
    Réponses: 3
    Dernier message: 27/06/2007, 23h28
  4. Réponses: 4
    Dernier message: 25/05/2007, 15h25
  5. Réponses: 11
    Dernier message: 26/02/2007, 00h04

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo