本文整理匯總了PHP中Sessions::edit方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sessions::edit方法的具體用法?PHP Sessions::edit怎麽用?PHP Sessions::edit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sessions
的用法示例。
在下文中一共展示了Sessions::edit方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Validate
// die();
$validate = new Validate();
$validation = $validate->check($_POST, array('position' => array('field_name' => 'Position', 'required' => true), 'date' => array('field_name' => 'Session Date', 'required' => true), 'text' => array('field_name' => 'Report Text', 'required' => true), 's' => array('field_name' => 'Session ID', 'required' => true)));
if ($validation->passed()) {
try {
$r->addReport(array('student_cid' => Input::get('cid'), 'mentor_cid' => $user->data()->id, 'report_type_id' => Input::get('type'), 'position_id' => Input::get('position'), 'submitted_date' => date("Y-m-d"), 'session_date' => Input::get('date'), 'text' => Input::get('text')));
$reportID = $r->getLatestID("reports");
if (Input::get('slider')) {
foreach (Input::get('slider') as $slideID => $slideVal) {
if ($slideVal > 0) {
$r->addSliderAnswers(array('report_id' => $reportID, 'slider_id' => $slideID, 'value' => $slideVal));
}
}
}
$s = new Sessions();
$sess = $s->edit(['report_id' => $reportID], [['id', '=', Input::get('s')]]);
$r->addCard(array('cid' => Input::get("cid"), 'card_type' => 0, 'link_id' => $reportID, 'submitted' => date('Y-m-d H:i:s')));
Session::flash('success', 'Report Added');
Redirect::to('./view_student.php?cid=' . Input::get('cid') . '#r' . $reportID);
} catch (Exception $e) {
die($e->getMessage());
}
} else {
echo '
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">The following errors occured:</h3>
</div>
<div class="panel-body">';
foreach ($validation->errors() as $error) {