<?php

// Get task ID to add this step to
$task_id = TaskerMAN\Core\IO::GET('task_id');
try {
    // Creates a new step, loads information, and then saves
    $step = new TaskerMAN\Application\TaskStep();
    $step->setTaskID(TaskerMAN\Core\IO::GET('task_id'));
    $step->setComment(TaskerMAN\Core\IO::POST('comment'));
    $step->setTitle(TaskerMAN\Core\IO::POST('title'));
    $step->save();
} catch (TaskerMAN\Application\TaskException $e) {
}
// Redirect back to the task page
header('Location: index.php?p=task&id=' . $task_id);
  				</div>
  				<br />

  				<div class="input-group input-group-md">
					<span class="input-group-addon" id="sizing-addon3">Assigned To</span>
					<select name="assigned-to" class="form-control">
						<?php 
echo TaskerMAN\WebInterface\UserListDropdownGenerator::generate(TaskerMAN\Core\IO::POST('assigned-to'));
?>
					</select>
  				</div>
  				<br />

  				<div class="input-group input-group-md">
					<span class="input-group-addon" id="sizing-addon4">Initial Step</span>
	  				<input type="text" name="step-text" class="form-control" aria-describedby="sizing-addon4" value="<?php 
echo TaskerMAN\Core\IO::POST('step-text');
?>
">
  				</div>
  				<br />

  				<div class="input-group input-group-md">
	  				<input type="submit" name="submit" value="Submit" class="btn btn-md btn-primary" />
	  			</div>

  			</form>
		</div>
	</div>

</div>
    } catch (TaskerMAN\Application\UserManagementException $e) {
        $alert = '<div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div>';
    }
} elseif (isset($_POST['submit'])) {
    // Form submitted
    if (isset($_POST['admin'])) {
        $is_admin = true;
    } else {
        $is_admin = false;
    }
    // Update user
    try {
        TaskerMAN\Application\UserManagement::update($user->id, TaskerMAN\Core\IO::POST('name'), TaskerMAN\Core\IO::POST('email'), $is_admin);
        // Update password
        if (!empty(TaskerMAN\Core\IO::POST('password'))) {
            TaskerMAN\Application\UserManagement::changePassword($user->id, TaskerMAN\Core\IO::POST('password'));
        }
        // Reload user
        $user = new TaskerMAN\Application\User($uid);
        $alert = '<div class="alert alert-info" role="alert">User settings were succesfully updated</div>';
    } catch (TaskerMAN\Application\UserManagementException $e) {
        $alert = '<div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div>';
    }
}
?>

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">

	<?php 
if (isset($alert)) {
    echo $alert;
			   		Once you have done that, you can create your first administrative user below.
			   	</p>
			  </div>
			</div>

			<?php 
if (!is_null($alert)) {
    echo $alert;
}
if (isset($_POST['name'])) {
    $name_placeholder = 'value="' . TaskerMAN\Core\IO::POST('name') . '"';
} else {
    $name_placeholder = null;
}
if (isset($_POST['email'])) {
    $email_placeholder = 'value="' . TaskerMAN\Core\IO::POST('email') . '"';
} else {
    $email_placeholder = null;
}
?>

	    	<label for="name" class="sr-only">Name</label>
			<input type="text" id="name" name="name" class="form-control" placeholder="Full Name" <?php 
echo $name_placeholder;
?>
 required autofocus>

			<label for="email" class="sr-only">Email address</label>
			<input type="email" id="email" name="email" class="form-control" placeholder="Email address" <?php 
echo $email_placeholder;
?>
TaskerMAN\WebInterface\WebInterface::setTitle('Task ' . $task_id);
?>

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">

	<?php 
if (isset($_POST['submit'])) {
    try {
        $task->setTitle(TaskerMAN\Core\IO::POST('task-title'));
        $task->setDueBy(TaskerMAN\Core\IO::POST('due-date'));
        $task->setAssignee(TaskerMAN\Core\IO::POST('assigned-to'));
        // Task changed to completed
        if ($task->status != 2 && TaskerMAN\Core\IO::POST('status') == 2) {
            $task->setCompletedTime();
        }
        $task->setStatus(TaskerMAN\Core\IO::POST('status'));
        $task->save();
    } catch (TaskerMAN\Application\TaskException $e) {
        $alert = '<div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div>';
    }
}
if (isset($alert)) {
    echo $alert;
}
switch ($task->status) {
    case 0:
        $label = '<span class="label label-default">Abandoned</span>';
        break;
    case 1:
        $label = '<span class="label label-primary">Allocated</span>';
        break;
<?php

$id = (int) TaskerMAN\Core\IO::GET('id');
$comment = TaskerMAN\Core\IO::POST('comment', false);
$step = new TaskerMAN\Application\TaskStep($id);
if ($step->task_id === NULL) {
    // Unable to load step, does not exist
    throw new TaskerMAN\Application\APIErrorException('Unknown step ID');
}
// Check that user is permitted to modify this task
if ((int) $step->assignee_uid != TaskerMAN\Application\API::$uid) {
    throw new TaskerMAN\Application\APIErrorException('User does not have access to modify this step');
}
// Set comment and commit changes
try {
    $step->setComment($comment);
    $step->save();
} catch (TaskerMAN\Application\TaskException $e) {
    throw new TaskerMAN\Application\APIErrorException($e->getMessage());
}
echo TaskerMAN\Application\API::response('Step comment updated successfully');
			<form method="post" action="index.php?p=new_user">

				<div class="input-group input-group-md">
					<span class="input-group-addon" id="sizing-addon1">Name</span>
	  				<input type="text" name="name" class="form-control" placeholder="Name" aria-describedby="sizing-addon1" maxlength="50" value="<?php 
echo TaskerMAN\Core\IO::POST('name');
?>
">
  				</div>
  				
  				<br />

  				<div class="input-group input-group-md">
	  				<span class="input-group-addon" id="sizing-addon2">Email Address</span>
	  				<input type="email" name="email" class="form-control" placeholder="Email Address" aria-describedby="sizing-addon2" value="<?php 
echo TaskerMAN\Core\IO::POST('email');
?>
">
  				</div>

  				<br />

  				<div class="input-group input-group-md">
	  				<span class="input-group-addon" id="sizing-addon3">Password</span>
	  				<input type="password" name="password" class="form-control" placeholder="Password" aria-describedby="sizing-addon3">
  				</div>

  				<br />

  				<div class="input-group input-group">
	  				<span class="input-group-addon" id="sizing-addon4">Administrator </span>