text:
<file_sep><?php

// YOU NEED TO ADD COMMENTS TO THESE FILES TOO!!!

require_once 'config.php';

$htmlOutput = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

  if (isset($_GET['username'])) {
    $username = htmlspecialchars(trim($_GET['username']));

  //get information from Database
  //SELECT itemId, Bids.ItemName, imageMime, imageData, max(amount) FROM Bids, Item WHERE BidderUName = 'hfranceschi' and Item.id = Bids.itemId group by itemId
  //$sql = "SELECT itemId, Bids.ItemName, imageMime, imageData, max(amount) FROM Bids, Item WHERE BidderUName = '$username' and Item.id = Bids.itemId group by itemId";
  $sql = "SELECT itemId, ItemName, max(amount) as amount FROM Bids WHERE BidderUName = '$username' group by itemId";

      $result = $mysqli->query($sql);
    echo $mysqli->error;
    if ($result->num_rows > 0) {

      $resultArray = '[';
      $tempArray= array();

      while($row=$result->fetch_assoc())
      {
      $tempArray = $row;
      $resultArray.=json_encode($tempArray).',';// $tempArray);
      echo $resultsArray;
      }

      $resultArray = substr($resultArray, 0, -1);
      $resultArray.=']';
       echo $resultArray;
  }
  }

  echo $htmlOutput;

?>
<file_sep>
<?php

session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';

$_SESSION["charityNotice"] = False;
$htmlOutput = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

#echo "Connected successfully";
#INSERT INTO `Item`(`auctionNameRef`, `itemName`, `description`, `startingBid`, `minimumBidInc`, `charityName`, `itemPic`)

$charity = array($_POST["OrgName"],$_POST["RepName"],$_POST["PhoneNumber"],$_POST["email"],$_POST["Address"]);
#$charity = array("<EMAIL>","Herve","Franceschi","hjfranceschi","<PASSWORD>");
# user should be from form
#| <EMAIL> | Herve | Franceschi | <PASSWORD>chi | <PASSWORD>

  $sql .= 'INSERT INTO Charity (orgName, repName, phoneNumber, email, address) VALUES'; #TODO: add itemPic

  $charity[0] = htmlspecialchars(trim($charity[0]));
  $charity[1] = htmlspecialchars(trim($charity[1]));
  $charity[2] = htmlspecialchars(trim($charity[2]));
  $charity[3] = htmlspecialchars(trim($charity[3]));
  $charity[4] = htmlspecialchars(trim($charity[4]));
  $sql .= '("'.$charity[0].'","'.$charity[1].'","'.$charity[2].'","'.$charity[3].'","'.$charity[4].'")';
  $sql .= ";";
  if ($mysqli->query($sql) === TRUE) {
      $htmlOutput .= "Charity added successfully";
  }
  else{
    $htmlOutput .= "Insertion Failed: ".$sql. $mysqli->error;

  }
  $_SESSION["charityNotice"] = True;

$htmlOutput .= " Charity: ".$charity[1];
$_SESSION["charityMessage"] = $htmlOutput;
header("Location: http://jorochial.cs.loyola.edu/html/Charity/CharitiesDashboard.php");
exit;
?>
<file_sep><?php

require_once 'config.php';

$htmlOutput = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

//Select auction currently running from server
$sql = "SELECT * FROM Auction WHERE startTime < now()  and endTime > now()";

$result = $mysqli->query($sql);

$resultArray = '[';
$tempArray= array();

$row=$result->fetch_assoc();
$tempArray = $row;
$resultArray.=json_encode($tempArray);// $tempArray);
$resultArray.=']';
 echo $resultArray;
?>
<file_sep>package com.example.cmaalouf.uxauction;

public class BidFetchData {
}
<file_sep><!DOCTYPE html>
<?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}

require_once '../config.php';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

if (isset($_SESSION["auctionNotice"])) {
    if ($_SESSION["auctionNotice"] == true) {
        $alert =  '

        '.$_SESSION["auctionMessage"].'
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      ×
      </button>

';
    } else {#($_SESSION["auctionNotice"] == False){
        $alert =  '

       '.$_SESSION["auctionMessage"].'
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      ×
      </button>

';
    }
}

if(!isset($_GET["page"])){
  $pageNumber = 1;
}
else {
  $pageNumber = $_GET["page"];
  if($pageNumber < 1){
    $pageNumber = 1;
    $_GET["page"] = 1;
  }
}

function auctionCard($id, $title, $description, $charity, $start, $end) {
  #TODO: Change hard coded picture to link
  return '

'.$title.'

'.$description.'

Beneficary: '.$charity.'

Start Date and Time: '.date("l jS \of F Y h:i:s A",strtotime( $start)).'

End Date and Time: '.date("l jS \of F Y h:i:s A",strtotime($end)).'

      More Details

';
}

function auctionGrid($pageNum, $mysqli){
  $htmlResult = "";
  $startRow = ($pageNum-1)*4;
  $sql = "SELECT * from Auction order by id LIMIT $startRow , 4";
  $result = $mysqli->query($sql);
  echo $mysqli->error;
  while( $row = $result->fetch_assoc( ) ){
     $htmlResult .= auctionCard($row["id"],$row["auctionName"],$row["description"], $row['beneficary'],$row["startTime"],$row["endTime"]);
  }
  return $htmlResult;
}

?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../css/SASS/AuctionProject.css">

    <title>Dashboard</title>

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

      </button>

            Dashboard(current)

              Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="../search.php">

          <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

        All Items
        Auctions
        Donors
        Charities
        Results Summary

      <form class="form-inline md-form form-lg " method="GET" action="searchAuctions.php">
        <input type="text" id="inputLGEx" class="col-10 form-control form-control-lg" placeholder="Search for an existing auction" name="query">
        <input class="col btn btn-lg btn-primary" type="submit" value="Submit">

      </form>

        <?php echo auctionGrid($pageNumber, $mysqli);?>

<a class="page-link" href="AuctionDashboard.php?page=<?php echo $pageNumber-1;?>">Previous

1

2

3

<a class="page-link" href="AuctionDashboard.php?page=<?php echo $pageNumber+1;?>">Next

 Contact Us

Main Campus

          4501 N. Charles Street

          Baltimore, MD 21210

          410-617-2000 or 1-800-221-9107

          Timonium Graduate Center

          2034 Greenspring Drive

          Timonium, MD 21093

          410-617-1903

          Columbia Graduate Center

          8890 McGaw Road

          Columbia, MD 21045

          410-617-7600

<file_sep><?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../css/SASS/AuctionProject.css">

    <title>Add Donor</title>

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

      </button>

            Dashboard(current)

              Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="../search.php">

          <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

      Add Charity
      Create Auction
       Add Donor
      Add an Item
      Results Summary

Add Donor to the System

      <form class="needs-validation" action="insertDonor.php" method="post" novalidate>

          Organization's Name
          <input type="text" class="form-control" id="OrgName" name="OrgName" placeholder="My Organization" required>

          Reprenstative's Name
          <input type="text" class="form-control" id="RepName" name="RepName" placeholder="<NAME>" required>

          Phone Number
          <input type="text" class="form-control" id="PhoneNumber" name="PhoneNumber" placeholder="+1 555-555-5555" required>

          Email
          <input type="email" class="form-control" id="email" name="email" placeholder="<EMAIL>" required>

          Address:
          <textarea class="form-control" id="Address" name="Address" rows="3" required></textarea>

          <button class="btn btn-primary mt-3 mt-md-0" type="submit" name="submit">Submit</button>

      </form>

 Contact Us

Main Campus

          4501 N. Charles Street

          Baltimore, MD 21210

          410-617-2000 or 1-800-221-9107

          Timonium Graduate Center

          2034 Greenspring Drive

          Timonium, MD 21093

          410-617-1903

          Columbia Graduate Center

          8890 McGaw Road

          Columbia, MD 21045

          410-617-7600

<file_sep>package com.example.cmaalouf.uxauction;
/**
 * Write Author Names!!
 */
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.sql.*;

public class Auction
{
    private ArrayList<Item> itemsInAuction;
    /*
    In order to keep track of how much each donor makes at the end of the auction,
    as well as how much total money was raised, the auction needs to keep track of each donor
    and what items they donated. To do this, the auction holds a map of donors associated
    with the items they donated.
     */
    private HashMap<Integer, Item> mapOfItems;
    private int startTime;
    private int endTime;
    private Charity beneficiary;
    private String json;
    private String access ="https:mysql://cs-database.cs.loyola.edu/jorochial";
    private String user = "?user=cmmaalouf&password=<PASSWORD>";
    private String time = "&serverTimezone=UTC";

    public Auction(int startTime, int endTime, ArrayList<Item> itemsInAuction)
    {
        this.startTime = startTime;
        this.endTime = endTime;
        this.beneficiary = beneficiary;
        this.itemsInAuction = itemsInAuction;
        mapOfItems = new HashMap<>();
        for(Item newItem : itemsInAuction)
        {
         mapOfItems.put(newItem.id,newItem);
        }

        //makeAuctionItems(json);

    }

//HEAD
    /**
     * Purpose: Add an item to the auction
     * @param itemToAdd the item to add
     * @param donor the donor of the item to add
     */
    public void addItem(Item itemToAdd, Donor donor)
    {
        //Update the map of donors associated with items
        Set<Item> itemsDonatedByThisDonor = donor.getItemsDonated();
        if(itemsDonatedByThisDonor == null)
        {
            itemsDonatedByThisDonor = new HashSet<>();
            //mapOfItems.put(donor, itemsDonatedByThisDonor);
        }

        itemsDonatedByThisDonor.add(itemToAdd);
        //mapOfItems.put(donor, itemsDonatedByThisDonor);

        //add to the list of items in the auction
        itemsInAuction.add(itemToAdd);

    }

    /**
     * Purpose: Remove an item from the auction
     * @param itemToDelete the item to delete
     * @param donor the donor of the deleted item
     */
    /*public void deleteItem(Item itemToDelete, Donor donor)
    {
        //update the map of donors associated with items
        Set<Item> itemsDonatedByThisDonor = donor.getItemsDonated();

        if(itemsDonatedByThisDonor != null)
        {
            mapOfItems.remove(donor, itemsDonatedByThisDonor);
        }

        //update the list of items in the auction
        itemsInAuction.remove(itemToDelete);
    }*/

    /**
     * Make items based off data from the server
     * @param jsonData the data to read in to make the items
     */
   /* protected void makeAuctionItems(String jsonData) {
        try {
            JSONArray jsonArray = new JSONArray(jsonData);
            for (int i = 0; i < jsonArray.length(); i++) {
                JSONObject jsonObject = (JSONObject) jsonArray.get(i);
                String name = jsonObject.get("itemName").toString();
                String desc = jsonObject.get("description").toString();
                String donor = jsonObject.get("donorName").toString();
                Double startingBid = Double.valueOf(jsonObject.get("startingBid").toString());
                Double minInc = Double.valueOf(jsonObject.get("minimumBidInc").toString());
                Item item = new Item(name, desc, startingBid, minInc, donor);
                itemsInAuction.add(item);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }*/

    /**
     * Purpose: Give other classes, namely the system, access to an auctions list of items
     * @return the list of items in the auction
     */
    public ArrayList<Item> getItemsInAuction()
    {
        return this.itemsInAuction;
    }

    /**
     * Purpose: Give other classes access to the map of item Ids associated with their items
     * @return the map of donors associated with their items
     */
    public HashMap<Integer, Item> getmapOfItems()
    {
        return this.mapOfItems;
    }

    //TO DO, not sure what this would like
    //public void editItem(){}

    //TO DO, not sure what this would like
//    public Item searchItem()
//    {
//
//    }

    //NEEDS TO BE CHANGED PROBABLY
    public void setTimeLeft(int timeLeft)
    {
        System.out.println("Countdown: " + timeLeft);
    }

    //notifyBidderOutBid and notfiyBidderWinner require the ability to use java to send emails
}
<file_sep><?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " . $mysqli->connect_error);
}

if(isset($_GET["id"])){
$sql = "SELECT * FROM Item WHERE id = ". $_GET["id"];

$result = $mysqli->query($sql);
$row = $result->fetch_assoc( );

$item_title = $row["itemName"];
$item_auction = $row["auctionNameRef"];
$item_description = $row["description"];
$item_current_bid= $row["currentBid"];
$item_starting_bid= $row["startingBid"];
$item_minimum_inc = $row["minimumBidInc"];
$item_donor = $row["donorName"];
#TODO: use pic from DB also Picture file ... url for now
$item_picture = "https://i.etsystatic.com/10797882/r/il/00ee9c/1373183800/il_794xN.1373183800_3udm.jpg";
}
else{
  $item_title = "Chessboard TEST";
  $item_auction = "Rendevous Haiti";
  $item_description = "This chessboard was owned by King George back in 1945, seeing use by over three generations of royal family. It was sold to the French after the Battle of 1765 and was gifted to the King after the former owner when in against a Sicilian when death was on the line.";
  $item_current_bid= 1000.00;
  $item_starting_bid= 500.00;
  $item_minimum_inc = 100.02;
  $item_donor = "The Royal Family";
  #also Picture file ... url for now
  $item_picture = "https://i.etsystatic.com/10797882/r/il/00ee9c/1373183800/il_794xN.1373183800_3udm.jpg";
}
?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../css/SASS/AuctionProject.css">

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

      </button>

            Dashboard(current)

              Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="../search.php">

          <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

Edit Item from Auction

      <form class="needs-validation" method="POST" action="updateItem.php" novalidate>
        <input type="hidden" class="invisible" name="ItemId" value="<?php echo $_GET['id'];?>">

          Auction:
          <select class="form-control" id="ItemAuction" name="ItemAuction">
            <?php
            $sql = $mysqli->query("SELECT * FROM Auction");
            while ($row2 = $sql->fetch_assoc()){
              if($row2['auctionName'] == $row['auctionNameRef']){
                echo '<option selected value="'.$row2['auctionName'].'">' . $row2['auctionName'] . '</option>';
              }
              else{
              echo '<option value="'.$row2['auctionName'].'">' . $row2['auctionName'] . '</option>';
                }
            }
            ?>
          </select>

          Item Title
          <input type="text" class="form-control" id="ItemTitle" name="ItemTitle" value="<?php echo $item_title ?>" required>

          Description:
          <textarea class="form-control" name="ItemDescription" id="ItemDescription" name="ItemDescription" rows="3" required><?php echo $item_description ?></textarea>

            Starting Bid:
            <input type="number" class="form-control" id="ItemStartingBid" name="ItemStartingBid" value="<?php echo $item_starting_bid ?>" step="0.01" min="0"  required>

            Minimum Bid Increment:
            <input type="number" class="form-control" id="ItemMinIncrement" name="ItemMinIncrement" value="<?php echo $item_minimum_inc ?>" step="0.01" min="0" required>

          Picture:

            <input type="file" class="custom-file-input" id="ItemPicture" name="ItemPicture" onchange="changeLabel( this )" required>
            Choose file

          <button class="btn btn-info mt-3 mt-md-0" type="submit" name="update">Update</button>
          <button class="btn btn-danger mt-3 mt-md-0" type="button" name="delete" data-toggle="modal" data-target="#DeleteModal">Delete</button>

      </form>

