aboutsummaryrefslogtreecommitdiff
path: root/blocks/mini_calendar
diff options
context:
space:
mode:
authorjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2010-01-03 23:54:14 -0500
committerjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2010-01-03 23:54:14 -0500
commit9d4fa2963b1059fed54aaeae583bf02a30c42239 (patch)
tree5bc96becffcda48318c932ece289ec358dc84691 /blocks/mini_calendar
parentb63430eba1943d1732634df88884e8d7c4b2b1fb (diff)
downloadbayonetcms-9d4fa2963b1059fed54aaeae583bf02a30c42239.tar.gz
Fixed SVN maybe.
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@448 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'blocks/mini_calendar')
-rw-r--r--blocks/mini_calendar/functions.php30
-rw-r--r--blocks/mini_calendar/style.css72
2 files changed, 59 insertions, 43 deletions
diff --git a/blocks/mini_calendar/functions.php b/blocks/mini_calendar/functions.php
index 1133daa..ffc98a6 100644
--- a/blocks/mini_calendar/functions.php
+++ b/blocks/mini_calendar/functions.php
@@ -25,6 +25,15 @@
/**
* PrintCalendar() - prints the calendar with events
*/
+ ?>
+<script type="text/javascript">
+function openEvent(date)
+{
+ myWindow = window.open('http://testbed.3rd-infantry-division.org/cms/blocks/mini_calendar/event.php?date='+date+'','','width=300,height=300')
+ myWindow.focus();
+}
+</script>
+ <?php
function PrintCalendar(){
$date = time();
@@ -35,7 +44,6 @@
$month = date('m', $date);
$monthNum = date('n', $date);
$year = date('Y', $date);
-
/* Accounts for the last couple days from the previous months */
$first_day = mktime(0,0,0,$monthNum, 1, $year);
@@ -76,7 +84,7 @@
?>
<center>
<table class="calendar" style="background-color:white;" cellspacing="1" cellpadding="0">
- <tr style="background-color:#999999; height:27px;">
+ <tr style="background-color:#999999; height:20px;">
<td colspan="50" style="vertical-align:middle; text-align:center;">
<!-- <a href="?op=calendar&month=<?php echo $previous_month.'&year='.$previous_year; ?>"><<</a> -->
<!-- Month Name and Year -->
@@ -105,7 +113,7 @@
$day_count++;
}
-$sqlToday = $year.'-'.$monthNum.'-'.$today;
+$sqlToday = date("Y-m-d", mktime(0, 0, 0, $monthNum, $today, $year));
$events = GetEventsOnInterval("{$year}-{$monthNum}-01","{$year}-{$monthNum}-{$days_in_month}");
//loop printing each day of the CURRENT month ONLY
@@ -117,7 +125,7 @@ $events = GetEventsOnInterval("{$year}-{$monthNum}-01","{$year}-{$monthNum}-{$da
echo '<td class="cal_weekday">'; //weekdays
}
- $sqlDate = $year.'-'.$monthNum.'-'.$day_num; //old way NOT unix
+ $sqlDate = date("Y-m-d", mktime(0, 0, 0, $monthNum, $day_num, $year));
//checks to see if the current day has events
$isEvent=false;
@@ -129,23 +137,13 @@ $events = GetEventsOnInterval("{$year}-{$monthNum}-01","{$year}-{$monthNum}-{$da
}
}
- }
-
- /* global $db;
- $result = $db->Query("SELECT title,color,date,time FROM `bayonet_events` WHERE `date` = '$sqlDate' ORDER BY `date` DESC");
- while(($row = $db->Fetch($result))!=false)
- {
- $isEvent = true;
- if($day_num == $today){
- $todaysEvents[] = $row;
- }
- } */
+ }
if($day_num == $today && $isEvent==true){
echo '<div class="eventtoday">'.$day_num.'</div>';
}else if($day_num == $today && $isEvent==false){
echo '<div class="monthtoday">'.$day_num.'</div>';
}else if($day_num != $today && $isEvent==true){
- echo '<div class="event" id="event'.$day_num.'" onmouseover="highlightEvent(this.id)" onmouseout="normEvent(this.id)">';
+ echo "<div class=\"event\" onclick=\"openEvent('{$sqlDate}')\">";
echo $day_num;
echo '</div>';
}else{
diff --git a/blocks/mini_calendar/style.css b/blocks/mini_calendar/style.css
index 72898ee..792ab69 100644
--- a/blocks/mini_calendar/style.css
+++ b/blocks/mini_calendar/style.css
@@ -7,90 +7,108 @@
font-family:arial;
}
td.weekday {
- width:40px;
- height:20px;
+ width:34px;
+ height:34px;
background-color:#cb2121;
color:green;
text-align:center;
font-size:10px;
- font-weight:bold;
+ /* font-weight:bold; */
}
th.weekday {
- width:40px;
- height:29px;
+ width:34px;
+ height:20px;
background-color:white;
color:black;
text-align:center;
font-size:11px;
- font-weight:bold;
+ font-weight:normal;
}
.monthday {
- width:40px;
- height:20px;
+ /* width:29px; */
+ height:36px;
background-color:#aea2a2;
color:white;
text-align:left;
font-size:10pt;
- font-weight:bold;
+ /* font-weight:bold; */
}
.monthtoday {
- width:38px;
- height:38px;
+ /* width:25px; */
+ height:32px;
/* background-color:#3666ba; */
color:#225eac;
text-align:center;
font-size:14px;
- font-weight:bold;
+ font-weight:bold;
+ font-family: arial;
border:1px solid #333333;
}
.event {
- width:38px;
- height:38px;
+ /* width:25px; */
+ height:32px;
background-color:#225eac;
text-align:center;
- border:1px solid #333333;
+ border:1px solid #333333;
+ cursor: pointer;
}
table.calendar a, table.calendar a:visited, table.calendar a:active, table.calendar a:hover {
color:white;
}
- .eventtoday{
- width:38px;
- height:38px;
+ .eventtoday {
+ /* width:25px; */
+ height:32px;
background-color:#225eac;
- color:#ef8e25;
+ color: white;
text-align:center;
font-size:14px;
font-weight:bold;
+ font-family: arial;
border:1px solid #333333;
}
td.cal_weekday {
- width:40px;
- height:40px;
+ width:34px;
+ height:34px;
background-color:#a1a1a1;
vertical-align:top;
color:#eeeeee;
font-family:arial;
text-align:center;
- font-size:14px;
+ font-size:12px;
}
td.cal_weekend {
- width:40px;
- height:40px;
+ width:34px;
+ height:34px;
background-color:#8f8f8f;
vertical-align:top;
color:#eeeeee;
font-family:arial;
text-align:center;
- font-size:14px;
+ font-size:12px;
}
td.cal_notmonth {
- width:40px;
- height:40px;
+ width:34px;
+ height:34px;
background-color:#6e6e6e;
vertical-align:top;
color:#d4d4d4;
text-align:left;
font-size:11px;
}
+ div.event_title {
+ font-family: Geneva, Verdana, Arial;
+ font-size: 14px;
+ }
+ div.event_text {
+ font-family: Geneva, Verdana, Arial;
+ font-size: 12px;
+ padding-top: 3px;
+ padding-left: 10px;
+ padding-right: 5px;
+ }
+ div.event_time {
+ font-family: Geneva, Verdana, Arial;
+ font-size: 12px;
+ }
/* END>> CALENDAR STYLES */ \ No newline at end of file