-
Notifications
You must be signed in to change notification settings - Fork 3
/
Insert_event.php
149 lines (140 loc) · 6.18 KB
/
Insert_event.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
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
<?php
/*
Funzione che determina il form di inserimento degli eventi
*/
function Insert_event_form()
{
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script("jquery-ui-datepicker");
wp_enqueue_style('jquery.ui.theme', plugins_url(null, __FILE__).'/smoothness/jquery-ui-1.10.0.custom.min.css');
if(isset($_GET["Id_Gcal"]))
echo "<h1>Modifica appello</h1>";
else
echo "<h1>Definisci un nuovo appello</h1>";
?>
<p><hr size=1 noshade></p>
<input type="hidden" value="<?php echo plugin_dir_path(__FILE__); ?>" id="path2" />
<input type="hidden" value="<?php echo plugins_url(null,__FILE__); ?>" id="path" />
<div id="alert"></div>
<div id="content"></div>
<?php if(isset($_GET["Id_Gcal"])) {
echo "<script type='text/javascript'>
var id ='".$_GET["Id_Gcal"]."';
compila_form_modifica(id);
</script> ";
}
?>
<form action="" METHOD="POST" >
<table class="form-table">
<tr>
<td><label for="nome_evento">Inserisci il nome del corso:</label></td>
<td><input type="text" name="nome_evento" size=25 id="Ins_txt_name_event" /> </td>
</tr>
<tr>
<td><label for="locaz_evento">Inserisci dove si svolgerà l'esame:</label></td>
<td><input type="text" name="locaz_evento" size="25" id="Ins_txt_locaz_event" /></td>
</tr>
<tr>
<td><label>Inserisci la data dell'esame:</label></td>
<td>
<input type="hidden" value="" id="hidd_date" />
<input type="text" readonly="readonly" value="" id="date" />
</td>
</tr>
<tr>
<td><label>Inserisci l'ora di inizio dell'esame:</label></td>
<td>
<select id="Ins_Hour_time">
<?php for($i=8;$i<=20;$i++) {
$selected="";
$h=$i;
if($i<10)
$h="0".$i;
if($i==10)
$selected=" selected='selected' ";
echo "<option value='$h' $selected>". $h ."</option>";
} ?>
</select>
<select id="Ins_Minutes_time">
<?php for($i=0;$i<=59;$i++) {
if($i<10)
echo "<option value='0$i'>0". $i."</option>";
else
echo "<option value='$i'>". $i."</option>";
} ?>
</select>
</td>
</tr>
<tr>
<td><label>Inserisci la durata dell'esame (hh):</label></td>
<td>
<select id="Ins_Durata">
<?php for($i=1;$i<=10;$i++)
echo "<option value='$i'>" . $i . "</option>";
?>
</select>
</td>
</tr>
<tr>
<td><label>Scegli la tipologia dell'esame:</label></td>
<td>
<select id="Ins_Tipologia">
<option value="Lab">Laboratorio</option>
<option value="Scritto">Scritto</option>
<option value="Orale">Orale</option>
</select>
</td>
</tr>
<tr>
<td><label>Note:</label></td>
<td><textarea id="Ins_Note" cols="30" rows="5"> </textarea></td>
</tr>
<tr>
<td><input type="button" value="Salva" align="middle" id="<?php if (isset($_GET["Id_Gcal"])) echo "Btn_modify_event"; else echo "Btn_enter_event"; ?>"/></td>
<td><input type="hidden" value="<?php if (isset($_GET["Id_Gcal"])) echo $_GET["Id_Gcal"]; ?>" id="Id_evento" /></td>
</tr>
</table>
</form>
<script type="text/javascript">
$j(document).ready(function(){
var mesi = ['gennaio','febbraio','marzo','aprile','maggio','giugno','luglio','agosto','settembre','ottobre','novembre','dicembre'];
$j.datepicker.regional['it'] = {
monthNames: mesi,
monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic'],
dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'],
dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'],
firstDay: 1,
renderer: $j.datepicker.defaultRenderer,
prevText: '<Prec', prevStatus: 'Mese precedente',
prevJumpText: '<<', prevJumpStatus: 'Mostra l\'anno precedente',
nextText: 'Succ>', nextStatus: 'Mese successivo',
nextJumpText: '>>', nextJumpStatus: 'Mostra l\'anno successivo',
currentText: 'Oggi', currentStatus: 'Mese corrente',
todayText: 'Oggi', todayStatus: 'Mese corrente',
clearText: 'Svuota', clearStatus: 'Annulla',
closeText: 'Chiudi', closeStatus: 'Chiudere senza modificare',
yearStatus: 'Seleziona un altro anno', monthStatus: 'Seleziona un altro mese',
weekText: 'Sm', weekStatus: 'Settimana dell\'anno',
dayStatus: '\'Seleziona\' D, M d', defaultStatus: 'Scegliere una data',
isRTL: false
};
$j.datepicker.setDefaults($j.datepicker.regional['it']);
$j('#date').datepicker({
onSelect: function(date) {
$j( '#date' ).datepicker( "option", "defaultDate", date );
var day = $j.datepicker.formatDate('d', new Date(date));
var month = mesi[$j.datepicker.formatDate('m', new Date(date))-1];
var year = $j.datepicker.formatDate('yy', new Date(date))
$j('#date').val(day+" "+month+" "+year);
$j('#hidd_date').val(date)
},
dateFormat : 'yy-mm-dd',
showOn: "button",
buttonImage: "<?php echo plugins_url(null, __FILE__); ?>/smoothness/images/calendar.gif",
buttonImageOnly: true,
defaultDate: $j('#hidd_date').val()
});
});
</script>
<?php } ?>