From 86399b3974395712fd4faf47bf39f878a826eef2 Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Mon, 19 Sep 2022 08:03:29 -0400 Subject: [PATCH] fix --- www/application/controllers/Member.php | 28 +++- .../site3/internal/template/side_menu.php | 39 +++--- .../views/users/sections/mgs_reply.php | 126 ++++++++++-------- 3 files changed, 112 insertions(+), 81 deletions(-) diff --git a/www/application/controllers/Member.php b/www/application/controllers/Member.php index 8dd4a05c..7f9575e5 100644 --- a/www/application/controllers/Member.php +++ b/www/application/controllers/Member.php @@ -1021,14 +1021,14 @@ class Member extends Users_Controller { ORDER BY mm.id DESC LIMIT 20"; - $mysql = "SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,ms.firstname AS senders_name ,mm.senders_id, mm.memo + $mysql = "SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,ms.firstname AS senders_name ,mm.senders_id, mm.memo,mm.reply FROM members_messages mm LEFT JOIN members ms ON mm.senders_id = ms.id - WHERE mm.member_id = " . $_SESSION['member_id'] . " AND mm.reply IS NULL + WHERE mm.member_id = " . $_SESSION['member_id'] . " UNION - SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,'Me' AS senders_name ,mm.senders_id, mm.memo + SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,'Me' AS senders_name ,mm.senders_id, mm.memo, mm.reply FROM members_messages mm - WHERE mm.senders_id = " . $_SESSION['member_id'] . " AND mm.reply IS NULL + WHERE mm.senders_id = " . $_SESSION['member_id'] . " ORDER BY msg_date DESC LIMIT 30"; $query = $this->db->query($mysql); @@ -1052,11 +1052,26 @@ class Member extends Users_Controller { } public function setupReply(){ -//E&message_id=" + message_id +"&job_id="+job_id $message_id = trim($this->input->get('message_id')); $job_id = trim($this->input->get('job_id')); if ($message_id > 0 && $job_id !=''){ - $answer_string = $this->load->view('users/sections/mgs_reply', '', TRUE); + $data['job_id'] = $job_id; + $data['message_id'] = $message_id; + + $mysql = "SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,ms.firstname AS senders_name ,mm.senders_id, mm.memo + FROM members_messages mm + LEFT JOIN members ms ON mm.senders_id = ms.id + WHERE mm.member_id = " . $_SESSION['member_id'] . " AND mm.memo='".$job_id."' + UNION + SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,'Me' AS senders_name ,mm.senders_id, mm.memo + FROM members_messages mm + WHERE mm.senders_id = " . $_SESSION['member_id'] . " AND mm.memo='".$job_id."' + ORDER BY msg_date DESC LIMIT 30"; + + $query = $this->db->query($mysql); + $data['my_message_rows'] = $query->result_array(); // new implementation + + $answer_string = $this->load->view('users/sections/mgs_reply', $data, TRUE); echo $answer_string; } } @@ -1110,6 +1125,7 @@ class Member extends Users_Controller { $in["message_id"] = $this->input->get('message_id'); $in["memo"] = trim($this->input->get('message_code')); $in["yourmessage"] = trim($this->input->get('yourmessage')); + $in['member_id'] = $_SESSION['member_id']; if ($in["message_id"] > 0 && $in["memo"] != '' && $in["yourmessage"] != '') { $in['action'] = WRENCHBOARD_JOB_REPLY_QUESTION; diff --git a/www/application/views/site3/internal/template/side_menu.php b/www/application/views/site3/internal/template/side_menu.php index 5c498955..58131c38 100644 --- a/www/application/views/site3/internal/template/side_menu.php +++ b/www/application/views/site3/internal/template/side_menu.php @@ -191,30 +191,31 @@ + + - + + - - 0) { ?> - < + diff --git a/www/application/views/users/sections/mgs_reply.php b/www/application/views/users/sections/mgs_reply.php index 2b2a6b9e..044c6261 100644 --- a/www/application/views/users/sections/mgs_reply.php +++ b/www/application/views/users/sections/mgs_reply.php @@ -5,7 +5,7 @@
- Brian Cox +
@@ -27,70 +27,84 @@
- -
- -
- -
- -
- Pic + + +
+
+
+
+ + +
+
+
- - -
- Brian Cox - 2 mins -
-
- - -
How likely are you to recommend our company to your friends and family ?
- -
- -
- - -
- -
- -
- -
- 5 mins - You + + +
+
+
+
+ + +
+
+
- - -
- Pic -
-
- - -
Hey there, we’re just writing to let you know that you’ve been subscribed to a repository on GitHub.
- -
- -
- +
- + + + + +