当前位置: 首页>>代码示例>>PHP>>正文


PHP Recipe::load方法代码示例

本文整理汇总了PHP中Recipe::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Recipe::load方法的具体用法?PHP Recipe::load怎么用?PHP Recipe::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Recipe的用法示例。


在下文中一共展示了Recipe::load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load

 public function load($iUserID)
 {
     $connection = new Connection();
     $sSQL = "SELECT UserID, FirstName, LastName, Username, Address, Email, Telephone, Password, Admin\n                     FROM tbuser\n                     WHERE UserID=" . $iUserID;
     $resultSet = $connection->query($sSQL);
     $row = $connection->fetch_array($resultSet);
     //store data into attributes:
     $this->iUserID = $row['UserID'];
     $this->sFirstName = $row['FirstName'];
     $this->sLastName = $row['LastName'];
     $this->sUsername = $row['Username'];
     $this->sAddress = $row['Address'];
     $this->sEmail = $row['Email'];
     $this->iTelephone = $row['Telephone'];
     $this->sPassword = $row['Password'];
     $this->iAdmin = $row['Admin'];
     // get all recipe ids of each user:
     $sSQL = "SELECT RecipeID\n                     FROM tbrecipe\n                     WHERE UserID=" . $iUserID;
     $resultSet = $connection->query($sSQL);
     while ($row = $connection->fetch_array($resultSet)) {
         $iRecipeID = $row["RecipeID"];
         $oRecipe = new Recipe();
         $oRecipe->load($iRecipeID);
         $this->aRecipes[] = $oRecipe;
     }
     $connection->close_connection();
 }
开发者ID:leanne-abarro,项目名称:getInMyBelly,代码行数:27,代码来源:user.php

示例2: getAllRecipes

 public static function getAllRecipes()
 {
     $aAllRecipes = array();
     $connection = new Connection();
     $sSQL = "SELECT RecipeID\n                     FROM tbrecipe\n                     ORDER BY CreatedAt DESC\n                     ";
     $resultSet = $connection->query($sSQL);
     while ($row = $connection->fetch_array($resultSet)) {
         $iRecipeID = $row['RecipeID'];
         $oRecipe = new Recipe();
         $oRecipe->load($iRecipeID);
         $aAllRecipes[] = $oRecipe;
     }
     $connection->close_connection();
     return $aAllRecipes;
 }
开发者ID:leanne-abarro,项目名称:getInMyBelly,代码行数:15,代码来源:recipeManager.php

示例3: load

 public function load($iRecipeTypeID)
 {
     $connection = new Connection();
     $sSQL = "SELECT RecipeTypeID, TypeName, Description, DisplayOrder\n                     FROM tbrecipetype\n                     WHERE RecipeTypeID=" . $iRecipeTypeID;
     $resultSet = $connection->query($sSQL);
     $row = $connection->fetch_array($resultSet);
     //store into data attribues:
     $this->iRecipeTypeID = $row["RecipeTypeID"];
     $this->sTypeName = $row["TypeName"];
     $this->sDescription = $row["Description"];
     $this->iDisplayOrder = $row["DisplayOrder"];
     // get all recipe IDs of type:
     $sSQL = "SELECT RecipeID\n                     FROM tbrecipe\n                     WHERE RecipeTypeID=" . $iRecipeTypeID . "\n                     ORDER BY CreatedAt DESC";
     $resultSet = $connection->query($sSQL);
     while ($row = $connection->fetch_array($resultSet)) {
         $iRecipeID = $row['RecipeID'];
         $oRecipe = new Recipe();
         $oRecipe->load($iRecipeID);
         $this->aRecipes[] = $oRecipe;
     }
     $connection->close_connection();
 }
开发者ID:leanne-abarro,项目名称:getInMyBelly,代码行数:22,代码来源:recipeType.php

示例4: header

<?php

require_once "includes/header.php";
require_once "includes/recipe.php";
require_once "includes/recipeType.php";
require_once "includes/form.php";
if (isset($_SESSION["UserID"]) == false) {
    header("Location: loginSignUp.php");
    exit;
}
$iRecipeID = 1;
if (isset($_GET["RecipeID"])) {
    $iRecipeID = $_GET["RecipeID"];
}
$oRecipe = new Recipe();
$oRecipe->load($iRecipeID);
$aExistingData = array();
$aExistingData["recipeTitle"] = $oRecipe->title;
$aExistingData["authorNotes"] = $oRecipe->authorNotes;
$aExistingData["ingredients"] = $oRecipe->ingredients;
$aExistingData["directions"] = $oRecipe->directions;
$aExistingData["recipeCategory"] = $oRecipe->recipeTypeID;
// edit recipe
$oEditForm = new Form();
$oEditForm->data = $aExistingData;
if (isset($_POST["update"])) {
    $oEditForm->data = $_POST;
    $oEditForm->files = $_FILES;
    //form validation
    $oEditForm->checkFilled("recipeTitle");
    $oEditForm->checkFilled("authorNotes");
开发者ID:leanne-abarro,项目名称:getInMyBelly,代码行数:31,代码来源:editRecipe.php


注:本文中的Recipe::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。