Cloudlog/application/models/Note.php
Warren Volz e384826aea Codeignitor 3.1.6 and corresponding changes
- fixes missing () from num_rows in authenticate user function
- removes passwordhash library in favor of built in PHP password_hash
  and password_verify functions
- uppercase all class filenames
- add new CLI error templates, move HTML error templates
- update mimes file to latest version
- update routes to latest version
2017-12-01 19:25:26 +00:00

48 行
无行尾
877 B
PHP

<?php
class Note extends CI_Model {
function __construct()
{
// Call the Model constructor
parent::__construct();
}
function list_all() {
return $this->db->get('notes');
}
function add() {
$data = array(
'cat' => $this->input->post('category'),
'title' => $this->input->post('title'),
'note' => $this->input->post('content')
);
$this->db->insert('notes', $data);
}
function edit() {
$data = array(
'cat' => $this->input->post('category'),
'title' => $this->input->post('title'),
'note' => $this->input->post('content')
);
$this->db->where('id', $this->input->post('id'));
$this->db->update('notes', $data);
}
function delete($id) {
$this->db->delete('notes', array('id' => $id));
}
function view($id) {
// Get Note
$this->db->where('id', $id);
return $this->db->get('notes');
}
}
?>