<file_sep><?php

session_start();

    if(!$_SESSION['validUser'] == true){
        header('Location: ../html/login.php');
    }

require 'selectProduct.php';

$inProductImage = "";
$inProductName = "";
$inProductPrice = "";
$inProductDescription = "";
$inProductBuyNowButton = "";
$inProductBuyNowButton2 = "";
$inProductAddToCartButton = "";
$inProductViewCart= "";

$inProductImageErrMsg = "";
$inProductNameErrMsg = "";
$inProductPriceErrMsg = "";
$inProductDescriptionErrMsg = "";
$inProductBuyNowButtonErrMsg= "";
$inProductBuyNowButton2ErrMsg= "";
$inProductAddToCartErrMsg= "";
$inProductViewCartErrMsg= "";

if(isset($_POST["submit"]))
	{
		// capturing the values of the form inputs
		$inProductImage= $_FILES['productImage']['name'];
		$inProductName = $_POST["productName"];
		$inProductPrice = $_POST["productPrice"];
        $inProductDescription = $_POST["productDescription"];
        $inProductBuyNowButton = $_POST["productBuyNow"];
        $inProductAddToCart= $_POST["addToCart"];
        $inProductBuyNowButton2=$_POST["productBuyNow2"];
        $inProductViewCart= $_POST["viewCart"];

        $target = "../images/".basename($_FILES['productImage']['name']);

        require 'PDOconnection.php';
        require 'insertProduct.php';

        if(move_uploaded_file($_FILES['productImage']['tmp_name'], $target)){
            $msg = 'Success';
        }else{
            $msg = 'Fail';
        }
	
        $validForm = true; // sets a flag/switch to make sure data is valid
        // PHP validation goes here
		
		if($validForm){
			
                require('PDOconnection.php');
                //echo '<script>alert("valid")</script>';
			
			} else{
			
			// BAD BAD Data - Display error message, display form to user
			// 1. bad name
				// put data on the form
				// put error messege on the form
                $inProductPriceErrMsg = "Invalid Product Price";
                $inProductNameErrMsg = "Invalid Product Name";	
                $inProductPriceErrMsg = "Invalid Product Price";
                $inProductDescriptionErrMsg = "Invalid Product Description";
                $inProductBuyNowButtonErrMsg = "Invalid button code";	
                $inProductAddToCartErrMsg = "Invalid Add to cart code";
                $inProductViewCartErrMsg = "invalid view card code";
                $inProductBuyNowButton2ErrMsg = "invalid buy now button code";
                    	
				}
	
	}else{
		}
?>
<!doctype html>
<html>
<head>

<!-- Meta Data -->
<meta charset="UTF-8">
<meta name="description" content="photography">
<meta name="author" content="<NAME> photography">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Product Form</title>

<!-- JavaScript -->
<script  src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="../js/userNav.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="<KEY>" crossorigin="anonymous"></script>

<!-- CSS -->
<link href="css/style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">

</head>

