コード例 #1
0
function get_reply($guests, $guest)
{
    global $reply, $heads, $comments;
    $row = rowid_get_row($guests, $guest, array("reply", "heads", "comments"));
    if ($row && $row["reply"]) {
        $reply = $row["reply"];
        $heads = $row["heads"];
        $comments = htmlspecialchars($row["comments"]);
    } else {
        $reply = null;
        $heads = 0;
        $comments = "";
    }
}
コード例 #2
0
<TR>
	<TH CLASS="fancy">Event</TH>
	<TH CLASS="fancy">Organizer</TH>
	<TH CLASS="fancy">Time</TH>
	<TH CLASS="fancy">Guests</TH>
</TR>
<?php 
$rows = gtable_rows($events);
foreach ($rows as $event) {
    $row = rowid_get_row($events, $event, array("hash", "name", "organizer", "time"));
    $hash = $row["hash"];
    $name = $row["name"];
    $org = $row["organizer"];
    $time = $row["time"];
    echo "<TR><TD CLASS=\"normal\"><A HREF=\"manage.php?event={$hash}\">{$name}</A></TD>\n";
    $row = rowid_get_row($guests, $org, array("hash", "name", "email"));
    $hash = $row["hash"];
    $name = $row["name"];
    $email = $row["email"];
    echo "<TD CLASS=\"normal\"><A HREF=\"mailto:{$email}\">{$name}</A></TD>\n";
    $time = date("l\\, F jS Y g:i A", $time);
    echo "<TD CLASS=\"normal\">{$time}</TD>\n";
    $count = gtable_count_query($guests, "event", $event);
    echo "<TD CLASS=\"normal\">{$count}</TD></TR>\n";
}
?>
</TABLE>
</TD></TR>
</TABLE>
<?php 
unset($guests);
コード例 #3
0
                            $rows = gtable_query($guests, "event", $id);
                            foreach ($rows as $guest) {
                                $name = $_REQUEST["name_{$guest}"];
                                $email = $_REQUEST["email_{$guest}"];
                                $row = rowid_get_row($guest, array("name", "email"));
                                if ($row["name"] != $name) {
                                    rowid_set_values($guests, $guest, array("name" => $name));
                                }
                                /* can't change the organizer email address */
                                if ($guest != $org_id) {
                                    if ($row["email"] != $email) {
                                        rowid_set_values($guests, $guest, array("email" => $email, "emails" => 0));
                                    }
                                }
                            }
                            $row = rowid_get_row($guests, $org_id, array("name", "email"));
                            if ($row) {
                                $org = $row["name"];
                                $org_email = $row["email"];
                            } else {
                                $error = "Database error.";
                            }
                        }
                    }
                }
            }
        }
    } else {
        $error = "Event not found.";
    }
} else {