Fix filtri dashboard

This commit is contained in:
Luca 2018-02-16 18:27:15 +01:00
parent 7a1e01f082
commit fd87ab9f0a
1 changed files with 12 additions and 12 deletions

View File

@ -62,7 +62,7 @@ for ($i = 0; $i < count($rs); ++$i) {
} }
} }
$checks .= "<li><input type='checkbox' id='idstato_".$rs[$i]['id']."' value=\"".$rs[$i]['id'].'" '.$attr." onclick=\"$.when ( session_set_array( 'dashboard,idstatiintervento', '".$rs[$i]['id']."' ) ).promise().done(function( ){ $('#calendar').fullCalendar('refetchEvents'); }); update_counter( 'idstati_count', $('#idstati_ul').find('input:checked').length ); \"> <label for='idstato_".$rs[$i]['id']."'> <span class='badge' style=\"color:#333; background:".$rs[$i]['colore'].';">'.$rs[$i]['descrizione']."</span></label></li>\n"; $checks .= "<li><input type='checkbox' id='idstato_".$rs[$i]['id']."' value=\"".$rs[$i]['id'].'" '.$attr." onclick=\"$.when ( session_set_array( 'dashboard,idstatiintervento', '".$rs[$i]['id']."' ) ).promise().then(function( ){ $('#calendar').fullCalendar('refetchEvents'); }); update_counter( 'idstati_count', $('#idstati_ul').find('input:checked').length ); \"> <label for='idstato_".$rs[$i]['id']."'> <span class='badge' style=\"color:#333; background:".$rs[$i]['colore'].';">'.$rs[$i]['descrizione']."</span></label></li>\n";
$allchecksstati .= "session_set_array( 'dashboard,idstatiintervento', '".$rs[$i]['id']."', 0 ); "; $allchecksstati .= "session_set_array( 'dashboard,idstatiintervento', '".$rs[$i]['id']."', 0 ); ";
} }
@ -117,7 +117,7 @@ for ($i = 0; $i < count($rs); ++$i) {
} }
$checks .= "<li><input type='checkbox' id='idtipo_".$rs[$i]['id']."' value=\"".$rs[$i]['id'].'" '.$attr." onclick=\"$.when ( session_set_array( 'dashboard,idtipiintervento', '".$rs[$i]['id']."' ) ).promise().done(function( ){ $('#calendar').fullCalendar('refetchEvents'); }); update_counter( 'idtipi_count', $('#idtipi_ul').find('input:checked').length ); \"> <label for='idtipo_".$rs[$i]['id']."'> ".$rs[$i]['descrizione']."</label></li>\n"; $checks .= "<li><input type='checkbox' id='idtipo_".$rs[$i]['id']."' value=\"".$rs[$i]['id'].'" '.$attr." onclick=\"$.when ( session_set_array( 'dashboard,idtipiintervento', '".$rs[$i]['id']."' ) ).promise().then(function( ){ $('#calendar').fullCalendar('refetchEvents'); }); update_counter( 'idtipi_count', $('#idtipi_ul').find('input:checked').length ); \"> <label for='idtipo_".$rs[$i]['id']."'> ".$rs[$i]['descrizione']."</label></li>\n";
$allcheckstipi .= "session_set_array( 'dashboard,idtipiintervento', '".$rs[$i]['id']."', 0 ); "; $allcheckstipi .= "session_set_array( 'dashboard,idtipiintervento', '".$rs[$i]['id']."', 0 ); ";
} }
@ -176,7 +176,7 @@ for ($i = 0; $i < count($rs); ++$i) {
$checks .= "<li><input type='checkbox' id='tech_".$rs[$i]['id']."' value=\"".$rs[$i]['id'].'" '.$attr." onclick=\"$.when ( session_set_array( 'dashboard,idtecnici', '".$rs[$i]['id']."' ) ).promise().done(function( ){ $('#calendar').fullCalendar('refetchEvents'); }); update_counter( 'idtecnici_count', $('#idtecnici_ul').find('input:checked').length ); \"> <label for='tech_".$rs[$i]['id']."'> ".$rs[$i]['ragione_sociale']."</label></li>\n"; $checks .= "<li><input type='checkbox' id='tech_".$rs[$i]['id']."' value=\"".$rs[$i]['id'].'" '.$attr." onclick=\"$.when ( session_set_array( 'dashboard,idtecnici', '".$rs[$i]['id']."' ) ).promise().then(function( ){ $('#calendar').fullCalendar('refetchEvents'); }); update_counter( 'idtecnici_count', $('#idtecnici_ul').find('input:checked').length ); \"> <label for='tech_".$rs[$i]['id']."'> ".$rs[$i]['ragione_sociale']."</label></li>\n";
$allchecktecnici .= "session_set_array( 'dashboard,idtecnici', '".$rs[$i]['id']."', 0 ); "; $allchecktecnici .= "session_set_array( 'dashboard,idtecnici', '".$rs[$i]['id']."', 0 ); ";
} }
@ -199,7 +199,7 @@ if ($total > 0) {
} }
} }
$checks .= "<li><input type='checkbox' id='tech_".$rs[$i]['id']."' value=\"".$rs[$i]['id'].'" '.$attr." onclick=\"$.when ( session_set_array( 'dashboard,idtecnici', '".$rs[$i]['id']."' ) ).promise().done(function( ){ $('#calendar').fullCalendar('refetchEvents'); }); update_counter( 'idtecnici_count', $('#idtecnici_ul').find('input:checked').length ); \"> <label for='tech_".$rs[$i]['id']."'> ".$rs[$i]['ragione_sociale']."</label></li>\n"; $checks .= "<li><input type='checkbox' id='tech_".$rs[$i]['id']."' value=\"".$rs[$i]['id'].'" '.$attr." onclick=\"$.when ( session_set_array( 'dashboard,idtecnici', '".$rs[$i]['id']."' ) ).promise().then(function( ){ $('#calendar').fullCalendar('refetchEvents'); }); update_counter( 'idtecnici_count', $('#idtecnici_ul').find('input:checked').length ); \"> <label for='tech_".$rs[$i]['id']."'> ".$rs[$i]['ragione_sociale']."</label></li>\n";
$allchecktecnici .= "session_set_array( 'dashboard,idtecnici', '".$rs[$i]['id']."', 0 ); "; $allchecktecnici .= "session_set_array( 'dashboard,idtecnici', '".$rs[$i]['id']."', 0 ); ";
} // end for } // end for
@ -330,7 +330,7 @@ if ($vista == 'mese') {
$(this).parent().parent().find('li input[type=checkbox]').each(function(i) { //loop through each checkbox $(this).parent().parent().find('li input[type=checkbox]').each(function(i) { //loop through each checkbox
this.checked = true; this.checked = true;
$.when (session_set_array( 'dashboard,idstatiintervento', this.value, 0 )).promise().done(function() { $.when (session_set_array( 'dashboard,idstatiintervento', this.value, 0 )).promise().then(function() {
$('#calendar').fullCalendar('refetchEvents'); $('#calendar').fullCalendar('refetchEvents');
}); });
@ -345,7 +345,7 @@ if ($vista == 'mese') {
$(this).parent().parent().find('li input[type=checkbox]').each(function(i) { //loop through each checkbox $(this).parent().parent().find('li input[type=checkbox]').each(function(i) { //loop through each checkbox
this.checked = true; this.checked = true;
$.when (session_set_array( 'dashboard,idtipiintervento', this.value, 0 )).promise().done(function() { $.when (session_set_array( 'dashboard,idtipiintervento', this.value, 0 )).promise().then(function() {
$('#calendar').fullCalendar('refetchEvents'); $('#calendar').fullCalendar('refetchEvents');
}); });
i++; i++;
@ -359,7 +359,7 @@ if ($vista == 'mese') {
$(this).parent().parent().find('li input[type=checkbox]').each(function(i) { //loop through each checkbox $(this).parent().parent().find('li input[type=checkbox]').each(function(i) { //loop through each checkbox
this.checked = true; this.checked = true;
$.when (session_set_array( 'dashboard,idtecnici', this.value, 0 )).promise().done(function() { $.when (session_set_array( 'dashboard,idtecnici', this.value, 0 )).promise().then(function() {
$('#calendar').fullCalendar('refetchEvents'); $('#calendar').fullCalendar('refetchEvents');
}); });
i++; i++;
@ -372,7 +372,7 @@ if ($vista == 'mese') {
$(this).parent().parent().find('li input[type=checkbox]').each(function(i) { //loop through each checkbox $(this).parent().parent().find('li input[type=checkbox]').each(function(i) { //loop through each checkbox
this.checked = true; this.checked = true;
$.when (session_set_array( 'dashboard,idzone', this.value, 0 )).promise().done(function() { $.when (session_set_array( 'dashboard,idzone', this.value, 0 )).promise().then(function() {
$('#calendar').fullCalendar('refetchEvents'); $('#calendar').fullCalendar('refetchEvents');
}); });
@ -388,7 +388,7 @@ if ($vista == 'mese') {
$(this).parent().parent().find('li input[type=checkbox]').each(function() { //loop through each checkbox $(this).parent().parent().find('li input[type=checkbox]').each(function() { //loop through each checkbox
this.checked = false; this.checked = false;
$.when (session_set_array( 'dashboard,idstatiintervento', this.value, 1 )).promise().done(function() { $.when (session_set_array( 'dashboard,idstatiintervento', this.value, 1 )).promise().then(function() {
$('#calendar').fullCalendar('refetchEvents'); $('#calendar').fullCalendar('refetchEvents');
}); });
@ -402,7 +402,7 @@ if ($vista == 'mese') {
$(this).parent().parent().find('li input[type=checkbox]').each(function() { //loop through each checkbox $(this).parent().parent().find('li input[type=checkbox]').each(function() { //loop through each checkbox
this.checked = false; this.checked = false;
$.when (session_set_array( 'dashboard,idtipiintervento', this.value, 1 )).promise().done(function() { $.when (session_set_array( 'dashboard,idtipiintervento', this.value, 1 )).promise().then(function() {
$('#calendar').fullCalendar('refetchEvents'); $('#calendar').fullCalendar('refetchEvents');
}); });
@ -417,7 +417,7 @@ if ($vista == 'mese') {
$(this).parent().parent().find('li input[type=checkbox]').each(function() { //loop through each checkbox $(this).parent().parent().find('li input[type=checkbox]').each(function() { //loop through each checkbox
this.checked = false; this.checked = false;
$.when (session_set_array( 'dashboard,idtecnici', this.value, 1 )).promise().done(function() { $.when (session_set_array( 'dashboard,idtecnici', this.value, 1 )).promise().then(function() {
$('#calendar').fullCalendar('refetchEvents'); $('#calendar').fullCalendar('refetchEvents');
}); });
@ -431,7 +431,7 @@ if ($vista == 'mese') {
$(this).parent().parent().find('li input[type=checkbox]').each(function() { //loop through each checkbox $(this).parent().parent().find('li input[type=checkbox]').each(function() { //loop through each checkbox
this.checked = false; this.checked = false;
$.when (session_set_array( 'dashboard,idzone', this.value, 1 )).promise().done(function() { $.when (session_set_array( 'dashboard,idzone', this.value, 1 )).promise().then(function() {
$('#calendar').fullCalendar('refetchEvents'); $('#calendar').fullCalendar('refetchEvents');
}); });