<body>

    <div id="userNav"></div>


    <div id="container" class="p-3 col-9 m-auto">

    <form method="POST" action="addProduct.php" enctype="multipart/form-data">
        <input type="hidden" name="size" value="1000000">
        <h1>Add Product:</h1>
        
        <div class="form-group">
            <label for="productImage">Product Image</label>
            <input type="file" class="form-control" id="productImage" name="productImage">
        </div>

        <div class="form-group">
            <label for="productName">Product Name</label>
            <input type="text" class="form-control" id="productName" name="productName" placeholder="Enter Product Name" value="<?php echo $inProductName; ?>" required><span><?php echo $inProductNameErrMsg; ?> </span>
        </div>

        <div class="form-group">
            <label for="productPrice">Product Price</label>
            <input type="text" class="form-control" id="productPrice" name="productPrice" placeholder="Enter Product Price" value="<?php echo $inProductPrice; ?>" required><span><?php echo $inProductPriceErrMsg; ?> </span>
        </div>

        <div class="form-group">
            <label for="productDescription">Product Description</label>
            <textarea class="form-control" id="productDescription" name="productDescription" placeholder="What is the picture?" value="<?php echo $inProductDescription; ?>" required></textarea><span><?php echo $inProductDescriptionErrMsg; ?>
        </div>

        <div class="form-group">
            <label for="productBuyNow">Buy Now Online </label>
            <textarea class="form-control" id="productBuyNow" name="productBuyNow" placeholder="buy now button code" value="<?php echo $inProductBuyNowButton; ?>"></textarea><span><?php echo $inProductBuyNowButtonErrMsg; ?>
        </div>

        <div class="form-group">
            <label for="productBuyNow2">Buy Now Paper print</label>
            <textarea class="form-control" id="productBuyNow2" name="productBuyNow2" placeholder="buy now physical print button code" value="<?php echo $inProductBuyNowButton2; ?>"></textarea><span><?php echo $inProductBuyNowButton2ErrMsg; ?>
        </div>

        <div class="form-group">
            <label for="addToCart">online Add To Cart</label>
            <textarea class="form-control" id="addToCart" name="addToCart" placeholder="add to cart button code" value="<?php echo $inProductAddToCart; ?>" required></textarea><span><?php echo $inProductAddToCartErrMsg; ?>
        </div>

        <div class="form-group">
            <label for="viewCart">Paper print add to cart</label>
            <textarea class="form-control" id="viewCart" name="viewCart" placeholder="view cart button code" value="<?php echo $inProductViewCart; ?>" required></textarea><span><?php echo $inProductViewCartErrMsg; ?>
        </div>


        <button type="submit" class="btn btn-primary" name="submit">Submit</button>
    </form>

        </div>

        <div id="logout">
                <a href="logout.php">Logout</a>
        </div>
        
	</div>
</body>
</html><file_sep><!DOCTYPE html>
<html lang="en">
<head>
    <!-- Css files -->
    <link src="../css/index.css" type="text/css" rel="stylesheet">

    <!-- javascript files -->
    <script  src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
    <script src="../js/nav.js"></script>
    <script src="../js/store.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="<KEY>" crossorigin="anonymous"></script>

    <!-- Bootsrap CDN -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">
 
    <!-- Meta Data-->
    <meta charset="UTF-8">
    <meta name="description" content="photography">
    <meta name="author" content="<NAME> photography">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Title -->
    <?php 
    require '../php/selectProduct.php';
    require '../php/PDOconnection.php';
    ?>

<!doctype html>
<html>
<head>
    <!-- Css files -->
    <link src="../css/product.css" type="text/css" rel="stylesheet">

    <!-- javascript files -->
    <script  src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
    <script src="../js/Nav.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="<KEY>" crossorigin="anonymous"></script>

    <!-- Bootsrap CDN -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">
 
    <!-- Meta Data-->
    <meta charset="UTF-8">
    <meta name="description" content="photography">
    <meta name="author" content="<NAME> photography">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Title -->
    <title>Products</title>

</head>
<body>

    <div id="Nav"></div>
<?php
    while( $row=$stmt->fetch(PDO::FETCH_ASSOC)) {
?>

<div class="m-auto" style="width: 400px;">
        <div class="card h-90">
            <p> * NOTE: ALL PAPER PRINTS COME WITH A DIGITAL COPY </p>
            <img src="../images/<?php echo $row['product_image']; ?>" name="productImage" id="productImage" class="card-img-top">

            <div class="card-body m-auto">

                <h2 class="card-title text-center">
                    <?php echo $row['product_Name'];?>
                </h2>

                <h5 class="text-center">$ <?php echo $row['product_Price'];?></h5>

                <h5 class="card-text"> <?php echo $row['product_Description'];?></h5>

                <center>
                    <h5>Buy Now Online Print</h5>
                    <p><?php echo $row['product_BuyNow'];?></p>

                    <h5>Buy Now Paper Print</h5>
                    <p><?php echo $row['product_BuyNow2'];?></p>

                    <h5>Add To Cart Online Print</h5>
                    <p><?php echo $row['product_AddToCart'];?></p>

                    <!--
                    <h5>Add To Cart Paper Print</h5>
                    <p><?php //echo $row['product_ViewCart'];?></p>
                    -->

                    <h5>View Cart</h5>
                    <p>
                    <form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" >
                        <input type="hidden" name="cmd" value="_s-xclick">
                        <input type="hidden" name="encrypted" value="-----<KEY>END <KEY>">
                        <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_viewcart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
                        <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
                    </form>
                    </p>
                </center>
        </div>
    </div>

    <!-- Temporary filler for gap between cards -->
    <p></p>
<?php
    };
