unexpected output in php algorythm - php

I'm trying to create a page where i can choose the hour to take a date with someone.
In my database i already have 3 dates for today as here :
at 9:00, 10:00 and 12:00 so these hours should not apear in the page.
But what i have is this :
9:30:00
9:30:00
10:00:00
10:30:00
11:00:00
11:00:00
11:00:00
11:30:00
11:30:00
11:30:00
12:00:00
12:00:00
14:00:00
14:00:00
14:00:00
...
I think there is an algorythm problem but i'm not shure there is the code :
<?php
/**
* Template Name: calendrier
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
//
get_header(); ?>
<div id="primary" <?php generate_do_element_classes( 'content' ); ?>>
<main id="main" <?php generate_do_element_classes( 'main' ); ?>>
<?php
do_action( 'generate_before_main_content' );
if(!isset($_GET['mydate'])){
$today=getdate();
$_GET['mydate']=$today['year']."-".$today['mon']."-".$today['mday'];
}
echo "<p>Entrez une date :</br><form action=\"\" method=\"get\"><input type=\"hidden\" name=\"page_id\" value=\"21\"><input type=\"hidden\" name=\"myuser\" value=\"".$_GET['myuser']."\" ><input type=\"hidden\" name=\"myform\" value=\"".$_GET['myform']."\"><input type=\"date\" name=\"mydate\" /></p><input type=\"submit\" value=\"Modifier la date\" /></form>";
$mydata = $wpdb->get_results(
$wpdb->prepare("
SELECT *
FROM cal
WHERE user_id = %s
AND date = %s
",
$_GET['myuser'],
$_GET['mydate']
)
);
$disp = $wpdb->get_results(
$wpdb->prepare("
SELECT * from disponibility where user_id = %s and date = %s
",
$_GET['myuser'],
$_GET['mydate']
)
);
$cat = $wpdb->get_row(
$wpdb->prepare("
SELECT * from cat where id = %s
",
$_GET['myform']
)
);
echo "<h1>Calendrier ".$_GET['mydate']."</h1>";
foreach($disp as $dispun){
$debut = $dispun->start; // start hour
$fin = $dispun->end; // end hour
$debut_parts = explode(":", $debut);
$fin_parts = explode(":", $fin);
$debut_parts[0] = intval($debut_parts[0]); // int start hour
$debut_parts[1] = intval($debut_parts[1]); // int start minutes
$debut_parts[2] = intval($debut_parts[2]); // int start seconds
$fin_parts[0] = intval($fin_parts[0]); // int end hour
$fin_parts[1] = intval($fin_parts[1]); // ...
$fin_parts[2] = intval($fin_parts[2]);
while($debut_parts[0] < $fin_parts[0] || ($debut_parts[0] == $fin_parts[0] && $debut_parts[1] < $fin_parts[1]) ){ // foreach half hour
if($mydata != null){ // if there is already an date recorded
foreach($mydata as $mydataun){ // foreach recorded date
$itime = $mydataun->time;
$jtime = explode(":", $itime);
$jtime[0] = intval($jtime[0]);
$jtime[1] = intval($jtime[1]);
$jtime[2] = intval($jtime[2]);
if(strval($jtime[0]).":".strval($jtime[1]).":".strval($jtime[2]) == strval($debut_parts[0]).":".strval($debut_parts[1]).":".strval($debut_parts[2])){
if($debut_parts[1]== 0 && $mydataun->duration == 1){
$debut_parts[1]+=30;
}elseif($mydataun->duration == 1){
$debut_parts[0]+=1;
$debut_parts[1]=0;
}
}else{
echo "<a href=\"https://someaddress/?page_id=24&mydate=".$_GET['mydate']."&myuser=".$_GET['myuser']."&myform=".$_GET['myform']."&mytime=".strval($debut_parts[0]).":";
if($debut_parts[1]==0){
echo "00:00";
}else{
echo "30:00";
}
echo "\">".$debut_parts[0].":";
if($debut_parts[1]==0){
echo "00:00";
}else{
echo "30:00";
}
echo "</a></br>";
}
}
}else{
echo "<a href=\"https://someaddress/?page_id=24&mydate=".$_GET['mydate']."&myuser=".$_GET['myuser']."&myform=".$_GET['myform']."&mytime=".strval($debut_parts[0]).":";
if($debut_parts[1]==0){
echo "00:00";
}else{
echo "30:00";
}
echo "\">".$debut_parts[0].":";
if($debut_parts[1]==0){
echo "00:00";
}else{
echo "30:00";
}
echo "</a></br>";
}
if($debut_parts[1]== 0){
$debut_parts[1]+=30;
}else{
$debut_parts[0]+=1;
$debut_parts[1]=0;
}
}
}
do_action( 'generate_after_main_content' );
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
/**
* generate_after_primary_content_area hook.
*
* #since 2.0
*/
do_action( 'generate_after_primary_content_area' );
generate_construct_sidebars();
get_footer();

echo "<a href=\"https://someaddress/?page_id=24&mydate=".$_GET['mydate']."&myuser=".$_GET['myuser']."&myform=".$_GET['myform']."&mytime=".strval($debut_parts[0]).":";
if($debut_parts[1]==0){
echo "00:00";
}else{
echo "30:00";
}
echo "\">".$debut_parts[0].":";
if($debut_parts[1]==0){
echo "00:00";
}else{
echo "30:00";
}
echo "</a></br>";
Have to be at the end of while loop

Related

how to close a div in a dynamic group?

With mysql left-join I have a result of 3 tables.
Every group of machine-types has special requirements. Some machine-types have the same requirements, some not.
My problem is, to list them grouped and clear adressable for css-styling. I want to show all groups - with its requirements - but the group as header only one time.
How can I output and place a closing div to the right position?
$lastDate = '';
while($r = $result_all->fetch(PDO::FETCH_OBJ)) {
$aktualisiert = $r->MTypID;
if ( $aktualisiert != $lastDate ){
echo '<div class="machine-type">'.$r->mtype'</div>';
echo '<div class="requirements">';
$lastDate = $aktualisiert;
}
//if ( $aktualisiert = $lastDate ){
echo $r->baustand." ";
//}
}//endwhile
Output should be like this (see *</div>*):
<div class="machine-type">Model 1</div><div class="requirements">Softwareupdate 2.4.0 Valve M4 Tube 20cm *</div>*
<div class="machine-type">Model 2</div><div class="requirements">Softwareupdate 2.4.0 *</div>*
You just need to close the div when $lastDate changes, but not when it is the first row in the output. So after
if ( $aktualisiert != $lastDate ){
add
if ( $lastDate != '' ) echo "</div>";
and then after your loop add
echo "</div>";
With adding of a separator (also a bit tricky), it's more useful.
Here the final code - maybe interesting to somebody...
$lastDate = '';
$separator ='+';
$space =' ';
while($r = $result_all->fetch(PDO::FETCH_OBJ)) {
$aktualisiert = $r->MTypID;
if ( $aktualisiert == $lastDate ) echo $separator.$space;
if ( $aktualisiert !== $lastDate ){
if ( $lastDate !== '' ) echo '</div>'; //<!-- end requirements 1/2 -->
echo '<div class="machine-type">'.htmlspecialchars($r->mtype)'</div>';;
echo '<div class="requirements">';
$lastDate = $aktualisiert;
}
echo htmlspecialchars($r->baustand).' ';
}//endwhile
echo '</div>'; //<!-- end requirements 2/2 -->

Extract different patterns of lat long date time float from 1 string and split it to variables

I need a regex expert who can split this single string variable into multiple variables. Coming data from source having line break but not showing \n.
I will be very thankful.
$text_utf8_test = "lat:24.910717 lon:67.073710
speed:0.00
T:17/02/22 17:00
http://maps.google.com/maps?f=q&q=24.910717,67.073710&z=16
Pwr: ON Door: OFF ACC: OFF";
Expected PHP variables after spliting
echo $lat;
echo $long;
echo $speed;
echo $time;
echo $pwr;
echo $door;
echo $acc;
Expected Output Result
24.910717 /*This value can be vary due to dynamic update from location*/
67.073710
0.00 /*this can be from zero to 320*/
ON /*this can be ON or OFF*/
OFF /*this can be ON or OFF*/
OFF /*this can be ON or OFF*/
$text_utf8_test = "lat:24.910717 lon:67.073710
speed:0.00
T:17/02/22 17:59
http://maps.google.com/maps?f=q&q=24.910717,67.073710&z=16
Pwr: ON Door: OFF ACC: OFF";
$phone_test = "88888888888";
echo $text_utf8_test;
preg_match('/([0-9.-]+).+?([0-9.-]+)/', $text_utf8_test, $matches); /*For lat long exclusively*/
//preg_match('/OFF/', $text_utf8_test, $test);
$keywords = preg_split("/[\s,]+/", $text_utf8_test); /*For spliting this whole string*/
preg_match('~speed:([-+]?[0-9]*\.?[0-9]*)~', $keywords[2], $speed ); /*For grabing speed*/
preg_match('/(\d{2})\/(\d{2})\/(\d{2})(\d{2}):(\d{2})$/', $keywords[3].$keywords[4], $split_date_time ); /*For grabing date time*/
/*Spliting and combining date time into sql format*/
if(!empty($split_date_time[3])){
$date = $split_date_time[3].$split_date_time[2].$split_date_time[1];
echo "</br>";
$date_sanitized1 = strtotime($split_date_time[2]."/".$split_date_time[3]."/".$split_date_time[1]);
$date_sanitized2 = date('Y-m-d',$date_sanitized1);
$date_time = $date_sanitized2." ".$split_date_time[4].":".$split_date_time[5].":"."00.000" ;
}
if((!empty($keywords[2])) && (!empty($keywords[8])) && (!empty($keywords[10])) && (!empty($keywords[12]))){
$speed=$speed[1];
$power=$keywords[8];
$door=$keywords[10];
$acc=$keywords[12];
}
$lat=$matches[1];
$long=$matches[2];
if ((!empty($lat)) && (!empty($long)) && (!empty($speed)) && (!empty($date_time)) && (!empty($power)) && (!empty($door)) && (!empty($acc)) ){
echo "</br>";
echo $lat;
echo "</br>";
echo $long;
echo "</br>";
echo $speed;
echo "</br>";
echo $date_time;
echo "</br>";
echo $power;
echo "</br>";
echo $door;
echo "</br>";
echo $acc;
echo "</br>";
}else{
echo "noting";
}
Output
24.910717
67.073710
0.00
2017-02-22 17:59:00.000
ON
OFF
OFF

print time between 10pm to 3am

I have 2 time strings as below:
10pm
3am
I want to print the time between above-given string like:
10pm
11pm
12am
1am
2am
3am
PHP Code I tried:
<?php
$new_otime = strtotime(date('H:i',strtotime('10pm')));
$close_time = strtotime(date('H:i',strtotime("3am")));
do { ?>
<option value="<?php echo date("g a",$new_otime) ?>"><?php echo date("g a",$new_otime); ?></option>
<?php
$new_otime = $new_otime+=3600;
} while ($new_otime == $close_time);
?>
But it echoes only 10 pm in the select box. How can I echo all the time between those string?
I suggest some work around to make this work:
<?php
$new_otime = strtotime(date('Y-m-d H:i',strtotime(date('Y-m-d').' 10pm')));
$close_time = strtotime(date('Y-m-d H:i',strtotime(date('Y-m-d').' 3am')));
if($close_time < $new_otime){
$close_time = strtotime(date('Y-m-d H:i',strtotime(date('Y-m-d',strtotime('+1 day')).'3am')));
}
do { ?>
<option value="<?php echo date("g a",$new_otime) ?>"><?php echo date("g a",$new_otime); ?></option>
<?php
$new_otime = $new_otime+=3600;
} while ($new_otime <= $close_time);
?>
Check if end time is bigger
If not make it next day
Loop while new_otime is less than close_time
You could also try using DateTime and DatePeriod:
$from = date_create_from_format('ha', '10pm');
//create 5 interations, each adds an additional hour
$dp = new DatePeriod($from, new DateInterval('PT1H'), 5);
/** #var DateTime $d */
foreach ($dp as $d) {
echo $d->format('ha');
}
I hope this is what you are looking for:
$time=22;
for($i=0;$i<6;$i++) {
echo date("g a",mktime($time+$i,0,0,09,21,2016))."<br>";
}
Try this
$new_otime = "10pm";
$close_time = "3am";
$counter=0;
while(date("g a",strtotime($new_otime)+3600*$counter)<=date("g a",strtotime($close_time))){
echo date("g a",strtotime($new_otime)+3600*$counter).'<br>';
$counter++;
}
Try this code
<?php
$new_otime = "10pm";
$close_time = "3am";
$new_otime = strtotime(date_create_from_format("ha", $new_otime)->format("ha"));
$close_time = strtotime(date_create_from_format("ha", $close_time)->format("ha"));
do {
?>
<option value="<?php echo date("ha", $new_otime) ?>"><?php echo date("ha", $new_otime); ?></option>
<?php
$new_otime = strtotime(date("ha", strtotime("+1 hours", $new_otime)));
} while ($new_otime != $close_time);
if ($new_otime == $close_time) {
?>
<option value="<?php echo date("ha", $new_otime) ?>"><?php echo date("ha", $new_otime); ?></option>
<?php } ?>

Listing diary events grouped by days in PHP/MySQL

I'm trying to list diary events in PHP from a MySQL database, but grouped by days. I'll explain.
This is a screenshot of what I have so far:
As you can see there are two diary events for the 23rd October 2012 and is showing two calendar icons/representations/whatever's. I actually want it to show one calendar icon on the left but list all of that days events on the right, until the next day - as seen in my a̶r̶t̶i̶s̶t̶s̶ idiots impression below:
This is the code I have just written, could somebody please point me in the right direction:
$SQL = "SELECT entry_id, entry_title, entry_body, entry_date, entry_day, entry_month, entry_year ";
$SQL .= "FROM pages_diary WHERE entry_month = :this_month AND entry_year = :this_year ";
$SQL .= "ORDER BY entry_date DESC;";
// PDO stuff
if ($STH->rowCount() > 0) {
while($row = $STH->fetch()):
$this_db_month_word = mktime(0, 0, 0, $row['entry_month']);
$this_db_month_word = strftime("%b", $this_db_month_word);
echo '<div class="diary_events_item" id="diary_events_item_'.$row['entry_id'].'">';
echo '<div class="diary_events_item_left">';
echo '<div class="calendar_wrap">';
echo '<div class="calendar_wrap_top">';
echo $this_db_month_word;
echo '</div>';
echo '<div class="calendar_wrap_bottom">';
echo str_pad($row['entry_day'],2,'0',STR_PAD_LEFT);;
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="diary_events_item_right">';
echo '<strong>'.htmlspecialchars($row['entry_title']).'</strong><br>';
echo '<p>'.htmlspecialchars($row['entry_body']).'</p>';
echo '</div>';
echo '<div class="clear"></div>';
echo '</div>';
endwhile;
} else {
echo '<p>There are no diary entries logged for <strong>'.$this_month_word.' '.$this_year.'</strong>.</p>';
}
Not looking for exact code (although that would be spiffing), just an explanation would do, I'm sure I can work it out from that.
THE FIX
At the end of the WHILE loop, I added:
$last_db_day = $row['entry_day'];
And then wrapped the calendar item in:
if ($last_db_day != $row['entry_day']) {
echo '<div class="calendar_wrap_top">';
echo $this_db_month_word;
echo '</div>';
echo '<div class="calendar_wrap_bottom">';
echo str_pad($row['entry_day'],2,'0',STR_PAD_LEFT);;
echo '</div>';
}
As you loop over your resultset from the database, keep track of the last entry_date that you've seen and only output a new calendar icon if the current record is for a different date.
I usually do this as follows:
if ($STH->execute()) {
// output headers
$row = $STH->fetch();
while ($row) {
$current_date = $row['entry_date'];
// output $current_date initialisation
do {
// output event $row
} while ($row = $STH->fetch() and $row['entry_date'] == $current_date);
// output $current_date termination
}
// output footers
}
Although I would go the other way around and embed the PHP within the HTML rather then the other way around, here is what I would do using your code:
$SQL = "SELECT entry_id, entry_title, entry_body, entry_date, entry_day, entry_month, entry_year ";
$SQL .= "FROM pages_diary WHERE entry_month = :this_month AND entry_year = :this_year ";
$SQL .= "ORDER BY entry_date DESC;";
// PDO stuff
if ($STH->rowCount() > 0) {
$loopDay = '';
while($row = $STH->fetch()):
if ($row['entry_day'] != $loopDay) {
$loopDay = $row['entry_day'];
$changed = true;
}
$this_db_month_word = mktime(0, 0, 0, $row['entry_month']);
$this_db_month_word = strftime("%b", $this_db_month_word);
echo '<div class="diary_events_item" id="diary_events_item_'.$row['entry_id'].'">';
echo '<div class="diary_events_item_left">';
if ($changed) {
echo '<div class="calendar_wrap">';
echo '<div class="calendar_wrap_top">';
echo $this_db_month_word;
echo '</div>';
echo '<div class="calendar_wrap_bottom">';
echo str_pad($row['entry_day'],2,'0',STR_PAD_LEFT);;
echo '</div>';
echo '</div>';
} else {
echo ' ';
}
echo '</div>';
echo '<div class="diary_events_item_right">';
echo '<strong>'.htmlspecialchars($row['entry_title']).'</strong><br>';
echo '<p>'.htmlspecialchars($row['entry_body']).'</p>';
echo '</div>';
echo '<div class="clear"></div>';
echo '</div>';
$changed = false;
endwhile;
} else {
echo '<p>There are no diary entries logged for <strong>'.$this_month_word.' '.$this_year.'</strong>.</p>';
}

PHP: Nested Foreach loop problems

I am attempting to display a list of users based on a month value. I want to display January then all the users associated with it etc...
What i have now is working correctly for the first months then does nothing after. I have comments in the code and a live version of this code is running at: http://blog.funeraldirectorslife.com/participants/
<?php
/*
Template Name: Participants
*/
?>
<?php
function display_user($author, $month){
$ID = $author->ID;
$full_name = get_the_author_meta('display_name', $ID);
$usr_name = get_the_author_meta('user_nicename', $ID);
$sab_descriptiom = get_cimyFieldValue("$ID", 'Sabbatical_desc');
$sab_start = get_cimyFieldValue("$ID", 'Sabbatical_Start');
$sab_end = get_cimyFieldValue("$ID", 'Sabbatical_End');
$sab_month = get_cimyFieldValue("$ID", 'Sabbatical_Month');
$author_posts = $author->num_posts;
//$months = array(January, February, March, April, May, June, July, August, September, October, November, December);
//echo $sab_month;
if ($sab_month == $month){
echo "<li>";
echo "<h4 class=\"nomar\"><a href=\"http://blog.funeraldirectorslife.com/author/"
. $usr_name
."\">"
.$full_name
."("
. $author_posts
. ")"
. "</a>"
. "</h4>";
echo $sab_start
. " - "
. $sab_end
. "<br />";
echo $sab_descriptiom
. "<br />"
. $sab_month . "</br>" . "</li>" . "\n";
}
else {
return;
}
}
?>
<?php get_header(); ?>
<div id="bd" class="grid_12 alpha omega clearfix">
<?php get_sidebar(); ?>
<div id="main" class="grid_9 omega">
<?php include(TEMPLATEPATH . '/banner.php'); ?>
<div class="unit">
<!--
<div class="head">
<div class="title"><h3><span>Blog Entries</span></h3></div>
</div>
//-->
<div class="body clearfix">
<ul class="styled_list">
<li class ="alpha"><h3 class="nomar"><span><?php the_title(); ?></span></h3></li>
<?php
//grab authors ids, post count, and extended info from database
//fill $authors array with data
$sql = "SELECT * FROM `wp_users` WHERE 1 ORDER BY ID";
$results = $wpdb->get_results($sql);
$authors = $results;
$author_count = array();
$rows = $wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author");
foreach ($rows as $row) {
$author_count[$row->post_author] = $row->count;
}
//combine queries
foreach( $authors as $author ) {
$author->num_posts = (isset($author_count[$author->ID])) ? $author_count[$author->ID] : 0;
}
//month array for comparing with sabbatical month
$months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October','November', 'December');
//tried old method for iterating arrays --> same result
/*reset($months);
while (list($key, $month) = each($months)){
echo "<h2 class=\"nomar\">" . $month . "</h2>" . "\n";
foreach($authors as $author) {
display_user($author, $month);
//echo $author->ID;
}
}*/
foreach($months as $month ) {
echo "<h2 class=\"nomar\">" . $month . "</h2>" . "\n";
foreach($authors as $author) {
display_user($author, $month);
//echo $author->ID;
}
//lists authors by ID - just making sure array is intact after each author loop
/*foreach($authors as $author) {
$ID = $author->ID;
$foo = get_cimyFieldValue("$ID", 'Sabbatical_Month');
echo $ID . $foo . "<br /> . "\n"";
}*/
}
?>
</ul>
</div>
</div>
</div>
</div>
<?php get_footer();
?>
I'm not sure if it will work properly, but I have updated your code somewhat. Mainly I added the trim() function when comparing your $sab_month and $month but I also cleaned up your code a bit. You can embed variables inside of a double-quoted string in PHP, so you don't have to concatenate them :-)
<?php /* Template Name: Participants */ ?>
<?php
function display_user($author, $month){
$ID = $author->ID;
$full_name = get_the_author_meta('display_name', $ID);
$usr_name = get_the_author_meta('user_nicename', $ID);
$sab_descriptiom = get_cimyFieldValue("$ID", 'Sabbatical_desc');
$sab_start = get_cimyFieldValue("$ID", 'Sabbatical_Start');
$sab_end = get_cimyFieldValue("$ID", 'Sabbatical_End');
$sab_month = get_cimyFieldValue("$ID", 'Sabbatical_Month');
$author_posts = $author->num_posts;
//$months = array(January, February, March, April, May, June, July, August, September, October, November, December);
//echo $sab_month;
if (trim($sab_month) == trim($month)){
echo "<li>";
echo " <h4 class='nomar'><a href='http://blog.funeraldirectorslife.com/author/$usr_name'>$full_name($author_posts)</a></h4>";
echo " $sab_start - $sab_end<br />";
echo " $sab_descriptiom<br />";
echo " $sab_month</br>";
echo "</li>\n";
}
/* Not necessary. The function will return when it hits the end
else {
return;
}
*/
}
?>
<?php get_header(); ?>
<div id="bd" class="grid_12 alpha omega clearfix">
<?php get_sidebar(); ?>
<div id="main" class="grid_9 omega">
<?php include(TEMPLATEPATH . '/banner.php'); ?>
<div class="unit">
<!--
<div class="head">
<div class="title"><h3><span>Blog Entries</span></h3></div>
</div>
//-->
<div class="body clearfix">
<ul class="styled_list">
<li class ="alpha"><h3 class="nomar"><span><?php the_title(); ?></span></h3></li>
<?php
//grab authors ids, post count, and extended info from database
//fill $authors array with data
$sql = "SELECT * FROM `wp_users` WHERE 1 ORDER BY ID";
$results = $wpdb->get_results($sql);
$authors = $results;
$author_count = array();
$rows = $wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author");
foreach ($rows as $row) {
$author_count[$row->post_author] = $row->count;
}
//combine queries
foreach( $authors as $author ) {
$author->num_posts = (isset($author_count[$author->ID])) ? $author_count[$author->ID] : 0;
}
//month array for comparing with sabbatical month
$months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October','November', 'December');
//tried old method for iterating arrays --> same result
/*reset($months);
while (list($key, $month) = each($months)){
echo "<h2 class=\"nomar\">" . $month . "</h2>" . "\n";
foreach($authors as $author) {
display_user($author, $month);
//echo $author->ID;
}
}*/
foreach($months as $month) {
echo "<h2 class='nomar'>$month</h2>\n";
foreach($authors as $author) {
display_user($author, $month);
//echo $author->ID;
}
//lists authors by ID - just making sure array is intact after each author loop
/*foreach($authors as $author) {
$ID = $author->ID;
$foo = get_cimyFieldValue("$ID", 'Sabbatical_Month');
echo $ID . $foo . "<br /> . "\n"";
}*/
}
?>
</ul>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
appearantly this if fails after the first month if ($sab_month == $month)
Maybe some typo, case differences perhaps? I'd try adding echo "Sab month == ",$sab_month,"\n script month ==",$month;
Put it just before the if. good luck
I know I used comma's , thats just another way of using echo.

Categories