本文整理匯總了PHP中Website::select方法的典型用法代碼示例。如果您正苦於以下問題:PHP Website::select方法的具體用法?PHP Website::select怎麽用?PHP Website::select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Website
的用法示例。
在下文中一共展示了Website::select方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: submitPage
public function submitPage()
{
$timeDiff = round(abs(time() - $_SESSION["time"]) / 60, 2) . " minute";
if ($timeDiff >= 20) {
exit("LOGGED OUT OF INACTIVE. <a href='home'>Log In</a>");
}
$userID = $_POST["userID"];
$result = Image::where('userID', $userID)->count();
if (file_exists($_FILES['photo']['tmp_name']) || is_uploaded_file($_FILES['photo']['tmp_name'])) {
$result++;
}
if ($result >= 4) {
echo $result;
exit("CAN ONLY HAVE 4 IMAGES GO BACK");
}
$id = Image::select('id')->where('userID', $userID)->get()->toArray();
for ($i = 0; $i < $result; $i++) {
if (isset($_POST["delete{$i}"])) {
Image::where('id', $id[$i]["id"])->delete();
}
}
Notes::where('userID', $_POST["userID"])->update(array('notes' => $_POST["notes"]));
TBD::where('userID', $_POST["userID"])->update(array('tbd' => $_POST["tbd"]));
$emailArray = array();
for ($i = 0; $i < 10; $i++) {
if (isset($_POST["website{$i}"]) && $_POST["website{$i}"] != "") {
array_push($emailArray, $_POST["website{$i}"]);
}
}
for ($i = 0; $i < count($emailArray); $i++) {
$result = Website::select('website')->where('website', $emailArray[$i])->get();
if ($result == "[]") {
Website::insert(array('userID' => $userID, 'website' => $emailArray[$i]));
}
}
if ($_FILES['photo']['error'] === UPLOAD_ERR_OK) {
if ($_FILES['photo']['type'] == "image/jpeg" || $_FILES['photo']['type'] == "image/jpg" || $_FILES['photo']['type'] == "image/gif") {
Image::insert(array('userID' => $userID, 'image' => file_get_contents($_FILES['photo']['tmp_name'])));
}
}
$profile = $this->returnProfile($_POST["userID"]);
return View::make('profile')->with('userProfile', $profile);
}