diff --git a/www/application/controllers/Dash.php b/www/application/controllers/Dash.php index 990c2643..a9360c29 100644 --- a/www/application/controllers/Dash.php +++ b/www/application/controllers/Dash.php @@ -87,82 +87,68 @@ class Dash extends Users_Controller { $this->table->set_heading(array('data' => 'Job', 'style' => 'width:180px'), 'Title/Description', array('data' => '', 'style' => 'width:100px; cellpadding:0px;')); $data['job_table'] = $this->table->generate($query); - + $data['job_table_result'] = $query->result(); // used in new impl. $x = $this->dashTaskMessage(); $data['job_message_table'] = $x['job_message_table']; + $data['job_message_table_result'] = $x['job_message_table_result']; + $data['message_found'] = $x['message_found']; /// End table data =========================== - - /* - $this->load->library('table'); - $this->table->set_template($this->template); - //$this->table->set_heading('Job', 'Client', 'Terms', 'Description', 'Manage', 'Status'); - $mysql = 'SELECT jo.added::date,jo.member_id,j.title,' - . 'CASE WHEN jo.status = 1 THEN \'Pending\' ELSE \'Other\' END AS status' - . 'FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id LIMIT 5'; - // $sqb =" ,'' As View "; - $jbx = "''jobs/viewjob''"; - $mysql = "SELECT jo.added::date,j.title," - . 'CASE WHEN jo.status = 1 THEN \'Pending\' ELSE \'Other\' END AS status,' - . "'' AS View " - . "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 = " . $_SESSION['member_id'] . "LIMIT 4"; - - $query = $this->db->query($mysql); - - $num = $query->num_rows(); - - $data["dash_title"] = "Pending Offer(s)"; - if ($num > 0) { - $this->table->set_heading('Added', 'Title', 'Status', ''); - $data['offer_dash'] = $this->table->generate($query); - } else { - $data["offer_dash"] = "

can you share your controller method and did you tried can you share your controller method and did you tried '||j.contract AS date_contract,'Title:'||j.title||' '||substring(s.message,0,90) as title_message," + $mysql = " SELECT s.created::date ||' '||j.contract AS date_contract,j.title AS title,substring(s.message,0,90) as title_message,'\/proj\/thisjob' AS qpath,j.id AS offer_code," . " '' " . " FROM members_jobs_contract j " . " RIGHT JOIN jobs_contract_message s ON s.contract=j.contract " @@ -170,13 +156,13 @@ class Dash extends Users_Controller { $query = $this->db->query($mysql); - $this->load->library('table'); $this->table->set_template($this->template); $this->table->set_heading(array('data' => 'Date', 'style' => 'width:180px'), 'Title/Message', array('data' => '', 'style' => 'width:100px; cellpadding:0px;')); $data['job_message_table'] = $this->table->generate($query); - + $data['job_message_table_result'] = $query->result(); // used in new impl. + $data['message_found'] = true; return $data; } @@ -185,21 +171,19 @@ class Dash extends Users_Controller { $offer_found = false; $data = array(); - $data['offer_dash'] = ''; + $data['offer_dash'] = $data['offer_dash_result'] =''; $this->load->library('table'); $this->table->set_template($this->template); $jbx = "''/jobs/viewjob''"; - $mysql = "SELECT jo.added::date,j.title," - . "'' AS View " + $mysql = "SELECT jo.added::date AS pdate,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 = " . $_SESSION['member_id'] . " LIMIT 4"; -// . 'CASE WHEN jo.status = 1 THEN \'Pending\' ELSE \'Other\' END AS status,' $query = $this->db->query($mysql); - $num = $query->num_rows(); - $data["dash_title"] = "Pending Offer(s)"; if ($num > 0) { @@ -209,6 +193,7 @@ class Dash extends Users_Controller { $this->table->set_heading(array('data' => 'Added', 'style' => 'width:80px'), 'Title', array('data' => '', 'style' => 'width:80px')); $data['offer_dash'] = $this->table->generate($query); + $data['offer_dash_result'] = $query->result(); $offer_found = true; } else { $data["offer_dash"] = " ![]() '||jo.expire::date,j.title||' To :'||(CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec," + $mysql = "SELECT jo.added::date||' '||jo.expire::date AS pdate,j.title, (CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,'\/jobs\/viewmyjob' 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 " + . "'' 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.member_id = " . $_SESSION['member_id'] . " ORDER BY jo.id DESC LIMIT 4"; $query = $this->db->query($mysql); - $num = $query->num_rows(); if ($num > 0) { @@ -236,10 +220,12 @@ class Dash extends Users_Controller { $this->table->set_heading(array('data' => 'Added/Expire', 'style' => 'width:120px'), 'Title/Recipient', array('data' => 'Status', 'style' => 'width:100px'), array('data' => '', 'style' => 'width:100px')); $data['offer_dash'] = $this->table->generate($query); + $data['offer_dash_result'] = $query->result(); $offer_found = true; } } + $data["offer_found"] = $offer_found; return $data; } diff --git a/www/application/controllers/Jobs.php b/www/application/controllers/Jobs.php index 5c149bed..8bf4cde0 100644 --- a/www/application/controllers/Jobs.php +++ b/www/application/controllers/Jobs.php @@ -500,8 +500,8 @@ class Jobs extends Users_Controller { . ' AND expire> now() AND public_view > 0'; $query = $this->db->query($mysql); - $num = $query->num_rows(); + $data['market_table_result'] = $query->result(); // used in new impl. if ($num > 0) { $myTable = "
-
-
-
-
-
+
+
-
+
+
-
+
+
-
-
-
+
+
+
+
+Available Jobs
+
+
+ |