This commit is contained in:
2022-07-09 19:22:51 -04:00
parent 4c122e73de
commit ab9dbfad9f
3 changed files with 218 additions and 7 deletions
+52
View File
@@ -744,6 +744,58 @@ echo $this->getMarketInterestMessage( $in['offer_code'], $out['client_id'] );
}
}
public function myoffer() {
$data = array();
$data = $this->getSessionArray();
$data['offer_dash'] = '';
$this->load->library('table');
$this->table->set_template($this->template);
$data["offer_dash"] = "<div class=\"thumb\"><img src='assets/images/notask.png' alt=\"Active Projects\"></div>";
$data["dash_title"] = "<a href='/jobs/pendingoffer'>My Pending Offer(s)</a>";
$jbx = "''/jobs/viewmyjob''";
$mysql = "SELECT jo.added::date||'<br>'||jo.expire::date,j.title||'<br><b>To :</b>'||jo.email AS tRec,"
. 'CASE WHEN jo.status = 1 THEN \'Pending\' ELSE \'Other\' END AS status,'
. "'<input type=submit onclick=\"return post_nav_find_action($jbx,'''||jo.offer_code||''')\" name=\"manage\" class=\"btn btn-primary btn-xs\" value=\"View\">' 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.member_id = " . $_SESSION['member_id'] . "LIMIT 400";
$mysql = "SELECT jo.added::date||'<br>'||jo.expire::date AS job_dates,j.title||'<br><b>To :</b>'||(CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,"
. "'<input type=submit onclick=\"return post_nav_find_action($jbx,'''||jo.offer_code||''')\" name=\"manage\" class=\"btn btn-primary btn-xs\" value=\"View\">' 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.member_id = " . $_SESSION['member_id'] . " ORDER BY jo.id DESC LIMIT 400";
// . '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,'
$query = $this->db->query($mysql);
$mysql2 = "SELECT 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 job_to,jo.offer_code AS offer_code,"
. "'<input type=submit onclick=\"return post_nav_find_action($jbx,'''||jo.offer_code||''')\" name=\"manage\" class=\"btn btn-primary btn-xs\" value=\"View\">' 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.member_id = " . $_SESSION['member_id'] . " ORDER BY jo.id DESC LIMIT 400";
$query2 = $this->db->query($mysql2);
$data['offer_dash_rows'] = $query2->result();
$num = $query->num_rows();
if ($num > 0) {
// array('data' => 'Added/Expire', 'style' => 'width:100px')
$this->table->set_heading(array('data' => 'Added/Expire', 'style' => 'width:100px'), 'Title/Recipient', array('data' => ' ', 'style' => 'width:80px'));
$data['offer_dash'] = $this->table->generate($query);
$offer_found = true;
}
$_SESSION['secure_data'] = $data; // all data needed for secure page
$data['page_title'] = "Offer(s)";
$this->renderSecurePage('jobs/view_myoffer', $data);
}
public function pendingoffer() {
$data = array();
$data = $this->getSessionArray();