?>
</body>
</html>


    <title>Gallary</title>

</head>
<body>
    
    <!-- NavBar -->
    <header></header>

    <!-- Footer -->
    <footer></footer>

</body>
</html><file_sep><?php

    session_start();

    

	// assign a defalt value to input fields and error messages
	$inLoginUsername = "";
	$inLoginPassword = "";

    // error messages
	$inLoginUsernameErrMsg = "";
	$inLoginPasswordErrMsg = "";

if(isset($_POST["submit"]))
	{
		// capturing the values of the form inputs
		$inLoginUsername = $_POST["username"];
		$inLoginPassword = $_POST["<PASSWORD>"];
	
        $validForm = true; // sets a flag/switch to make sure data is valid
        // PHP validation goes here
		
		if($validForm && $inLoginUsername == 'dhuck' && $inLoginPassword == '<PASSWORD>!'){
			
                //require('validUser.php');
                echo '<script>alert("valid")</script>';
                $_SESSION["validUser"] = "true";

                if($_SESSION["validUser"] == true){
                    header("Location: ../php/addProduct.php");
                }
			
			} else{
			
			// BAD BAD Data - Display error message, display form to user
			// 1. bad name
				// put data on the form
                // put error messege on the form
					$inLoginUsernameErrMsg = " Invalid Username";
                    $inLoginPasswordErrMsg = " <PASSWORD>";
                    $_SESSION['validUser'] = false;
                    	
				}
	
	}else{
		echo "<h1>Please enter your information</h1>";
		}
?>
<!doctype html>
<html>
<head>
    <!-- Css files -->
    <link src="../css/product.css" type="text/css" rel="stylesheet">

    <!-- javascript files -->
    <script  src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
    <script src="../js/userNav.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="<KEY>" crossorigin="anonymous"></script>

    <!-- Bootsrap CDN -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">
 
    <!-- Meta Data-->
    <meta charset="UTF-8">
    <meta name="description" content="photography">
    <meta name="author" content="<NAME> photography">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Title -->
    <title>Login</title>

</head>

<body>
    <div id="userNav"></div>
        
        <form method="post" action="login.php" class="col-lg-6 col-sm-10 m-auto" >

            <div class="form-group">
                <label for="username">Username:</label>
                <input type="text" name="username" id="username" class="form-control" value="<?php echo $inLoginUsername; ?>"><span><?php echo $inLoginUsernameErrMsg; ?> </span>
            </div>

            <div class="form-group">
                <label for="password">Password:</label>
                <input type="text" name="password" id="password" class="form-control" value="<?php echo $inLoginPassword; ?>"><span><?php echo $inLoginPasswordErrMsg; ?></span>
            </div>

            <button type="submit" class="btn btn-primary" name="submit">Submit</button>
            <button type="reset" class="btn" name="submit">Reset</button>
        </form>
</body>
</html><file_sep><?php
    session_start();

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Css files -->
    <link src="../css/index.css" type="text/css" rel="stylesheet">

    <!-- javascript files -->
    <script  src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
    <script src="../js/nav.js"></script>
    <script src="../js/about.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="<KEY>" crossorigin="anonymous"></script>

    <!-- Bootsrap CDN -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">
 
    <!-- Meta Date -->
    <meta charset="UTF-8">
    <meta name="description" content="photography">
    <meta name="author" content="<NAME> photography">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Valkenburg</title>

</head>
<body class="p-2 border">
    
    <h1>Product Purchased! Valkenburg Print</h1>
    <h2>Thank you for supporting David Huck Photography</h1>
    <h2>*Please allow for two weeks if you purchased the Paper Print*</h2>

    <div>
        <ul>
            <li><a href="../images/valkenburg/valkenburg.jpg" download>Valkenburg JPG</a></li>
            <li><a href="../images/valkenburg/valkenburg.png" download>Valkenburg PNG</a></li>
            <p>If your download has not started within 10 seconds, click the link(s) above</p>
        </ul>
    </div>

    <h2><a href="../html/gallery.html">Click Here To Return To David Huck Photography</a></h2>



    <!-- Footer -->
    <footer></footer>

