Skip to content

Instantly share code, notes, and snippets.

Created January 13, 2012 10:30
Show Gist options
  • Save anonymous/1605440 to your computer and use it in GitHub Desktop.
Save anonymous/1605440 to your computer and use it in GitHub Desktop.
In getOrganisatie moet de waarde van $orga_id in komen... de waardes zijn allemaal al gezet en kloppen.
<?php
class Ticketmodel extends CI_Model {
function getOrganisatie($orga_id) {
$r = $this->db->query('SELECT * FROM organisatie WHERE id = '.$orga_id);
if($r->num_rows() > 0) {
$data2[] = $r->result();
return $data2;
}
}
function getOneTicket($id) {
$q = $this->db->query('SELECT * FROM tickets WHERE id = '.$id);
if($q->num_rows() > 0) {
foreach($q->result() as $row) {
$data[] = $row;
}
$orga_id = $row->organisatie_id;
getOrganisatie($orga_id);
return $data;
}
}
function getTickets() {
$q = $this->db->query('SELECT * FROM tickets WHERE status != "closed" ORDER BY datum DESC');
if($q->num_rows() > 0) {
foreach($q->result() as $row) {
$data[] = $row;
}
return $data;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment