示例#1
0
    $email = mysqli_real_escape_string($conn, $_POST['email']);
    $topic = mysqli_real_escape_string($conn, $_POST['topic']);
    $content = mysqli_real_escape_string($conn, $_POST['content']);
    InsertQuestion($conn, $name, $email, $topic, $content);
    $id = SelectLastID($conn);
    $vote = GetVote($conn, $id);
    $datetime = GetDateTime($conn, $id);
} else {
    if (isset($_POST['editquestion'])) {
        // if the previous page was the Edit Question page
        $name = mysqli_real_escape_string($conn, $_POST['name']);
        $email = mysqli_real_escape_string($conn, $_POST['email']);
        $topic = mysqli_real_escape_string($conn, $_POST['topic']);
        $content = mysqli_real_escape_string($conn, $_POST['content']);
        EditQuestion($conn, $id, $name, $email, $topic, $content);
        $vote = GetVote($conn, $id);
        $datetime = GetDateTime($conn, $id);
    } else {
        if (isset($_POST['saveanswer'])) {
            // if the previous action was submitting answer
            $name_ans = mysqli_real_escape_string($conn, $_POST['name_ans']);
            $email_ans = mysqli_real_escape_string($conn, $_POST['email_ans']);
            $content_ans = mysqli_real_escape_string($conn, $_POST['content_ans']);
            InsertAnswer($conn, $id, $name_ans, $email_ans, $content_ans);
            $result = SelectQuestion($conn, $id);
            if ($result->num_rows > 0) {
                // output data of each row
                while ($row = $result->fetch_assoc()) {
                    $name = $row["name"];
                    $email = $row["email"];
                    $topic = $row["topic"];
示例#2
0
if ($mpval and $vformfilled) {
    $mpprop = $mpval["mpprop"];
    $party = $mpprop["party"];
    $name = $mpprop["name"];
    $constituency = $mpprop["constituency"];
    $minentered_house = $mpval["minentered_house"];
    $vnvotes = array("part4_terroristcertification" => array("2001-11-21", 75, "Power of Home Secretary to certify individuals as terrorists"), "part4_indefinitedetention" => array("2001-11-21", 76, "Power to detain certified terrorists indefinitely if foreign"), "public_emergency" => array("2001-11-21", 70, "Declaration of public emergency threatening the life of the nation"), "part4_siac" => array("2001-11-21", 77), "part4_privy" => array("2004-02-25", 59), "part4_renewal" => array("2004-03-03", 71, "Renewal of law for detaining certified terrorists indefinitely"), "d90days" => array("2005-11-09", 84, "Extention of period of detention without charge to 90 days"), "d28days" => array("2005-11-09", 85, "Extention of period of detention to 28 days (but not 60)"), "d42days_enable" => array("2008-06-11", 219, "Conditions to enable detention without charge up to 42 days"), "d42days_procedure" => array("2008-06-11", 220, "Power to detain suspects without charge for up to 42 days"));
    # book the values into a database
    #$db->query("drop table if exists pw_dyn_fortytwoday_comments");
    #$db->query("create table pw_dyn_fortytwoday_comments (vterdet varchar(10), vpubem varchar(20), ltime timestamp, vrand int, vpostcode varchar(20), constituency varchar(80))");
    #$db->query("INSERT INTO pw_dyn_fortytwoday_comments (vterdet, vpubem, ltime, vrand, vpostcode, constituency)
    #            VALUES ('$vterdet', '$vpubem', NOW(), $vrand, '$vpostcode', '".mysql_real_escape_string($constituency)."')");
    # looks up as a batch.  Or we could look up individually for easier coding
    $votes = GetVotes($db, $mpprop["person"], 1039);
    foreach ($vnvotes as $vname => &$vnvote) {
        $vnvote[] = GetVote($votes, $vnvote[0], $vnvote[1]);
    }
    print "<div id=\"content\">\n";
    $atcsa = "<a href=\"http://www.opsi.gov.uk/acts/acts2001/ukpga_20010024_en_1\">Anti-terrorism, Crime and Security Act 2001</a>";
    $party = $mpprop["party"];
    print "<p><b><a href=\"http://www.publicwhip.org.uk/mp.php?" . $mpprop["mpanchor"] . "\">{$name} MP ({$party})</a></b>,\n           representing the constituency of <b>{$constituency}</b>,\n";
    if ($minentered_house == "1997-05-01") {
        print " has been in Parliament long enough to vote on the detention of \n                terrorist suspects without charge for up to 90 days, as well as \n                on earlier laws of indefinite detention without charge of foreign suspects under the {$atcsa}.\n";
    } else {
        print " entered Parliament on " . pretty_date($minentered_house) . ",\n";
        print " and was able to vote on the detention of terrorist suspects without charge ";
        print " for up to 42 days";
        if ($d90days != "notmp") {
            print " and to 90 days.";
        } else {
            print " but not to 90 days.";