Are you sure you want to delete this item?

            <button type="button" class="close" data-dismiss="modal" aria-label="Close Delete Box" aria-hidden="true">×</button>

This action cannot be undone.

            <form class = "m-0" method="POST" action="deleteItem.php" novalidate>
            <input type="hidden" class="invisible" name= "itemId" value="<?php echo $_GET["id"]?>">
            <input type="submit" value="Delete" class="btn btn-danger">
          </form>
            <button type="button" class="btn btn-outline-info" data-dismiss="modal" aria-label="Close Delete Box" aria-hidden="true" id="buttonClose">Close</button>

 Contact Us

Main Campus

          4501 N. Charles Street

          Baltimore, MD 21210

          410-617-2000 or 1-800-221-9107

          Timonium Graduate Center

          2034 Greenspring Drive

          Timonium, MD 21093

          410-617-1903

          Columbia Graduate Center

          8890 McGaw Road

          Columbia, MD 21045

          410-617-7600

<file_sep><?php

// NEED TO ADD COMMENTS TO THE PHP FILES

session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';

$_SESSION["adminAdd"] = False;
$htmlOutput = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

#echo "Connected successfully";
$user = array($_POST["newAdminEmail"],$_POST["newAdminFirstName"],$_POST["newAdminLastName"],$_POST["newAdminUsername"],$_POST["newAdminPassword"]);
#$user = array("<EMAIL>","Herve","Franceschi","hjfranceschi","password");
# user should be from form
#| <EMAIL> | Herve | Franceschi | hjfranceschi | password
if ($_POST["newAdminPassword"] == $_POST["newPassword2"]){
  $sql .= 'INSERT INTO admin(email, fname, lname, uname, pwd) VALUES';

  $user[0] = htmlspecialchars(trim($user[0]));
  $user[1] = htmlspecialchars(trim($user[1]));
  $user[2] = htmlspecialchars(trim($user[2]));
  $user[3] = htmlspecialchars(trim($user[3]));
  $user[4]= password_hash(htmlspecialchars(trim($user[4])), PASSWORD_DEFAULT);
  $sql .= '("'.$user[0].'","'. $user[1] .'","'. $user[2] .'","'. $user[3] .'","'. $user[4] .'")';
  $sql .= ";";
  #echo $sql;
  if ($mysqli->query($sql) === TRUE) {
      $htmlOutput .= "Users added successfully";
  }
  else{
    $htmlOutput .= "Insertion Failed: ". $mysqli->error;

  }
  #echo $htmlOutput;
  $_SESSION["adminAdd"] = True;
}
else {
  #echo "vaildation fail";
  $_SESSION["adminAdd"] = False;
}
$htmlOutput = " Username: ".$user[3];
$_SESSION["adminMessage"] = $htmlOutput;
header("Location: http://jorochial.cs.loyola.edu/html/Settings.php");
exit;
?>
<file_sep>package com.example.cmaalouf.uxauction;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

public class AuctionTest {

    Auction auction;
    String itemName;
    String json ;
    String json2;
    @Before
    public void beforeTest(){
        auction = new Auction(1,1,null);
        itemName ="Chessboard";
        json = "[{\"id\":\"0\",\"itemName\":\"Chessboard\",\"description\":\"" +
                "This chessboard was owned by King George back in 1945, seeing use by over three generations of royal family.\",\"" +
                "startingBid\":\"1000.00\",\"minimumBidInc\":\"100.00\",\"currentBid\":\"500.00\",\"donorName\":\"The Hat Store\"" +
                ",\"auctionNameRef\":\"The Best Auction\",\"imageName\":null,\"imageMime\":null,\"imageData\":null},";
        json2 = "{\"id\":\"0\",\"itemName\":\"Chessboard\",\"description\":\"" +
                "This chessboard was owned by King George back in 1945, seeing use by over three generations of royal family.\",\"" +
                "startingBid\":\"1000.00\",\"minimumBidInc\":\"100.00\",\"currentBid\":\"500.00\",\"donorName\":\"The Hat Store\"" +
                ",\"auctionNameRef\":\"The Best Auction\",\"imageName\":null,\"imageMime\":null,\"imageData\":null}]";
    }

    @After
    public void tearDown() throws Exception{
        auction =null;
    }

    @Test
    public void makeAuctionItems() {
        auction.makeAuctionItems(json+json2);
        assertTrue(auction.getItemsInAuction()!=null);
        assertTrue(auction.getItemsInAuction().size()!=0);
        assertEquals(auction.getItemsInAuction().get(0).name,itemName);

    }

    @Test
    public void getItemsInAuction() {
        auction.makeAuctionItems(json);
        assertTrue(auction.getItemsInAuction()!=null);
        assertEquals(auction.getItemsInAuction().get(0).name,itemName);
    }

    @Test
    public void setTimeLeft() {
        int a = 1;
        assertEquals(a,1);
    }

}<file_sep><!DOCTYPE html>
<?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: index.php");
  exit();
}
?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../css/SASS/AuctionProject.css">

    <title>Host an Event</title>

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

      </button>

            Dashboard(current)

              Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="search.php">

          <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

        Add Charity
        Create Auction
         Add Donor
        Add an Item
        Results Summary

Host an Event!

Follow these steps to setup your next event.

Add the Charity to benefit.

Input the Auction details.

Add the  Donor's information.

Add the Items that have been donated.

Run Your Event with our Andriod Application.

Review Your Results!

 Contact Us

Main Campus

          4501 N. Charles Street

          Baltimore, MD 21210

          410-617-2000 or 1-800-221-9107

          Timonium Graduate Center

          2034 Greenspring Drive

          Timonium, MD 21093

          410-617-1903

          Columbia Graduate Center

          8890 McGaw Road

          Columbia, MD 21045

          410-617-7600

<file_sep><?php

require_once 'config.php';

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

session_start();
//check if already logged in
 if(isset($_SESSION["login"]) && $_SESSION["login"] === true){
     header("location: Item/DashboardPage.php");
     exit();
}

//check if redirected from secure
$alertHTML = "";
if(isset($_SESSION["secure_Attempt"]) && $_SESSION["secure_Attempt"] === true){
    $_SESSION["secure_Attempt"]= "false";
    $alertHTML = "
Please login to access the site.<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">
    ×
  </button>
";

}

if (isset($_SESSION["loggedOut"])) {
    if ($_SESSION["loggedOut"] == true) {
        $alertHTML =  '

        Logged Out Successfully.
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      ×
      </button>

';
    } else {#($_SESSION["itemNotice"] == False){
        $alertHTML =  '

       Log out not successful.
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      ×
      </button>

';
    }
}

$passwordClass = $userClass = 'class="form-control"';

//retrieve user entered information from form
$username = $password = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {
  $username = htmlspecialchars(trim($_POST['username']));
  $password = htmlspecialchars(trim($_POST['password']));

  if ($password == "" || $username == ""){
    $passwordClass = $userClass = 'class="form-control is-invalid"';
    exit();
  }

  //get information from Database
  $sql = 'SELECT * FROM admin WHERE uname = "' . $username . '";';
  $result = $mysqli->query($sql);

  if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
      if ($username == $row["uname"]){
        //verify Password
        if (password_verify($password, $row["pwd"])){
          $_SESSION["login"] = true;
          header("location: Item/DashboardPage.php");
          exit();
        }else{
          $_SESSION["login"] = false;
          $passwordClass = $userClass = 'class="form-control is-invalid"';
        }
      }
      }
  }  else{
    echo $mysqli->connect_error;
    $userClass = $passwordClass= 'class="form-control is-invalid"';
  }
}
$mysqli->close();
?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../css/SASS/AuctionProject.css">

      AuctionForHaiti

Login to Auction Manager

          <?php echo $alertHTML ?>

          <form class="needs-validation" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>" method="POST" novalidate>
            Username:
            <input type="text" <?php echo $userClass; ?> <?php echo 'value="'.$username.'"'?> name="username" id="username" required>
            Password
            <input type="password" <?php echo $passwordClass; ?> name="password" id="password" required>

Username or Password incorrect. Forgot Your Password?

            <input class="btn btn-primary mt-3" type="submit" value="Login">
          </form>

 Contact Us

Main Campus

          4501 N. Charles Street

          Baltimore, MD 21210

          410-617-2000 or 1-800-221-9107

          Timonium Graduate Center

          2034 Greenspring Drive

          Timonium, MD 21093

          410-617-1903

          Columbia Graduate Center

          8890 McGaw Road

          Columbia, MD 21045

          410-617-7600

<file_sep>package com.example.cmaalouf.uxauction;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.ImageView;
import android.widget.TextView;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class Adapter extends RecyclerView.Adapter<Adapter.ViewHolder>  implements Filterable{

    private LayoutInflater layoutInflater;
    private ArrayList<Item> data;
    private ArrayList<Item> fullList;

    Adapter(Context context, ArrayList<Item> data){
        this.layoutInflater = LayoutInflater.from(context);
        this.data = data;
        Log.w("adapter items size",""+data.size());
        fullList = new ArrayList<>(data);
    }

    /**
     * Purpose: method for RecycleView.ViewHolder to call when it needs a new ViewHolder to
     * represent an item.
     * @param viewGroup the group to add the new view to
     * @param viewType  the type of new view
     * @return the new ViewHolder that holds the new view
     */
    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType) {
        View view = layoutInflater.inflate(R.layout.search_item_view,viewGroup, false);
        return new ViewHolder(view);

    }

    /**
     * Purpose: Display data located at a position in the data set
     * @param holder the ViewHolder to be updated to represent the contents of the item
     * @param position the position of the item within the data set
     */
    @Override
    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
        //bind the text view wiht the data recieved
        Item item = data.get(position);
        Log.w("items bitmap in adapter", item.image+"");
        holder.textTitle.setText(item.name);
        holder.textId.setText(""+item.id);
        //holder.itemImage.setImageDrawable(this.getResources().getDrawable(R.drawable.bike));
        holder.itemImage.setImageBitmap(item.image);
        //holder.itemImage.setBackground();

        //similarly you can set new image for each card and description
    }

    /**
     * Purpose: give other classes access to the size of this data set
     * @return the total number of items in the adapter
     */
    @Override
    public int getItemCount() {
        return data.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder{
        TextView textTitle, textId;
        ImageView itemImage;
        public ViewHolder(@NonNull View itemView)
        {
            super(itemView);
            textTitle = itemView.findViewById(R.id.itemTitle);
            itemImage = itemView.findViewById(R.id.itemPicture);
            textId = itemView.findViewById(R.id.itemid);
        }

    }

    /**
     * Purpose: give other classes access to the filter
     * @return the filter to filter data
     */
    @Override
    public Filter getFilter(){
        return examplerFilter;
    }

    private Filter examplerFilter = new Filter(){
        @Override
        /**
         * Purpose: filter data based on given constraints
         * @param constraint the constraint to filter by
         * @return the filtered data
         */
        protected FilterResults performFiltering(CharSequence constraint){
            List<Item> filteredList = new ArrayList<>();
            if(constraint==null || constraint.length()==0){
                filteredList.addAll(fullList);
            }else{
                String filterPattern = constraint.toString().toLowerCase().trim();
                for (Item myItem:fullList){
                    if(myItem.name.toLowerCase().contains(filterPattern)){
                        filteredList.add(myItem);
                    }
                    else if(myItem.description.toLowerCase().contains(filterPattern)){
                        filteredList.add(myItem);
                    }
                }
            }

            FilterResults results = new FilterResults();
            results.values = filteredList;
            return results;
        }
        /**
         * Purpose: publish the filtered data
         * @param constraint the constraint to filter
         * @param results the results of the filtering
         */
        @Override
        protected void publishResults(CharSequence constraint,FilterResults results){
            data.clear();
            data.addAll((List) results.values);
            notifyDataSetChanged();
        }
    };
}
<file_sep><?php
require_once 'config.php';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
//Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

$sql = "SELECT auctionName FROM Auction WHERE startTime < now() and endTime > now() LIMIT 0, 1";

$result1 = $mysqli->query($sql);

$row1=$result1->fetch_assoc();

$sql = "SELECT id,itemName, description, startingBid, minimumBidInc, currentBid, donorName, auctionNameRef FROM Item where auctionNameRef = \"".$row1['auctionName']."\" order by itemName;";
$result = $mysqli->query($sql);

$resultArray = '[';
$tempArray= array();
echo $resultArray;
while($row=$result->fetch_assoc())
{
$tempArray = $row;
$resultArray=json_encode($tempArray).',';// $tempArray);
echo $resultArray;
}

$resultArray = substr($resultArray, 0, -1);
$resultArray.=']';
 echo $resultArray;
//echo $resultArray;
?>
<file_sep><!DOCTYPE html>

    <meta charset="utf-8">
    <title>imagesTool.php</title>

<?php
//Creates PDO object for database connection
$dbh = new PDO("mysql:host=cs-database.cs.loyola.edu;dbname=jorochial", "jbennett", "1670682");
if (isset($_POST['btn'])) {
  // Insert values and encoding for data in blob typing
  $name = $_FILES['myfile']['name'];
  $type = $_FILES['myfile']['type'];
  $data = file_get_contents($_FILES['myfile']['tmp_name']);
  $stmt = $dbh->prepare("insert into myblob values ('', ?, ?, ? )");
  $stmt->bindParam(1,$name);
  $stmt->bindParam(2,$type);
  $stmt->bindParam(3,$data);
  $stmt->execute();
}
?>

<form method="post" enctype="multipart/form-data">
  <input type="file" name="myfile"/>
  <button name="btn">Upload</button>
</form>

<?php
$stat = $dbh->prepare("select * from myblob");
$stat->execute();
while($row = $stat->fetch()){

  //Outputs to user the list of images, link data for download, translates blob data into
  //  browser image
  echo "
".$row['name']."

  <embed src='data:".$row['mime'].";base64," .base64_encode($row['data'])."' width='200'/>
";
}
?>

<file_sep><?php

require_once 'config.php';

$htmlOutput = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

#echo "Connected successfully";
$sql = "SELECT max(amount) as amount FROM Bids WHERE itemId = ". $_GET["itemId"];
$result = $mysqli->query($sql);
echo $mysqli->error;
$row = $result->fetch_assoc();

$resultArray = '[';
$tempArray= array();

$tempArray = $row;
$resultArray.=json_encode($tempArray).',';// $tempArray);

$resultArray = substr($resultArray, 0, -1);
$resultArray.=']';
 echo $resultArray;

