PHP Classes

File: fwphp/glomodul/z_examples/todo_csv_js/todolist/change-status.php

Recommend this page to a friend!
  Classes of Slavko Srakocic   B12 PHP FW   fwphp/glomodul/z_examples/todo_csv_js/todolist/change-status.php   Download  
File: fwphp/glomodul/z_examples/todo_csv_js/todolist/change-status.php
Role: Example script
Content type: text/plain
Description: Example script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change: Update of fwphp/glomodul/z_examples/todo_csv_js/todolist/change-status.php
Date: 1 year ago
Size: 438 bytes
 

Contents

Class file image Download
<?php
/*
 *
 */

namespace TodoList;

use \
TodoList\Dao\TodoDao;
use \
TodoList\Flash\Flash;
use \
TodoList\Util\Utils;

$todo = Utils::getTodoByGetId();
$todo->setStatus(Utils::getUrlParam('status'));
if (
array_key_exists('comment', $_POST)) {
   
$todo->setComment($_POST['comment']);
}

$dao = new TodoDao();
$dao->save($todo);
Flash::addFlash('TODO status changed successfully.');

Utils::redirect('detail', ['id' => $todo->getId()]);