$alldayapps = '<table width="100%"><tr>'; while ($row = $q->fetchRow()) { // trim subject if (strlen($row["app_subject"]) > 25) { $subject = substr($row["app_subject"], 0, 25) . "..."; } else { $subject = $row["app_subject"]; } // variable style values from database, rest is in css class $alldayapps .= '<td style="white-space: nowrap;width:' . $width . '%;border:1px solid #' . $row["use_colour"] . ';border-left: 10px solid #' . $row["use_colour"] . ';background-color: #FFFFFF; cursor:pointer; font-size:9px; overflow: hidden;" '; //<div style="width:300px;border:1px solid #'.$row["use_colour"].';display:block;" '; display:inline; margin: 2px; border: 1px solid #'.$row["use_colour"].'; // href targetted at parent of parent. remove hightlight var from querystring // parent.parent.frames[\'mainFrame\'].window.location.href= $alldayapps .= 'onClick="javascript:window.location.href=\'appointment_edit.php?app_id=' . $row["app_id"] . '&searchLink=calendar.php?' . urlencode(replaceQueryString($_SERVER['QUERY_STRING'], 'app_highlight')) . '\'" '; // js actions $alldayapps .= 'onMouseOver="return overlib(\'' . $row["app_subject"] . '<br />' . format_overdiv($row["note"]) . '<br /><br />' . $row["use_name"] . '\',CAPTION,\'' . $row["app_type"] . '\');" onMouseOut="nd();" onMouseDown="nd();"'; // text displayed within appointment $alldayapps .= '>' . $subject . '</td>' . "\n"; //' - '.$row["use_name"]. if ($counter % $perRow == 0) { $alldayapps .= ' </tr> <tr>'; } $counter++; } $alldayapps .= '</tr></table>'; } if ($alldayapps) { $render .= '
$cli_name = preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $row['cli_name']); // this removes the cli_id in parenthesis if ($row['app_attendees']) { $app_attendees = '<br><font size="1">' . trim(preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $row['app_attendees'])) . '</font>'; // this removes the use_id in parenthesis } if ($row['use_colour']) { $use_colour = '<span class="use_col" style="background-color: ' . $row['use_colour'] . ';"><img src="/images/sys/admin/blank.gif"></span> '; } $start = explode(" ", $row['app_start']); $start = $start[1]; $end = explode(" ", $row['app_end']); $end = $end[1]; $first_app = strtotime($row['app_start']) - $daybegin; $start_pixel = $first_app / 60 * $zoom; $divs[] = array('id' => $row['followUpAppointmentId'] ?: $row['app_id'], 'start_stamp' => strtotime($row['app_start']), 'end_stamp' => strtotime($row['app_end']), 'start_offset' => round_to_nearest($start_time, 15) * $zoom, 'start' => date('H:i', strtotime(substr($start, 0, -3))), 'end' => date('H:i', strtotime(substr($end, 0, -3))), 'duration' => $duration, 'start_pixel' => $start_pixel, 'end_pixel' => $start_pixel + $duration * $zoom, 'app_height' => $duration * $zoom, 'colour' => $row['use_colour'], 'type' => $row['app_type'], 'subtype' => $row['ity_title'], 'notetype' => $row['app_notetype'], 'client' => $cli_name, 'addr' => str_replace(" ", " ", $pro_addr), 'tel' => $row['tel_number'], 'user' => $row['use_name'], 'contact' => $row['con_name'], 'attendees' => $row['app_attendees'], 'cv' => $row['d2a_cv'], 'subject' => format_overdiv($row['app_subject']), 'notes' => format_overdiv($row['note']), 'private' => $row['app_private'], 'bookedby' => $row['app_bookedby'], 'DIT' => $row['DIT']); unset($app_attendees, $use_colour, $pro_addr, $cli_name, $price); } } //print_r($divs); // end sql // need to loop every 15 minutes, consider not using Calendar class for this and going bespoke $Day->build(); while ($Hour =& $Day->fetch()) { // show working hours only if (date('H', $Hour->getTimeStamp()) >= $default_workingday_start && date('H', $Hour->getTimeStamp()) <= $default_workingday_end) { // highlight current hour slot but only if viewing current day if (date('l, jS F, Y', $Day->getTimeStamp()) == date('l, jS F, Y')) { if (date('H', $Hour->getTimeStamp()) == date('H')) { $class = "calHourNow"; } else {
$cli_name = preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $row["cli_name"]); // this removes the cli_id in parenthesis if ($row["app_attendees"]) { $app_attendees = '<br><font size="1">' . trim(preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $row["app_attendees"])) . '</font>'; // this removes the use_id in parenthesis } if ($row["use_colour"]) { $use_colour = '<span class="use_col" style="background-color: ' . $row["use_colour"] . ';"><img src="/images/sys/admin/blank.gif"></span> '; } $start = explode(" ", $row["app_start"]); $start = $start[1]; $end = explode(" ", $row["app_end"]); $end = $end[1]; $first_app = strtotime($row["app_start"]) - $daybegin; $start_pixel = $first_app / 60 * $zoom; $divs[] = array('id' => $row["app_id"], 'start_stamp' => strtotime($row["app_start"]), 'end_stamp' => strtotime($row["app_end"]), 'start_offset' => round_to_nearest($start_time, 15) * $zoom, 'start' => date('H:i', strtotime(substr($start, 0, -3))), 'end' => date('H:i', strtotime(substr($end, 0, -3))), 'duration' => $duration, 'start_pixel' => $start_pixel, 'end_pixel' => $start_pixel + $duration * $zoom, 'app_height' => $duration * $zoom, 'colour' => $row["use_colour"], 'type' => $row["app_type"], 'client' => $cli_name, 'addr' => str_replace(" ", " ", $pro_addr), 'user' => $row["use_name"], 'contact' => $row["con_name"], 'attendees' => $row["app_attendees"], 'cv' => $row["d2a_cv"], 'subject' => format_overdiv($row["app_subject"]), 'notes' => format_overdiv($row["note"]), 'subtype' => $row["ity_title"], 'private' => $row["app_private"], 'bookedby' => $row["app_bookedby"]); unset($app_attendees, $use_colour, $pro_addr, $cli_name, $price); } } //print_r($divs); // end sql // need to loop every 15 minutes, consider not using Calendar class for this and going bespoke $Day->build(); while ($Hour =& $Day->fetch()) { // show working hours only if (date('H', $Hour->getTimeStamp()) >= $default_workingday_start && date('H', $Hour->getTimeStamp()) <= $default_workingday_end) { // highlight current hour slot but only if viewing current day if (date('l, jS of F, Y', $Day->getTimeStamp()) == date('l, jS of F, Y')) { if (date('H', $Hour->getTimeStamp()) == date('H')) { $class = "calHourNow"; } else {