//updating details: $oRecipe->title = $_POST["recipeTitle"]; $oRecipe->authorNotes = $_POST["authorNotes"]; $oRecipe->ingredients = $_POST["ingredients"]; $oRecipe->directions = $_POST["directions"]; // $sImageName = "recipeImage".$oRecipe -> title.".jpg"; // $oRecipe -> imagePath = $sImageName; // $oRecipe -> userID = $oCustomer -> userID; // $oRecipe -> recipeTypeID = $_POST["recipeCategory"]; $oRecipe->save(); header("Location: editRecipe.php?message=updated&RecipeID=" . $oRecipe->recipeID); exit; } } //html markup: $oEditForm->makeInput("recipeTitle", "Recipe Title *", "eight columns editRecipe floatLeft marginBottom10"); $oEditForm->makeSelect("recipeCategory", "Recipe Category *", RecipeTypeManager::listAllTypes(), "eight columns floatLeft editRecipe marginBottom10"); $oEditForm->makeImageUpload("imageUpload", "Image Upload *"); $oEditForm->makeTextArea("authorNotes", "Author Notes *", "eight columns editRecipe floatLeft marginBottom10"); $oEditForm->makeTextArea("ingredients", "Ingredients *", "eight columns editRecipe floatLeft marginBottom10"); $oEditForm->makeTextArea("directions", "Directions *", "clearBoth editRecipe marginRight10 marginBottom30 marginLeft10"); $oEditForm->makeSubmit("update", "update", "blueButton2 bgBlue marginBottom10"); ?> <h1 class="textAlignCenter marginBottom30">Edit Recipe</h1> <span class="displayBlock positionRelative recipeCaption captionLine textAlignCenter marginBottom10">* Required Fields </span> <!-- submit recipe form starts here --> <div class="otherForms"> <?php echo $oEditForm->HTML; if (isset($_GET["message"]) == true) { if ($_GET["message"] == "updated") {
$oCustomer->password = password_hash($_POST["password"], PASSWORD_DEFAULT); $oCustomer->save(); $oSubscriber = new Subscriber(); if (isset($_POST["newsSignUp"])) { $oSubscriber->email = $_POST["email"]; } $oSubscriber->save(); // redirect after adding new page successfully to that new location header("Location:loginSignUp.php?message=created"); // will prompt message to come up exit; // terminates request } } // form markup: $oForm2->makeInput("firstName", "First Name *", "doubleColumn heightApplied floatLeft"); $oForm2->makeInput("lastName", "Last Name *", "doubleColumn heightApplied floatLeft"); $oForm2->makeInput("username", "Username *", "doubleColumn heightApplied floatLeft "); $oForm2->makeInput("email", "Email *", "doubleColumn heightApplied floatLeft "); $oForm2->makeInput("address", "Address *", "doubleColumn heightApplied floatLeft "); $oForm2->makeInput("telephone", "Telephone *", "doubleColumn heightApplied floatLeft"); $oForm2->makePassword("password", "Password *", "doubleColumn heightApplied floatLeft"); $oForm2->makePassword("confirmPassword", "Confirm Password *", "doubleColumn heightApplied floatLeft"); $oForm2->makeCheckBox("newsSignUp", "Subscribe to the Get in my Belly Newsletter"); $oForm2->makeSubmit("create", "Create", "blueButton2 bgBlue marginBottom10"); ?> <h1 class="textAlignCenter marginBottom30">User Login</h1> <!-- login form --> <div class="mainForms eight columns floatLeft marginBottom50"> <h2 class="formHeader paddingTop10 paddingBottom20">Login</h2> <?php
$sImageName = "productImage-" . date("Y-m-d-H-i-s") . ".jpg"; $oProductForm->moveFile("imageUpload", $sImageName); $oProduct->productName = $_POST["productName"]; $oProduct->description = $_POST["productDescription"]; $oProduct->imagePath = $sImageName; $oProduct->size = $_POST["productSize"]; $oProduct->price = $_POST["productPrice"]; $oProduct->ingredients = $_POST["ingredients"]; $oProduct->stockLevel = $_POST["stockLevel"]; $oProduct->save(); header("Location: addProduct.php?message=added"); exit; } } //html markup $oProductForm->makeInput("productName", "Product Name *", "eight columns floatLeft marginBottom10"); $oProductForm->makeInput("productDescription", "Product Description *", "eight columns floatLeft marginBottom10"); $oProductForm->makeImageUpload("imageUpload", "Image Upload *"); $oProductForm->makeInput("productSize", "Product Size *", "eight columns floatLeft marginBottom10"); $oProductForm->makeInput("productPrice", "Product Price *", "eight columns floatLeft marginBottom10"); $oProductForm->makeTextArea("ingredients", "Ingredients *", "eight columns floatLeft marginBottom10 selfClear"); $oProductForm->quantityInput("stockLevel", "Stock Level *", "addStockLevel"); $oProductForm->makeSubmit("add", "Add Product", "clearBoth blueButton bgBlue marginBottom30"); ?> <h1 class="textAlignCenter marginBottom30">Add a Product</h1> <span class="displayBlock positionRelative recipeCaption captionLine textAlignCenter marginBottom10">* Required Fields </span> <!-- add product form starts here --> <div class="otherForms addProductForm"> <?php echo $oProductForm->HTML; if (isset($_GET["message"]) == true) {
$sImageName = "recipeImage-" . date("Y-m-d-H-i-s") . ".jpg"; $oSubmitForm->moveFile("imageUpload", $sImageName); $oRecipe->title = $_POST["recipeTitle"]; $oRecipe->authorNotes = $_POST["authorNotes"]; $oRecipe->ingredients = $_POST["ingredients"]; $oRecipe->directions = $_POST["directions"]; $oRecipe->imagePath = $sImageName; $oRecipe->userID = $oCustomer->userID; $oRecipe->recipeTypeID = $_POST["recipeCategory"]; $oRecipe->save(); header("Location: submitRecipe.php?message=submitted"); exit; } } //html markup: $oSubmitForm->makeInput("recipeTitle", "Recipe Title *", "eight columns floatLeft marginBottom10"); $oSubmitForm->makeSelect("recipeCategory", "Recipe Category *", RecipeTypeManager::listAllTypes(), "eight columns floatLeft marginBottom10"); $oSubmitForm->makeImageUpload("imageUpload", "Image Upload *"); $oSubmitForm->makeTextArea("authorNotes", "Author Notes *", "eight columns floatLeft marginBottom10"); $oSubmitForm->makeTextArea("ingredients", "Ingredients *", "eight columns floatLeft marginBottom10"); $oSubmitForm->makeTextArea("directions", "Directions *", "clearBoth marginRight10 marginBottom30 marginLeft10"); $oSubmitForm->makeSubmit("submit", "submit", "blueButton2 bgBlue marginBottom10"); ?> <h1 class="textAlignCenter marginBottom30">Submit a Recipe</h1> <span class="displayBlock positionRelative recipeCaption captionLine textAlignCenter marginBottom10">* Required Fields </span> <!-- submit recipe form starts here --> <div class="otherForms"> <?php echo $oSubmitForm->HTML; if (isset($_GET["message"]) == true) { if ($_GET["message"] == "submitted") {
$oOrder->accountName = $_POST["accountName"]; $oOrder->cardNumber = $_POST["ccNumber"]; $oOrder->expiry = $_POST["expiry"]; $oOrder->security = $_POST["security"]; $oOrder->userID = $oCustomer->userID; $oOrder->save(); // redirect after adding new page successfully to that new location header("Location:orderProcessing.php"); // will prompt message to come up exit; // terminates request } } // html form markup $oDeliveryPayForm->makeHeader3("Delivery & Billing Address"); $oDeliveryPayForm->makeInput("name", "Name", "inputHeight"); $oDeliveryPayForm->makeInput("delivery", "Delivery Address", "inputHeight"); $oDeliveryPayForm->makeCheckBox("deliveryAdd", "* use address in my account details"); $oDeliveryPayForm->makeInput("billing", "Billing Address", "inputHeight"); $oDeliveryPayForm->makeCheckBox("billingAdd", "* same as delivery address"); $oDeliveryPayForm->makeHeader3("Payment Information"); $oDeliveryPayForm->makeInput("paymentType", "Payment Method", "inputHeight"); $oDeliveryPayForm->makeInput("accountName", "Account Name", "inputHeight"); $oDeliveryPayForm->makeInput("ccNumber", "Credit Card Number", "inputHeight"); $oDeliveryPayForm->makeInput("expiry", "Expiry Date", "inputHeight inputQuarter marginRight10 floatLeft"); $oDeliveryPayForm->makeInput("security", "Security", "inputHeight inputQuarter floatLeft"); $oDeliveryPayForm->makeSubmit("checkout", "CheckOut", "clearBoth blueButton bgBlue floatRight selfClear"); ?> <!-- delivery and billing -->