Repository navigation
Expand file tree
/
Copy pathsend_email_model.php
More file actions
55 lines (48 loc) · 1.97 KB
/
Copy pathsend_email_model.php
File metadata and controls
55 lines (48 loc) · 1.97 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Description of send_email_model
*
* @author Wesam Gerges
*/
class Send_email_model extends CI_Model {
function getAllMeetings() {
return $this->db->order_by("Mname")
->get("meetings")
->result();
}
function getWeeklyMeetings($meetingid = 2) {
return $this->db->order_by("Date", "DESC")
//->where("meetingid",$meetingid)
->get_where("weeklymeeting", array("meetingid" => $meetingid))
->result();
}
function getAttendees() {
$this->db->select('*');
$this->db->from('person');
$this->db->join('meetingattendance', ' person.id=meetingattendance.MemberId');
$this->db->where(array("meetingattendance.weeklyMeetingId"=>$this->input->post("weeklymeeting")));
$this->db->order_by("FirstName","ASC");
$query = $this->db->get();
return $query->result();
}
function getServants() {
$this->db->select('*');
$this->db->from(ServantsTable);
$this->db->join(PersonsTable, ServantsTable.".Memberid = ".PersonsTable.".id");
$this->db->where(array("meetingId"=>$this->input->post("Meetings")));
$this->db->order_by("FirstName","ASC");
$query = $this->db->get();
return $query->result();
}
function getabsence() {
return $this->db->query(" SELECT * FROM membermeeting, person
WHERE membermeeting.meetingId = ".$this->input->post("Meetings")." AND
person.id = memberid AND memberid
NOT IN (
SELECT memberid FROM meetingattendance
WHERE meetingattendance.weeklyMeetingId = ".$this->input->post("weeklymeeting")."
)
ORDER BY FirstName;")->result();
}
}
?>