//$timeline->update_all_promotion_status_by_career_id($values['id'],$values['status']); $res = $timeline->save_item($values); $message = Display::return_message(sprintf(get_lang('ItemUpdated'), $values['name']), 'confirmation'); } $timeline->display(); } else { $actions = '<a href="' . api_get_self() . '">' . Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . '</a>'; $form->addElement('hidden', 'sec_token'); $form->setConstants(array('sec_token' => $token)); $content = $form->return_form(); } break; case 'delete': // Action handling: delete if ($check) { $res = $timeline->delete($_GET['id']); if ($res) { $message = Display::return_message(get_lang('ItemDeleted'), 'success'); } } $content = $timeline->listing(); break; default: $content = $timeline->listing(); break; } $tpl = new Template($tool_name); $tpl->assign('actions', $actions); $tpl->assign('message', $message); $tpl->assign('content', $content); $tpl->display_one_col_template();
<?php # Ex 5 : Delete a tweet include "timeline.php"; $tl = new Timeline(); try { $tl->delete($_POST["no"]); header("Location:index.php"); } catch (Exception $e) { header("Location:error.php"); }
<?php # Ex 5 : Delete a tweet include 'timeline.php'; $timeline = new Timeline(); try { $number = $_POST["number"]; $timeline->delete($number); header("Location:index.php"); } catch (Exception $e) { header("Location:error.php"); }