This commit is contained in:
2022-07-16 19:22:20 -04:00
parent 2f6050fb08
commit 1a6bade648
6 changed files with 148 additions and 134 deletions
@@ -26,6 +26,34 @@ class Users_Controller extends WRB_Controller {
$this->data = $this->getSessionArray();
}
public function activeProjects(){
$jbx = "''/proj/thisjob''";
$mysql = "SELECT '<b>ID:</b><a href=\"#\" onclick=\"showJobModal('''||mc.contract||''');\" >'||mc.contract||'</a><br><b>Timeline:</b>'||mc.timeline_days||' day(s)<br><b>Price:</b>'||mc.price*0.01 AS Project,"
. " '<b>Title: </b>'||mc.title||'<br><b>Description: </b>'||mc.description AS description,'\/proj\/thisjob' AS qpath, mc.id AS offer_id,"
. " (CASE WHEN mc.status=4 THEN '<input type=submit onclick=\"return post_nav_find_action($jbx, '||mc.id||')\" name=\"manage\" class=\"btn btn-info btn-xs btn-block\" value=\"Review\">' "
. " WHEN mc.status = 1 AND mc.delivery_date > now() THEN '<input type=submit onclick=\"return post_nav_find_action($jbx, '||mc.id||')\" name=\"manage\" class=\"btn btn-success btn-xs btn-block\" value=\"View\">' "
. " WHEN mc.status = 1 AND mc.delivery_date <now() THEN '<span class=\"label label-flat border-danger text-danger-600\">PastDue</span>' "
. " ELSE '<input type=submit onclick=\"return post_nav_find_action($jbx, '||mc.id||')\" name=\"manage\" class=\"btn btn-info btn-xs btn-block\" value=\"View\">' 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;
}
public function getSessionArray() {
$data["current_date"] = date('l jS \of F Y h:i:s A');
$data['username'] = $_SESSION['username']; // = $this->input->post('username');