?>
<file_sep><?php
//Utilizes techniques from Code Tube PDO object Blob work
//All in all allows for down load of image theoretically if separated
$dbh = new PDO("mysql:host=cs-database.cs.loyola.edu;dbname=jorochial", "jbennett", "1670682");
$id = isset($_GET['id'])? $_GET['id'] : "";
$stat = $dbh->prepare("select * from myblolb where id=?");
$stat->bindParam(1, $id);
$stat->execute();
$row = $stat->fetch();
header('Content-Type:' .$row['mime']);
echo $row['data'];
?>
<file_sep><?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: index.php");
  exit();
}
?>

  <link rel="stylesheet" href="../css/SASS/AuctionProject.css">

  AuctionForHaiti
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

  </button>

        Dashboard(current)

          Host an Event

        Settings

        Logout

    <form class="form-inline" method="get" action="search.php">
      <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
      <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
    </form>

<file_sep>
<?php

session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';

$_SESSION["itemNotice"] = False;
$htmlOutput = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

#echo "Connected successfully";
#INSERT INTO `Item`(`auctionNameRef`, `itemName`, `description`, `startingBid`, `minimumBidInc`, `donorName`, `itemPic`)
$item = array($_POST["ItemAuction"],$_POST["ItemTitle"],$_POST["ItemDescription"],$_POST["ItemStartingBid"],$_POST["ItemMinIncrement"],$_POST["ItemDonor"]);
#$item = array("<EMAIL>","Herve","Franceschi","hjfranceschi","<PASSWORD>");
# user should be from form
#| <EMAIL> | Herve | Franceschi | <PASSWORD> | password
if (true){

  $sql .= 'INSERT INTO Item (auctionNameRef, itemName, description, startingBid, minimumBidInc, donorName, imageName, imageMime, imageData) VALUES'; #TODO: add itemPic

  $item[0] = htmlspecialchars($item[0]);
  $item[1] = htmlspecialchars(trim($item[1]));
  $item[2] = htmlspecialchars(trim($item[2]));
  $item[3] = htmlspecialchars(trim($item[3]));
  $item[4] = htmlspecialchars(trim($item[4]));
  $item[5] = htmlspecialchars(trim($item[5]));
#  $item[6] = htmlspecialchars(trim($item[6]));
  //$sql .= '("'.$item[0].'","'. $item[1] .'","'. $item[2] .'",'. $item[3] .','. $item[4] .',"'. $item[5]. '")';
  $filefullname = $_FILES['ItemPicture']['name'];
  $filetype = $_FILES['ItemPicture']['type'];
  $filedata = file_get_contents($_FILES['ItemPicture']['tmp_name']);
  $filedata = base64_encode($filedata);

  $sql .= "(\"$item[0]\",\"$item[1]\",\"$item[2]\", $item[3] , $item[4] ,\"$item[5]\",\"$filefullname\",\"$filetype\"";
  $sql .= ", \" $filedata \");";
  //$sql .= ",\" $filedata\");";
  //echo sql;
  if ($item[5] == "NULL"){
    $sql = "INSERT INTO Item (auctionNameRef, itemName, description, startingBid, minimumBidInc, imageName, imageMime, imageData) VALUES";
    $sql .= "(\"$item[0]\",\"$item[1]\",\"$item[2]\", $item[3] , $item[4] ,\"$filefullname\",\"$filetype\"";
    $sql .= ", \" $filedata \");";
  }
  #echo $sql;
  if ($mysqli->query($sql) === TRUE) {
      $htmlOutput .= "Item added successfully";
  }
  else{
    $htmlOutput .= "Insertion Failed: ".$sql. $mysqli->error;

  }
  #echo $htmlOutput;
  $_SESSION["itemNotice"] = True;
}
else {
  #echo "vaildation fail";
  $_SESSION["itemNotice"] = False;
}
$htmlOutput .= " Item: ".$item[1];
$_SESSION["itemMessage"] = $htmlOutput;
header("Location: http://jorochial.cs.loyola.edu/html/Item/DashboardPage.php");
exit;
?>
<file_sep>
<?php
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: index.php");
  exit();
}
session_destroy();   // function that destroys session
$_SESSION["loggedOut"] == true;
header("location: index.php");

?>
<file_sep><?php

require_once 'config.php';

$htmlOutput = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

#echo "Connected successfully";
$bid = $_GET["itemId"];

$sql = "SELECT currentBid, minimumBidInc as minInc FROM Item WHERE id = ". $_GET["itemId"];

$result = $mysqli->query($sql);

$resultArray = '[';
$tempArray= array();

$row=$result->fetch_assoc();

$tempArray = $row;
$resultArray.=json_encode($tempArray).',';// $tempArray);

$resultArray = substr($resultArray, 0, -1);
$resultArray.=']';
 echo $resultArray;

?>
<file_sep>package com.example.cmaalouf.uxauction;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Set;

import static org.junit.Assert.*;

public class DonorTest {
    private String name;
    private String representativeName;
    private String phoneNumber;
    private String address;
    private String emailAddress;
    private Donor donor;
    private Item item;
    private Auction auction;
    private ArrayList<Item> items = new ArrayList<>();

    @Before
    public void beforetest()
    {
        donor = new Donor(name, representativeName, phoneNumber, address, emailAddress);
        item = new Item(name, "description", 20.0, 5.0, "donor");
        auction = new Auction(3, 5, items);
        auction.addItem(item, donor);
    }

    @After
    public void tearDown()
    {
          name = null;
          representativeName = null;
          phoneNumber = null;
          address = null;
          emailAddress = null;
          donor = null;
    }

    @Test
    public void getItemsDonated() {

        assertTrue(donor.getItemsDonated()!=null);
        Set<Item> items = donor.getItemsDonated();
        assertTrue(items.contains(item));
    }

    @Test
    public void testString() {

        assertNotNull(donor);
    }
}<file_sep>package com.example.cmaalouf.uxauction;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.StrictMode;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.w3c.dom.Text;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import static java.lang.String.valueOf;

public class ScrollingActivity extends AppCompatActivity {

    List<Item> itemList;
    ListView listView;
    public static String json ="";
    public static String query="";
    public static ArrayList<Item> items = new ArrayList<Item>();
    public static ArrayList<Bitmap> images = new ArrayList<Bitmap>();
    public static RecyclerView recyclerView;
    protected Auction auction;
    private Adapter adapter;

    /**
     * Purpose: intialize activity data and the layout from the xml
     * @param savedInstanceState the saved state information to initialize the activity
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list_view);

        Toolbar toolbar = (Toolbar) findViewById(R.id.Mytoolbar);
        setSupportActionBar(toolbar);
        toolbar.setSubtitleTextColor(getResources().getColor(R.color.white));
        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });

        items.clear();
        FetchData process = new FetchData(this);
        //FetchData process = new FetchData(this);
        process.execute();
        update();
        //getImages();
        //String s = ""+process.getData();
        auction = new Auction(0,0,items);
        Log.w("images size",""+images.size());
        //auction.makeAuctionItems(json);
        //items = auction.getItemsInAuction();
        //adapter = new Adapter(this, items);

        // THIS WORKS ISH
        final SearchView searchView = (SearchView) findViewById(R.id.ItemSearch);
        searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
            /**
             * Purpose: search for a query
             * @param s the query to search
             * @return false
             */
            @Override
            public boolean onQueryTextSubmit(String s) {
                //SearchFetchData process = new SearchFetchData(this);
                //process.execute();
                //searchUpdate();
                //update();
                items.clear();
                query= searchView.getQuery().toString();
                searchUpdate();
                return false;
            }
            /**
             * Purpose: update search results when query changes
             * @param //s the query to search
             * @return false
             */
            @Override
            public boolean onQueryTextChange(String newText) {
                items.clear();
                query= searchView.getQuery().toString();
                searchUpdate();
                return false;
            }
        });

    }

    private void getImages()
    {
        Log.w("items size",""+items.size());
        for(Item thisItem : items){
            ImageFetch fetch = new ImageFetch(this);
            fetch.execute();//""+thisItem.id);
            if(images.size()>0) {
                thisItem.setImage(images.get(images.size() - 1));
            }
            Log.w("items image", valueOf(thisItem.image));
        }
        Log.w("now images size",""+images.size());
        update();
    }

    /**
     * Purpose: update the search view
     */
    private void searchUpdate()
    {
        SearchFetchData process = new SearchFetchData(this);
        process.execute();
        update();
    }

    /**
     * Purpose: update the view
     */
    private void update()
    {
        Log.w("UPDATE items size",""+items.size());
        Adapter adapter = new Adapter(this,items);
        recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
        // set a LinearLayoutManager with default orientation
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext());
        recyclerView.setLayoutManager(linearLayoutManager);
        recyclerView.setAdapter(adapter);

