本文整理汇总了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) {