<label for="old_id">Nom original:</label> <select autofocus id="old_id" name="old_id" tabindex="1"> <option></option> <?php echo dropdown_options($data, 8, $old_id); ?> </select> </div> <div> <?php echo form_error('new-name')."\n"; ?> <label for="new-name">Nouveau Nom:</label> <input id="new-name" name="new-name" tabindex="10" type="text" value="<?php echo $new_name; ?>" /> </div> <div> <?php echo form_error('type')."\n"; ?> <label for="type">Type:</label> <select id="type" name="type" tabindex="20"> <option></option> <?php echo dropdown_options(array('b'=>'Chapelle', 'c'=>'Cours', 's'=>'Semaine', 'v'=>'Autres'), 8, $type); ?> </select> </div> <div class="choice"> <?php echo form_error('mod')."\n"; ?> <?php echo rad_check('radio', array('add'=>'Ajouter', 'mod'=>'Modifier', 'del'=>'Supprimer'), 'mod', 30, 7, $mod); ?> </div> <p class="submit"> <input name="submit_name" tabindex="40" type="submit" value="Envoyer" /> </p> <?php echo form_close()."\n"; ?> </div> <?php # Fin du fichier names_view.php # Emplacement: /application/views/cal/admin/names_view.php
public function box($type, $day) { $info = explode('_', $day); $result = $this->db->select('c.cours_id, c.cours_nom, d.type')->from('cours c')->join('cours_date d', 'c.cours_id=d.cours_id') ->where('year', $info[0])->where('month', $info[1])->where('day', $info[2])->where('hour', $info[3])->where("(d.type = '$type' OR d.type='all')") ->order_by('d.hour, d.ordre')->get()->result(); $name = ''; $id = ''; $hour = $info[3]; if(array_key_exists(0, $result)) { $name = $result[0]->cours_nom; $id = $result[0]->cours_id; $type = $result[0]->type; } if($hour < 4) { $output = $hour.($hour==1?'ère':'ème').' heure'; } elseif($hour == 4) { $output = 'Chapelle'; } elseif($hour == 5) { $output = 'pause'; } elseif($hour > 5) { $output = ($hour-2).'ème heure'; } echo '<p>Ajouter ou modifier les données pour la <strong>'.$output.' </strong> du <strong>'.utf8_encode(strftime('%A %d %B', mktime(0, 0, 0, $info[1], $info[2], $info[0]))).'</strong><br /><label for="">Cours 1 : </label><input value="'.$name.'" /><input type="hidden" value="'.$id.'" /><select>'; echo dropdown_options(array('all'=>'Tout', 'triennal'=>'Triennal', 'annuel'=>'Annuel'), 2, $type); echo '</select><br /><label for="">Cours 2 : </label><input /><input type="hidden" /><select>'; echo dropdown_options(array('all'=>'Tout', 'triennal'=>'Triennal', 'annuel'=>'Annuel'), 2, $type); echo '</select><button>Action</button><button id="cancel">Annuler</button></p>'; }