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 @@ + + - - - - - - - - - - - - - My Jobs - - + + + + + + + + + + + + + My Jobs + + + - - 0) { ?> - < + @@ -227,7 +228,7 @@ - Active Offers [] + Active Jobs[] 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 + =$job_id?> @@ -27,70 +27,84 @@ - - - - - - - - - + + + + + + + =$row['msg_date']?> + =$row['senders_name']?> + + + =$row['msg']?> - - - - Brian Cox - 2 mins - - - - - How likely are you to recommend our company to your friends and family ? - - - - - - - - - - - - - - 5 mins - You + + + + }else{ + ?> + + + + + =$row['senders_name']?> + =$row['msg_date']?> + + + =$row['msg']?> - - - - - - - - - Hey there, we’re just writing to let you know that you’ve been subscribed to a repository on GitHub. - - - - - + - + + + + +