Jump to content

IF (troubles) echo phpfreaks.com


piznac

Recommended Posts

Hey guys,

Im still working on the calendar script. I need for this to display an icon on each day depending on event type if there is an event. ie if there is an appointment that day then it needs to display that icon. That I have working but there are several different types of events. So if there was an appointmanet and a project for that day I need it to display both icons.Here is part of what I have so far:

[code]function createBody(){
// start rendering table
$this->html.= "<p class=style1><tr><th>S</th><th>M</th><th>T</th><th>W</th><th>Th</th><th>F</th><th>S</th></tr></p>";
for($j=0;$j<$this->weeksInMonth;$j++) {
$this->html.= "<tr>";
for ($i=0;$i<7;$i++) {
$cellValue = $this->week[$j][$i];
// if today
if (($this->today['day'] == $cellValue) && ($this->today['month'] == $this->month) && ($this->today['year'] == $this->year)) {
$cell = "<div class='today'>$cellValue</div>";
}
// else normal day
else {
$cell = "$cellValue";
}
// if days with link
foreach ($this->links as $val) {
$num = $val['id'];
if(($val['day'] == $cellValue) && (($val['month'] == $this->month) || ($val['month'] == '*')) && (($val['year'] == $this->year) || ($val['year'] == '*')) && (($val['type'] == 'app'))){
$app = "<a href=\"cal3_results.php?id=$num\"><img src=\"http://project.rackattackzone.com/images/app.jpg\" width=\"18\" height=\"18\" /></a>";
}else{
$app = '';
}
if (($val['day'] == $cellValue) && (($val['month'] == $this->month) || ($val['month'] == '*')) && (($val['year'] == $this->year) || ($val['year'] == '*')) && (($val['type'] == 'misc'))){
$misc = " <a href=\"cal3_results.php?id=$num\"><img src=\"http://project.rackattackzone.com/images/misc.jpg\" width=\"18\" height=\"18\" /></a>";
}else{
$misc = '';
}
if (($val['day'] == $cellValue) && (($val['month'] == $this->month) || ($val['month'] == '*')) && (($val['year'] == $this->year) || ($val['year'] == '*')) && (($val['type'] == 'pro'))){
$pro = " <a href=\"cal3_results.php?id=$num\"><img src=\"http://project.rackattackzone.com/images/pro.jpg\" width=\"18\" height=\"18\" /></a>";
}else{
$pro = '';
}


}
$this->html.= "<td>$cell $app $misc $pro</td>";
}
$this->html.= "</tr>";
}
}[/code]

The problem is if there are multiple event types for a certain day then no icons show. If there is only one then the icon will show. What have I done wrong? If you need more info please let me know,.. here is the link where the calendar is located:
[url=http://project.rackattackzone.com/cal/cal3.php]http://project.rackattackzone.com/cal/cal3.php[/url]

on the 24th day of this month there are events of 3 different types, though none are showing. On the 25th there is only "misc" and it is showing.
Link to comment
https://forums.phpfreaks.com/topic/27892-if-troubles-echo-phpfreakscom/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.