コード例 #1
0
ファイル: report.php プロジェクト: verdurin/mrbs-mcr
function reporton(&$row, &$last_area_room)
{
    global $vocab, $typel;
    # Display Area/Room, but only when it changes:
    $area_room = htmlspecialchars($row[8]) . " - " . htmlspecialchars($row[9]);
    if ($area_room != $last_area_room) {
        echo "<hr><h2>{$vocab['room']} {$area_room}</h2>\n";
        $last_area_room = $area_room;
    }
    echo "<hr><table width=\"100%\">\n";
    # Brief Description (title), linked to view_entry:
    echo "<tr><td class=\"BL\"><a href=\"view_entry.php?id={$row['0']}\">" . htmlspecialchars($row[3]) . "</a></td>\n";
    # From date-time and duration:
    echo "<td class=\"BR\" align=right>" . describe_span($row[1], $row[2]) . "</td></tr>\n";
    # Description:
    echo "<tr><td class=\"BL\" colspan=2><b>{$vocab['description']}</b> " . nl2br(htmlspecialchars($row[4])) . "</td></tr>\n";
    # Entry Type:
    $et = empty($typel[$row[5]]) ? "?{$row['5']}?" : $typel[$row[5]];
    echo "<tr><td class=\"BL\" colspan=2><b>{$vocab['type']}</b> {$et}</td></tr>\n";
    # Created by and last update timestamp:
    echo "<tr><td class=\"BL\" colspan=2><small><b>{$vocab['createdby']}</b> " . htmlspecialchars($row[6]) . ", <b>{$vocab['lastupdate']}</b> " . date_time_string($row[7]) . "</small></td></tr>\n";
    echo "</table>\n";
}
コード例 #2
0
ファイル: report.php プロジェクト: verdurin/mrbs-mcr
function reporton(&$row, &$last_area_room)
{
    global $typel;
    global $enable_periods;
    # Display Area/Room, but only when it changes:
    $area_room = htmlspecialchars($row[8]) . " - " . htmlspecialchars($row[9]);
    if ($area_room != $last_area_room) {
        echo "<hr><h2>" . get_vocab("room") . $area_room . "</h2>\n";
        $last_area_room = $area_room;
    }
    echo "<hr><table width=\"100%\">\n";
    # Brief Description (title), linked to view_entry:
    echo "<tr><td class=\"BL\"><a href=\"view_entry.php?id={$row['0']}\">" . htmlspecialchars($row[3]) . "</a></td>\n";
    # From date-time and duration:
    echo "<td class=\"BR\" align=right>" . (empty($enable_periods) ? describe_span($row[1], $row[2]) : describe_period_span($row[1], $row[2])) . "</td></tr>\n";
    # Description:
    echo "<tr><td class=\"BL\" colspan=2><b>" . get_vocab("description") . "</b> " . nl2br(htmlspecialchars($row[4])) . "</td></tr>\n";
    # Entry Type:
    $et = empty($typel[$row[5]]) ? "?{$row['5']}?" : $typel[$row[5]];
    echo "<tr><td class=\"BL\" colspan=2><b>" . get_vocab("type") . "</b> {$et}</td></tr>\n";
    # Created by and last update timestamp:
    echo "<tr><td class=\"BL\" colspan=2><small><b>" . get_vocab("createdby") . "</b> " . htmlspecialchars($row[6]) . ", <b>" . get_vocab("lastupdate") . "</b> " . date_time_string(MDB_Date::mdbstamp2Unix($row[7])) . "</small></td></tr>\n";
    echo "</table>\n";
}
コード例 #3
0
ファイル: report.php プロジェクト: nicolas-san/GRRV4
function reporton(&$row, $dformat)
{
    global $vocab, $enable_periods;
    echo "<tr>";
    //Affiche "area"
    $area_nom = htmlspecialchars($row[8]);
    $areadescrip = htmlspecialchars($row[10]);
    if ($areadescrip != "") {
        $titre_area_descript = "title=\"" . $areadescrip . "\"";
    } else {
        $titre_area_descript = "";
    }
    echo "<td " . $titre_area_descript . " >" . $area_nom . "</td>";
    //Affiche "room"
    $room = htmlspecialchars($row[9]);
    echo "<td>" . $room . "</td>";
    // Breve description (title), avec un lien
    $breve_description = affichage_lien_resa_planning($row[3], $row[0]);
    $breve_description = "<a href=\"view_entry.php?id={$row['0']}\">" . $breve_description . "</a>";
    echo "<td>" . $breve_description . "</td>\n";
    // From date-time and duration:
    echo "<td>";
    if ($enable_periods == 'y') {
        echo describe_period_span($row[1], $row[2]);
        echo "</td>\n";
    } else {
        echo describe_span($row[1], $row[2], $dformat);
        if (date("d\\/m\\/Y", $row[1]) == date("d\\/m\\/Y", $row[2])) {
            echo "<br />" . date("H\\:i", $row[1]) . " ==> " . date("H\\:i", $row[2]) . "</td>\n";
        } else {
            echo "<br />" . date("d\\/m\\/Y\\ \\-\\ H\\:i", $row[1]) . " ==> " . date("d\\/m\\/Y\\ \\-\\ H\\:i", $row[2]) . "</td>\n";
        }
    }
    //Description
    if ($row[4] != "") {
        $description = nl2br(htmlspecialchars($row[4]));
    } else {
        $description = " ";
    }
    echo "<td>" . $description . "</td>\n";
    //Type de réservation
    $et = grr_sql_query1("SELECT type_name FROM " . TABLE_PREFIX . "_type_area WHERE type_letter='" . $row[5] . "'");
    if ($et == -1) {
        $et = "?" . $row[5] . "?";
    }
    echo "<td>" . $et . "</td>\n";
    //Affichage de "crée par"
    $sql_beneficiaire = "SELECT prenom, nom FROM " . TABLE_PREFIX . "_utilisateurs WHERE login = '******'";
    $res_beneficiaire = grr_sql_query($sql_beneficiaire);
    if ($res_beneficiaire) {
        $row_user = grr_sql_row($res_beneficiaire, 0);
    }
    echo "<td>" . htmlspecialchars($row_user[0]) . " " . htmlspecialchars($row_user[1]) . "</td>";
    //Affichage de la date de la dernière mise à jour
    echo "<td>" . date_time_string($row[7], $dformat) . "</td>\n";
    echo "</tr>\n";
}
コード例 #4
0
ファイル: report.php プロジェクト: verdurin/mrbs-mcr
function reporton(&$row, &$last_area_room, &$last_date, $sortby, $display)
{
    global $typel;
    global $enable_periods;
    // Display Area/Room, but only when it changes:
    $area_room = htmlspecialchars($row['area_name']) . " - " . htmlspecialchars($row['room_name']);
    $date = utf8_strftime("%d-%b-%Y", $row['start_time']);
    // entries to be sorted on area/room
    echo "<div class=\"div_report\">\n";
    if ($sortby == "r") {
        if ($area_room != $last_area_room) {
            echo "<h2>" . get_vocab("room") . ": " . $area_room . "</h2>\n";
        }
        if ($date != $last_date || $area_room != $last_area_room) {
            echo "<h3>" . get_vocab("date") . ": " . $date . "</h3>\n";
            $last_date = $date;
        }
        // remember current area/room that is being processed.
        // this is done here as the if statement above needs the old
        // values
        if ($area_room != $last_area_room) {
            $last_area_room = $area_room;
        }
    } else {
        if ($date != $last_date) {
            echo "<h2>" . get_vocab("date") . ": " . $date . "</h2>\n";
        }
        if ($area_room != $last_area_room || $date != $last_date) {
            echo "<h3>" . get_vocab("room") . ": " . $area_room . "</h3>\n";
            $last_area_room = $area_room;
        }
        // remember current date that is being processed.
        // this is done here as the if statement above needs the old
        // values
        if ($date != $last_date) {
            $last_date = $date;
        }
    }
    echo "<div class=\"report_entry_title\">\n";
    echo "<div class=\"report_entry_name\">\n";
    // Brief Description (title), linked to view_entry:
    echo "<a href=\"view_entry.php?id=" . $row['entry_id'] . "\">" . htmlspecialchars($row['name']) . "</a>\n";
    echo "</div>\n";
    echo "<div class=\"report_entry_when\">\n";
    // what do you want to display duration or end date/time
    if ($display == "d") {
        // Start date/time and duration:
        echo (empty($enable_periods) ? describe_span($row['start_time'], $row['end_time']) : describe_period_span($row['start_time'], $row['end_time'])) . "\n";
    } else {
        // Start date/time and End date/time:
        echo (empty($enable_periods) ? start_to_end($row['start_time'], $row['end_time']) : start_to_end_period($row['start_time'], $row['end_time'])) . "\n";
    }
    echo "</div>\n";
    echo "</div>\n";
    echo "<table>\n";
    echo "<colgroup>\n";
    echo "<col class=\"col1\">\n";
    echo "<col class=\"col2\">\n";
    echo "</colgroup>\n";
    // Description:
    echo "<tr><td>" . get_vocab("description") . ":</td><td>" . mrbs_nl2br(htmlspecialchars($row['description'])) . "</td></tr>\n";
    // Entry Type:
    $et = empty($typel[$row['type']]) ? "?" . $row['type'] . "?" : $typel[$row['type']];
    echo "<tr><td>" . get_vocab("type") . ":</td><td>{$et}</td></tr>\n";
    // Created by and last update timestamp:
    echo "<tr class=\"createdby\"><td>" . get_vocab("createdby") . ":</td><td>" . htmlspecialchars($row['create_by']) . "</td></tr>\n";
    echo "<tr class=\"lastupdate\"><td>" . get_vocab("lastupdate") . ":</td><td>" . date_time_string($row['last_updated']) . "</td></tr>\n";
    echo "</table>\n";
    echo "</div>\n\n";
}
コード例 #5
0
ファイル: report.php プロジェクト: jwigal/emcommdb
function reporton(&$row, &$last_area_room, &$last_date, $sortby, $display)
{
    global $typel;
    global $enable_periods;
    # Display Area/Room, but only when it changes:
    $area_room = htmlspecialchars($row[8]) . " - " . htmlspecialchars($row[9]);
    $date = utf8_strftime("%d-%b-%Y", $row[1]);
    # entries to be sorted on area/room
    if ($sortby == "r") {
        if ($area_room != $last_area_room) {
            echo "<hr><h2>" . get_vocab("room") . ": " . $area_room . "</h2>\n";
        }
        if ($date != $last_date || $area_room != $last_area_room) {
            echo "<hr noshade=\"true\"><h3>" . get_vocab("date") . " " . $date . "</h3>\n";
            $last_date = $date;
        }
        # remember current area/room that is being processed.
        # this is done here as the if statement above needs the old
        # values
        if ($area_room != $last_area_room) {
            $last_area_room = $area_room;
        }
    } else {
        if ($date != $last_date) {
            echo "<hr><h2>" . get_vocab("date") . " " . $date . "</h2>\n";
        }
        if ($area_room != $last_area_room || $date != $last_date) {
            echo "<hr noshade=\"true\"><h3>" . get_vocab("room") . ": " . $area_room . "</h3>\n";
            $last_area_room = $area_room;
        }
        # remember current date that is being processed.
        # this is done here as the if statement above needs the old
        # values
        if ($date != $last_date) {
            $last_date = $date;
        }
    }
    echo "<hr><table width=\"100%\">\n";
    # Brief Description (title), linked to view_entry:
    echo "<tr><td class=\"BL\"><a href=\"view_entry.php?id={$row['0']}\">" . htmlspecialchars($row[3]) . "</a></td>\n";
    # what do you want to display duration or end date/time
    if ($display == "d") {
        # Start date/time and duration:
        echo "<td class=\"BR\" align=right>" . (empty($enable_periods) ? describe_span($row[1], $row[2]) : describe_period_span($row[1], $row[2])) . "</td></tr>\n";
    } else {
        # Start date/time and End date/time:
        echo "<td class=\"BR\" align=right>" . (empty($enable_periods) ? start_to_end($row[1], $row[2]) : start_to_end_period($row[1], $row[2])) . "</td></tr>\n";
    }
    # Description:
    echo "<tr><td class=\"BL\" colspan=2><b>" . get_vocab("description") . "</b> " . nl2br(htmlspecialchars($row[4])) . "</td></tr>\n";
    # Entry Type:
    $et = empty($typel[$row[5]]) ? "?{$row['5']}?" : $typel[$row[5]];
    echo "<tr><td class=\"BL\" colspan=2><b>" . get_vocab("type") . "</b> {$et}</td></tr>\n";
    # Created by and last update timestamp:
    echo "<tr><td class=\"BL\" colspan=2><small><b>" . get_vocab("createdby") . "</b> " . htmlspecialchars($row[6]) . ", <b>" . get_vocab("lastupdate") . "</b> " . date_time_string($row[7]) . "</small></td></tr>\n";
    echo "</table>\n";
}
コード例 #6
0
function reporton(&$row, &$last_area_room, &$last_date, $sortby, $display)
{
    global $typel;
    global $output_as_csv;
    global $csv_row_sep;
    global $custom_fields, $field_natures, $field_lengths, $tbl_entry;
    global $approval_somewhere, $confirmation_somewhere;
    global $strftime_format;
    // Initialise the line for CSV reports
    $line = "";
    // Display Area/Room, but only when it changes:
    $area_room = $row['area_name'] . " - " . $row['room_name'];
    $date = utf8_strftime($strftime_format['date'], $row['start_time']);
    // entries to be sorted on area/room
    echo $output_as_csv ? '' : "<div class=\"div_report\">\n";
    if ($sortby == "r") {
        if ($area_room != $last_area_room) {
            echo $output_as_csv ? '' : "<h2>" . get_vocab("room") . ": " . escape($area_room) . "</h2>\n";
        }
        if ($date != $last_date || $area_room != $last_area_room) {
            echo $output_as_csv ? '' : "<h3>" . get_vocab("date") . ": " . $date . "</h3>\n";
            $last_date = $date;
        }
        // remember current area/room that is being processed.
        // this is done here as the if statement above needs the old
        // values
        if ($area_room != $last_area_room) {
            $last_area_room = $area_room;
        }
    } else {
        if ($date != $last_date) {
            echo $output_as_csv ? '' : "<h2>" . get_vocab("date") . ": " . $date . "</h2>\n";
        }
        if ($area_room != $last_area_room || $date != $last_date) {
            echo $output_as_csv ? '' : "<h3>" . get_vocab("room") . ": " . escape($area_room) . "</h3>\n";
            $last_area_room = $area_room;
        }
        // remember current date that is being processed.
        // this is done here as the if statement above needs the old
        // values
        if ($date != $last_date) {
            $last_date = $date;
        }
    }
    if ($output_as_csv) {
        $line = csv_row_add_value($line, $area_room);
        // for the CSV report put the area-room name on every line
        $line = csv_row_add_value($line, $row['name']);
    } else {
        echo "<div class=\"report_entry_title\">\n";
        echo "<div class=\"report_entry_name\">\n";
        // Brief Description (title), linked to view_entry:
        echo "<a href=\"view_entry/id:" . $row['id'] . "\">" . htmlspecialchars($row['name']) . "</a>\n";
        echo "</div>\n";
    }
    echo $output_as_csv ? '' : "<div class=\"report_entry_when\">\n";
    // what do you want to display duration or end date/time
    if ($display == "d") {
        // Start date/time and duration:
        $when = empty($row['enable_periods']) ? describe_span($row['start_time'], $row['end_time']) : describe_period_span($row['start_time'], $row['end_time']);
    } else {
        // Start date/time and End date/time:
        $when = empty($row['enable_periods']) ? start_to_end($row['start_time'], $row['end_time']) : start_to_end_period($row['start_time'], $row['end_time']);
    }
    if ($output_as_csv) {
        $line = csv_row_add_value($line, $when);
    } else {
        echo "{$when}\n";
        echo "</div>\n";
        echo "</div>\n";
        echo "<table>\n";
        echo "<colgroup>\n";
        echo "<col class=\"col1\">\n";
        echo "<col class=\"col2\">\n";
        echo "</colgroup>\n";
    }
    // Description:
    if ($output_as_csv) {
        $line = csv_row_add_value($line, $row['description']);
    } else {
        echo "<tr>\n";
        echo "<td>" . get_vocab("description") . ":</td>\n";
        echo "<td>" . escape($row['description']) . "</td>\n";
        echo "</tr>\n";
    }
    // Entry Type:
    $et = empty($typel[$row['type']]) ? "?" . $row['type'] . "?" : $typel[$row['type']];
    if ($output_as_csv) {
        $line = csv_row_add_value($line, $et);
    } else {
        echo "<tr>\n";
        echo "<td>" . get_vocab("type") . ":</td>\n";
        echo "<td>" . escape($et) . "</td>\n";
        echo "</tr>\n";
    }
    // Created by:
    if ($output_as_csv) {
        $line = csv_row_add_value($line, $row['create_by']);
    } else {
        echo "<tr>\n";
        echo "<td>" . get_vocab("createdby") . ":</td>\n";
        echo "<td>" . escape($row['create_by']) . "</td>\n";
        echo "</tr>\n";
    }
    // Confirmation status
    if ($confirmation_somewhere) {
        // Translate the status field bit into meaningful text
        if ($row['confirmation_enabled']) {
            $confirmation_status = $row['status'] & STATUS_TENTATIVE ? get_vocab("tentative") : get_vocab("confirmed");
        } else {
            $confirmation_status = '';
        }
        // Now output the text
        if ($output_as_csv) {
            $line = csv_row_add_value($line, $confirmation_status);
        } else {
            echo "<tr>\n";
            echo "<td>" . get_vocab("confirmation_status") . ":</td>\n";
            echo "<td>" . escape($confirmation_status) . "</td>\n";
            echo "</tr>\n";
        }
    }
    // Approval status
    if ($approval_somewhere) {
        // Translate the status field bit into meaningful text
        if ($row['approval_enabled']) {
            $approval_status = $row['status'] & STATUS_AWAITING_APPROVAL ? get_vocab("awaiting_approval") : get_vocab("approved");
        } else {
            $approval_status = '';
        }
        // Now output the text
        if ($output_as_csv) {
            $line = csv_row_add_value($line, $approval_status);
        } else {
            echo "<tr>\n";
            echo "<td>" . get_vocab("approval_status") . ":</td>\n";
            echo "<td>" . escape($approval_status) . "</td>\n";
            echo "</tr>\n";
        }
    }
    // Now do any custom fields
    foreach ($custom_fields as $key => $value) {
        // Output a yes/no if it's a boolean or integer <= 2 bytes (which we will
        // assume are intended to be booleans)
        if ($field_natures[$key] == 'boolean' || $field_natures[$key] == 'integer' && isset($field_lengths[$key]) && $field_lengths[$key] <= 2) {
            $output = empty($row[$key]) ? get_vocab("no") : get_vocab("yes");
        } else {
            $output = isset($row[$key]) ? $row[$key] : '';
        }
        if ($output_as_csv) {
            $line = csv_row_add_value($line, $output);
        } else {
            echo "<tr>\n";
            echo "<td>" . get_loc_field_name($tbl_entry, $key) . ":</td>\n";
            echo "<td>" . escape($output) . "</td>\n";
            echo "</tr>\n";
        }
    }
    // Last updated:
    if ($output_as_csv) {
        $line = csv_row_add_value($line, time_date_string($row['last_updated']));
    } else {
        echo "<tr>\n";
        echo "<td>" . get_vocab("lastupdate") . ":</td>\n";
        echo "<td>" . time_date_string($row['last_updated']) . "</td>\n";
        echo "</tr>\n";
    }
    if ($output_as_csv) {
        // terminate and output the line
        $line .= $csv_row_sep;
        echo $line;
    } else {
        echo "</table>\n";
        echo "</div>\n\n";
    }
}
コード例 #7
0
ファイル: report.php プロジェクト: jessfishenden/mrbs
function reporton(&$row, &$last_area_room, &$last_date, $sortby, $display)
{
    global $typel;
    global $enable_periods;
    global $output_as_csv;
    global $csv_row_sep;
    // Initialise the line for CSV reports
    $line = "";
    // Display Area/Room, but only when it changes:
    $area_room = $row['area_name'] . " - " . $row['room_name'];
    $date = utf8_strftime("%d-%b-%Y", $row['start_time']);
    // entries to be sorted on area/room
    echo $output_as_csv ? '' : "<div class=\"div_report\">\n";
    if ($sortby == "r") {
        if ($area_room != $last_area_room) {
            echo $output_as_csv ? '' : "<h2>" . get_vocab("room") . ": " . escape($area_room) . "</h2>\n";
        }
        if ($date != $last_date || $area_room != $last_area_room) {
            echo $output_as_csv ? '' : "<h3>" . get_vocab("date") . ": " . $date . "</h3>\n";
            $last_date = $date;
        }
        // remember current area/room that is being processed.
        // this is done here as the if statement above needs the old
        // values
        if ($area_room != $last_area_room) {
            $last_area_room = $area_room;
        }
    } else {
        if ($date != $last_date) {
            echo $output_as_csv ? '' : "<h2>" . get_vocab("date") . ": " . $date . "</h2>\n";
        }
        if ($area_room != $last_area_room || $date != $last_date) {
            echo $output_as_csv ? '' : "<h3>" . get_vocab("room") . ": " . escape($area_room) . "</h3>\n";
            $last_area_room = $area_room;
        }
        // remember current date that is being processed.
        // this is done here as the if statement above needs the old
        // values
        if ($date != $last_date) {
            $last_date = $date;
        }
    }
    if ($output_as_csv) {
        $line = csv_row_add_value($line, $area_room);
        // for the CSV report put the area-room name on every line
        $line = csv_row_add_value($line, $row['name']);
    } else {
        echo "<div class=\"report_entry_title\">\n";
        echo "<div class=\"report_entry_name\">\n";
        // Brief Description (title), linked to view_entry:
        echo "<a href=\"view_entry.php?id=" . $row['entry_id'] . "\">" . htmlspecialchars($row['name']) . "</a>\n";
        echo "</div>\n";
    }
    echo $output_as_csv ? '' : "<div class=\"report_entry_when\">\n";
    // what do you want to display duration or end date/time
    if ($display == "d") {
        // Start date/time and duration:
        $when = empty($enable_periods) ? describe_span($row['start_time'], $row['end_time']) : describe_period_span($row['start_time'], $row['end_time']);
    } else {
        // Start date/time and End date/time:
        $when = empty($enable_periods) ? start_to_end($row['start_time'], $row['end_time']) : start_to_end_period($row['start_time'], $row['end_time']);
    }
    if ($output_as_csv) {
        $line = csv_row_add_value($line, $when);
    } else {
        echo "{$when}\n";
        echo "</div>\n";
        echo "</div>\n";
        echo "<table>\n";
        echo "<colgroup>\n";
        echo "<col class=\"col1\">\n";
        echo "<col class=\"col2\">\n";
        echo "</colgroup>\n";
    }
    // Description:
    if ($output_as_csv) {
        $line = csv_row_add_value($line, $row['description']);
    } else {
        echo "<tr>\n";
        echo "<td>" . get_vocab("description") . ":</td>\n";
        echo "<td>" . escape($row['description']) . "</td>\n";
        echo "</tr>\n";
    }
    // Entry Type:
    $et = empty($typel[$row['type']]) ? "?" . $row['type'] . "?" : $typel[$row['type']];
    if ($output_as_csv) {
        $line = csv_row_add_value($line, $et);
    } else {
        echo "<tr>\n";
        echo "<td>" . get_vocab("type") . ":</td>\n";
        echo "<td>" . escape($et) . "</td>\n";
        echo "</tr>\n";
    }
    // Created by:
    if ($output_as_csv) {
        $line = csv_row_add_value($line, $row['create_by']);
    } else {
        echo "<tr>\n";
        echo "<td>" . get_vocab("createdby") . ":</td>\n";
        echo "<td>" . escape($row['create_by']) . "</td>\n";
        echo "</tr>\n";
    }
    // Last updated:
    if ($output_as_csv) {
        $line = csv_row_add_value($line, date_time_string($row['last_updated']));
    } else {
        echo "<tr>\n";
        echo "<td>" . get_vocab("lastupdate") . ":</td>\n";
        echo "<td>" . date_time_string($row['last_updated']) . "</td>\n";
        echo "</tr>\n";
    }
    if ($output_as_csv) {
        // terminate and output the line
        $line .= $csv_row_sep;
        echo $line;
    } else {
        echo "</table>\n";
        echo "</div>\n\n";
    }
}