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


PHP Update::create方法代码示例

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


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

示例1: store

 /**
  * Store a newly created update in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Update::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     Update::create($data);
     return Redirect::route('updates.index');
 }
开发者ID:hopshoppub,项目名称:hopshop.dev,代码行数:14,代码来源:UpdatesController.php

示例2: createAnswer

 public static function createAnswer($ticket_id, $message)
 {
     $update = new Update(array('ticket_id' => $ticket_id, 'user_id' => $_SESSION['user']['id'], 'type' => 'answer', 'message' => $message));
     $id = $update->create();
     $ticket = new Ticket(array('id' => $ticket_id));
     $ticket->setNotification();
     return $id;
 }
开发者ID:JJWTimmer,项目名称:BLAM,代码行数:8,代码来源:BLAM.class.php

示例3: Supplier

// get table link paramiters into input fields
if (isset($_GET) == true && empty($_GET) == false) {
    $sup_code = $_GET['sup_code'];
    $sup_name = $_GET['sup_name'];
} else {
    $sup_code = "";
    $sup_name = "";
}
$supplier = new Supplier();
$user = new User();
$x = escape($user->data()->name);
if ($user->isLoggedIn()) {
    if (Input::exists()) {
        $update = new Update();
        try {
            $update->create(array('date' => date("Y-m-d"), 'supplier_code' => Input::get('sup_code'), 'approved_kgs' => Input::get('app_kgs'), 'supplied_kgs' => Input::get('sup_kgs'), 'units' => Input::get('units'), 'editor' => $x, 'approved_by' => $x, 'last_editor' => $x, 'last_edit_date' => date("Y-m-d")));
        } catch (Exception $e) {
            die($e->getMessage());
        }
        Session::flash('success');
        Redirect::to('supply_update.php?inserted');
    }
    include 'includes/head.php';
    ?>
<body class="hold-transition skin-blue sidebar-mini">
   <div class="wrapper">
   <!-- Main Header -->
   <?php 
    include 'top_nav.php';
    ?>
   <!-- Left side column. contains the logo and sidebar -->
开发者ID:TSMS,项目名称:UCSC-groupProject-Tsms,代码行数:31,代码来源:supply_update.php

示例4: User

require_once 'core/init.php';
if (Session::exists('success')) {
    echo Session::flash('success');
}
$user = new User();
if ($user->isLoggedIn()) {
    if (Input::exists()) {
        //if(Token::check(Input::get('token'))) {
        if (true) {
            $validate = new Validation();
            $validation = $validate->check($_POST, array('sup_code' => array('required' => true), 'quantity' => array('required' => true)));
            if ($validation->passed()) {
                $update = new Update();
                try {
                    $update->create(array('sup_code' => Input::get('sup_code'), 'date' => Input::get('date'), 'quantity' => Input::get('quantity'), 'approved_kgs' => Input::get('app_kgs'), 'supplied_kgs' => Input::get('sup_kgs'), 'editor' => "no-editor-yet"));
                } catch (Exception $e) {
                    die($e->getMessage());
                }
                Session::flash('success', 'You have successfully registered.');
                Redirect::to('index.php');
            } else {
                pre($validation->errors());
            }
        }
    }
}
?>
<form action="" method="post">
    <div class="field">
        <label for="sup_code">Supplier Code: </label>
开发者ID:TSMS,项目名称:UCSC-groupProject-Tsms,代码行数:30,代码来源:daily_update.php

示例5: header

                $Image->setContent($_POST["content"]);
                $Image->setTags($_POST["content"]);
                $Image->setLocation($_POST["location"]);
                $Image->setMonth($_POST["month"]);
                $Image->setDay($_POST["day"]);
                $Image->setYear($_POST["year"]);
                $Image->query($user["id"]);
                header("Location: " . htmlspecialchars($_SERVER["HTTP_REFERER"]));
            } catch (Exception $e) {
                echo $e->getMessage();
            }
        }
    } else {
        $Update = new Update($user["id"], $Database);
        try {
            echo $_POST["month"] . '-' . $_POST["day"];
            $Update->setContent($_POST["content"]);
            $Update->setTags($_POST["content"]);
            $Update->setCategory("text");
            $Update->setMonth($_POST["month"]);
            $Update->setDay($_POST["day"]);
            $Update->setYear($_POST["year"]);
            $Update->setLocation($_POST["location"]);
            $Update->setCalendarId($_POST["calendar_id"]);
            $Update->create();
            header("Location: " . htmlspecialchars($_SERVER["HTTP_REFERER"]));
        } catch (Exception $e) {
            echo $e->getMessage();
        }
    }
}
开发者ID:alexkonetchy,项目名称:social-calendar,代码行数:31,代码来源:update.php


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