本文整理汇总了PHP中Agenda::saveAgenda方法的典型用法代码示例。如果您正苦于以下问题:PHP Agenda::saveAgenda方法的具体用法?PHP Agenda::saveAgenda怎么用?PHP Agenda::saveAgenda使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agenda
的用法示例。
在下文中一共展示了Agenda::saveAgenda方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editarAction
public function editarAction()
{
//summernote (composer::textarea)
$this->view->headLink()->appendStylesheet($this->_request->getBaseUrl() . '/public/painel/assets/plugins/summernote/dist/summernote.css');
//css datepicker
$this->view->headLink()->appendStylesheet($this->_request->getBaseUrl() . '/public/painel/assets/plugins/form-daterangepicker/daterangepicker-bs3.css');
$ag = new Agenda();
$request = $this->getRequest();
$id = $request->getParam('id');
$evento = $ag->getAgendaById($id);
$erro = false;
$msg = '';
if ($request->isPost()) {
$start = new Zend_Date($request->getPost('data_ini'));
$end = new Zend_Date($request->getPost('data_fim'));
$evento = $request->getPost('evento');
$iniciaem = $start->toString('YYYY-MM-dd');
$finalizaem = $end->toString('YYYY-MM-dd');
$descricao = $request->getPost('descricao');
$horario = $request->getPost('horario');
$local = $request->getPost('local');
$ag->setEvento($evento);
$ag->setIniciaem($iniciaem);
$ag->setFinalizaem($finalizaem);
$ag->setDescricao($descricao);
$ag->setHorario($horario);
$ag->setLocal($local);
$data = array('evento' => $ag->getEvento(), 'iniciaem' => $ag->getIniciaem(), 'finalizaem' => $ag->getFinalizaem(), 'descricao' => $ag->getDescricao(), 'horario' => $ag->getHorario(), 'local' => $ag->getLocal());
$ag->saveAgenda($data, $id);
if ($erro) {
$msg = 'Ocorreu um erro, tente novamente';
$this->view->msg = $msg;
} else {
$this->_helper->redirector('listar', 'agenda');
}
}
$this->view->evento = $evento;
$this->render();
}