-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
172 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
// handler.php | ||
// handle comment posts, saving to MySQL and redirecting back to the list | ||
require_once "Dao.php"; | ||
|
||
if (isset($_SESSION["name"]) && isset($_POST["commentButton"])) { | ||
$comment = $_POST["comment"]; | ||
$comment_type = $_POST["vote"]; | ||
|
||
try { | ||
$dao = new Dao(); | ||
$dao->saveComment($comment); | ||
} catch (Exception $e) { | ||
var_dump($e); | ||
die; | ||
} | ||
} | ||
header("Location:index.php"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,56 @@ | ||
<?php | ||
$thisPage="Lawmakers"; | ||
include 'top.php'; ?> | ||
include 'top.php'; | ||
require_once "Dao.php"; ?> | ||
|
||
<div class="maincontainer"> | ||
|
||
<?php include 'dash.php'; ?> | ||
<?php include 'dash.php'; | ||
|
||
/* read the json file contents */ | ||
|
||
$jsondata = file_get_contents('http://openstates.org/api/v1/legislators/?apikey=bcc2a830883c4f459dbffe94b2a3e90f&state=id'); | ||
|
||
//convert json object to php associative array | ||
$data = json_decode($jsondata, true); | ||
|
||
<?php include 'footer.php'; ?> | ||
/* get the legislator details | ||
// FIXXXXXX extra fields | ||
$suffix = $data['personal']['address']['streetaddress']; | ||
$nickname = $data['personal']['address']['city']; | ||
$website = $data['personal']['address']['postalcode']; | ||
$first_name = $data['first_name']; | ||
$last_name = $data['last_name']; | ||
$middle_name = $data['middle_name']; | ||
$district = $data['district']; | ||
$party = $data['party']; | ||
$active = $data['active']; | ||
$chamber = $data['chamber']; | ||
$photo_url = $data['photo_url']; | ||
$sql = "INSERT INTO lawmakers(first_name, last_name, middle_name, district, party, active, chamber, photo_url) | ||
VALUES('$first_name', '$last_name', '$middle_name', '$district', '$party', '$active', '$chamber', '$photo_url')"; | ||
if(!mysql_query($sql,$con)) | ||
{ | ||
die('Error inserting data: ' . mysql_error()); | ||
} | ||
} | ||
VALUES('".$item['first_name']."', '".$item['last_name']."', '".$item['middle_name']."', '".$item['district']."', '".$item['party']."', '".$item['active']."', '".$item['chamber']."', '".$item['photo_url']."'); | ||
*/ | ||
|
||
try { | ||
$dao = new Dao(); | ||
} catch (Exception $e) { | ||
var_dump($e); | ||
die; | ||
} | ||
|
||
//insert into mysql table | ||
saveJson($data); | ||
|
||
|
||
|
||
include 'footer.php'; ?> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,67 @@ | ||
new user account | ||
<?php | ||
$thisPage="New_Account"; | ||
include 'top.php'; ?> | ||
|
||
<div class="maincontainer"> | ||
|
||
<div class="dashboard"> | ||
<div class="dashhead" id="dashtop"> | ||
Legislative Dash | ||
</div> | ||
|
||
<div class="dashhead" id="login">Create new account</div> | ||
<div class="loginbox"> | ||
<form action="newuser.php" method="POST"> | ||
<div class="loginbox"> | ||
<input type="text" name="username" id="username" placeholder="Username" /> | ||
<input type="email" name="email" id="email" placeholder="Email" /> | ||
<input type="password" name="password" id="password" placeholder="Password"> | ||
<input type="text" name="username" id="username" placeholder="Username" /> | ||
<input type="text" name="username" id="username" placeholder="Username" /> | ||
<input type="text" name="username" id="username" placeholder="Username" /> | ||
</div> | ||
<input type="submit" value="Go"> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
<div class="billmain"> | ||
<div class="active"> | ||
<p>Most Active</p> | ||
<div class="billimage"><span>S 1081</span></div> | ||
<div class="lastaction">Passed Senate, 2/20/2015</div> | ||
<div class="billsummary">Summary: HEALTH CARE - Amends existing law to provide reserves and surplus requirements of public postsecondary educational institutions with a public postsecondary educational institution plan for health care benefits.</div> | ||
<div class="comments"> | ||
<div class="commentbox"> | ||
<form> | ||
<textarea name="comment" rows="4" placeholder="Write comments or testimony here, select pro, neutral or anti, and press Go."></textarea> | ||
<label>Yea or Nay?</label> | ||
<label> | ||
<input type="radio" name="vote" value="pro" /><img class="prolabel" src="images/thumbs_up.png" /> | ||
</label> | ||
<label class="neutrallabel"> | ||
<input type="radio" name="vote" value="neutral" />?</label> | ||
<label> | ||
<input type="radio" name="vote" value="anti" /><img class="antilabel" src="images/thumbs_down.png" /> | ||
</label> | ||
<input type="submit" value="Go" /> | ||
</form> | ||
</div> | ||
<div class="pro"> | ||
<span>Conrad says:</span> Best bill ever ... Lorem ipsum dolor sit amet, nobis suavitate iracundia ei his, ad nihil eirmod quo, viris temporibus qui eu. Et idque omnes instructior usu, qui ut posse everti lobortis, id his deserunt assentior. | ||
Quo oratio senserit te, verterem constituto usu ut. Te pro aeque equidem maluisset, ponderum consetetur sea no. At volutpat torquatos adipiscing est, tempor temporibus in cum. | ||
</div> | ||
<div class="neutral"> | ||
<span>Sarah says:</span> Could go either way... Lorem ipsum dolor sit amet, nobis suavitate iracundia ei his, ad nihil eirmod quo, viris temporibus qui eu. Et idque omnes instructior usu, qui ut posse everti lobortis, id his deserunt assentior. | ||
Quo oratio senserit te, verterem constituto usu ut. Te pro aeque equidem maluisset, ponderum consetetur sea no. At volutpat torquatos adipiscing est, tempor temporibus in cum. | ||
</div> | ||
<div class="anti"> | ||
<span>José says:</span> Impeach! Impeach! Lorem ipsum dolor sit amet, nobis suavitate iracundia ei his, ad nihil eirmod quo, viris temporibus qui eu. Et idque omnes instructior usu, qui ut posse everti lobortis, id his deserunt assentior. | ||
Quo oratio senserit te, verterem constituto usu ut. Te pro aeque equidem maluisset, ponderum consetetur sea no. At volutpat torquatos adipiscing est, tempor temporibus in cum. | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<?php include 'footer.php'; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters