summaryrefslogtreecommitdiffstats
path: root/App/database/Insert.php
blob: 9c4428d47c1fe84168190fcca5c3ba1f28d412ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
 * Created by PhpStorm.
 * User: brolaugh
 * Date: 2/13/16
 * Time: 4:15 AM
 */

namespace App\database;


class Insert extends dbSetup{

  /**
   * @param String $title
   * @param String $detail
   * @param String $person
   */
  public function AddCompleteListEntry($title, $detail, $person){
    $stmt = $this->getDb()->prepare("INSERT INTO task(title, description) values(?,?)");
    $stmt->bind_param('ss', $title, $detail);
    $stmt->execute();
    $this->addStatus($stmt->insert_id, 1, $person);
    $stmt->close();

  }

  /**
   * @param int $task
   * @param int $status_level
   * @param String $user
   */
  public function addStatus($task, $status_level, $user="Unkown"){
    $stmt = $this->getDb()->prepare("INSERT INTO status(task, status_level, user, stamp) values(?,?,?, now())");
    $stmt->bind_param('iis', $task, $status_level, $user);
    $stmt->execute();
    $stmt->close();
  }

}