コード例 #1
0
ファイル: home-2013-03-24.php プロジェクト: DinethH/EES
$sql_academic_calendar = "SELECT * FROM academic_calendar WHERE date_from >= '{$currentDate}' ORDER BY date_from ASC";
$restults_academic_calendar = mysql_query($sql_academic_calendar);
while ($row = mysql_fetch_assoc($restults_academic_calendar)) {
    $upcomingArray[$upcomingCount]['date_from'] = $row['date_from'];
    $upcomingArray[$upcomingCount]['date_to'] = $row['date_to'];
    $upcomingArray[$upcomingCount]['title'] = $row['description'];
    $upcomingArray[$upcomingCount]['url'] = NULL;
    $upcomingArray[$upcomingCount]['semester'] = $row['semester'];
    $upcomingArray[$upcomingCount]['type'] = NULL;
    $upcomingCount++;
}
sort($upcomingArray);
if ($upcomingCount != 0) {
    echo '<table style="padding-left:20px;padding-right:20px; margin-top:-15px">';
    for ($c = 0; $c <= 2; $c++) {
        list($mon, $day) = monthDay($upcomingArray[$c]['date_from']);
        echo '<tr>';
        echo '<td><div class="date_figure">' . $mon . '<br />' . $day . '</div></td>';
        echo '<td valign="top"><div class="event_box_home"><strong><a ';
        if (strlen($upcomingArray[$c]['url']) > 0) {
            echo 'href="' . $upcomingArray[$c]['url'] . '">';
        } elseif ($upcomingArray[$c]['url'] != NULL) {
            echo 'href="?i=events&id=' . $row['ID'] . '">';
        } elseif ($upcomingArray[$c]['url'] == NULL) {
            echo '>';
        }
        echo ucwords($upcomingArray[$c]['title']) . '</a></strong><br />';
        if ($upcomingArray[$c]['semester'] != NULL && strlen($upcomingArray[$c]['semester']) > 0) {
            echo strtolower($upcomingArray[$c]['semester']);
        } elseif ($upcomingArray[$c]['type'] != NULL && strlen($upcomingArray[$c]['type']) > 0) {
            echo strtolower($upcomingArray[$c]['type']);
コード例 #2
0
ファイル: pProfile.php プロジェクト: Neldris/Amisti
    /**
     * Get USER AGE
     * return Age;
     */
    public function getAge($show = "")
    {
        $this->setRquery("SELECT pDOBD,pDOBM,pDOBY  FROM amistiPersonal WHERE userID=?", array($this->UID));
        $res = $this->getRquery();
        $id = $this->UID;
        if (!$res[0]['pDOBD'] == NULL) {
            $age = getUserAge($res[0]['pDOBD'], $res[0]['pDOBM'], $res[0]['pDOBY']);
            $age .= " years";
            $birthD .= addZero($res[0]['pDOBD']) . " " . numberToMonth($res[0]['pDOBM']);
            $ageInfo = $this->UID == UID ? "Your age information:" : $this->uName . " age information:";
            ?>
				<div class="pProfileICHeader"> Age Information:</div>
				<?php 
            if ($this->UID == UID) {
                //check if it same as cur user
                ?>
				<div class="pProfileMenuShow">...</div>
				<!--- menu -->
				<div class="pProfileMenu">
				<li id="ageEdit">Edit</li>
				<li id="ageDelete">Delete</li>
				</div>
				<?php 
            }
            ?>
				<div class="pProfileItem">
                <table> 
                <tr><td>Date of Birth </td><td>: <?php 
            echo $birthD;
            ?>
</td></tr>
				<tr><td> Age </td><td>: <?php 
            echo $age;
            ?>
 </td></tr>
               </table>
               
                </div>

				<?php 
        } else {
            if ($this->UID == UID) {
                if ($show == true) {
                    ?>
				<div class="pProfileICHeader"> Age:</div>
				<div class="pProfileItem pProfileBack">
                         
                          <table>
                          <tr><td> Day </td><td><?php 
                    echo monthDay();
                    ?>
</td></tr>
                          
						  <tr><td>Month</td><td><?php 
                    echo monthName();
                    ?>
</td></tr>
                          <tr><td>Year</td><td><?php 
                    echo ageYear();
                    ?>
</td></tr>
                          <tr><td colspan="2">
                               <input type="submit" id="ageClear" value="Cancel"> 
                          	   <input type="submit" id="ageSave" value="Save">
                               </td></tr>
                          </table>
                </div>
				
				<?php 
                } else {
                    ?>
						   <div class="pProfileICHeader"> Age:</div>  
                           <div class="pProfileItem pGender">
                           <div class="addProfile" id="ageAdd"> Add Date of Birth</div>
                           </div>
                             <?php 
                }
            } else {
                ?>
				<div class="pProfileICHeader"> Age Information:</div>
				<div class="pProfileItem pProfileItemNon">
                <?php 
                echo $this->fName . " " . $this->sName . " has not updated age information.";
                ?>
                </div>
				
						
						<?php 
            }
        }
    }
コード例 #3
0
ファイル: home.php プロジェクト: DinethH/EES
    list($mon, $day) = monthDay($row['date_from']);
    echo '<tr>';
    echo '<td><div class="date_figure">' . $mon . '<br />' . $day . '</div></td>';
    echo '<td valign="top"><div class="event_box_home"><strong><a href="?i=events&id=' . $row['ID'] . '">' . ucwords($row['title']) . '</a></strong><br />' . ucwords($row['location']) . '</div></td>';
    echo '</tr>';
    $upcomingCount++;
    if ($upcomingCount >= 3) {
        break;
    }
}
// academic calendar
$sql_academic_calendar = "SELECT * FROM academic_calendar WHERE date_from >= '{$currentDate}' ORDER BY date_from ASC LIMIT 3";
$restults_academic_calendar = mysql_query($sql_academic_calendar);
while ($row = mysql_fetch_assoc($restults_academic_calendar)) {
    $nothing = FALSE;
    list($mon, $day) = monthDay($row['date_from']);
    echo '<tr>';
    echo '<td><div class="date_figure">' . $mon . '<br />' . $day . '</div></td>';
    echo '<td valign="top"><div class="event_box_home"><strong>' . ucwords($row['description']) . '</strong><br />' . strtolower($row['semester']) . '</div></td>';
    echo '</tr>';
    $upcomingCount++;
    if ($upcomingCount >= 3) {
        break;
    }
}
echo '</table>';
if ($upcomingCount == 0) {
    echo "There are currently no scheduled events.";
}
?>
                    </div>