</body>
</html><file_sep>
$(document).ready(function(){

    $('#store').html(`
    
        <div class="container">

            <div class="row">

                <div class="col-sm">
                    <div class="card h-100">
                        <a href="#"><img class="card-img-top" src="../images/ferrari.jpg" alt="ferrari"></a>

                        <div class="card-body">
                            <h4 class="card-title">
                                <a href="#">Ferrari Side Print</a>
                            </h4>
                            <h5>$5.00 - $30.00</h5>
                            <p class="card-text">Spice up your collection with this beautiful Ferrari Print!</p>
                        </div>

                        <div class="card-footer">
                            <small class="text-muted">&#9733; &#9733; &#9733; &#9733; &#9734;</small>
                        </div>
                    </div>
                </div>

                <div class="col-sm">
                    One of three columns
                </div>

                <div class="col-sm">
                    One of three columns
                </div>
            </div>
        </div

    `);

});<file_sep><?php

session_start();

    if(!$_SESSION['validUser'] == true){
        header('Location: ../html/login.php');
    }

try {
      
    require 'PDOconnection.php';
    require 'selectProduct.php';	//CONNECT to the database    

   $sql = "DELETE FROM dhp WHERE product_ID='$_GET[id]'";

  
    //PREPARE the SQL statement
    $stmt = $conn->prepare($sql);
    
    //EXECUTE the prepared statement
    $stmt->execute();		
    
    //Prepared statement result will deliver an associative array
    $stmt->setFetchMode(PDO::FETCH_ASSOC);
    
    header("refresh:1; url=deleteProduct.php");
}

catch(PDOException $e)
{
    $message = "There has been a problem . Please try again later.";
    echo $message;

    error_log($e->getMessage());			//Delivers a developer defined error message to the PHP log file at c:\xampp/php\logs\php_error_log
    error_log($e->getLine());
    error_log(var_dump(debug_backtrace()));

    //Clean up any variables or connections that have been left hanging by this error.		

    header('Location: files/505_error_response_page.php');	//sends control to a User friendly page					
}





?><file_sep><?php

// PHP PDO Connection File.
// This file used to connect to a database.
// Include this file into your application as needed.

$serverName = 'localhost'; 	// the usual default name
$username = 'dnhuck_photography'; 	//username of database
$password = '<PASSWORD>!'; 	//password of database
$database = 'dnhuck_photography'; 	// name of database you will be accessing

try {
    $conn = new PDO("mysql:host=$serverName;dbname=$database", $username, $password);
    // set the PDO error mode to exception
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    //echo "Submission Success! Redirecting you now";
	//header('Refresh:3; url="eventsForm.php", true, 303');
    }
catch(PDOException $e)
    {
    echo "Connection failed: " . $e->getMessage();
    }

?><file_sep>
$(document).ready(function(){

    $('#gallary').html(`

        <div class="p-2">

            <img src="../images/banner.jpg" alt="david huck banner" class="img-fluid">

            <center style="width: 80%;" class="m-auto">

                <h1 class="d-flex justify-content-center">Gallary</h1>

                <div id="pixlee_container"></div><script type="text/javascript">window.PixleeAsyncInit = function() {Pixlee.init({apiKey:'<KEY>'});Pixlee.addSimpleWidget({widgetId:'30371'});};</script><script src="//instafeed.assets.pxlecdn.com/assets/pixlee_widget_1_0_0.js"></script>

            </center>
        </div>

        `);

});<file_sep><?php

	if(isset($_POST['submit'])){
		$firstName = $_POST['fName'];
		$lastName = $_POST['lName'];
		$FromEmail = $_POST['email'];
		$message = $_POST['message'];

		$mailTo = '<EMAIL>';
		$headers = "From: " . $FromEmail;
		$txt = "You have recieved an email from " . $firstName. ".\n\n".$message;


		mail($mailTo, $message, $txt, $headers);
		echo "<script>alert('Sent Success!';)</script>";
		header('Location: ../html/contact.html');


	}

