From ee4b81e348ddc28be774fecde1f22f49c14c9225 Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Fri, 18 Feb 2022 00:17:29 -0500 Subject: [PATCH] fix --- www/application/controllers/Dash.php | 122 +- www/application/controllers/Jobs.php | 8 +- www/application/controllers/Member.php | 7 +- .../libraries/Users_Controller.php | 11 +- www/application/views/jobs/view_market.php | 181 +- .../internal/template/view_securefooter.php | 68 + .../internal/template/view_securehead.php | 671 + .../views/users/common/userstrip.php | 45 +- www/application/views/users/view_dash.php | 361 +- www/application/views/users/view_message.php | 42 +- www/application/views/users/view_yourpage.php | 207 +- www/site3/assets/css/style.bundle.css | 2 +- www/site3/assets/css/style.bundle.rtl.css | 51194 ---------------- 13 files changed, 1449 insertions(+), 51470 deletions(-) create mode 100644 www/application/views/site3/internal/template/view_securefooter.php create mode 100644 www/application/views/site3/internal/template/view_securehead.php delete mode 100644 www/site3/assets/css/style.bundle.rtl.css 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"] = "
\"Active
"; - } - */ + $acp = array(); + $acp = $this->activeProjects(); + $data['job_table'] = $acp['job_table']; + $data['job_table_result'] = $acp['job_table_result']; $ya = array(); $ya = $this->dash_title(); $data["dash_title"] = $ya["dash_title"]; $data["offer_dash"] = $ya["offer_dash"]; + $data["offer_dash_result"] = $ya["offer_dash_result"]; + $data["offer_found"] = $ya["offer_found"]; $_SESSION['secure_data'] = $data; // all data needed for secure page - // print_r($_SESSION); +//var_dump( $_SESSION); +//exit; + $data['page_title'] ="Dashboard"; + $this->renderSecurePage('users/view_dash', $data); - $this->load->view('users/view_header_user', $data); - $this->load->view('users/view_dash', $data); - $this->load->view('users/view_footer_user', $data); - } + } } + + private function activeProjects(){ + + + $jbx = "''/proj/thisjob''"; + $mysql = "SELECT 'ID:'||mc.contract||'
Timeline:'||mc.timeline_days||' day(s)
Price:'||mc.price*0.01 AS Project," + . " 'Title: '||mc.title||'
Description: '||mc.description AS description,'\/proj\/thisjob' AS qpath, mc.id AS offer_id," + . " (CASE WHEN mc.status=4 THEN '' " + . " WHEN mc.status = 1 AND mc.delivery_date > now() THEN '' " + . " WHEN mc.status = 1 AND mc.delivery_date PastDue' " + . " ELSE '' END) AS manage " + . " FROM members_jobs_contract mc LEFT JOIN members m ON m.id=mc.client_id " + . " WHERE mc.member_id = " . $_SESSION['member_id'] . " AND mc.status IN (1,2,4) AND mc.delivery_date > now() " + . " OR mc.client_id =" . $_SESSION['member_id'] . " AND mc.status IN (1,2,4) AND mc.delivery_date > now() LIMIT 4"; + + $query = $this->db->query($mysql); + + + $this->load->library('table'); + $this->table->set_template($this->template); + $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. + + return $data; + + } private function dashTaskMessage() { $data = array(); - /* - wrenchboard=> select s.created,j.contract,j.title,j.id,j.status,j.delivery_date,substring(s.message,0,100) FROM members_jobs_contract j RIGHT JOIN jobs_contract_message s ON s.contract=j.contract WHERE j.member_id=3 or j.client_id = 3 AND j.status IN (1,4); - created | contract | title | id | status | delivery_date | substring - ----------------------------+------------+-----------------------------------------------+----+--------+----------------------------+----------------------------------------------------------------------------------------------------- - 2017-05-18 11:53:20.569399 | 7BW9B9R8BB | five thousand naira | 13 | 1 | 2017-08-02 14:19:38.711257 | This is a test of ajax send message - 2017-05-18 12:03:30.685328 | 7B27RRBRB7 | 595Job Title Job Title Job Title Job Title932 | 15 | 4 | 2017-05-10 19:23:26.115394 | dldldldldldl - 2017-05-18 12:03:44.137005 | 7B27RRBRB7 | 595Job Title Job Title Job Title Job Title932 | 15 | 4 | 2017-05-10 19:23:26.115394 | This is an empty list test - 2017-05-18 12:04:00.228586 | 7B27RRBRB7 | 595Job Title Job Title Job Title Job Title932 | 15 | 4 | 2017-05-10 19:23:26.115394 | List should be populated now - 2017-05-18 20:49:12.996077 | 7BW9B9R8BB | five thousand naira | 13 | 1 | 2017-08-02 14:19:38.711257 | About PayQuic\r + - | | | | | | PayQuic is global payments and airtime top-up company. Open for business 24/7, 365 d - 2017-06-12 10:28:32.720786 | 601BBWRW48 | 595Job Title Job Title Job Title Job Title932 | 10 | 1 | 2017-08-09 16:08:43.503739 |

can you share your controller method and did you tried 

