<?php
class OntStatus{
    private $conn;
    private $table_name = "ont_status";
 
	public $id;
	public $id_no;
	public $invoice_no;
	public $status;

	public $entry_by;
	public $entry_date_time;
	
    public function __construct($db){
        $this->conn = $db;
    }


	function create(){
		$query = "INSERT INTO " . $this->table_name . " SET id_no=:id_no, invoice_no=:invoice_no, status=:status, entry_by=:entry_by, entry_date_time=:entry_date_time";
		$stmt = $this->conn->prepare($query);

		$stmt->bindParam(":id_no", $this->id_no);
        $stmt->bindParam(":invoice_no", $this->invoice_no);
        $stmt->bindParam(":status", $this->status);
		$stmt->bindParam(":entry_by", $this->entry_by);
		$stmt->bindParam(":entry_date_time", $this->entry_date_time);
		
		if($stmt->execute()){
			$this->id = $this->conn->lastInsertId();
			return true;
		}
		return false;
	}


}
?>
