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


PHP Website::insert方法代码示例

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


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

示例1: count

 /**
  *
  *
  * @access public
  */
 function add_save()
 {
     $img_url = get_post_value('img_url');
     $language = get_post_value('language');
     $website_name_th = get_post_value('website_name_th');
     $website_name_cn = get_post_value('website_name_cn');
     $orders = get_post_value('order');
     $filename = get_post_value('filename');
     $num = count($filename);
     //print_r($filename);
     $m = new Website();
     if ($filename != '' && count($filename) > 0) {
         $field = array('img_url' => $img_url, 'language' => $language, 'website_name_th' => $website_name_th, 'website_name_cn' => $website_name_cn, 'orders' => $orders, 'status' => '10000', 'img_path' => '/Upload/' . $filename[0], 'created' => date('Y-m-d H:i:s', time()));
         $m->clear();
         $m->setTable('vcb_index_website');
         $m->setField($field);
         $websiter_id = $m->insert();
     }
     if (!$websiter_id) {
         echo '<br>保存失败<br>';
     } else {
         echo '<br>保存成功,<a href="add">继续添加</a>,<a href="website">返回</a><br>';
     }
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:29,代码来源:WebsiteController.class.php

示例2: 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);
 }
开发者ID:rshen3p,项目名称:PHP-Laravel.NoteToMyself,代码行数:43,代码来源:PagesController.php


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