query( $query . " ORDER BY a.date_from" ) ; if ( $mysqli_query->num_rows > 0 ){ $status = '200' ; while ( $row = $mysqli_query->fetch_assoc() ){ $boolean_loop = true ; $date_from = date( 'Y-m-d', strtotime( $row['date_from'] ) ) ; $date_to = date( 'Y-m-d', strtotime( $row['date_to'] ) ) ; $loop_date_from = $date_from ; $loop_date_to = $date_to ; while ( $boolean_loop ){ if ( $loop_date_from <= $loop_date_to ){ $selected[$loop_date_from] = $loop_date_from ; }else{ $boolean_loop = false ; } $loop_date_from = date('Y-m-d', strtotime("+1 day", strtotime($loop_date_from))) ; } if ( $date_from <= $searchyearmonthday && $date_to >= $searchyearmonthday ){ $row['title'] = dataFilter( $row['title'] ) ; $row['description'] = dataFilter( $row['description'] ) ; $row['reason'] = dataFilter( $row['reason'] ) ; $row['request_date'] = ( $row['date_from'] != '' ? date( "Y-m-d", strtotime( $row['date_from'] ) ) : '' ) ; $row['time_from'] = date( 'h:ia', strtotime( $row['date_from'] ) ) ; $row['time_to'] = date( 'h:ia', strtotime( $row['date_to'] ) ) ; $list[] = $row ; } } } $first_day_of_month = $searchyearmonth . '-01' ; $last_day_of_month = $searchyearmonth . '-' . date( 't', strtotime( $first_day_of_month ) ) ; for ( $a = $first_day_of_month ; $a <= $last_day_of_month ; $a++ ){ if ( $selected[$a] != null ){ $marked[$a] = [ 'marked' => true, 'dotColor' => '#ff9500' ] ; } } $data['yearmonthday'] = $searchyearmonthday ; $data['list'] = $list ; $data['marked'] = $marked ; } require( $require_sub.'footer.php' ) ; ?>