if (mysql_result($result, $i, "opsreq_opt8") == 'Y') {
        $options = $options . " (" . $event_tools_op_session_opt8_name . ") ";
    }
    if ($options != "") {
        $sessions = $sessions . "\n" . $options;
    }
    $sessions = $sessions . "\n\n";
    if ($i == $num - 1 || $lastmajorkey != mysql_result($result, $i + 1, "show_name") . mysql_result($result, $i + 1, "start_date")) {
        if ($i < $num - 1) {
            $lastmajorkey = mysql_result($result, $i + 1, "show_name") . mysql_result($result, $i + 1, "start_date");
        }
        if ($testto == '$') {
            $to = mysql_result($result, $i, "layout_owner_email");
        } else {
            $to = $testto;
        }
        echo "Sending to " . mysql_result($result, $i, "layout_owner_email") . ' ' . mysql_result($result, $i, "show_name") . '(' . $to . ')<p>';
        $subject = "Operating Session Assignments";
        $headers = "from: " . $from . "\nreply-to: " . $reply . "\nbcc: " . $bcc;
        $body = $part1 . "\n\n" . daydatetime_from_long_format(mysql_result($result, $i, "start_date")) . " session attendees:\n\n" . $sessions . "\n\n\n";
        mail($to, $subject, $body, $headers);
        echo '<hr>' . $body . '<hr>';
        $sessions = "";
    }
    $i++;
}
mysql_close();
echo "</clinics>\n";
?>