?><file_sep>
$(document).ready(function(){

    $('#homepage').html(`

        <div>
            <a href="gallery.html"><img src="../images/home.png" alt="biker chick" class="img-fluid"></a>
        </div>

        `);

});<file_sep>
$(document).ready(function(){

    $('#userNav').html(`
    
        <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
            <div class="container">

                <a class="navbar-brand">DAVID HUCK PRODUCTS</a>

                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>

                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                    <ul class="navbar-nav ml-auto">

                        <li class="nav-item">
                            <a class="nav-link" href="../html/gallery.html">Back To Home</a>
                        </li>

                        <li class="nav-item">
                            <a class="nav-link" href="addProduct.php">Add New Product</a>
                        </li>

                        <li class="nav-item">
                            <a class="nav-link" href="updateProduct.php">Update Product</a>
                        </li>

                        <li class="nav-item">
                            <a class="nav-link" href="deleteProduct.php">Delete Product</a>
                        </li>

                        <li class="nav-item">
                            <a class="nav-link" href="viewProduct.php">View Products</a>
                        </li>

                        <li class="nav-item">
                            <a class="nav-link" href="../html/logout.php">Logout</a>
                        </li>

                    </ul>
                </div>
            </div>
        </nav>
    
    `);

});<file_sep><?php

session_start();

    if(!$_SESSION['validUser'] == true){
        header('Location: ../html/login.php');
    }

	require 'PDOconnection.php'; // access and run this external file

try{
    
	$picImage = $_FILES['productImage']['name']; 
	$picName = $_POST["productName"];
	$picPrice = $_POST["productPrice"];
    $picDescription = $_POST["productDescription"];
    $picBuyNow = $_POST["productBuyNow"];
    $picBuyNow2=$_POST['productBuyNow2'];
    $picAddToCart = $_POST["addToCart"];
    $picViewCart = $_POST["viewCart"];
	//$eventTime = $_POST["eventTime"];
	//$image = $_FILES['image']['name'];

	// PDO Prepare statements

	// prepare the SQL statements

	// 1. Create the SQL statements with name placeholders
	$sql = "INSERT INTO dhp(product_image, product_Name, product_Price, product_Description, product_BuyNow, product_BuyNow2, product_AddToCart, product_ViewCart)
	VALUES (:productImage, :productName, :productPrice, :productDescription, :productBuyNow, :productBuyNow2, :addToCart, :viewCart)";

	// 2. Create the prepared statement object
	$stmt = $conn->prepare($sql); 	// creates the prepared statement object

	// Bind parameters to the prepared statement object. One for each parameter
	$stmt->bindParam(':productImage', $picImage);
	$stmt->bindParam(':productName', $picName);
	$stmt->bindParam(':productPrice', $picPrice);
    $stmt->bindParam(':productDescription', $picDescription);
    $stmt->bindParam(':productBuyNow', $picBuyNow);
    $stmt->bindParam(':productBuyNow2', $picBuyNow2);
    $stmt->bindParam(':addToCart', $picAddToCart);
    $stmt->bindParam(':viewCart', $picViewCart);

	
	//Execute the prepared statement 
	$stmt->execute();
	}

	catch(PDOException $e){
		echo "Failure. Please try again";
	}

$conn = null; // close your connection object
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Insert Events</title>
</head>

<body>
</body>
</html><file_sep><?php 

session_start();

    if(!$_SESSION['validUser'] == true){
        header('Location: login.php');
    }
    
    require 'selectProduct.php';
    require 'PDOconnection.php';
?>

<!doctype html>
<html>
<head>
    <!-- Css files -->
    <link src="../css/product.css" type="text/css" rel="stylesheet">

    <!-- javascript files -->
    <script  src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
    <script src="../js/userNav.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="<KEY>" crossorigin="anonymous"></script>

    <!-- Bootsrap CDN -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">
 
    <!-- Meta Data-->
    <meta charset="UTF-8">
    <meta name="description" content="photography">
    <meta name="author" content="<NAME>uck photography">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Title -->
    <title>Products</title>

</head>
<body>

    <div id="userNav"></div>
