Skip to content

Commit

Permalink
added kittens & friendly/pet (#75)
Browse files Browse the repository at this point in the history
* added .txt extention to Database_JobTables

* tried to remove commas from $typeofworkstring

* edit

* added files back to forlder

* added alice's part

* xxx

* Delete Database_JobTables.txt

* comma strip

* updated login page

not sure if it'll show up correctly because I couldn't get to run in on my computer... I tested it by changing it to html instead of php..

* minor change to login

* merge problems..

* userprofile.css small modification

* create.account ext rename

* updated createaccount.php

* error msg box added

* tooltip updates

* buttons for "text ok" added to forms

* volunteerform

* volunteerform textok

* removed <<<<<HEAD

* small change so add 1 to db if textok is checked

* Rename Database_JobTables.txt to Database_JobTables

* a

* Rename Database_JobTables to Database_JobTables.txt

* updateprofile.php

* able to submit update to profile

* auto populate city&county by zip

* restrict zip to CA

* Update reportform.php

* Update reportform.php

* fixed city problem

* city fix

* Update reportform.php

* display form on checkbox

* email tooltip

* minor form updates

* caregiver/feeder update

* Update script.js

* form update #2

* form update #3

* search.php: removed colony name & ear tipped

* db: removed colony name & ear tipped

* forgot to remove eartipped

* form updates #4

* minor changes

* found it

* added "are there any kittens"

* added friendly/pet
  • Loading branch information
vitadub authored and JustinLangshaw committed Oct 31, 2017
1 parent 01120a2 commit be8f926
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 35 deletions.
4 changes: 3 additions & 1 deletion sacferals/Database_creation_tables.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ CREATE TABLE ReportColonyForm (
ZipCode varchar(200),
AnyoneAttempted varchar(15),
ApproximateCats int,
Kittens varchar(15),
ColonyCareGiver varchar(15),
FeederDescription varchar(200),
Injured varchar(15),
InjuryDescription varchar(200),
FriendlyPet varchar(15),
ColonySetting varchar(200),
Comments varchar(200),
VolunteerResponding varchar(200),
Expand All @@ -57,7 +59,7 @@ CREATE TABLE ReportColonyForm (


INSERT INTO ReportColonyForm VALUES
('', '', '', 'NULL', '11/25/2013 10:30:37', 'NA', '[email protected]', '916-682-1883', 'NA', 'long address', 'city', 'county', 'zip', 'Yes', '5', 'No', 'neighbor', 'Yes', 'descrpition of injury', 'setting of colony', 'comments', 'responder', '4/26/2014', 'needed outcome', 'beat leader name', 'outcome', 'completion date');
('', '', '', 'NULL', '11/25/2013 10:30:37', 'NA', '[email protected]', '916-682-1883', 'NA', 'long address', 'city', 'county', 'zip', 'Yes', '5', 'No', 'No', 'neighbor', 'Yes', 'descrpition of injury', 'Yes', 'setting of colony', 'comments', 'responder', '4/26/2014', 'needed outcome', 'beat leader name', 'outcome', 'completion date');


CREATE TABLE VolunteerForm (
Expand Down
17 changes: 15 additions & 2 deletions sacferals/reportform.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ function formatPhone(phoneId) {
$zipcode = $_POST['zipcode'];
$trapattempt = $_POST['trapattempt'];
$numberofcats = $_POST['numberofcats'];
$kittens = $_POST['kittens'];
$injured = $_POST['recentlyinjured'];
$injurydescription = $_POST['injurydescription'];
$friendlypet = $_POST['friendlypet'];
$setting = $_POST['setting'];
$comments = $_POST['comments'];

Expand All @@ -81,8 +83,8 @@ function formatPhone(phoneId) {
if(preg_match($re, $firstname) )
{ //no need to check for duplicates
$query = "insert into ReportColonyForm values('', '', '', '', Now(), '$fullname', '$email', '$phone1', '$phone2',
'$colonystreet', '$city', '$county', '$zipcode', '$trapattempt[0]', '$numberofcats',
'$caregiver[0]', '$feederdescription', '$injured[0]', '$injurydescription', '$setting[0]', '$comments', '', '', '', '', '', '')";
'$colonystreet', '$city', '$county', '$zipcode', '$trapattempt[0]', '$numberofcats', '$kittens[0]',
'$caregiver[0]', '$feederdescription', '$injured[0]', '$injurydescription', '$friendlypet[0]', '$setting[0]', '$comments', '', '', '', '', '', '')";

mysqli_query($link, $query); //link query to database
echo "<script type='text/javascript'> document.location = 'formsubmitted.php'; </script>";
Expand Down Expand Up @@ -269,6 +271,13 @@ function formatPhone(phoneId) {

<b>*Approx # of Cats (including Kittens)</b><br>
<input type="number" name="numberofcats" min="1" max="99" id="numberofcats" required><br><br>
<b>If there are kittens, are they under 8 weeks old and nursing?</b>
<i class="tooltip"><img src="images/blue_question_mark.png" height="13px"/>
<span class="tooltiptext">Kitten Description<br>
Will be provided by SacFerals later.</span>
</i><br>
<input type="radio" name="kittens[]" value="Yes" id="kittensyes"> Yes<br>
<input type="radio" name="kittens[]" value="No" id="kittensno"> No<br><br>

<b>Injured or Pregnant Cats?</b>
<i class="tooltip"><img src="images/blue_question_mark.png" height="13px"/>
Expand All @@ -284,6 +293,10 @@ function formatPhone(phoneId) {
<textarea rows="4" cols="50" name="injurydescription"></textarea><br><br>
</div>

<b>Is the cat friendly or a pet?</b><br>
<input type="radio" name="friendlypet[]" value="Yes" id="friendlypetyes"> Yes<br>
<input type="radio" name="friendlypet[]" value="No" id="friendlypetno"> No<br><br>

<b>What is the setting of this colony?</b><br>
<input type="radio" name="setting[]" value="Residential" id="residentialsetting"> Residential<br>
<input type="radio" name="setting[]" value="Commercial" id="commercialsetting"> Commercial<br>
Expand Down
82 changes: 50 additions & 32 deletions sacferals/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@
<option value='ZipCode'>ZipCode</option>
<option value='AnyoneAttempted'>Anyone Attempted</option>
<option value='ApproximateCats'>Approximate Cats</option>
<option value='Kittens'>Kittens</option>
<option value='ColonyCareGiver'>Colony Caregiver</option>
<option value='FeederDescription'>Feeder Description</option>
<option value='Injured'>Injured/Pregnant</option>
<option value='InjuryDescription'>Injury Description</option>
<option value='FriendlyPet'>Friendly/Pet</option>
<option value='ColonySetting'>Colony Setting</option>
<option value='Comments'>Comments</option>
<option value='VolunteerResponding'>Volunteer Responding</option>
Expand Down Expand Up @@ -163,8 +165,8 @@
$result = mysqli_query($link, $query);
$row = mysqli_fetch_row($result);
list($Comments1, $Responder, $Status, $RecordNumber, $DateAndTime, $FullName, $Email, $Phone1, $Phone2, $ColonyAddress,
$City, $County, $ZipCode, $AnyoneAttempted, $ApproximateCats, $ColonyCareGiver, $FeederDescription,
$Injured, $InjuryDescription, $ColonySetting, $Comments, $VolunteerResponding, $ResponseDate, $CustNeedOutcome, $BeatTeamLeader,
$City, $County, $ZipCode, $AnyoneAttempted, $ApproximateCats, $Kittens, $ColonyCareGiver, $FeederDescription,
$Injured, $InjuryDescription, $FriendlyPet, $ColonySetting, $Comments, $VolunteerResponding, $ResponseDate, $CustNeedOutcome, $BeatTeamLeader,
$Outcome, $CompletionDate) = $row;


Expand Down Expand Up @@ -216,10 +218,12 @@
<th><a>Zip_Code</a></th>
<th><a>Anyone_Attempted</a></th>
<th><a>Approximate_Cats</a></th>
<th><a>Kittens</a></th>
<th><a>Colony_Caregiver</a></th>
<th><a>Feeder_Description</a></th>
<th><a>Injured/Pregnant</a></th>
<th><a>Injury_Description</a></th>
<th><a>Friendly/Pet</a></th>
<th><a>Colony_Setting</a></th>
<th><a>Comments</a></th>
<th><a>Volunteer_Responding</a></th>
Expand All @@ -242,8 +246,8 @@
while($row = mysqli_fetch_row($result))
{
list($Comments1, $Responder, $Status, $RecordNumber, $DateAndTime, $FullName, $Email, $Phone1, $Phone2, $ColonyAddress,
$City, $County, $ZipCode, $AnyoneAttempted, $ApproximateCats, $ColonyCareGiver, $FeederDescription,
$Injured, $InjuryDescription, $ColonySetting, $Comments, $VolunteerResponding, $ResponseDate, $CustNeedOutcome, $BeatTeamLeader,
$City, $County, $ZipCode, $AnyoneAttempted, $ApproximateCats, $Kittens, $ColonyCareGiver, $FeederDescription,
$Injured, $InjuryDescription, $FriendlyPet, $ColonySetting, $Comments, $VolunteerResponding, $ResponseDate, $CustNeedOutcome, $BeatTeamLeader,
$Outcome, $CompletionDate) = $row; // variables are set to current row
// then printed in one table row

Expand Down Expand Up @@ -311,10 +315,12 @@
<td><input type='text' name='ZipCode' value='$ZipCode'></td>
<td><input type='text' name='AnyoneAttempted' value='$AnyoneAttempted'></td>
<td><input type='text' name='ApproximateCats' value='$ApproximateCats'></td>
<td><input type='text' name='Kittens' value='$Kittens'></td>
<td><input type='text' name='ColonyCareGiver' value='$ColonyCareGiver'></td>
<td><input type='text' name='FeederDescription' value='$FeederDescription'></td>
<td><input type='text' name='Injured' value='$Injured'></td>
<td><input type='text' name='InjuryDescription' value='$InjuryDescription'></td>
<td><input type='text' name='FriendlyPet' value='$FriendlyPet'></td>
<td><input type='text' name='ColonySetting' value='$ColonySetting'></td>
<td><textarea name='Comments'>$Comments</textarea></td>
<td><input type='text' name='VolunteerResponding' value='$VolunteerResponding'></td>
Expand Down Expand Up @@ -365,10 +371,12 @@
<td id='zipCodeCol'>$ZipCode</td>
<td>$AnyoneAttempted</td>
<td>$ApproximateCats</td>
<td>$Kittens</td>
<td>$ColonyCareGiver</td>
<td>$FeederDescription</td>
<td>$Injured</td>
<td>$InjuryDescription</td>
<td>$FriendlyPet</td>
<td>$ColonySetting</td>
<td>$Comments</td>
<td>$VolunteerResponding</td>
Expand Down Expand Up @@ -413,10 +421,12 @@
$ZipCode = $_POST['ZipCode'];
$AnyoneAttempted = $_POST['AnyoneAttempted'];
$ApproximateCats = $_POST['ApproximateCats'];
$Kittens = $_POST['Kittens'];
$ColonyCareGiver = $_POST['ColonyCareGiver'];
$FeederDescription = $_POST['FeederDescription'];
$Injured = $_POST['Injured'];
$InjuryDescription = $_POST['InjuryDescription'];
$FriendlyPet = $_POST['FriendlyPet'];
$ColonySetting = $_POST['ColonySetting'];
$Comments = $_POST['Comments'];
$VolunteerResponding = $_POST['VolunteerResponding'];
Expand Down Expand Up @@ -497,8 +507,8 @@
FullName='$FullName', Email='$Email',
Phone1='$Phone1', Phone2='$Phone2', ColonyAddress='$ColonyAddress',
City='$City', County='$County', ZipCode='$ZipCode', AnyoneAttempted='$AnyoneAttempted',
ApproximateCats='$ApproximateCats', ColonyCareGiver='$ColonyCareGiver', FeederDescription='$FeederDescription',
Injured='$Injured', InjuryDescription='$InjuryDescription', ColonySetting='$ColonySetting', Comments='$Comments',
ApproximateCats='$ApproximateCats', Kittens='$Kittens', ColonyCareGiver='$ColonyCareGiver', FeederDescription='$FeederDescription',
Injured='$Injured', InjuryDescription='$InjuryDescription', FriendlyPet='$FriendlyPet', ColonySetting='$ColonySetting', Comments='$Comments',
VolunteerResponding='$VolunteerResponding', ResponseDate='$ResponseDate', CustNeedOutcome='$CustNeedOutcome',
BeatTeamLeader='$BeatTeamLeader', Outcome='$Outcome', CompletionDate='$CompletionDate' where RecordNumber='$RecordNumber1'";

Expand Down Expand Up @@ -579,10 +589,12 @@
<th><a href='search.php?sort=ZipCode'>Zip_Code</a></th>
<th><a href='search.php?sort=AnyoneAttempted'>Anyone_Attempted</a></th>
<th><a href='search.php?sort=ApproximateCats'>Approximate_Cats</a></th>
<th><a href='search.php?sort=Kittens'>Kittens</a></th>
<th><a href='search.php?sort=ColonyCareGiver'>Colony_Caregiver</a></th>
<th><a href='search.php?sort=FeederDescription'>Feeder_Description</a></th>
<th><a href='search.php?sort=Injured'>Injured/Pregnant</a></th>
<th><a href='search.php?sort=InjuryDescription'>InjuryDescription</a></th>
<th><a href='search.php?sort=FriendlyPet'>Friendly/Pet</a></th>
<th><a href='search.php?sort=ColonySetting'>Colony_Setting</a></th>
<th><a href='search.php?sort=Comments'>Comments</a></th>
<th><a href='search.php?sort=VolunteerResponding'>Volunteer_Responding</a></th>
Expand All @@ -604,8 +616,8 @@
while($row = mysqli_fetch_row($result))
{
list($Comments1, $Responder, $Status, $RecordNumber, $DateAndTime, $FullName, $Email, $Phone1, $Phone2, $ColonyAddress,
$City, $County, $ZipCode, $AnyoneAttempted, $ApproximateCats, $ColonyCareGiver, $FeederDescription,
$Injured, $InjuryDescription, $ColonySetting, $Comments, $VolunteerResponding, $ResponseDate, $CustNeedOutcome, $BeatTeamLeader,
$City, $County, $ZipCode, $AnyoneAttempted, $ApproximateCats, $Kittens, $ColonyCareGiver, $FeederDescription,
$Injured, $InjuryDescription, $FriendlyPet, $ColonySetting, $Comments, $VolunteerResponding, $ResponseDate, $CustNeedOutcome, $BeatTeamLeader,
$Outcome, $CompletionDate) = $row; // variables are set to current row
// then printed in one table row

Expand All @@ -625,18 +637,20 @@
$myArray[12]=$ZipCode;
$myArray[13]=$AnyoneAttempted;
$myArray[14]=$ApproximateCats;
$myArray[15]=$ColonyCareGiver;
$myArray[16]=$FeederDescription;
$myArray[17]=$Injured;
$myArray[18]=$InjuryDescription;
$myArray[19]=$ColonySetting;
$myArray[20]=$Comments;
$myArray[21]=$VolunteerResponding;
$myArray[22]=$ResponseDate;
$myArray[23]=$CustNeedOutcome;
$myArray[24]=$BeatTeamLeader;
$myArray[25]=$Outcome;
$myArray[26]=$CompletionDate;
$myArray[15]=$Kittens;
$myArray[16]=$ColonyCareGiver;
$myArray[17]=$FeederDescription;
$myArray[18]=$Injured;
$myArray[19]=$InjuryDescription;
$myArray[20]=$FriendlyPet;
$myArray[21]=$ColonySetting;
$myArray[22]=$Comments;
$myArray[23]=$VolunteerResponding;
$myArray[24]=$ResponseDate;
$myArray[25]=$CustNeedOutcome;
$myArray[26]=$BeatTeamLeader;
$myArray[27]=$Outcome;
$myArray[28]=$CompletionDate;

$myArray1[0]="Comments1";
$myArray1[1]="Responder";
Expand All @@ -653,18 +667,20 @@
$myArray1[12]="ZipCode";
$myArray1[13]="AnyoneAttempted";
$myArray1[14]="ApproximateCats";
$myArray1[15]="ColonyCareGiver";
$myArray1[16]="FeederDescription";
$myArray1[17]="Injured";
$myArray1[18]="InjuryDescription";
$myArray1[19]="ColonySetting";
$myArray1[20]="Comments";
$myArray1[21]="VolunteerResponding";
$myArray1[22]="ResponseDate";
$myArray1[23]="CustNeedOutcome";
$myArray1[24]="BeatTeamLeader";
$myArray1[25]="Outcome";
$myArray1[26]="CompletionDate";
$myArray1[15]="Kittens";
$myArray1[16]="ColonyCareGiver";
$myArray1[17]="FeederDescription";
$myArray1[18]="Injured";
$myArray1[19]="InjuryDescription";
$myArray1[20]="FriendlyPet";
$myArray1[21]="ColonySetting";
$myArray1[22]="Comments";
$myArray1[23]="VolunteerResponding";
$myArray1[24]="ResponseDate";
$myArray1[25]="CustNeedOutcome";
$myArray1[26]="BeatTeamLeader";
$myArray1[27]="Outcome";
$myArray1[28]="CompletionDate";

print "
<tr>
Expand Down Expand Up @@ -725,10 +741,12 @@
<td id='zipCodeCol'>$ZipCode</td>
<td>$AnyoneAttempted</td>
<td>$ApproximateCats</td>
<td>$Kittens</td>
<td>$ColonyCareGiver</td>
<td>$FeederDescription</td>
<td>$Injured</td>
<td>$InjuryDescription</td>
<td>$FriendlyPet</td>
<td>$ColonySetting</td>
<td>$Comments</td>
<td>$VolunteerResponding</td>
Expand Down

0 comments on commit be8f926

Please sign in to comment.