if (!($args["operator"] == NONE || $args["operator"] == "" || $args["operator"] == "(ALL)")) {
    $where = "AND opsreq_person_email = '" . $args["operator"] . "' ";
} else {
    $where = "";
}
$query = "\r\n    SELECT *\r\n    FROM " . $event_tools_db_prefix . "eventtools_ops_group_session_assignments \r\n    WHERE opsreq_group_cycle_name = '" . $cycle . "'\r\n    " . $where . "\r\n    AND show_name != ''\r\n    AND status = '1'\r\n    ORDER BY opsreq_group_cycle_name\r\n    ";
$result = mysql_query($query);
$num = mysql_numrows($result);
//echo $query;
//echo '['.$num.']';
$i = 0;
$lastmajorkey = mysql_result($result, $i, "opsreq_person_email");
$part1 = $args["content"] . "\n\n";
$sessions = "";
while ($i < $num) {
    $sessions = $sessions . mysql_result($result, $i, "show_name") . "\n" . daydatetime_from_long_format(mysql_result($result, $i, "start_date")) . "\n\n";
    if ($i == $num - 1 || $lastmajorkey != mysql_result($result, $i + 1, "opsreq_person_email")) {
        if ($i < $num - 1) {
            $lastmajorkey = mysql_result($result, $i + 1, "opsreq_person_email");
        }
        if ($testto == '$') {
            $to = mysql_result($result, $i, "opsreq_person_email");
        } else {
            $to = $testto;
        }
        echo "sending to " . mysql_result($result, $i, "opsreq_person_email") . '(' . $to . ')<p>';
        $subject = $args["subject"];
        $headers = "from: " . $from . "\nreply-to: " . $reply . "\nbcc: " . $bcc;
        $body = $part1;
        if ($args["noassignments"] != "on") {
            $body = $body . $sessions;
Beispiel #3
0
function format_all_clinics_as_2table($where = "", $order = "start_date, end_date")
{
    global $opts, $event_tools_db_prefix, $event_tools_href_add_on;
    mysql_connect($opts['hn'], $opts['un'], $opts['pw']);
    @mysql_select_db($opts['db']) or die("Unable to select database");
    if ($where != NONE) {
        $where = " WHERE " . $where;
    }
    $query = "\r\n        SELECT *\r\n        FROM " . $event_tools_db_prefix . "eventtools_clinics_with_tags\r\n        " . $where . "\r\n        ORDER BY start_date, end_date, name\r\n        ;\r\n    ";
    //echo $query;
    $result = mysql_query($query);
    $i = 0;
    $num = mysql_numrows($result);
    //echo "num: ".$num."<br/>\n";
    if ($num == 0) {
        mysql_close();
        return;
    }
    $lastmajorkey = mysql_result($result, 0, "start_date");
    echo "<table border=\"1\" class=\"et-clinic\">\n";
    while ($i < $num) {
        if ($lastmajorkey != mysql_result($result, $i, "start_date")) {
            $lastmajorkey = mysql_result($result, $i, "start_date");
            echo "</table>\n";
            echo "<p/>\n";
            echo "<table border=\"1\" class=\"et-clinic\">\n";
        }
        echo "<tr class=\"et-clinic-tr1\">\n";
        echo "  <td class=\"et-clinic-td1\">\n";
        echo "    <a name=\"" . mysql_result($result, $i, "number") . "\"></a>\n";
        echo "    <span class=\"et-clinic-name\">" . mysql_result($result, $i, "name") . "</span>\n";
        echo "  </td>\n";
        echo "  <td class=\"et-clinic-td2\">\n";
        echo "    <span class=\"et-clinic-time\">" . daydatetime_from_long_format(mysql_result($result, $i, "start_date")) . " - " . time_from_long_format(mysql_result($result, $i, "end_date")) . "</span>\n";
        echo "  </td>\n";
        echo "</tr>\n";
        if (mysql_result($result, $i, "clinic_presenter") != '') {
            $clinic_presenter = mysql_result($result, $i, "clinic_presenter");
        } else {
            $clinic_presenter = "(no presenter name provided)";
        }
        if (mysql_result($result, $i, "description") != '') {
            $description = mysql_result($result, $i, "description");
        } else {
            $description = "(no description provided)";
        }
        echo "<tr class=\"et-clinic-tr2\">\n";
        echo "  <td class=\"et-clinic-td1\">\n";
        echo "    <span class=\"et-clinic-presenter\">" . $clinic_presenter . "</span>\n";
        echo "  </td>\n";
        echo "  <td class=\"et-clinic-td2\">\n";
        echo "    <span class=\"et-clinic-location\">" . mysql_result($result, $i, "location_name") . "</span>\n";
        echo "  </td>\n";
        echo "</tr>\n";
        echo "<tr class=\"et-clinic-tr3\">\n";
        echo "  <td colspan=\"2\" class=\"et-clinic-td1\">\n";
        echo "    <div class=\"et-clinic-description\">" . $description . "</div>\n";
        echo "  </td>\n";
        echo "</tr>\n";
        echo "<tr class=\"et-clinic-tr4\">\n";
        echo "  <td colspan=\"2\" class=\"et-clinic-td1\">\n";
        if (mysql_result($result, $i, "clinic_url") != '') {
            echo "    <span class=\"et-clinic-url\"><a " . $event_tools_href_add_on . " href=\"" . mysql_result($result, $i, "clinic_url") . "\">" . mysql_result($result, $i, "clinic_url") . "</a></span>\n";
        }
        echo "  </td>\n";
        echo "</tr>\n";
        // process tags
        echo "<tr class=\"et-clinic-tr5\">\n";
        echo "  <td colspan=\"2\" class=\"et-clinic-td1\"><span class=\"et-clinic-tags\">\n";
        echo mysql_result($result, $i, "tag_name");
        while ($i < $num - 1 && mysql_result($result, $i, "name") == mysql_result($result, $i + 1, "name")) {
            $i++;
            echo ",\n" . mysql_result($result, $i, "tag_name");
        }
        echo "\n  </span></td>\n";
        echo "</tr>\n";
        // spare line at end
        echo "<tr class=\"et-clinic-tr6\">\n";
        // blank line
        echo "  <td colspan=\"2\" class=\"et-clinic-td1\">\n";
        echo "  </td>\n";
        echo "</tr>\n";
        $i++;
    }
    // done, clean up
    echo "</table>\n";
    mysql_close();
}