示例#1
0
function displayResults($results)
{
    $nothing = FALSE;
    while ($row = mysql_fetch_array($results)) {
        $nothing = TRUE;
        echo '<div class="event_box">';
        echo '<a href="';
        if (strlen($row['url']) > 0) {
            echo $row['url'];
        } else {
            echo "?i=events&id=" . $row['ID'];
        }
        echo '"><strong>' . ucwords($row['title']) . '</strong></a>';
        echo "<br />";
        if (strlen($row['date_to']) > 0) {
            echo '<span class="news_date">' . dateInUS($row['date_from']);
            if (strlen($row['date_to']) > 0) {
                echo ' - ' . dateInUS($row['date_to']);
            }
        } else {
            echo '<span class="news_date">' . dateInUS($row['date_from']);
        }
        if (strlen($row['time_from']) > 0) {
            echo ", {$row['time_from']}";
        }
        if (strlen(isset($row['time_to'])) > 0) {
            echo " - {$row['time_to']}";
        }
        if (strlen($row['location']) > 0) {
            echo ", {$row['location']}";
        }
        echo '</span>';
        echo "<br />";
        echo $row['summary'];
        echo "<br />";
        if (strlen($row['description']) > 0) {
            echo "<a class='news_url' href='?i=events&id=" . $row['ID'] . "'>MORE INFO</a>";
        }
        echo "</div>";
    }
    if (!$nothing) {
        echo "There are currently no scheduled events.";
    }
}
示例#2
0
文件: news_page.php 项目: DinethH/EES
 while ($row = mysql_fetch_array($results)) {
     $date = explode("-", $row['date']);
     echo "<div style='overflow:hidden;' class='news_box ";
     if ($count < 5) {
         echo "bottom_border";
     }
     echo "'>";
     echo "<a class='news_title' ";
     if (strlen($row['url']) > 0) {
         echo "target='_blank' href='" . $row['url'] . "'>";
     } elseif (strlen($row['long_disc']) > 0) {
         echo "href='?i=news&year=" . $date[0] . "&id=" . $row['ID'] . "'>";
     }
     echo "<span >{$row['title']}</span></a><br />";
     if (isset($row['date'])) {
         echo "<span class='news_date'>Posted on " . dateInUS($row['date']) . "</span><br />";
     }
     if (isset($row['image'])) {
         echo '<img style="float:left; padding-right:5px;" width="100" src="images/news/' . $row['image'] . '" />';
     }
     if (strlen($row['short_disc']) > 0) {
         echo "<span class='news_short'>{$row['short_disc']}</span>";
     }
     echo "<br />";
     if (strlen($row['url']) > 0) {
         echo "<a class='news_url' target='_blank' href='{$row['url']}'> READ MORE &raquo;</a>";
     }
     if (strlen($row['long_disc']) > 0) {
         echo "<a class='news_url' href='index.php?i=news";
         if ($date[0] < date('Y')) {
             echo "&s=archive";
示例#3
0
        
        
        <select class="button white" name="fieldDates" onchange="this.form.submit();">
        	<?php 
$sql = "SELECT * FROM events WHERE (date_from={$_POST['years']} && type='fieldcamp' && status='approved') ORDER BY date_from DESC";
$results = mysql_query($sql) or die("Unable to execute:" . mysql_error());
while ($row = mysql_fetch_array($results)) {
    echo '<option ';
    echo 'value="' . dateInUS($row['date_from']) . '" ';
    if (isset($_POST['fieldDates']) && $_POST['fieldDates'] == dateInUS($row['date_from'])) {
        echo " selected";
    }
    echo '>';
    echo dateMD($row['date_from']) . ' - ' . dateMD($row['date_to']);
    echo '</option>';
    if (isset($_POST['fieldDates']) && $_POST['fieldDates'] == dateInUS($row['date_from'])) {
        $ID = $row['ID'];
    }
}
?>
        </select>  
        
        
        <input class="button white" name="info" type="submit" value="INFO" />
        
        <?php 
$sql_photos_button = "SELECT * FROM events WHERE ID={$ID}";
$results_photos_button = mysql_query($sql_photos_button) or die("Unable to execute:" . mysql_error());
$row_photos_button = mysql_fetch_array($results_photos_button);
if (strlen($row_photos_button['images']) > 0) {
    echo '<input class="button white" name="photos" type="submit" value="PHOTOS" />';
        }
    }
    ?>
                        	<input name="bCount" type="hidden" value="<?php 
    echo $bCount;
    ?>
" />
                            <input name="cCount" type="hidden" value="<?php 
    echo $cCount;
    ?>
" />
                            	<tr height="40" >
                                	<td colspan="4">
                                    	<strong><span class="bottom_border"><?php 
    if ($row['dateFrom'] == $row['dateTo']) {
        echo dateInUS($row['dateFrom']);
    } else {
        echo dateMONDD($row['dateFrom']) . ' - ' . dateMONDD($row['dateTo']);
    }
    ?>
</span></strong>
                                    </td>
                                </tr>
                                <tr height="40">
                                	<td width="25%">
                                    	Bus
                                    </td>
                                    <td width="25%">
                                    <?php 
    //// dates before 25th
    if ($row['dateFrom'] < '2012-10-25') {
示例#5
0
文件: news_item.php 项目: DinethH/EES
$results = mysql_query($sql) or die("Unable to execute:" . mysql_error());
$row = mysql_fetch_array($results);
?>
<table>
	<tr height="50">
    	<td class="bottom_border">
        	<span style="font-size:18px;"><strong><?php 
echo strtoupper($row['title']);
?>
</strong></span>
        </td>
    </tr>
    <tr height="30">
    	<td>
        	<span class="news_date"><?php 
echo dateInUS($row['date']);
?>
</span>
        </td>
    </tr>
    <tr>
    	<td>
        	<div class="news_page_box normal_text">
            	<?php 
if (isset($row['image'])) {
    $imageURL = "images/news/" . $row['image'];
    list($width, $height) = getimagesize($imageURL);
    echo '<img class="news_image"';
    if ($width > 300) {
        echo 'width="300"';
    }
示例#6
0
function dateAndTime($string)
{
    $timestamp = explode(" ", $string);
    $date = $timestamp[0];
    $time = $timestamp[1];
    $time = explode(":", $time);
    $hour = $time[0];
    $minute = $time[1];
    if ($hour > 12) {
        $ampm = 'PM';
    } else {
        $ampm = 'AM';
    }
    // today
    if ($date == date('Y-m-d')) {
        return "Today at {$hour}:{$minute} {$ampm}";
    } else {
        if ($date == date('Y-m-d', strtotime("-1 days"))) {
            return "Yesterday at {$hour}:{$minute} {$ampm}";
        } else {
            return dateInUS($date);
        }
    }
}
示例#7
0
<table>
	<tr height="50">
    	<td class="bottom_border">
        	<span style="font-size:18px;"><strong><?php 
echo strtoupper($row['title']);
?>
</strong></span>
        </td>
    </tr>
    <tr height="30">
    	<td>
        	<?php 
if ($row['date_from']) {
    echo '<span class="news_date">' . dateInUS($row['date_from']);
    if (strlen($row['date_to']) > 0) {
        echo ' - ' . dateInUS($row['date_to']);
    }
    if (isset($row['time_from'])) {
        echo ", {$row['time_from']}";
    }
    if (isset($row['time_to'])) {
        echo " - {$row['time_to']}";
    }
    echo '</span>';
}
?>
        </td>
    </tr>
    <tr>
    	<td>
        	<div class="news_page_box normal_text">
示例#8
0
    } else {
        if ($profile_info2['pstatus'] < 5) {
            ?>
    Complete your tutor profile 
    	<a href="../profile-setup/"> <button name="completeProfile" type="button" class="btn btn-info" style="margin-left:20px;">Go</button></a>
    <?php 
        } else {
            $profile_info3 = mysql_fetch_array(mysql_query("SELECT * FROM users LEFT JOIN profile6 ON users.username = profile6.username WHERE users.ID = '{$currentUserProfile}'"));
            ?>
    Your account was created on: <?php 
            echo dateInUS($profile_info3['date']);
            ?>
<br /><br />

	Subscription expiry date: <?php 
            echo dateInUS($profile_info3['termend']);
            ?>
<br /><br />

    
    Your profile: <a href="../tutor/?ID=<?php 
            echo $currentUserProfile;
            ?>
"> <button name="myProfile" type="button" class="btn btn-info" style="margin-left:20px;">My Profile</button></a>

    <?php 
        }
    }
    ?>
</div>
<script>
示例#9
0
    function displayResults($upcomingArray)
    {
        $nothing = FALSE;
        ?>
<table width="750">
                    <?php 
        foreach ($upcomingArray as $upcoming) {
            ?>
                    	<tr valign="top" >
                        	<td style="padding:10px; line-height:26px;">
                            	<?php 
            if (isset($upcoming['url']) && strlen($upcoming['url']) > 0) {
                echo '<a href="' . $upcoming['url'] . '">';
            }
            ?>
                                
                                <div>
                            	 <?php 
            if (isset($upcoming['type']) && strlen($upcoming['type']) > 0 && $upcoming['type'] == 'tech session') {
                echo '<span class="event_type_u">' . $upcoming['type'] . '</span><br />';
            }
            if (isset($upcoming['type']) && strlen($upcoming['type']) > 0 && $upcoming['type'] == 'Cool Talks') {
                echo '<span class="type_cool">' . $upcoming['type'] . '</span><br />';
            }
            if (isset($upcoming['type']) && strlen($upcoming['type']) > 0 && $upcoming['type'] == 'fieldcamp') {
                echo '<span class="type_field">' . $upcoming['type'] . '</span><br />';
            }
            ?>
                            	
								<?php 
            if (isset($upcoming['title']) && strlen($upcoming['title']) > 0) {
                if ($upcoming['type'] == 'tech session') {
                    echo '<strong>Title:</strong> ' . $upcoming['title'];
                } else {
                    echo $upcoming['title'];
                }
            }
            ?>
                               
                                
                                <?php 
            if (isset($upcoming['ts_speaker']) && strlen($upcoming['ts_speaker']) > 0) {
                echo '<br /><strong>Speaker:</strong> ' . $upcoming['ts_speaker'] . '<br /><strong>Affiliation:</strong> ' . $upcoming['ts_affiliation'];
            }
            ?>
                                <br />
								<span style="color:green; font-size:14px">
								<?php 
            if (isset($upcoming['date_from']) && strlen($upcoming['date_from']) > 0) {
                echo dateInUS($upcoming['date_from']);
            }
            ?>
 
                                <?php 
            if (isset($upcoming['time_from']) && strlen($upcoming['time_from']) > 0) {
                echo " | " . $upcoming['time_from'];
            }
            ?>
 
                                <?php 
            if (isset($upcoming['location']) && strlen($upcoming['location']) > 0) {
                echo ' | ' . $upcoming['location'];
            }
            ?>
 
                                </span>
                                </div>
                                <?php 
            if (isset($upcoming['type']) && strlen($upcoming['type']) > 0) {
                //echo '</a>';
            }
            ?>
                                
                            </td>
                        </tr>
						
					<?php 
        }
        ?>
                    </table>
<?php 
    }