<?php
    while( $row=$stmt->fetch(PDO::FETCH_ASSOC)) {
?>

    <div class="m-auto" style="width: 400px;">
        <div class="card h-90">
            <p> * NOTE: ALL PAPER PRINTS COME WITH A DIGITAL COPY </p>
            <img src="../images/<?php echo $row['product_image']; ?>" name="productImage" id="productImage" class="card-img-top">

            <div class="card-body m-auto">

                <h2 class="card-title text-center">
                    <?php echo $row['product_Name'];?>
                </h2>

                <h5 class="text-center">$ <?php echo $row['product_Price'];?></h5>

                <h5 class="card-text"> <?php echo $row['product_Description'];?></h5>

                <center>
                    <h5>Buy Now Online Print</h5>
                    <p><?php echo $row['product_BuyNow'];?></p>

                    <h5>Add To Cart Paper Print</h5>
                    <p><?php echo $row['product_BuyNow2'];?></p>

                    <h5>Buy Now Online Print</h5>
                    <p><?php echo $row['product_AddToCart'];?></p>

                    <!--
                    <h5>Add To Cart Paper Print</h5>
                    <p><?php //echo $row['product_ViewCart'];?></p>
                    -->

                </center>
        </div>
    </div>

    <!-- Temporary filler for gap between cards -->
    <p></p>
    
<?php
    };
?>
</body>
</html>

<file_sep><?php
    session_start();

    if(!$_SESSION['validUser'] == true){
        header('Location: ../html/login.php');
    }
?>
<!doctype html>
<html>
<head>

    <!-- javascript files -->
    <script  src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="<KEY>" crossorigin="anonymous"></script>
    <script src="../js/userNav.js"></script>

    <!-- Bootsrap CDN -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">
 
    <!-- Meta Data-->
    <meta charset="UTF-8">
    <meta name="description" content="photography">
    <meta name="author" content="<NAME> photography">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Title -->
    <title>Update Products</title>

</head>
<body>

    <div id="userNav"></div>
    <h1>Update Product:</h1>


<?php
    require 'selectProduct.php';
    while( $row=$stmt->fetch(PDO::FETCH_ASSOC)) {
?>

    <div class="p-3 col-9 m-auto">
    <form method="POST" action="update.php" enctype="multipart/form-data" >
        <input type="hidden" name="size" value="1000000">

        <input type="hidden" name="id" value="<?php echo $row['product_ID']?>">
        <div class="form-group">
            <label for="updateImage">Update Image</label>
            <input type="file" class="form-control" id="updateImage" name="updateImage" value="$_FILES['product_image']['name'];">
        </div>

        <div class="form-group">
            <label for="updateName">Product Name</label>
            <input type="text" class="form-control" id="updateName" name="updateName"  value="<?php echo $row['product_Name']?>">
        </div>

        <div class="form-group">
            <label for="updatePrice">Update Price</label>
            <input type="text" class="form-control" id="updatePrice" name="updatePrice"  value="<?php echo $row['product_Price']?>">
        </div>

        <div class="form-group">
            <label for="updateDescription">Update Description</label>
            <textarea class="form-control" id="updateDescription" name="updateDescription"  value="<?php echo $row['product_Description']?>"> </textarea>
        </div>

        <div class="form-group">
            <label for="updateBuyNow">Update Buy Now Button Code</label>
            <textarea class="form-control" id="updateBuyNow" name="updateBuyNow"  value="<?php echo $row['product_BuyNow']?>"></textarea>
        </div>

        <div class="form-group">
            <label for="updateBuyNow2">Update Physical Good Buy Now Button Code</label>
            <textarea class="form-control" id="updateBuyNow2" name="updateBuyNow2"  value="<?php echo $row['product_BuyNow2']?>"></textarea>
        </div>

        <div class="form-group">
            <label for="updateAddToCart">Update Add To Card Button Code</label>
            <textarea class="form-control" id="updateAddToCart" name="updateAddToCart"  value="<?php echo $row['product_AddToCart']?>"></textarea>
        </div>

        <!--
        <div class="form-group">
            <label for="updateViewCart">Update Buy Now Button Code</label>
            <textarea class="form-control" id="updateViewCart" name="updateViewCart"  value="<?php echo $row['product_ViewCart']?>"></textarea>
        </div>
        -->

        <button type="submit" class="btn btn-primary" name="submit">Submit</button>
    </form>
    </div>
           
            
            <?php
                }
            ?>
</body>
</html>