Esempio n. 1
0
function popp($link, $d, $arrD)
{
    $dt_d = prevmday($d);
    # Y-m-d
    $iscurwk = prevmday($dt_d) == prevmday(date('Y-m-d')) ? 1 : 0;
    $str = '';
    // Get info for popups
    for ($i = 0; $i < 7; $i++) {
        $mysqldt_p = date('Y-m-d', strtotime(date('Y-m-d', strtotime($dt_d)) . " +{$i} day"));
        list($dy, $dt, $mnth) = explode(" ", d_format($mysqldt_p, 4));
        // 29/04/15 - Shorten day name to three letters so day and date fits:
        if (strlen($dy . $dt) > 11) {
            $dy = substr($dy, 0, 3);
        }
        // 22/05/09: We use htmlspecialchars() so that the pop display info correctly - Added to get_info() function instead! on 26/05/2009
        $popuptxt2 = '<div class=&quot;date_s&quot;>' . d_format($mysqldt_p) . '<br />[' . days_from_days_to($mysqldt_p) . "]</div><p>" . get_info($link, $mysqldt_p, 400) . '</p>';
        $str .= "-||-<a tooltiptxt=\"{$popuptxt2}\" title3=\"{$mysqldt_p}\" title4=\"" . substr($dy, 0, 3) . "\" iscurwk=\"{$iscurwk}\"" . " class=\"datehead\">{$dy} {$dt}<br />{$mnth}</a>";
        // $str.=  "-||-<a title2=\"$popuptxt2\""
        // . ' class="datehead" onclick="makerequest(\''.TOOLS_SCRIPT.'?act=getday\' '
        // . ", 'dateinfo', '$mysqldt_p', '{$arrD[$i]}', $iscurwk);\">$dy $dt<br />$mnth</a>";
    }
    // End for.
    return $str;
}
Esempio n. 2
0
function helpcal($link, $i, $subsequentrowcellcounter, $subseq = 0)
{
    global $tootipchars, $arr_d, $colspan_1;
    $full_date = "{$_GET['y']}-" . sing_num($_GET['m']) . '-' . sing_num($i);
    $full_date2 = date('l jS F, Y', strtotime($full_date));
    $popuptxt = get_info($link, $full_date, $tootipchars);
    if (strlen($popuptxt) > 0) {
        $popuptxt2 = '<div class=&quot;date_s&quot;>' . "{$full_date2}<br />[" . days_from_days_to($full_date) . "]</div>\r\n      <p>{$popuptxt}</p>";
        $tdclass = 'three_col';
    } else {
        // No entry
        $popuptxt2 = '';
        $tdclass = 'four_col';
    }
    // End if.
    $str = '';
    if ($subseq and $subsequentrowcellcounter > 6) {
        $subsequentrowcellcounter = $subsequentrowcellcounter % 7;
    }
    if (date("j") == $i and date("n") == $_GET['m'] and date("Y") == $_GET['y']) {
        // Highlight current date
        $str .= writetdcell('curDate', $popuptxt2, $full_date, $arr_d[$subsequentrowcellcounter], 1, $i);
    } else {
        if (isset($_GET['d']) and $_GET['d'] == $i) {
            // Selected day that is not the current day:
            $str .= writetdcell('sel_col', $popuptxt2, $full_date, $arr_d[$subsequentrowcellcounter], isCurWk($full_date), $i);
        } else {
            //
            $str .= writetdcell($tdclass, $popuptxt2, $full_date, $arr_d[$subsequentrowcellcounter], isCurWk($full_date), $i);
        }
    }
    // End if.
    return $str;
}