can you share your controller method and did you tried ' " - . " FROM members_jobs_contract j " - . " RIGHT JOIN jobs_contract_message s ON s.contract=j.contract " - . " WHERE j.member_id=" . $_SESSION['member_id'] . " OR j.client_id = " . $_SESSION['member_id'] . " AND j.status IN (1,4)"; - - $mysql = " SELECT s.created::date ||'
'||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"] = "
\"Active
"; @@ -218,15 +203,14 @@ class Dash extends Users_Controller { if ($offer_found == false) { $data["dash_title"] = "My Pending Offer(s)"; $jbx = "''/jobs/viewmyjob''"; - $mysql = "SELECT jo.added::date||'
'||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 = ""; @@ -520,9 +520,13 @@ class Jobs extends Users_Controller { $_SESSION['secure_data'] = $data; // all data needed for secure page $data['page_title'] = "Available Jobs & Tasks"; - $this->load->view('users/view_header_user', $data); + /* $this->load->view('users/view_header_user', $data); $this->load->view('jobs/view_market', $data); $this->load->view('users/view_footer_user', $data); +*/ + // var_dump( $data['market_table_result']); + // exit; + $this->renderSecurePage('jobs/view_market', $data); } private function makeMarketTableRow($row) { diff --git a/www/application/controllers/Member.php b/www/application/controllers/Member.php index 08d94e38..8fb140f6 100644 --- a/www/application/controllers/Member.php +++ b/www/application/controllers/Member.php @@ -438,9 +438,12 @@ class Member extends Users_Controller { $data['galery_list'] = $this->getGaleryList($_SESSION['member_id']); - $this->load->view('users/view_header_user', $data); + /* $this->load->view('users/view_header_user', $data); $this->load->view('users/view_yourpage', $data); $this->load->view('users/view_footer_user', $data); +*/ + $data['page_title'] ="My Page"; + $this->renderSecurePage('users/view_yourpage', $data); } @@ -817,7 +820,7 @@ class Member extends Users_Controller { $myTable .="
"; - + $data['page_title'] ="Messages"; //$this->table->set_heading(array('data' => 'Date', 'style' => 'width:110px'), 'Message'); $data['message_table'] = $myTable; //$this->table->generate($query); $this->RenderUserPage('users/view_message', $data); diff --git a/www/application/libraries/Users_Controller.php b/www/application/libraries/Users_Controller.php index cea2f533..a22a8ae4 100644 --- a/www/application/libraries/Users_Controller.php +++ b/www/application/libraries/Users_Controller.php @@ -77,11 +77,20 @@ class Users_Controller extends WRB_Controller { redirect(home); } } - + + protected function renderSecurePage($page_path_name, $data) { + $this->load->view('site3/internal/template/view_securehead', $data); + $this->load->view( $page_path_name, $data); + $this->load->view('site3/internal/template/view_securefooter', $data); + } + protected function RenderUserPage($page_name, $data) { + return $this->renderSecurePage($page_name, $data); + /* $this->load->view('users/view_header_user', $data); $this->load->view($page_name, $data); $this->load->view('users/view_footer_user', $data); + */ } } diff --git a/www/application/views/jobs/view_market.php b/www/application/views/jobs/view_market.php index 9dd78db9..e70cc4bd 100644 --- a/www/application/views/jobs/view_market.php +++ b/www/application/views/jobs/view_market.php @@ -11,37 +11,176 @@ return false; } // --> - + - -
- - - - -
-
-
- -
-
+ +
+ +

Available Jobs + + +
+ + +
+ +

+ + + + + + + + + + + + + + + diff --git a/www/application/views/site3/internal/template/view_securefooter.php b/www/application/views/site3/internal/template/view_securefooter.php new file mode 100644 index 00000000..7a2d911a --- /dev/null +++ b/www/application/views/site3/internal/template/view_securefooter.php @@ -0,0 +1,68 @@ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/www/application/views/site3/internal/template/view_securehead.php b/www/application/views/site3/internal/template/view_securehead.php new file mode 100644 index 00000000..80546608 --- /dev/null +++ b/www/application/views/site3/internal/template/view_securehead.php @@ -0,0 +1,671 @@ + + + + + + WrenchBoard -<?php echo $_SESSION['firstname']; ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + +
+ + + +
+ + + + + + + +
+ + +
+ +
+ +
+ + + Logo + + + +
+ + + + + + + + + + + + + + + + + + +
+ + +
+
+ + + + + + + + +
+
+ +
+ + +
+ +
+ +
+ +

+ + + + +
+ + + + +
+ +
+ +
+ + +
+ +
+ +
diff --git a/www/application/views/users/common/userstrip.php b/www/application/views/users/common/userstrip.php index 432d0231..df9974c8 100644 --- a/www/application/views/users/common/userstrip.php +++ b/www/application/views/users/common/userstrip.php @@ -7,13 +7,54 @@ if ($_SESSION["offer_interest_count"] + $_SESSION['past_duejobs_count'] > 0) { if ($_SESSION['past_duejobs_count'] > 0) { ?> - + + + + 0) { ?> - + +
+ + + +
+ + + +
+ +
+ +
+ +
+

+ +

+
+ +
+
+ + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Added/ExpireTitleTargetStatus
+
+ + pdate ?> + +
+
+ title ?> + Movie Creator + trec ?> + status ?> + + + + + + + + + + + +
+
+ +
+ + +
+
+ +
+ +
+ + +
+ +
+ +
+

+ Active Projects +

+
+ +
+
+ + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
JobTitle/DescriptionStatus
+ project ?> + description ?> + + + + + + + + + + + + +
+
+ +
+ + +
+
+ +
+ +
+ +
+ + +
+
+ +
+ +
+ +

+ Recent Task Message +

+ + +
+ + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
DateTitle/Message
+
+ + date_contract ?> + +
+
+ title ?> + title_message?> + + + + + + + + + + + +
+
+ +
+ + +
+ + +
+ +
+ +
+
+ + + + + + + + - - -
- - -
-
- -
-
- -
- - + - - - - - - -
- - - -
- -