From 9d66d36948e310328bd25df89f033ed0bbf1bdeb Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Sun, 18 Sep 2022 15:06:45 -0400 Subject: [PATCH] fix --- www/application/controllers/Jobs.php | 14 ++--- www/application/models/Offers_model.php | 40 +++++++++++- www/application/views/jobs/view_myoffer.php | 63 +------------------ .../site3/internal/template/side_menu.php | 61 ++++++++---------- 4 files changed, 74 insertions(+), 104 deletions(-) diff --git a/www/application/controllers/Jobs.php b/www/application/controllers/Jobs.php index 27ddf62f..00099751 100644 --- a/www/application/controllers/Jobs.php +++ b/www/application/controllers/Jobs.php @@ -736,17 +736,15 @@ echo $this->getMarketInterestMessage( $in['offer_code'], $out['client_id'] ); // $data = array(); $data = $this->getSessionArray(); $this->load->model('offers_model'); - $out = $this->offers_model->getUserPendingOffers($_SESSION['member_id']); - - $data['my_offer_rows'] = $out["query"]->result(); - - - - $data['page_title'] = "Pending"; + $out = $this->offers_model->getUserPendingOffers($_SESSION['member_id'], 10000); + $data['my_offer_rows'] = $out["my_offer_rows"]; //same + $data['offer_dash_result'] = $out["my_offer_rows"]; //same + $data['offer_found']= count($out["my_offer_rows"])>0; + $data['dash_title'] = "Pending Offers"; $this->renderSecurePage('jobs/view_myoffer', $data); - } + public function pendingoffer() { $data = array(); $data = $this->getSessionArray(); diff --git a/www/application/models/Offers_model.php b/www/application/models/Offers_model.php index 928180d1..7136e3e6 100644 --- a/www/application/models/Offers_model.php +++ b/www/application/models/Offers_model.php @@ -9,6 +9,13 @@ class Offers_model extends CI_Model function __construct() { + } + + // NOT completed -- + public function getSentPendingOffers($member_id) + { + + } public function attachOffers($email) @@ -28,10 +35,11 @@ class Offers_model extends CI_Model } // NOT completed -- - public function getUserPendingOffers($member_id) + public function getUserPendingOffers($member_id,$listLimit) { $out = array(); + /* $error_state = false; $out['error'] = ''; $sqlOffer = "SELECT mo.member_id, to_char(mo.added, 'Day Mon dd, yyyy HH:MI AM') AS sent, @@ -47,7 +55,35 @@ class Offers_model extends CI_Model $out["query"] = $this->db->query($sqlOffer); - return $out; + + + $offer_found = false; +*/ + $data = array(); + $data['offer_dash'] = $data['offer_dash_result'] =''; + + $jbx = "''/jobs/viewjob''"; + $mysql = "SELECT jo.added::date AS pdate, jo.added::date AS start_job_date , jo.expire::date AS end_job_date, j.title,(CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,'\/jobs\/viewjob' AS qpath," + . 'CASE WHEN jo.status = 1 AND jo.public_view =0 THEN \'Pending\' WHEN jo.status = 1 AND jo.public_view >0 THEN \'Active\' ELSE \'Other\' END AS status,' + . "'' AS View ,jo.offer_code AS offer_code " + . "FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id " + . "WHERE jo.expire > now() AND jo.status = 1 " + . "AND jo.client_id = " .$member_id . " LIMIT $listLimit"; + $query = $this->db->query($mysql); + $num = $query->num_rows(); + $data["dash_title"] = "Pending Offer(s)"; + + // array('data' => 'Added', 'style' => 'width:80px') + + // $this->table->set_heading(array('data' => 'Added', 'style' => 'width:80px'), 'Title', array('data' => '', 'style' => 'width:80px')); + // $data['offer_dash'] = $this->table->generate($query); + $data['my_offer_rows'] = $query->result(); + $offer_found = true; + + + + + return $data; /* */ diff --git a/www/application/views/jobs/view_myoffer.php b/www/application/views/jobs/view_myoffer.php index 694d1f24..6ad842a6 100644 --- a/www/application/views/jobs/view_myoffer.php +++ b/www/application/views/jobs/view_myoffer.php @@ -18,66 +18,9 @@
- -
- -
-

- My Offers -

-
- -
-
- - -
-
- -
- -
- - - - - - - - - - - -
- title?> - description?> - Send : sent?>
- Expire : expire?> -
- - - - - - -
- -
- -
- - -
-
- -
- +
diff --git a/www/application/views/site3/internal/template/side_menu.php b/www/application/views/site3/internal/template/side_menu.php index bbce91a1..069c0173 100644 --- a/www/application/views/site3/internal/template/side_menu.php +++ b/www/application/views/site3/internal/template/side_menu.php @@ -136,6 +136,9 @@
+ + + - - - + + + 0) { ?> @@ -243,25 +232,29 @@ + + + + + - - +