//        Current_Adapter adapter1 = new Current_Adapter(this, items);
//        recyclerView.setAdapter(adapter1);

        //Current_Adapter adapter1 = new Current_Adapter(this, items);
        //recyclerView.setAdapter(adapter1);

    }

    /**
     * Purpose: initialize the contents of the menu
     * @param menu the menu to place items
     * @return true so the menu is displayed
     */
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_scrolling, menu);
        /*SearchView searchView = findViewById(R.id.ItemSearch);
        searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
            @Override
            public boolean onQueryTextSubmit(String s) {
                return false;
            }

            @Override
            public boolean onQueryTextChange(String newText) {
                adapter.getFilter().filter(newText);
                return false;
            }
        });*/
        return true;
    }

    /**
     * Purpose: tell the program what to do when an item is selected
     * @param item the item that was selected
     * @return true if the item was settings, false otherwise to allow normal menu handling
     */
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    /**
     * Purpose: Handle the bidder clicking on an item
     * @param view convention for onClick methods
     */
    protected void itemClick(View view)
    {
        TextView tId = (TextView) findViewById(R.id.itemid);
        String idString = tId.getText().toString();
        Intent myIntent = new Intent( this,
                ItemActivity.class );
        Log.w("string ID",idString);
        myIntent.putExtra("id",Integer.valueOf(idString));
        HashMap <Integer, Item> map = auction.getmapOfItems();
        Item thisItem = map.get(Integer.valueOf(idString));

        myIntent.putExtra("desc",thisItem.description);
        myIntent.putExtra("minInc",thisItem.minIncrement);
        myIntent.putExtra("name",thisItem.name);
        this.startActivity( myIntent );
    }

    /**
     * Purpose: Handle the bidder pressing Current Bids
     * @param view convention for onClick methods
     */
    public void goToCurrent(View view)
    {
        Intent myIntent = new Intent( this,
                CurrentActivity.class );
        this.startActivity( myIntent );
    }

    /**
     * Purpose: Handle the bidder pressing Past Bids
     * @param view convention for onClick methods
     */
    public void goToPast(View view)
    {
        Intent myIntent = new Intent( this,
                PastActivity.class );
        this.startActivity( myIntent );
    }

    /**
     * Purpose: Handle the bidder pressing Search Auction
     * @param view convention for onClick methods
     */
    public void goToSearch(View view)
    {

        Intent myIntent = new Intent( this,
                ScrollingActivity.class );
        this.startActivity( myIntent );
    }

    /**
     * Purpose: Handle the bidder pressing log out
     * @param view convention for onClick methods
     */
    public void logout(View view)
    {

        Intent myIntent = new Intent( this,
                MainActivity.class );
        this.startActivity( myIntent );
    }
}
<file_sep><?php
  session_start();
  if (!isset($_SESSION["login"]) || $_SESSION["login"] !== true) {
      //if not login in
      $_SESSION["secure_Attempt"] = true;
      header("location: ../index.php");
      exit();
  }
    require_once '../config.php';

    $htmlOutput = "";
    $_SESSION["auctionNotice"] = false;
    $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
    // Check connection
    if ($mysqli->connect_error) {
        die("Connection failed: " .  $mysqli->connect_error);
    }

    $auction = array($POST['id'],$_POST["AuctionTitle"],$_POST["AuctionDescription"],$_POST["AuctionCharity"],$_POST["StartDateTime"],$_POST["EndDateTime"]);

        $sql = "SELECT * FROM Auction WHERE id = ".$auction[0];

        $result = $mysqli->query($sql);
        $row = $result->fetch_assoc();

        $unchangedCount= 0;

      if ($row["auctionName"] != htmlspecialchars(trim($auction[1]))) {
          $sql = 'UPDATE Auction SET auctionName ="'.htmlspecialchars(trim($auction[1])).'"WHERE id ='.$auction[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Organization's Name updated successfully. ";
              $_SESSION["auctionNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      } else {
          $unchangedCount++;
      }
      if ($row["description"] != htmlspecialchars(trim($auction[2]))) {
          $sql = 'UPDATE Auction SET description ="'.htmlspecialchars(trim($auction[2])).'"WHERE id ='.$auction[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Auction Description  updated successfully. ";
              $_SESSION["auctionNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      } else {
          $unchangedCount++;
      }
      if ($row["beneficiary"] != htmlspecialchars(trim($auction[3]))) {
          $sql = 'UPDATE Auction SET beneficiary ="'.htmlspecialchars(trim($auction[3])).'"WHERE id ='.$auction[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Beneficary updated successfully. ";
              $_SESSION["auctionNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      } else {
          $unchangedCount++;
      }
      if ($row["startTime"] != htmlspecialchars(trim($auction[4]))) {
          if strtotime($auction[4]) < date(){
          $sql = 'UPDATE Auction SET startTime ="'.htmlspecialchars(trim($auction[4])).'"WHERE id ='.$auction[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Start Time updated successfully. ";
              $_SESSION["auctionNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
        }
        else {
            $htmlOutput .= "Update Failed: Auction already started";
      } else {
          $unchangedCount++;
      }
      if ($row["endTime"] != htmlspecialchars(trim($auction[5]))) {
          $sql = 'UPDATE Auction SET endTime ="'.htmlspecialchars(trim($auction[5])).'"WHERE id ='.$auction[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "End Time updated successfully. ";
              $_SESSION["auctionNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      } else {
          $unchangedCount++;
      }

      if ($unchangedCount == 5) {
          $_SESSION["auctionNotice"] = true;
          $htmlOutput = "No changes detected.";
      }

    $_SESSION["auctionMessage"] = $htmlOutput;
    header("Location: http://jorochial.cs.loyola.edu/html/Auction/viewAuction.php?id=".$auction[0]);
    exit;
<file_sep><?php
  session_start();
  if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
    //if not login in
    $_SESSION["secure_Attempt"] = true;
    header("location: ../index.php");
    exit();
  }
    require_once '../config.php';

    $htmlOutput = "";
    $_SESSION["charityNotice"] = false;
    $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
    // Check connection
    if ($mysqli->connect_error) {
        die("Connection failed: " .  $mysqli->connect_error);
    }

    #echo "Connected successfully";
    #UPDATE INTO `Charity`(`auctionNameRef`, `itemName`, `description`, `startingBid`, `minimumBidInc`, `charity`, `itemPic`)
    $charity = array($_POST["id"],$_POST["OrgName"],$_POST["RepName"],$_POST["PhoneNumber"],$_POST["email"],$_POST["Address"]);
    # user should be from form
    #| <EMAIL> | Herve | Franceschi | hjfranceschi | password
        $sql = "SELECT * FROM Charity WHERE charityId = ".$charity[0];

        $result = $mysqli->query($sql);
        $row = $result->fetch_assoc();

        $unchangedCount= 0;

      if ($row["orgName"] != htmlspecialchars(trim($charity[1]))) {
          $sql = 'UPDATE Charity SET orgName ="'.htmlspecialchars(trim($charity[1])).'"WHERE charityId ='.$charity[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Organization's Name updated successfully. ";
              $_SESSION["charityNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      }
      else{
        $unchangedCount++;
      }
      if ($row["repName"] != htmlspecialchars(trim($charity[2]))) {
          $sql = 'UPDATE Charity SET repName ="'.htmlspecialchars(trim($charity[2])).'"WHERE charityId ='.$charity[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Rep Name updated successfully. ";
              $_SESSION["charityNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      }
      else{
        $unchangedCount++;
      }
      if ($row["phoneNumber"] != htmlspecialchars(trim($charity[3]))) {
          $sql = 'UPDATE Charity SET phoneNumber ="'.htmlspecialchars(trim($charity[3])).'"WHERE charityId ='.$charity[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Phone Number updated successfully. ";
              $_SESSION["charityNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      }
      else{
        $unchangedCount++;
      }
      if ($row["email"] != htmlspecialchars(trim($charity[4]))) {
          $sql = 'UPDATE Charity SET email ="'.htmlspecialchars(trim($charity[4])).'"WHERE charityId ='.$charity[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Email updated successfully. ";
              $_SESSION["charityNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      }
      else{
        $unchangedCount++;
      }
      if ($row["address"] != htmlspecialchars(trim($charity[5]))) {
          $sql = 'UPDATE Charity SET address ="'.htmlspecialchars(trim($charity[5])).'"WHERE charityId ='.$charity[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Address updated successfully. ";
              $_SESSION["charityNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      }
      else{
        $unchangedCount++;
      }

      if ($unchangedCount == 5){
        $_SESSION["charityNotice"] = true;
        $htmlOutput = "No changes detected.";
      }

    $_SESSION["charityMessage"] = $htmlOutput;
    header("Location: http://jorochial.cs.loyola.edu/html/Charity/viewCharity.php?id=".$charity[0]);
    exit;
?>
<file_sep><?php

require_once 'config.php';

$htmlOutput = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

#echo "Connected successfully";
$bid = array($_GET["username"],$_GET["amount"],$_GET["itemId"]);

$sql = "SELECT ItemName FROM Item WHERE id = ". $_GET["itemId"];

$result = $mysqli->query($sql);
while( $row = $result->fetch_assoc( ) ){
   $itemName = $row["ItemName"];
}

  $sql = 'INSERT INTO Bids (bidderUName, amount, itemId, ItemName) VALUES';

  $bid[0] = htmlspecialchars(trim($bid[0]));
  $bid[1] = htmlspecialchars(trim($bid[1]));
  $bid[2] = htmlspecialchars(trim($bid[2]));
  $sql .= '("'.$bid[0].'",'. $bid[1] .','. $bid[2] .',"'. $itemName .'")';
  $sql .= ";";
  if ($mysqli->query($sql) === TRUE) {
      $htmlOutput = "Success";
  }
  else{
    $htmlOutput .= "Failed ". $mysqli->error;

  }
  $sql = "SELECT max(amount) FROM Bids WHERE itemId = ". $_GET["itemId"];
  $result = $mysqli->query($sql);
  echo $mysqli->error;
  $row = $result->fetch_assoc();

  $sql = "Update Item set currentBid = ".$row["max(amount)"]." WHERE id = ". $_GET["itemId"];
  $result = $mysqli->query($sql);
  echo $mysqli->error;
  if ($mysqli->query($sql) === TRUE) {
      $htmlOutput = "Success";
  }
  else{
    $htmlOutput .= "Failed ". $mysqli->error;

  }

  echo $htmlOutput;

?>
<file_sep>package com.example.cmaalouf.uxauction;
/**
 * NO JAVADOC COMMENTS ????
 * ????????????????????????
 */
public class Bid {

    protected int bidId;  // Why protected?
    protected String bidderUName;
    protected double amount;
    protected int itemId;
    public Bid(int bidId, String bidderUName, double amount, int itemId)
    {
        this.bidId=bidId;
        this.bidderUName=bidderUName;
        this.amount = amount;
        this.itemId=itemId;
    }
}
<file_sep><?php

require_once 'config.php';

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

if(isset($_GET["query"])){
  $query = htmlspecialchars($_GET["query"]);
}else{
  $query = htmlspecialchars("Car");
}

  $htmlResult = "[";
  $sql = "SELECT id,itemName, description, startingBid, minimumBidInc, currentBid, donorName  from Item where (itemName like '%$query%') order by itemName";
  $result = $mysqli->query($sql);
  if ($result->num_rows <= 0) {
      $sql = "SELECT * from Item where (description like '%$query%')";
      $result = $mysqli->query($sql);
  }
  echo $mysqli->error;
  while( $row = $result->fetch_assoc( ) ){
     $htmlResult .= json_encode($row);
     $htmlResult.=",";

  }
	$htmlResult = substr($htmlResult,0,-1);
	$htmlResult.=']';
	echo $htmlResult;

?>
<file_sep><?php
// Start the session
session_start();
if (!isset($_SESSION["login"]) || $_SESSION["login"] !== true) {
    //if not login in
    $_SESSION["secure_Attempt"] = true;
    header("location: ../index.php");
    exit();
}
require_once '../config.php';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);

$charites = array();

$sql = "Select orgName from Charity";
$result = $mysqli->query($sql);
$threadId = 0;
while ($row = $result->fetch_assoc()) {
    $charites =  $row['orgName'];
}

?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../css/SASS/AuctionProject.css">

    <title>Create Auction</title>

        AuctionForHaiti
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

        </button>

              Dashboard(current)

                Host an Event

              Settings

              Logout

          <form class="form-inline" method="get" action="../search.php">

            <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
            <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
          </form>

        Add Charity
        Create Auction
         Add Donor
        Add an Item
        Results Summary

Create Auction

        <form class="needs-validation" action="addAuctionForm.php" method="post" novalidate>

            Auction Title
            <input type="text" class="form-control" id="AuctionTitle" name="AuctionTitle" placeholder="My Auction" required>

            Description:
            <textarea class="form-control" id="AuctionDescription" name="AuctionDescription" rows="3" required></textarea>

            Beneficary:

            <select class="form-control" name="AuctionCharity" id="AuctionCharity" required>
              <option>Anonymous</option>
              <option>Charity1</option>
              <option>Charity2</option>
              <option>Charity3</option>
            </select>

            Start Date and Time
            <input type="text" class="form-control" id="StartDateTime" name="StartDateTime" placeholder="01/01/1970 10:00AM" required>

            End Date and Time
            <input type="text" class="form-control" name="EndDateTime" id="EndDateTime" placeholder="01/01/1970 10:01AM" required>

            <button class="btn btn-primary mt-3 mt-md-0" type="submit" name="submit">Submit</button>

        </form>

 Contact Us

Main Campus

            4501 N. Charles Street

            Baltimore, MD 21210

            410-617-2000 or 1-800-221-9107

            Timonium Graduate Center

            2034 Greenspring Drive

            Timonium, MD 21093

            410-617-1903

            Columbia Graduate Center

            8890 McGaw Road

            Columbia, MD 21045

            410-617-7600

<file_sep>package com.example.cmaalouf.uxauction;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import java.util.ArrayList;

/**
 * @author ?????????????????????
 * @version ????????????????????
 */
public class CurrentActivity extends AppCompatActivity{

    public static ArrayList<Item> myItems;
    //private static final long START_TIME_IN_MILIS;
    public static String query;

    /**
     * Purpose: Load the layout of this activity when it is accessed
     * @param savedInstanceState the saved state information to initialize the activity
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_currentscrolling);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });

        myItems= new ArrayList<Item>();

        /*myItems.add(add_this);
        myItems.add(add_this);
        myItems.add(add_this);
        myItems.add(add_this);
        myItems.add(add_this);
    */
        query="hfranceschi";
        Log.w("CurrentFetch ", query);
        CurrentFetchData process = new CurrentFetchData(this,"hfranceschi");
        process.execute();
        update();

        //long mTimeLeftInMillis = START_TIME_IN_MILIS; // MAKE CALL
    }

    /**
     * Purpose: Update the view
     */
    public void update(){

        CurrentAdapter Cadapter = new CurrentAdapter(this,myItems);
        RecyclerView CrecyclerView = (RecyclerView) findViewById(R.id.CurrentrecyclerView);
        // set a LinearLayoutManager with default orientation
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext());
        CrecyclerView.setLayoutManager(linearLayoutManager);
        CrecyclerView.setAdapter(Cadapter);
    }

    /**
     * Purpose: initialize the contents of the menu
     * @param menu the menu to place items
     * @return true so the menu is displayed
     */
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_scrolling, menu);
        return true;
    }

    /**
     * Purpose: tell the program what to do when an item is selected
     * @param item the item that was selected
     * @return true if the item was settings, false otherwise to allow normal menu handling
     */
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    /**
     * Purpose: Handle the bidder clicking on an item
     * @param view convention for onClick methods
     */
    public void itemClick(View view) {
        Intent myIntent = new Intent(this,
                ItemActivity.class);
        this.startActivity(myIntent);
    }

    /**
     * Purpose: Handle the bidder pressing Current Bids
     * @param view convention for onClick methods
     */
    public void goToCurrent(View view) {
        Intent myIntent = new Intent(this,
                CurrentActivity.class);
        this.startActivity(myIntent);
    }

    /**
     * Purpose: Handle the bidder pressing Past Bids
     * @param view convention for onClick methods
     */
    public void goToPast(View view) {
        Intent myIntent = new Intent(this,
                PastActivity.class);
        this.startActivity(myIntent);
    }

    /**
     * Purpose: Handle the bidder pressing Search Auction
     * @param view convention for onClick methods
     */
    public void goToSearch(View view)
    {

        Intent myIntent = new Intent( this,
                ScrollingActivity.class );
        this.startActivity( myIntent );
    }
}
<file_sep><?php

#if email in db, else skip

require_once 'config.php';

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}
 $to_email = $_GET['emailAddress'];

$sql = "SELECT * FROM Bidder WHERE email = '$to_email';";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
  $subject = $_GET['emailSubject'];
  $message = $_GET['emailMessage'];
  $headers = 'From: <EMAIL>';
  mail($to_email,$subject,$message,$headers);
}

?>
<file_sep>package com.example.cmaalouf.uxauction;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

public class AuctionSystem
{
    ArrayList<Bidder> listOfAllBidders;
    ArrayList<Bidder> biddersInAuction;

    /**
     * Purpose: Print the amount raised by each donor, the total amount raised by the auction
     * and the bid history of each item
     * @param auction the auction to review
     */
    public void reviewResults(Auction auction)
    {
        HashMap<Integer, Item> donorsInAuction = auction.getmapOfItems();
        double totalMoneyRaised = 0;

        if(donorsInAuction != null)
        {
            //loop through map of donors and their associated items
            for(Map.Entry donors: donorsInAuction.entrySet())
            {
                double moneyRaisedByThisDonor = 0;
                Donor donor = (Donor) donors.getKey();
                //get the set of items for current donor in map
                Set<Item> itemsDonated = donor.getItemsDonated();

                for(Item item: itemsDonated)
                {
                    //get the bidders of current item
                    TreeMap<Double, Bidder> biddersForThisItem = item.getBiddersForThisItem();
                    if(!biddersForThisItem.isEmpty())
                    {
                        //if there are bidders, get the winning bid and add it to money raised
                        double highestBid = item.getCurrentHighestBid();
                        moneyRaisedByThisDonor += highestBid;
                    }

                }

                System.out.println(donor.toString() + " raised " + moneyRaisedByThisDonor);
                totalMoneyRaised += moneyRaisedByThisDonor;
            }
        }

        System.out.println("Total money raised for this event: " + totalMoneyRaised);

        List<Item> itemsInAuction = auction.getItemsInAuction();

        for(Item item: itemsInAuction)
        {
            //for every item in the auction, get all the bids associated with that item
            System.out.println("Bidding history for: " + item);
            //since TreeMaps are sorted, will automatically be in chronological order
            TreeMap<Double, Bidder> biddersForThisItem = item.getBiddersForThisItem();

            if(!biddersForThisItem.isEmpty())
            {
                //loop through bidding history of item
                for(Map.Entry bidders: biddersForThisItem.entrySet())
                {
                    double bid = (double) bidders.getKey();
                    Bidder bidder = (Bidder) bidders.getValue();

                    System.out.println("Bidder: " +  bidder + "\tBid: " + bid);
                }

            }else
                System.out.println("No bids for " + item + ".");
        }

    }
}
<file_sep><?php
// Start the session
session_start();

?>

  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="../css/SASS/AuctionProject.css">

    AuctionForHaiti
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

    </button>

          Login

      <form class="form-inline" method="get" action="../search.php">

        <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
        <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
      </form>

Forgot your Password?

 A secret code has been emailed to the email assocated with your account.

    <form class="needs-validation" novalidate>

          Admin Username:
          <input class="form-control col-md-8" type="text" name="username" value="yourUsername" readonly>

          Secret Code:

            <input class="form-control" type="<PASSWORD>" name="currentPassword" required>

              Please enter your secret code.  Email Again.

          New Password:
          <input class="form-control col-md-8" type="<PASSWORD>" name="newPassword" required>

          New Password again:

            <input class="form-control" type="password" name="<PASSWORD>" required>

              Your new password must match.

          <button class="btn btn-primary mt-3" type="submit" name="update">Update</button>
    </form>

 Contact Us

Main Campus

        4501 N. Charles Street

        Baltimore, MD 21210

        410-617-2000 or 1-800-221-9107

        Timonium Graduate Center

        2034 Greenspring Drive

        Timonium, MD 21093

        410-617-1903

        Columbia Graduate Center

        8890 McGaw Road

        Columbia, MD 21045

        410-617-7600

<file_sep><?php

require_once 'config.php';

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

//retrieve user entered information from form
$username = "";

if (isset($_GET['username'])) {
  $username = htmlspecialchars(trim($_GET['username']));

  //get information from Database
  $sql = "SELECT * FROM Bids WHERE itemId not in (SELECT itemId FROM Bids WHERE bidderUName = '$username' group by itemId having amount = max(amount)) and bidderUName = '$username ';";

  $result = $mysqli->query($sql);
  echo $mysqli->error;
  //$sql = "SELECT itemId, ItemName, max(amount) as amount FROM Bids WHERE BidderUName = '$username' group by itemId";
  //$result2 = $mysqli->query($sql);
  if ($result->num_rows > 0) {

    $resultArray = '[';
    $tempArray= array();

    while($row=$result->fetch_assoc())
    {
    $tempArray = $row;
    $resultArray.=json_encode($tempArray).',';// $tempArray);
    echo $resultsArray;
    }

    $resultArray = substr($resultArray, 0, -1);
    $resultArray.=']';
     echo $resultArray;
}
}
$mysqli->close();
?>
<file_sep><?php

const DB_HOST = 'cs-database.cs.loyola.edu';
const DB_USER = 'arschilke';
const DB_PASS = '<PASSWORD>';
const DB_NAME = 'jorochial';
 ?>
<file_sep>
<?php

session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';

$_SESSION["donorNotice"] = False;
$htmlOutput = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

#echo "Connected successfully";
#INSERT INTO `Item`(`auctionNameRef`, `itemName`, `description`, `startingBid`, `minimumBidInc`, `donorName`, `itemPic`)

$donor = array($_POST["OrgName"],$_POST["RepName"],$_POST["PhoneNumber"],$_POST["email"],$_POST["Address"]);
#$donor = array("<EMAIL>","Herve","Franceschi","hjfranceschi","<PASSWORD>");
# user should be from form
#| <EMAIL> | Herve | Franceschi | hjfranceschi | <PASSWORD>

  $sql .= 'INSERT INTO Donor (orgName, repName, phoneNum, email, address) VALUES'; #TODO: add itemPic

  $donor[0] = htmlspecialchars(trim($donor[0]));
  $donor[1] = htmlspecialchars(trim($donor[1]));
  $donor[2] = htmlspecialchars(trim($donor[2]));
  $donor[3] = htmlspecialchars(trim($donor[3]));
  $donor[4] = htmlspecialchars(trim($donor[4]));
  $sql .= '("'.$donor[0].'","'.$donor[1].'","'.$donor[2].'","'.$donor[3].'","'.$donor[4].'")';
  $sql .= ";";
  if ($mysqli->query($sql) === TRUE) {
      $htmlOutput .= "Donor added successfully";
  }
  else{
    $htmlOutput .= "Insertion Failed: ".$sql. $mysqli->error;

  }
  $_SESSION["donorNotice"] = True;

$htmlOutput .= " Donor: ".$donor[1];
$_SESSION["donorMessage"] = $htmlOutput;
header("Location: http://jorochial.cs.loyola.edu/html/Donor/DonorsDashboard.php");
exit;
?>
<file_sep>package com.example.cmaalouf.uxauction;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import java.util.ArrayList;

public class PastActivity extends AppCompatActivity {

    public static ArrayList<Item> myItems = new ArrayList<Item>();
    public static String query;
    public static RecyclerView pastRecyclerView;

    /**
     * Purpose: intialize activity data and the layout from the xml
     * @param savedInstanceState the saved state information to initialize the activity
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pastscrolling);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton fab = findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("logOut", null).show();

            }
        });

        query="hfranceschi";
        PastFetchData process = new PastFetchData(this,query);
        process.execute();

        update();

    }

    /**
     * Purpose: Update the view
     */
    public void update(){

        PastAdapter pastAdapter = new PastAdapter(this, myItems);
        RecyclerView pastRecyclerView = findViewById(R.id.PastrecyclerView);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext());
        pastRecyclerView.setLayoutManager(linearLayoutManager);
        pastRecyclerView.setAdapter(pastAdapter);
    }

    /**
     * Purpose: initialize the contents of the menu
     * @param menu the menu to place items
     * @return true so the menu is displayed
     */
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_scrolling, menu);
        return true;
    }

    /**
     * Purpose: tell the program what to do when an item is selected
     * @param item the item that was selected
     * @return true if the item was settings, false otherwise to allow normal menu handling
     */
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    /**
     * Purpose: Handle the bidder clicking on an item
     * @param view convention for onClick methods
     */
    protected void itemClick(View view) {
        Intent myIntent = new Intent(this,
                ItemActivity.class);
        this.startActivity(myIntent);
    }

    /**
     * Purpose: Handle the bidder pressing Current Bids
     * @param view convention for onClick methods
     */
    public void goToCurrent(View view) {
        Intent myIntent = new Intent(this,
                CurrentActivity.class);
        this.startActivity(myIntent);
    }

    /**
     * Purpose: Handle the bidder pressing Past Bids
     * @param view convention for onClick methods
     */
    public void goToPast(View view) {
        Intent myIntent = new Intent(this,
                PastActivity.class);
        this.startActivity(myIntent);
    }

    /**
     * Purpose: Handle the bidder pressing Search Auction
     * @param view convention for onClick methods
     */
    public void goToSearch(View view)
    {

        Intent myIntent = new Intent( this,
                ScrollingActivity.class );
        this.startActivity( myIntent );
    }

    /**
     * Purpose: Handle the bidder pressing log out
     * @param view convention for onClick methods
     */
    public void logOut(View view)
    {
        Intent myIntent = new Intent( this,
                ScrollingActivity.class );
        finish();
        this.startActivity( myIntent );
    }
}
<file_sep><?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " . $mysqli->connect_error);
}

if(isset($_GET["id"])){
$sql = "SELECT * FROM Auction WHERE id = ". $_GET["id"];

$result = $mysqli->query($sql);
$row = $result->fetch_assoc( );

$auction_title = $row["auctionName"];
$auction_description = $row["description"];
$auction_beneficiary= $row["beneficiary"];
$auction_start_time= strtotime($row["startTime"]);
$auction_end_time = strtotime($row["endTime"]);
}
else{
  $auction_title = "Chessboard TEST";
  $auction_description = "This chessboard was owned by King George back in 1945, seeing use by over three generations of royal family. It was sold to the French after the Battle of 1765 and was gifted to the King after the former owner when in against a Sicilian when death was on the line.";
  $auction_beneficiary= "TEST";
  $auction_start_time= strtotime("2019-12-02 10:00:00");
  $auction_end_time = strtotime("2019-12-02 19:00:12");
}
?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../css/SASS/AuctionProject.css">

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

      </button>

            Dashboard(current)

              Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="../search.php">

          <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

Edit Auction

      <form class="needs-validation" action="updateAuction.php" method="post" novalidate>

          <input type="hidden" name ="id" value="<?php echo $_GET["id"];?>">

          Auction Title
          <input type="text" class="form-control" id="AuctionTitle" name="AuctionTitle" value="<?= $auction_title?>" required>

          Description:
          <textarea class="form-control" id="AuctionDescription" name="AuctionDescription" rows="3" required><?= $auction_description ?></textarea>

          Start Date and Time
          <input type="text" class="form-control" id="StartDateTime" name="StartDateTime" value="<?= date('m/d/Y h:i A', $auction_start_time) ?>" required>

          End Date and Time
          <input type="text" class="form-control" name="EndDateTime" id="EndDateTime" value="<?= date('m/d/Y h:i A', $auction_end_time)?>" required>

          <button class="btn btn-primary mt-3 mt-md-0" type="submit" name="submit">Submit</button>

      </form>

Are you sure you want to delete this auction?

            <button type="button" class="close" data-dismiss="modal" aria-label="Close Delete Box" aria-hidden="true">×</button>

This action cannot be undone.

            <form class = "m-0" method="POST" action="deleteAuction.php" novalidate>
            <input type="hidden" class="invisible" name= "auctionId" value="<?php echo $_GET["id"]?>">
            <input type="submit" value="Delete" class="btn btn-danger">
          </form>
            <button type="button" class="btn btn-outline-info" data-dismiss="modal" aria-label="Close Delete Box" aria-hidden="true" id="buttonClose">Close</button>

 Contact Us

Main Campus

          4501 N. Charles Street

          Baltimore, MD 21210

          410-617-2000 or 1-800-221-9107

          Timonium Graduate Center

          2034 Greenspring Drive

          Timonium, MD 21093

          410-617-1903

          Columbia Graduate Center

          8890 McGaw Road

          Columbia, MD 21045

          410-617-7600

<file_sep><?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " . $mysqli->connect_error);
}

if (isset($_GET["id"])) {
    $sql = "SELECT * FROM Charity WHERE charityId = ". $_GET["id"];

    $result = $mysqli->query($sql);
    $row = $result->fetch_assoc();
    $charity_edit_link= "editCharity.php?id=".$row["charityId"];
    $charity_title = $row["orgName"];
    $charity_repName = $row["repName"];
    $charity_phoneNum= $row["phoneNum"];
    $charity_email= $row["email"];
    $charity_address = $row["address"];
} else {
    $charity_title = "The Agatha Foundation";
    $charity_repName = "<NAME>";
    $charity_phoneNum= "213-123-2312";
    $charity_email= "<EMAIL>";
    $charity_address = "123 Main Street
 Baltimore, MD";
}
?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../css/SASS/AuctionProject.css">

    <title>Add Charity</title>

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

      </button>

            Dashboard(current)

              Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="../search.php">

          <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

Edit a Charity

      <form class="needs-validation" action="updateCharity.php" method="post" novalidate>
        <input type="hidden" name ="id" value="<?php echo $_GET["id"];?>">

          Organization's Name
          <input type="text" class="form-control" id="OrgName" name="OrgName" value="<?php echo $charity_title ?>" required>

          Reprenstative's Name
          <input type="text" class="form-control" id="RepName" name="RepName" value="<?php echo $charity_repName ?>" required>

          Phone Number
          <input type="text" class="form-control" id="PhoneNumber" name="PhoneNumber" value="<?php echo $charity_phoneNum ?>" required>

          Email
          <input type="email" class="form-control" id="email" name="email" value="<?php echo $charity_email ?>" required>

          Address:
          <textarea class="form-control" id="Address" name="Address" rows="3" required><?php echo $charity_address ?></textarea>

          <button class="btn btn-info mt-3 mt-md-0" type="submit" name="Update">Update</button>
            <button class="btn btn-danger mt-3 mt-md-0" type="button" name="delete" data-toggle="modal" data-target="#DeleteModal">Delete</button>

      </form>

Are you sure you want to delete this charity?

            <button type="button" class="close" data-dismiss="modal" aria-label="Close Delete Box" aria-hidden="true">×</button>

This action cannot be undone.

            <form class = "m-0" method="POST" action="deleteCharity.php" novalidate>
            <input type="hidden" class="invisible" name= "charityId" value="<?php echo $_GET["id"]?>">
            <input type="submit" value="Delete" class="btn btn-danger">
          </form>
            <button type="button" class="btn btn-outline-info" data-dismiss="modal" aria-label="Close Delete Box" aria-hidden="true" id="buttonClose">Close</button>

 Contact Us

Main Campus

          4501 N. Charles Street

          Baltimore, MD 21210

          410-617-2000 or 1-800-221-9107

          Timonium Graduate Center

          2034 Greenspring Drive

          Timonium, MD 21093

          410-617-1903

          Columbia Graduate Center

          8890 McGaw Road

          Columbia, MD 21045

          410-617-7600

<file_sep><?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " . $mysqli->connect_error);
}

if(isset($_GET["id"])){

  $sql = "SELECT * FROM Item WHERE id = ". $_GET["id"];

  $result = $mysqli->query($sql);
  $row = $result->fetch_assoc( );
  $item_edit_link= "editItem.php?id=".$row["id"];
  $item_title = $row["itemName"];
  $item_auction = $row["auctionNameRef"];
  $item_description = $row["description"];
  $item_current_bid= $row["currentBid"];
  $item_starting_bid= $row["startingBid"];
  $item_minimum_inc = $row["minimumBidInc"];
  $item_donor = (is_null($row["donorName"]) ? "Anonymous" : $row["donorName"]) ;

  #TODO: use pic from DB also Picture file ... url for now
  $item_picture_ref = $row['imageRef'];
  $item_picture_data = $row["imageData"];
}
else{
  $item_title = "Chessboard";
  $item_auction = "Rendevous Haiti";
  $item_description = "This chessboard was owned by King George back in 1945, seeing use by over three generations of royal family. It was sold to the French after the Battle of 1765 and was gifted to the King after the former owner when in against a Sicilian when death was on the line.";
  $item_current_bid= 1000.00;
  $item_starting_bid= 500.00;
  $item_minimum_inc = 100.02;
  $item_donor = "The Royal Family";
  #also Picture file ... url for now
  $item_picture = "https://assets.dmagstatic.com/wp-content/uploads/2018/12/dallas-construction-1024x683.jpg";
}

function itemRow($bidder,$amount, $time) {
  #TODO: Change hard coded picture to link
  return '

      '.$bidder.'
       $'.$amount.'
       '.date("F j, Y, g:i a", strtotime($time)).'

';
}

function bidsTable($mysqli, $itemId){
  $htmlResult = "";
  $sql = "SELECT *  FROM Bids WHERE itemId = $itemId";
  $result = $mysqli->query($sql);
  echo $mysqli->error;
  while( $row = $result->fetch_assoc( ) ){
     $htmlResult .= itemRow($row["bidderUName"],$row["amount"],$row["time"]);
  }
  return $htmlResult;
}

 ?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../css/SASS/AuctionProject.css">

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-h5="Toggle navigation">

      </button>

            Dashboard(current)

            Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="../search.php">

          <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-h5="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

          <img class="card-img" src="data:<?php echo $item_picture_ref ?>;base64, <?php echo $item_picture_data ?>" class="img-fluid" width=200>

<?php echo $item_title;?>

Auction: <?php echo $item_auction;?>

<?php echo $item_description;?>

Current Bid: <?php echo "$".$item_current_bid;?>

Starting Bid: <?php echo "$".$item_starting_bid;?>

Minimum Bid Increment: <?php echo "$".$item_minimum_inc;?>

Donor: <?php echo $item_donor;?>

          <a class="btn btn-primary" href="<?php echo $item_edit_link?>"> Edit Item

            Bidder's Username
            Amount
            Time

          <?php echo bidsTable($mysqli, $_GET["id"]);?>

 Contact Us

Main Campus

          4501 N. Charles Street

          Baltimore, MD 21210

          410-617-2000 or 1-800-221-9107

          Timonium Graduate Center

          2034 Greenspring Drive

          Timonium, MD 21093

          410-617-1903

          Columbia Graduate Center

          8890 McGaw Road

          Columbia, MD 21045

          410-617-7600

<file_sep><?php
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';

$htmlOutput = "";
$_SESSION["donorNotice"] == false;
$_SESSION["donorMessage"] = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}
$sql = "DELETE from Donor where donorId = ".$_POST["donorId"];

if ($mysqli->query($sql) === TRUE) {
    $htmlOutput .= "Donor deleted successfully";
    $_SESSION["donorNotice"] == true;
}
else{
  $htmlOutput .= "Deletion Failed: ". $mysqli->error;
  $_SESSION["donorNotice"] == false;
}

$_SESSION["donorMessage"] = $htmlOutput;
header("Location: http://jorochial.cs.loyola.edu/html/Donor/DonorsDashboard.php");
exit;

 ?>
<file_sep><?php
require_once 'config.php';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
//Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

// Select all of our stocks from table 'stock_tracker'
$sql = "SELECT * FROM Item";
//there is no stock_tracker table what are
$result = $mysqli->query($sql);

$resultArray = '{ "items": [';
$tempArray= array();

//test
//echo json_encode($result->fetch_assoc());
//echo json_encode($result->fetch_assoc());
//$row =0;
while($row=$result->fetch_assoc())
{
$tempArray = $row;
//echo json_encode($tempArray);
//echo json_encode($result->fetch_assoc());
//array_push($resultArray, $tempArray)
$resultArray.=json_encode($tempArray).',';// $tempArray);
echo $resultsArray;
}

$resultArray = substr($resultArray, 0, -1);
$resultArray.=']}';
 echo $resultArray;
//echo $resultArray;
?>
<file_sep><?php session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: index.php");
  exit();
}
if (isset($_SESSION["adminAdd"])){
  if($_SESSION["adminAdd"] == TRUE){
      $alert =  '

       New Admin added.'.$_SESSION["adminMessage"].'
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      ×
      </button>

';
  }
  else{#($_SESSION["adminAdd"] == False){
    $alert =  '

       New Admin not added.
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      ×
      </button>

';
  }
}
/*if (isset($_SESSION["resetPassword"])) {
    if ($_SESSION["resetPassword"] == True) {
        $alert =  '

        Password changed.'.$_SESSION["passwordMessage"].'
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      ×
      </button>

';
  }
  else{#($_SESSION["resetPassword"] == False){
    $alert =  '

       New password not added.
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      ×
      </button>

';
  }
} */

 ?>

<!DOCTYPE html>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../css/SASS/AuctionProject.css">

    <title>Settings</title>

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

      </button>

            Dashboard(current)

              Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="search.php">

          <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

      <?php echo $alert ?>

Settings

        Reset Password
        Add Admin
        Update other info

          <form class="needs-validation" action="Admin/resetPwd.php" method="POST" novalidate>

                Admin Username:
                <input class="form-control" style="max-width:33%;" type="text" name="resetUsername">

                Current Password:

                <input class="form-control" style="max-width:50%;" type="password" name="currentPwd" required>

                  Please enter your current password.

                New Password:
                <input class="form-control" style="max-width:33%;" type="password" name="newPwd1" required>

                New Password again:

                <input class="form-control" style="max-width:50%;" type="password" name="newPwd2" required>

                  Your new password must match.

                <button class="btn btn-primary mt-3" type="submit" name="update">Update</button>
            </form>

Add Admin

          <form class="needs-validation" action="Admin/addAdmin.php" method="POST" novalidate>

                New Admin Username:
                <input class="form-control" style="max-width:33%;" type="text" name="newAdminUsername">

                New Admin Email:
                <input class="form-control" style="max-width:33%;" type="text" name="newAdminEmail">

                First Name:
                <input class="form-control" style="max-width:33%;" type="text" name="newAdminFirstName">

                Last Name:
                <input class="form-control" style="max-width:33%;" type="text" name="newAdminLastName">

                New Password

                <input class="form-control" style="max-width:50%;" type="password" name="<PASSWORD>Password" required>

                  Please enter a password

                Confirm New Password:

                <input class="form-control" style="max-width:50%;" type="password" name="newPassword2" required>

                  Your new password must match.

                <button class="btn btn-primary mt-3" type="submit" name="update">Update</button>
            </form>

Enhanced features coming soon...

 Contact Us

Main Campus

        4501 N. Charles Street

        Baltimore, MD 21210

        410-617-2000 or 1-800-221-9107

        Timonium Graduate Center

        2034 Greenspring Drive

        Timonium, MD 21093

        410-617-1903

        Columbia Graduate Center

        8890 McGaw Road

        Columbia, MD 21045

        410-617-7600

<file_sep><?php
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
    require_once '../config.php';

    $htmlOutput = "";

    $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
    // Check connection
    if ($mysqli->connect_error) {
        die("Connection failed: " .  $mysqli->connect_error);
    }

    #echo "Connected successfully";
    #UPDATE INTO `Item`(`auctionNameRef`, `itemName`, `description`, `startingBid`, `minimumBidInc`, `donor`, `itemPic`)
    $item = array($_POST["ItemAuction"],$_POST["ItemTitle"],$_POST["ItemDescription"],$_POST["ItemStartingBid"],$_POST["ItemMinIncrement"],$_POST["ItemDonor"],$_POST["ItemPicture"],$_POST["ItemId"]);
    #$item = array("<EMAIL>","Herve","Franceschi","hjfranceschi","password");
    # user should be from form
    #| <EMAIL> | Herve | Franceschi | hjfranceschi | password

    $sql = "SELECT * FROM Item WHERE id = ". $item[7];

    $result = $mysqli->query($sql);
    $row = $result->fetch_assoc( );

      if($row["auctionNameRef"] != htmlspecialchars(trim($item[0]))){
        $sql = 'UPDATE Item SET auctionNameRef ="'.htmlspecialchars(trim($item[0])).'"WHERE id ='.$item[7];
        if ($mysqli->query($sql) === TRUE) {
            $htmlOutput .= "Auction updated successfully";
        }
        else{
          $htmlOutput .= "Update Failed: ". $mysqli->error;

        }
      }
      if($row["itemName"] != htmlspecialchars(trim($item[1]))){
        $sql = 'UPDATE Item SET itemName ="'.htmlspecialchars(trim($item[1])).'"WHERE id ='.$item[7];
        if ($mysqli->query($sql) === TRUE) {
            $htmlOutput .= "Title updated successfully";
        }
        else{
          $htmlOutput .= "Update Failed: ". $mysqli->error;

        }
      }
      if($row["description"] != htmlspecialchars(trim($item[2]))){
        $sql = 'UPDATE Item SET description ="'.htmlspecialchars(trim($item[2])).'"WHERE id ='.$item[7];
        if ($mysqli->query($sql) === TRUE) {
            $htmlOutput .= "Description updated successfully";
        }
        else{
          $htmlOutput .= "Update Failed: ". $mysqli->error;

        }
      }
      if($row["startingBid"] != htmlspecialchars(trim($item[3]))){
        $sql = 'UPDATE Item SET startingBid ="'.htmlspecialchars(trim($item[3])).'"WHERE id ='.$item[7];
        if ($mysqli->query($sql) === TRUE) {
            $htmlOutput .= "Starting Bid updated successfully";
        }
        else{
          $htmlOutput .= "Update Failed: ". $mysqli->error;

        }
      }
      if($row["minimumBidInc"] != htmlspecialchars(trim($item[4]))){
        $sql = 'UPDATE Item SET minimumBidInc ="'.htmlspecialchars(trim($item[3])).'"WHERE id ='.$item[7];
        if ($mysqli->query($sql) === TRUE) {
            $htmlOutput .= "Minimum Bid Increment updated successfully";
        }
        else{
          $htmlOutput .= "Update Failed: ". $mysqli->error;

        }
      }
      if($row["donorName"] != htmlspecialchars(trim($item[5]))){
        $sql = 'UPDATE Item SET donorName ="'.htmlspecialchars(trim($item[3])).'"WHERE id ='.$item[7];
        if ($mysqli->query($sql) === TRUE) {
            $htmlOutput .= "Minimum Bid Increment updated successfully";
        }
        else{
          $htmlOutput .= "Update Failed: ". $mysqli->error;

        }
      }

      #TODO: add itemPic update here

    $_SESSION["itemMessage"] = $htmlOutput;
    header("Location: http://jorochial.cs.loyola.edu/html/Item/viewItem.php?id=".$item[7]);
    exit;

?>
<file_sep><?php

//Database components
const DB_HOST = 'cs-database.cs.loyola.edu';
const DB_USER = 'arschilke';
const DB_PASS = '<PASSWORD>';
const DB_NAME = 'jorochial';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

//User input for id
$userIdRequest = $_GET['id'];

//Queries database
$sqlIdStatement = "select imageData from Item where id = '$userIdRequest' LIMIT 1";
$result = $mysqli->query($sqlIdStatement);

while ($row = $result->fetch_assoc()) {

    echo $row['imageData'];

}

$mysqli->close();
 ?>
<file_sep><?php
  session_start();
  if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
    //if not login in
    $_SESSION["secure_Attempt"] = true;
    header("location: ../index.php");
    exit();
  }
    require_once '../config.php';

    $htmlOutput = "";
    $_SESSION["donorNotice"] = false;
    $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
    // Check connection
    if ($mysqli->connect_error) {
        die("Connection failed: " .  $mysqli->connect_error);
    }

    $donor = array($_POST["id"],$_POST["OrgName"],$_POST["RepName"],$_POST["PhoneNumber"],$_POST["email"],$_POST["Address"]);

        $sql = "SELECT * FROM Donor WHERE donorId = ".$donor[0];

        $result = $mysqli->query($sql);
        $row = $result->fetch_assoc();

        $unchangedCount= 0;

      if ($row["orgName"] != htmlspecialchars(trim($donor[1]))) {
          $sql = 'UPDATE Donor SET orgName ="'.htmlspecialchars(trim($donor[1])).'"WHERE donorId ='.$donor[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Organization's Name updated successfully. ";
              $_SESSION["donorNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      }
      else{
        $unchangedCount++;
      }
      if ($row["repName"] != htmlspecialchars(trim($donor[2]))) {
          $sql = 'UPDATE Donor SET repName ="'.htmlspecialchars(trim($donor[2])).'"WHERE donorId ='.$donor[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Rep Name updated successfully. ";
              $_SESSION["donorNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      }
      else{
        $unchangedCount++;
      }
      if ($row["phoneNum"] != htmlspecialchars(trim($donor[3]))) {
          $sql = 'UPDATE Donor SET phoneNum ="'.htmlspecialchars(trim($donor[3])).'"WHERE donorId ='.$donor[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Phone Number updated successfully. ";
              $_SESSION["donorNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      }
      else{
        $unchangedCount++;
      }
      if ($row["email"] != htmlspecialchars(trim($donor[4]))) {
          $sql = 'UPDATE Donor SET email ="'.htmlspecialchars(trim($donor[4])).'"WHERE donorId ='.$donor[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Email updated successfully. ";
              $_SESSION["donorNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      }
      else{
        $unchangedCount++;
      }
      if ($row["address"] != htmlspecialchars(trim($donor[5]))) {
          $sql = 'UPDATE Donor SET address ="'.htmlspecialchars(trim($donor[5])).'"WHERE donorId ='.$donor[0];
          if ($mysqli->query($sql) === true) {
              $htmlOutput .= "Address updated successfully. ";
              $_SESSION["donorNotice"] = true;
          } else {
              $htmlOutput .= "Update Failed: ". $mysqli->error;
          }
      }
      else{
        $unchangedCount++;
      }

      if ($unchangedCount == 5){
        $_SESSION["donorNotice"] = true;
        $htmlOutput = "No changes detected.";
      }

    $_SESSION["donorMessage"] = $htmlOutput;
    header("Location: http://jorochial.cs.loyola.edu/html/Donor/viewDonor.php?id=".$donor[0]);
    exit;
?>
<file_sep>package com.example.cmaalouf.uxauction;

import com.example.cmaalouf.uxauction.MainActivity;
import com.example.cmaalouf.uxauction.R;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import androidx.test.rule.ActivityTestRule;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;

public class LogInViewTest
{
    @Rule
    public ActivityTestRule<MainActivity> loginActivityRule = new ActivityTestRule<>(MainActivity.class);

    @Test
    public void testTextViews()
    {

        onView(withId(R.id.login)).check(matches(withText("Login")));
    }

}

<file_sep><?php
require_once 'config.php';

$htmlOutput = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}
//$bidder = array($_POST["username"],$_POST["email"],$_POST["password"],$_POST["fname"],$_POST["lname"]);
$bidder = array($_POST["fname"],$_POST["lname"],$_POST["email"],$_POST["username"],$_POST["pwd"]);

$sql = 'INSERT INTO Bidder (fname, lname, email, username, pwd) VALUES';

$bidder[0] = htmlspecialchars(trim($bidder[0]));
$bidder[1] = htmlspecialchars(trim($bidder[1]));
$bidder[2] = htmlspecialchars(trim($bidder[2]));
$bidder[3] = htmlspecialchars(trim($bidder[3]));
$bidder[4]= password_hash(htmlspecialchars(trim($bidder[4])), PASSWORD_DEFAULT);
$sql .= '("'.$bidder[0].'","'. $bidder[1] .'","'. $bidder[2] .'","'. $bidder[3] .'","'.$bidder[4].'")';
  $sql .= ";";
 if ($mysqli->query($sql) === TRUE) {
      $htmlOutput = "Success";
  }
  else{
    $htmlOutput .= "Failed ". $mysqli->error;
	echo "inside error";
  }
echo $htmlOutput;
?>
<file_sep># Overview of the Project
The goal of this project is to develop a cross platform auction and bid application across web browsers and android devices. Auction admins can list, set, alter, modify, view items and more on any web browser, optimized for desktop. Auction participants (aka bidders) will utilize the android application to search, view, bid, alter/increase bids, and more on Android devices with all data being maintained via MySQL database interaction.

# Team Members:
1. <NAME> (Jo)
2. <NAME> (ro)
3. <NAME> (chi) {Team Lead}
4. <NAME> (al)

# View the live development version of the site here:
[jorochial.cs.loyola.edu](http://jorochial.cs.loyola.edu/html/index.php)

# Documentation

[Software Specification Doc](https://docs.google.com/document/d/1FqCSX0mkYGmzBUIB0VnIK-IrNWB5HTUl3e_dMB7CK28/edit?usp=sharing)

[Design Specification Doc](https://docs.google.com/document/d/1FPO10swg8NkEMLQjEbMFuLM_w9yK_ZRpLC_51IIXfGM/edit?usp=sharing)

[Final Report Document](https://docs.google.com/document/d/1FqCSX0mkYGmzBUIB0VnIK-IrNWB5HTUl3e_dMB7CK28/edit?usp=sharing)

## Implemented Features
Web Application
- Ability to create auctions
- Add items to a specific auction
- Delete items from a auction
- View inidividual item
- Edit items
- Time a auction to start and end at a spefic time/date
- Admin can create sub/child-admins
- Credential/profile based logins
- Change password
- Hashed passwords for proper security/encrpytion
- SQL sanitization against SQL injection
- Responsive CSS across devices/window sizes

Android Application
- Create profile
- Change password
- Bid on item
- View item
- Autobid to a certain vlaue on item
- Email confirmation of bids
- Search for items
- See countdown of time left on a bidding
- See countdown of time left on a auction

## Not Yet Implemented Features
-
-
-

# Dependencies

## Frameworks:
- Bootstrap 4
- W3
- jquery

## General Web Dev:
- HTML
- PHP
- CSS
- SASS

## Database:
- MySQL
- myPHPadmin

## Android App
- Java
- Android Studio

## To fork this repo:
- Download a SASS complier such as [Koala](http://koala-app.com/)
- Setup a web server or your localhost to run PHP
- All other files can be run in the web browser

This project contains all code created by the development team, as well as the Bootstrap 4 source files for compling the project SCSS file.

# 482f19-JOROCHIAL
This is the repository for team jorochial to develop their Auction application in Fall 2019 Software Engineering course.
<file_sep><?php
require_once '../config.php';
$mysqli = new mysqlii_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$statement = $mysqli_query($mysqli,"select * from Item ");
$json_array=array();
while($row = mysqli_fetch_assoc($result))
{
	$json_array[] = $row;
}

print(json_encode($json_array));
//mysqli_close($db);
?>
<file_sep>package com.example.cmaalouf.uxauction;

import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;

import static com.example.cmaalouf.uxauction.MainActivity.enter;
import static com.example.cmaalouf.uxauction.MainActivity.pass;
import static com.example.cmaalouf.uxauction.MainActivity.username;
import static com.example.cmaalouf.uxauction.MainActivity.verified;
import static java.lang.String.valueOf;

public class LoginFetch extends AsyncTask<String,String,String> {

    private Context ctx;
    public LoginFetch(Context context)
    {
        this.ctx=context;

    }

    /**
     * Purpose: execute on AI thread  before doInBackground
     */
    @Override
    protected void onPreExecute()
    {
        super.onPreExecute();
    }

    /**
     * Purpose: fetch the data for logging in
     * @param String...strings the data types to perform the tasks on
     * @return the results of the task
     */
    @Override
    protected String doInBackground(String... strings) {
        try {
            //items.add("before url");
            String user = strings[0];
            String passw = strings[1];
            //String user = "hfranceschi";// strings[0];
            //String passw = "pwd";//strings[1];
            URL url = new URL("http://jorochial.cs.loyola.edu/php/index.php");

            Map<String,Object> params = new LinkedHashMap<>();
            params.put("username", user );
            params.put("password", passw);

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String,Object> param : params.entrySet()) {
                if (postData.length() != 0) postData.append('&');
                postData.append(URLEncoder.encode(param.getKey(), "UTF-8"));
                postData.append('=');
                postData.append(URLEncoder.encode(String.valueOf(param.getValue()), "UTF-8"));
            }
            byte[] postDataBytes = postData.toString().getBytes("UTF-8");

            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            //Log.w("HHTP STAT", valueOf(con.getResponseCode()));
            con.setRequestMethod("POST");
            //con.setRequestProperty("username","hfranceschi");
            //con.setRequestProperty("password","pwd");
            con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            con.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
            con.setDoOutput( true );
            con.setDoInput(true);

            OutputStream os = con.getOutputStream();
            Log.w("USR", ""+user);
            Log.w("PSS",""+passw);
            Log.w("OS ",os.toString());
           // BufferedWriter writer = new BufferedWriter( new OutputStreamWriter(os, "iso-8859-1"));
            os.write(postDataBytes);
            //writer.write(pass);
            //writer.flush();
            //writer.close();
            os.close();

            InputStream inputStream = con.getInputStream();
            Log.w("fetchdata ",inputStream.toString());
            //items.add("after input stream");

            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "iso-8859-1"));
            String line = "";
            String result = "";

            //items.add("past buffer");
            while ((line=bufferedReader.readLine()) != null) {
                result += line;
                //json+=line
            }
            Log.w("PHP", result);
            enter.add(result.matches("True"));

            bufferedReader.close();
            inputStream.close();
            con.disconnect();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
            // items.add("IO");
        }

        return "";
    }

    /**
     * Purpose: Run in the UI thread after doInBackground
     * @param aVoid the String result from doInBackground
     */
    @Override
    protected  void onPostExecute(String aVoid)
    {

        super.onPostExecute(aVoid);

    }

}
<file_sep>package com.example.cmaalouf.uxauction;

import android.graphics.Bitmap;

import java.util.TreeMap;

public class Item
{

    protected String description;
    private double startingBid;
    protected double minIncrement;
    private String donor;
    protected String name;
    public int id;
    protected Bitmap image;
    private TreeMap<Double, Bidder> biddersForThisItem;

    public Item(int id, String name, String description, double startingBid, double minIncrement, String donor)
    {
        this.name = name;
        this.id = id;
        this.description = description;
        this.startingBid = startingBid;
        this.minIncrement = minIncrement;
        this.donor = donor;
        biddersForThisItem = new TreeMap<>();

    }

    public void setImage(Bitmap bitmap){
        this.image = bitmap;
    }

    /**
     * Purpose: Give other classes access to an items bidders
     * @return map of bids associated with bidders for this item
     */
    public TreeMap<Double, Bidder> getBiddersForThisItem()
    {
        String username = "cmaalouf";
        String password= "<PASSWORD>";
        String firstName = "chiara";
        String lastName = "maalouf";
        String emailAddress= "<EMAIL>";
        String billingInfo = "blah";
        biddersForThisItem.put(1.0, new Bidder(username,password, firstName,lastName,emailAddress,billingInfo));
        return this.biddersForThisItem;
    }

    /**
     * Purpose: Give other classes access to an items highest bid
     * Each item has a TreeMap of bids associated with bidders
     * Since TreeMaps are sorted, the last key will be associated with the highest bidder
     * @return the highest bid for this item, which is mapped to its respective bidder
     */
    public double getCurrentHighestBid()
    {
        return biddersForThisItem.lastKey();
    }

    public String getItemDescription()
    {
        return this.description;
    }

    public double getStartingBid()
    {
        return this.startingBid;
    }

    /**
     * Purpose: Tell java how to print Item objects
     * @return the string to print
     */
    @Override
    public String toString()
    {
        String str = "";
        str += this.name + ": " + this.startingBid;
        return str;
    }

}
<file_sep><!DOCTYPE html>
<?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

if (isset($_SESSION["itemNotice"])) {
    if ($_SESSION["itemNotice"] == true) {
        $alert =  '

        '.$_SESSION["itemMessage"].'
      <button type="button" class="close" data-dismiss="alert" aria-label="Close"  onclick="<?php unset($_SESSION["itemNotice"]); ?>">
      ×
      </button>

';
    } else {#($_SESSION["itemNotice"] == False){
        $alert =  '

       '.$_SESSION["itemMessage"].'
      <button type="button" class="close" data-dismiss="alert" aria-label="Close"  onclick="<?php unset($_SESSION["itemNotice"]); ?>">
      ×
      </button>

';
    }
}
if(!isset($_GET["page"])){
  $pageNumber = 1;
}
else {
  $pageNumber = $_GET["page"];
  if($pageNumber < 1){
    $pageNumber = 1;
    $_GET["page"] = 1;
  }
}

function itemCard($id, $title, $description, $c_bid, $min_inc, $start_bid, $donor, $auction, $pictureName, $pictureRef, $pictureData) {
  #TODO: Change hard coded picture to link
  //Possible solutions
  //<embed src='data:".$row['mime'].";base64," .base64_encode($row['data'])."' width='200'/>
  //Original: all original images
  //New: breaks all but new images
  return '

'.$title.'

'.$description.'

Current Bid: $'.$c_bid.'

Minimum Increment: $'.$min_inc.'

Starting Bid: $'.$start_bid.'

Donated by: '.$donor.'

Auction: '.$auction.'

          View Details

';
}

function itemGrid($pageNum, $mysqli){
  $htmlResult = "";
  $startRow = ($pageNum-1)*4;
  $sql = "SELECT * from Item order by id LIMIT $startRow , 4";
  $result = $mysqli->query($sql);
  echo $mysqli->error;
  while( $row = $result->fetch_assoc( ) ){
    if(is_null($row["donorName"])){
     $htmlResult .= itemCard($row["id"],$row["itemName"],$row["description"], $row['currentBid'],$row["minimumBidInc"],$row["startingBid"],"Anonymous",$row["auctionNameRef"], $row["imageName"], $row["imageRef"], $row["imageData"]);
   }else{
     $htmlResult .= itemCard($row["id"],$row["itemName"],$row["description"], $row['currentBid'],$row["minimumBidInc"],$row["startingBid"],$row["donorName"],$row["auctionNameRef"], $row["imageName"], $row["imageRef"], $row["imageData"]);
   }
 }
  return $htmlResult;
}

?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../css/SASS/AuctionProject.css">

    <title>Dashboard</title>

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

      </button>

            Dashboard(current)

              Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="../search.php">

          <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

    <?php echo $alert ?>

        All Items
        Auctions
        Donors
        Charities
        Results Summary

        <form class="form-inline md-form form-lg " method="GET" action="../search.php">
          <input type="text" id="inputLGEx" class="col-10 form-control form-control-lg" placeholder="Search for an existing item at auction" name="query">
          <input class="col btn btn-lg btn-primary" type="submit" value="Submit">

        </form>

        <?php echo itemGrid($pageNumber, $mysqli);?>

<a class="page-link" href="DashboardPage.php?page=<?php echo $pageNumber-1;?>">Previous

1

2

3

<a class="page-link" href="DashboardPage.php?page=<?php echo $pageNumber+1;?>">Next

 Contact Us

Main Campus

          4501 N. Charles Street

          Baltimore, MD 21210

          410-617-2000 or 1-800-221-9107

          Timonium Graduate Center

          2034 Greenspring Drive

          Timonium, MD 21093

          410-617-1903

          Columbia Graduate Center

          8890 McGaw Road

          Columbia, MD 21045

          410-617-7600

<file_sep>package com.example.cmaalouf.uxauction;

import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;

import static com.example.cmaalouf.uxauction.ScrollingActivity.items;
import static com.example.cmaalouf.uxauction.ScrollingActivity.query;
import static java.lang.String.valueOf;

public class SearchFetchData extends AsyncTask<String,String,String> {

    String data;
    String data_parse;
    String single_parse;
    private Context ctx;
    public SearchFetchData(Context context)
    {
        this.ctx=context;

    }

    /**
     * Purpose: execute before doInBackground, initialize data to an empty string
     */
    @Override
    protected void onPreExecute()
    {
        super.onPreExecute();
        data ="";
    }

    /**
     * Purpose: fetch the data for searching
     * @param ///String...voids the data types to perform the tasks on
     * @return the results of the task
     */
    @Override
    protected String doInBackground(String... voids) {
        try {
            //items.add("before url");
            Log.w("QUERY", ""+query);
            URL url = new URL("http://jorochial.cs.loyola.edu/php/search.php?query="+query);
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            //Log.w("HHTP STAT", valueOf(con.getResponseCode()));
            con.setRequestMethod("GET");

            con.setDoOutput( true );
            con.setDoInput(true);

            InputStream inputStream = con.getInputStream();
            Log.w("fetchdata ",inputStream.toString());
            //items.add("after input stream");

            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "iso-8859-1"));
            String line = "";
            String result = "";
            data = "";
            //items.add("past buffer");
            while ((line=bufferedReader.readLine()) != null) {
                result += line;
                //json+=line;
                Log.w("echo from php", result);
                data = data +line;

            }
            data = result;
            JSONArray jsonArray = new JSONArray(result);
            for(int i = 0; i<jsonArray.length(); i++) {
                JSONObject jsonObject = (JSONObject) jsonArray.get(i);
                int id = Integer.parseInt(jsonObject.get("id").toString());
                String name = jsonObject.get("itemName").toString();
                String desc =jsonObject.get("description").toString();
                String donor = jsonObject.get("donorName").toString();
                Double startingBid = Double.valueOf(jsonObject.get("startingBid").toString());
                Double minInc = Double.valueOf(jsonObject.get("minimumBidInc").toString());
                Item item = new Item(id, name, desc, startingBid,minInc,donor);
                items.add(item);
            }

            bufferedReader.close();
            inputStream.close();
            con.disconnect();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
            // items.add("IO");
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return data;
    }

    /**
     * Purpose: Run in the UI thread after doInBackground
     * @param aVoid the String result from doInBackground
     */
    @Override
    protected  void onPostExecute(String aVoid)
    {

        super.onPostExecute(aVoid);

    }
    /**
     * Purpose: give other classes access to data
     * @return the data computed from doInBackground
     */
    public String getData(){

        return data;
    }

}
<file_sep><?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}

require_once '../config.php';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);

if(!isset($_GET["page"])){
  $pageNumber = 1;
  $_GET["page"] = 1;
}
else {
  $pageNumber = $_GET["page"];
  if($pageNumber < 1){
    $pageNumber = 1;
    $_GET["page"] = 1;
  }
}

if(isset($_GET["id"])){

  $name = "Game Sale";

  $result = $mysqli->query('SELECT * FROM Auction WHERE id = "'.$_GET["id"].'";');

  $row = $result->fetch_assoc( );
  $auction_id = $row["id"];
  $auction_title = $row['auctionName'];
  $auction_description = $row['description'];
  $auction_start_date = date("F j, Y, g:i a", strtotime($row["startTime"]));
  $auction_end_date=  date("F j, Y, g:i a", strtotime($row['endTime']));
  $auction_charity = $row['beneficiary'];
}
else{
  $auction_id = 0;
  $auction_title = "The Best Auction";
  $auction_description = "This auction is in support of the XYZ group and features items from Donors.";
  $auction_start_date = date("l jS \of F Y h:i:s A", 1530054626);;
  $auction_end_date= date("l jS \of F Y h:i:s A", 1530154626);
  $auction_charity = "The Children's Project";
}

if (isset($_SESSION["auctionNotice"])) {
    if ($_SESSION["auctionNotice"] == true) {
        $alert =  '

        '.$_SESSION["auctionMessage"].'
      <button type="button" class="close" data-dismiss="alert" aria-label="Close" onclick="<?php unset($_SESSION["auctionNotice"]); ?>">
      ×
      </button>

';
    } else {#($_SESSION["itemNotice"] == False){
        $alert =  '

       '.$_SESSION["auctionMessage"].'
      <button type="button" class="close" data-dismiss="alert" aria-label="Close" onclick="<?php unset($_SESSION["auctionNotice"]); ?>">
      ×
      </button>

';
    }
}

function itemRow($id,$name, $donor, $current_bid, $start, $min_inc) {
  #TODO: Change hard coded picture to link
  return '

'.$name.'

      '.$donor.'
       $'.$current_bid.'
       $'.$start.'
       $'.$min_inc.'
      View Item

';
}

function itemTable( $mysqli, $auction_title, $pageNum, $tableSize){
  $htmlResult = "";
  $startRow = ($pageNum-1)*$tableSize;
  $sql = 'SELECT *  FROM Item WHERE auctionNameRef LIKE "'.$auction_title.'" order by id LIMIT '.$startRow.' , '.$tableSize;
  $result = $mysqli->query($sql);
  echo $mysqli->error;
  while( $row = $result->fetch_assoc( ) ){
     $htmlResult .= itemRow($row["id"],$row["itemName"],$row["donorName"],$row["currentBid"],$row["startingBid"],$row["minimumBidInc"]);
  }
  return $htmlResult;
}

function sumAmounts($mysqli, $auction_title){
  $output =  "Total raised: $";
  $sql = 'SELECT sum(currentBid) FROM Item WHERE auctionNameRef LIKE "'.$auction_title.'";';
  $result = $mysqli->query($sql);
  echo $mysqli->error;
  while( $row = $result->fetch_assoc( ) ){
     $output .= $row["sum(currentBid)"];
  }
  return $output;
}

?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../css/SASS/AuctionProject.css">

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-h5="Toggle navigation">

      </button>

            Dashboard(current)

              Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="../search.php">

          <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-h5="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

<?php echo $alert; ?>

<?= $auction_title ?>

<?= $auction_description;?>

Start Date and Time: <?= $auction_start_date;?>

End Date and Time: <?php echo $auction_end_date;?>

Beneficiary: <?php echo $auction_charity;?>

<?php echo sumAmounts($mysqli, $auction_title)?>

      Edit Auction Details

          Item Title
          Item Description
          Item's Donor
          Current Bid
          Minimum Bid
          Starting Bid

        <?php echo itemTable($mysqli,$auction_title, $pageNumber,4);?>

<a class="page-link" href="viewAuction.php?id=<?php echo $auction_id."page=".$pageNumber-1;?>">Previous

<a class="page-link" href="viewAuction.php?id=<?php echo $auction_id;?>&page=1">1

<a class="page-link" href="viewAuction.php?id=<?php echo $auction_id;?>&page=2">2

<a class="page-link" href="viewAuction.php?id=<?php echo $auction_id;?>&page=3">3

<a class="page-link" href="viewAuction.php?id=<?php echo $auction_id;?>&page=<?php echo $pageNumber+1;?>">Next

 Contact Us

Main Campus

          4501 N. Charles Street

          Baltimore, MD 21210

          410-617-2000 or 1-800-221-9107

          Timonium Graduate Center

          2034 Greenspring Drive

          Timonium, MD 21093

          410-617-1903

          Columbia Graduate Center

          8890 McGaw Road

          Columbia, MD 21045

          410-617-7600

<file_sep><?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " . $mysqli->connect_error);
}

if (isset($_GET["id"])) {
    $sql = "SELECT * FROM Charity WHERE charityId = ". $_GET["id"];

    $result = $mysqli->query($sql);
    $row = $result->fetch_assoc();
    $charity_edit_link= "editCharity.php?id=".$row["charityId"];
    $charity_title = $row["orgName"];

    $charity_repName = $row["repName"];
    $charity_phoneNum= $row["phoneNumber"];
    $charity_email= $row["email"];
    $charity_address = $row["address"];
} else {
    $charity_title = "Cars for Kids";
    $charity_repName = "DEFAULT NAME";
    $charity_phoneNum= "213-123-2312";
    $charity_email= "<EMAIL>";
    $charity_address = "123 Main Street
 Baltimore, MD";
}

if (isset($_SESSION["charityNotice"])) {
    if ($_SESSION["charityNotice"] == true) {
        $alert =  '

        '.$_SESSION["charityMessage"].'
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      ×
      </button>

';
    } else {#($_SESSION["auctionNotice"] == False){
        $alert =  '

       '.$_SESSION["charityMessage"].'
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      ×
      </button>

';
    }
}

#Donaton table
function auctionRow($id,$name, $descript, $startTime, $endTime) {
  return '

'.$name.'

      '.date('m/d/Y h:i A', $startTime).'
      '.date('m/d/Y h:i A', $endTime).'
      View Auction

';
}

function auctionTable($mysqli, $orgName){
  $htmlResult = "";
  $sql = 'SELECT *  FROM Auction WHERE beneficiary LIKE "'.$orgName.'"';
  $result = $mysqli->query($sql);
  echo $mysqli->error;
  while( $row = $result->fetch_assoc( ) ){
     $htmlResult .= auctionRow($row["id"],$row["auctionName"],$row["description"],strtotime($row["startTime"]),strtotime($row["endTime"]));
  }
  return $htmlResult;
}

?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../css/SASS/AuctionProject.css">

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-h5="Toggle navigation">

      </button>

            Dashboard(current)

              Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="../search.php">

          <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-h5="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

<?php echo $alert; ?>

<?php echo $charity_title;?>

Contact Information

<?php echo $charity_repName;?>
<?php echo $charity_phoneNum;?>
<?php echo $charity_email;?>
<?php echo $charity_address;?>

        <a class="btn btn-primary" href="<?php echo $charity_edit_link?>">Edit Charity's Details

Related Auctions:

          Name
          Start Time
          End Time

        <?php echo auctionTable($mysqli, $charity_title);?>

 Contact Us

Main Campus

          4501 N. Charles Street

          Baltimore, MD 21210

          410-617-2000 or 1-800-221-9107

          Timonium Graduate Center

          2034 Greenspring Drive

          Timonium, MD 21093

          410-617-1903

          Columbia Graduate Center

          8890 McGaw Road

          Columbia, MD 21045

          410-617-7600

<file_sep><?php

<?php

session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once '../config.php';

$_SESSION["auctionNotice"] = False;
$htmlOutput = "";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

#echo "Connected successfully";
#INSERT INTO `Auction`(`auctionNameRef`, `auctionName`, `description`, `startingBid`, `minimumBidInc`, `donorName`, `auctionPic`)
$auction = array($_POST["AuctionTitle"],$_POST["AuctionDescription"],$_POST["AuctionCharity"],$_POST["StartDateTime"],$_POST["EndDateTime"]);
#$auction = array("<EMAIL>","Herve","Franceschi","hjfr<PASSWORD>chi","<PASSWORD>");
# user should be from form
#| <EMAIL> | Herve | Franceschi | <PASSWORD> | password

  $sql .= 'INSERT INTO Auction (auctionName, description, beneficiary, startTime, endTime) VALUES'; #TODO: add auctionPic

  $auction[0] = htmlspecialchars($auction[0]);
  $auction[1] = htmlspecialchars(trim($auction[1]));
  $auction[2] = htmlspecialchars(trim($auction[2]));
  $auction[3] = htmlspecialchars(trim($auction[3]));
  $auction[4] = htmlspecialchars(trim($auction[4]));
#  $auction[6] = htmlspecialchars(trim($auction[6]));
  $sql .= '("'.$auction[0].'","'. $auction[1] .'","'. $auction[2] .'","'. $auction[3] .'","'. $auction[4] .'","'. $auction[5]. '")';
  $sql .= ";";
  #echo $sql;
  if ($mysqli->query($sql) === TRUE) {
      $htmlOutput .= "Auction added successfully";
  }
  else{
    $htmlOutput .= "Insertion Failed: ".$sql. $mysqli->error;

  }
  #echo $htmlOutput;
  $_SESSION["auctionNotice"] = True;

else {
  #echo "vaildation fail";
  $_SESSION["auctionNotice"] = False;
}
$htmlOutput .= " Auction: ".$auction[1];
$_SESSION["auctionMessage"] = $htmlOutput;
header("Location: http://jorochial.cs.loyola.edu/html/Auction/AuctionDashboard.php");
exit;
?>
<file_sep><?php

require_once '../config.php';

//User entered values to validate
$username = $_POST['resetUsername'];
$userCurrentPassword = $_POST['pwd'];

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);

if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

//Selects password of that user
$sqlValidateCredentials = "SELECT * from admin where uname = '$username'";
$result = $mysqli->query($sqlValidateCredentials);

//Does that user exist
if ($result->num_rows > 0) {
    // Gets password in database taht matches that username
    while($row = $result->fetch_assoc()) {
        $trueCurrentPassword = $row['pwd'];
    }

    //Determines if passwords match of user
    if ($newPassword1 !== $newPassword2) {
      goto a;
    }
    else { //User passwords match

      //Check if password matches official PASSWORD_DEFAULT
      if (password_verify($newPassword1, $trueCurrentPassword)) {

        $hashedPassword = password_hash($<PASSWORD>, PASSWORD_DEFAULT);
        $sqlUpdatePassword = "UPDATE admin set pwd = '$<PASSWORD>' where uname = '$username'";

        //Determines if password user entered matches databases
        if($mysqli->query($sqlUpdatePassword)){
          echo '';
          header("Refresh:1; url=http://jorochial.cs.loyola.edu/html/Settings.php");
        }

      }
      else {
        echo '';
        header("Refresh:1; url=http://jorochial.cs.loyola.edu/html/Settings.php");
      }

    }
}
else{
  echo '';
}

goto end;

a:
  echo '';
  header("Refresh:1 ; url=http://jorochial.cs.loyola.edu/html/Settings.php");

b:
  echo '';
  header("Refresh:1; url=http://jorochial.cs.loyola.edu/html/Settings.php");

end:
  header("Refresh:0; url=http://jorochial.cs.loyola.edu/html/Settings.php");

?>
<file_sep><!DOCTYPE html>
<?php
// Start the session
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: index.php");
  exit();
}
?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../css/SASS/AuctionProject.css">

    <title>Search Results</title>

      AuctionForHaiti
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

      </button>

            Dashboard(current)

              Host an Event

            Settings

            Logout

        <form class="form-inline" method="get" action="search.php">
          <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
          <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
        </form>

Your query of ________ returned:

Chessboard

This chessboard was owned by <NAME> back in 1945, seeing use by over three generation sof royal family....

Current Bid: $1,000.00

Donated by: The Royal Family

 Contact Us

Main Campus

      4501 N. Charles Street

      Baltimore, MD 21210

      410-617-2000 or 1-800-221-9107

      Timonium Graduate Center

      2034 Greenspring Drive

      Timonium, MD 21093

      410-617-1903

      Columbia Graduate Center

      8890 McGaw Road

      Columbia, MD 21045

      410-617-7600

<file_sep><?php

session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] !== true){
  //if not login in
  $_SESSION["secure_Attempt"] = true;
  header("location: ../index.php");
  exit();
}
require_once 'config.php';

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

if(isset($_GET["query"])){
  $query = htmlspecialchars($_GET["query"]);
}else{
  $query = htmlspecialchars("Car");
}

if(!isset($_GET["page"])){
  $pageNumber = 1;
}
else {
  $pageNumber = $_GET["page"];
  if($pageNumber < 1){
    $pageNumber = 1;
    $_GET["page"] = 1;
  }
}

function itemCard($id, $title, $description, $c_bid, $min_inc, $start_bid, $donor, $auction, $pictureName, $pictureRef, $pictureData) {
  #TODO: Change hard coded picture to link
  return '

'.$title.'

'.$description.'

Current Bid: $'.$c_bid.'

Minimum Increment: $'.$min_inc.'

Starting Bid: $'.$start_bid.'

Donated by: '.$donor.'

Auction: '.$auction.'

          View Details

';
}

function itemGrid($pageNum, $mysqli, $query){
  $htmlResult = "";
  $startRow = ($pageNum-1)*4;
  $sql = "SELECT * from Item where (itemName like '%$query%') order by itemName LIMIT $startRow , 4";
  $result = $mysqli->query($sql);
  if ($result->num_rows <= 0) {
      $sql = "SELECT * from Item where (description like '%$query%') LIMIT $startRow , 4";
      $result = $mysqli->query($sql);
  }
  echo $mysqli->error;
  while( $row = $result->fetch_assoc( ) ){
     $htmlResult .= itemCard($row["id"],$row["itemName"],$row["description"], $row['currentBid'],$row["minimumBidInc"],$row["startingBid"],$row["donor"],$row["auctionNameRef"], $row["imageName"], $row["imageRef"], $row["imageData"]);
  }
  return $htmlResult;
}

?>

  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="../css/SASS/AuctionProject.css">

  <title>Search Results</title>

    AuctionForHaiti
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">

    </button>

          Dashboard(current)

          Host an Event

          Settings

          Logout

      <form class="form-inline" method="get" action="search.php">

        <input class="form-control mr-sm-2" type="search" name="query" placeholder="Search" aria-label="Search">
        <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
      </form>

  <form class="form-inline md-form form-lg " method="GET" action="search.php">
    <input type="text" id="inputLGEx" class="col-10 form-control form-control-lg" placeholder="Search for an existing auction" name="query">
    <input class="col btn btn-lg btn-primary" type="submit" value="Submit">

  </form>

Your query of <?= $query ?> returned:

    <?= itemGrid($pageNumber, $mysqli, $query);?>

<a class="page-link" href="search.php?query=<?= $query?>&page=<?= $pageNumber-1;?>">Previous

<a class="page-link" href="search.php?query=<?= $query?>&page=1">1

<a class="page-link" href="search.php?query=<?= $query?>&page=2">2

<a class="page-link" href="search.php?query=<?= $query?>&page=3">3

<a class="page-link" href="search.php?query=<?= $query?>&page=<?= $pageNumber+1;?>">Next

 Contact Us

Main Campus

        4501 N. Charles Street

        Baltimore, MD 21210

        410-617-2000 or 1-800-221-9107

        Timonium Graduate Center

        2034 Greenspring Drive

        Timonium, MD 21093

        410-617-1903

        Columbia Graduate Center

        8890 McGaw Road

        Columbia, MD 21045

        410-617-7600

<file_sep><?php

require_once 'config.php';

$htmlOutput = "No Post";

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " .  $mysqli->connect_error);
}

//retrieve user entered information from form
$username = $password = "";

if(isset($_SERVER["REQUEST_METHOD"])){
if ($_SERVER["REQUEST_METHOD"] == "POST") {
  $username = htmlspecialchars(trim($_POST['username']));
  $password = htmlspecialchars(trim($_POST['password']));

  //get information from Database
  $sql = 'SELECT * FROM Bidder WHERE username = "' . $username . '";';
  $result = $mysqli->query($sql);
  if ($result->num_rows > 0) {
     while($row = $result->fetch_assoc()) {
      if ($username == $row["username"]){
        //verify Password
        if (password_verify($password, $row["pwd"])){
          $htmlOutput = "True";
        }else{
          $htmlOutput = "False";
        }
      }
      }
  }  else{
    echo $mysqli->connect_error;
    $userClass = $passwordClass= 'class="form-control is-invalid"';
  }
}
}

echo $htmlOutput;

$mysqli->close();
?>

languages: Java Markdown PHP

repo_language: Java