input->post('username'); $data['name'] = $_SESSION['name']; // = $this->input->post('username'); $data['firstname'] = $_SESSION['firstname']; // = $ret->firstname; $data['lastname'] = $_SESSION['lastname']; // = $ret->lastname; $data['email'] = $_SESSION['email']; // = $ret->email; // print_r($_SESSION); //Array ( [__ci_last_regenerate] => 1474689025 [username] => ses66181+1@gmail.com [name] => ses66181+1@gmail.com [firstname] => Olusesan [lastname] => Amey [email] => ses66181+1@gmail.com ) // if (!isset($_SESSION['username']) or $_SESSION['username'] == '') { redirect(home); } else { $this->load->view('users/view_header_user', $data); $this->load->view('users/view_active', $data); $this->load->view('users/view_footer_user', $data); } } public function startcreate(){ $data = $this->getSessionArray(); $this->load->model('dash_model'); $out = $this->dash_model->getDashData($data); $this->load->model('job_model'); $data['jobs_list'] = $this->job_model->getComboJobListOrdered($_SESSION['member_id'],50); $data['active_task'] = $out['active_task']; $data['active_pass_due'] = $out['active_pass_due']; $data['current_balance'] = $out['current_balance']; $data['new_message'] = $out['new_message']; $data['template_data'] = $this->jobsTemplates(); $this->renderSecurePage('jobs/view_startcreate', $data); } private function jobsTemplates(){ return [ [ 'ID'=>'FACEBOOKSHARE', 'name'=>'Share my article on your FaceBook Page', 'description'=>'Pick from the articles on my blog and share on your FaceBook page', 'delivery'=>'You will need to have a minimum of 100 friends on your profile', 'img'=>'/site3/assets/media/jobs/share-stories.jpg', 'timeline_days'=>'7', 'price'=> 2000 ], [ 'ID'=>'TESTMYAPP', 'name'=>'Test my App and give feedback', 'description'=>'Download install and go through my app, upload feedback as part of my testing', 'delivery'=>'You will have to capture and upload up to 12 screens', 'img'=>'/site3/assets/media/jobs/test-app.jpg', 'timeline_days'=>'7', 'price'=> 2000 ], [ 'ID'=>'REVIEWFEEDBACK', 'name'=>'Review My Blog Story with feedback', 'description'=>'View my Blog or Site stories, review and provide feedbacks or comments', 'delivery'=>'', 'img'=>'/site3/assets/media/jobs/review-stories.jpg', 'timeline_days'=>'7', 'price'=> 2000 ], [ 'ID'=>'PROPOSEBLOG', 'name'=>'Propose new articles tiltles for my blog', 'description'=>'Look at my site stories, propose 5 new articles for my contents line', 'delivery'=>'Proposed items myst be relvant to the site and not currenlty present in any form', 'img'=>'/site3/assets/media/jobs/propose-new.jpg', 'timeline_days'=>'7', 'price'=> 2000 ], [ 'ID'=>'WEBSITEREVIEW', 'name'=>'Visit and review my Website provide feedback', 'description'=>'Visit my website,browse througn the pages and provide feedback', 'delivery'=>'Capture 10 screen shots and upload', 'img'=>'/site3/assets/media/jobs/review-site.jpg', 'timeline_days'=>'7', 'price'=> 2000 ], ]; } public function active() { $data['username'] = $_SESSION['username']; // = $this->input->post('username'); $data['name'] = $_SESSION['name']; // = $this->input->post('username'); $data['firstname'] = $_SESSION['firstname']; // = $ret->firstname; $data['lastname'] = $_SESSION['lastname']; // = $ret->lastname; $data['email'] = $_SESSION['email']; // = $ret->email; // print_r($_SESSION); //Array ( [__ci_last_regenerate] => 1474689025 [username] => ses66181+1@gmail.com [name] => ses66181+1@gmail.com [firstname] => Olusesan [lastname] => Amey [email] => ses66181+1@gmail.com ) // if (!isset($_SESSION['username']) or $_SESSION['username'] == '') { redirect(home); } else { $this->load->view('users/view_header_user', $data); $this->load->view('users/view_active', $data); $this->load->view('users/view_footer_user', $data); } } public function offerinterest() { $data = $this->getSessionArray(); $jaction = "''/jobs/jobinterest''"; $mysql = "SELECT to_char(mi.added, 'YYYY-MM-DD HH24:MI') AS added,jo.offer_code,mjs.title," . "m.firstname||' '||m.lastname AS Client," . " '
' AS view " . "FROM members_offer_interest mi " . "LEFT JOIN members m ON m.id = mi.member_id " . "LEFT JOIN members_jobs_offer jo ON jo.id=mi.offer_id " . "LEFT JOIN members_jobs mjs ON mjs.id=jo.job_id " . "WHERE jo.member_id =" . $_SESSION['member_id'] . " " . "AND mi.status=1 AND jo.expire> now() + '-3 days' ORDER BY mi.added ASC"; $this->load->library('pagination'); $config = array(); $query = $this->db->query($mysql); $config["total_rows"] = $query->num_rows(); $data['dash_title'] = "Public Offer Interset [" . $config["total_rows"] . "]"; $config["base_url"] = base_url() . "/jobs/offerinterest"; $config["per_page"] = 5; $config["uri_segment"] = 3; $config["num_links"] = 5; $config['full_tag_open'] = ""; $config['num_tag_open'] = '
  • '; $config['num_tag_close'] = '
  • '; $config['cur_tag_open'] = "
  • "; $config['cur_tag_close'] = "
  • "; $config['next_tag_open'] = "
  • "; $config['next_tagl_close'] = "
  • "; $config['prev_tag_open'] = "
  • "; $config['prev_tagl_close'] = "
  • "; $config['first_tag_open'] = "
  • "; $config['first_tagl_close'] = "
  • "; $config['last_tag_open'] = "
  • "; $config['last_tagl_close'] = "
  • "; $this->pagination->initialize($config); $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0; $page = is_numeric($page) ? $page : 0; // '||jo.offer_code||'' AS added_code,mjs.title," . "m.firstname AS Client," . " '
    ' AS view " . "FROM members_offer_interest mi " . "LEFT JOIN members m ON m.id = mi.member_id " . "LEFT JOIN members_jobs_offer jo ON jo.id=mi.offer_id " . "LEFT JOIN members_jobs mjs ON mjs.id=jo.job_id " . "WHERE jo.member_id =" . $_SESSION['member_id'] . " " . "AND mi.status=1 AND jo.expire> now() + '-3 days' ORDER BY mi.added ASC LIMIT " . $config["per_page"] . " OFFSET " . $page; $this->load->library('table'); $this->table->set_template($this->template); $query = $this->db->query($mysql); $this->table->set_heading(array('data' => 'Added/ID', 'style' => 'width:100px'), 'Title', 'Client', array('data' => 'Action', 'style' => 'width:70px')); $data['job_interest_table'] = $this->table->generate($query); $data["links"] = $this->pagination->create_links(); $this->renderSecurePage('jobs/view_pendinginterest', $data); } public function jobinterest() { $data['message_list'] = ''; $interest_id = $this->input->post('interest_id'); $data = $this->getSessionArray(); $jaction = "''/jobs/jobinterest''"; $data['total_jobs_completed'] = $data['total_jobs_active'] = $data['total_jobs_uncompleted'] = $data['total_pending_offers'] = 0; $data['dash_title'] = 'Manage Offer Interset'; $mysql = "SELECT to_char(mi.added, 'YYYY-MM-DD') AS added,jo.offer_code,mjs.title," . "m.firstname AS Client,mi.offer_id,m.id AS client_id, mi.id AS interest_id,md.description AS client_description,m.added::date AS client_added," . " '
    ' AS view " . "FROM members_offer_interest mi " . "LEFT JOIN members m ON m.id = mi.member_id " . "LEFT JOIN members_jobs_offer jo ON jo.id=mi.offer_id " . "LEFT JOIN members_jobs mjs ON mjs.id=jo.job_id " . "LEFT JOIN members_detail md ON md.member_id=m.id " . "WHERE jo.member_id =" . $_SESSION['member_id'] . " " . " AND mi.id=" . $interest_id . " " . " AND mi.status = 1 ORDER BY mi.added ASC"; //AND jo.status=1 AND jo.expire> now() $query = $this->db->query($mysql); $num = $query->num_rows(); if ($num > 0) { $row = $query->row_array(); $data['added'] = $row['added']; $data['client'] = $row['client']; $data['title'] = $row['title']; $data['offer_code'] = $row['offer_code']; $data['interest_id'] = $row['interest_id']; // The interested member id is here $data['client_description'] = $row['client_description']; $data['client_added'] = $row['client_added']; $data['message_list'] = $this->getMarketInterestMessage($data['offer_code'], $row['client_id']); // $data['skills_set'] = $this->getUserSavedSkillsSet($row['client_id']); //onclick="showModal( $interest_id)" //to_char(mi.added, 'YYYY-MM-DD HH24:MI') AS added $out = $this->getClientJobStats($row['client_id']); $data['total_jobs_completed'] = $out['total_jobs_completed']; $data['total_jobs_active'] = $out['total_jobs_active']; $data['total_jobs_uncompleted'] = $out['total_jobs_uncompleted']; $data['total_pending_offers'] = $out['total_pending_offers']; $mysql = "SELECT mi.added::date AS added, " . "''||m.firstname||'' AS Client," . "CASE WHEN mi.status =1 THEN 'Pending' WHEN mi.status=5 THEN 'Approved' ELSE 'Unknown' END AS status," . "(CASE WHEN mi.status = 1 THEN '
    ' ELSE '' END) AS Sel " . "FROM members_offer_interest mi " . "LEFT JOIN members m ON m.id = mi.member_id " . "LEFT JOIN members_jobs_offer jo ON jo.id=mi.offer_id " . "LEFT JOIN members_jobs mjs ON mjs.id=jo.job_id " . "WHERE jo.member_id =" . $_SESSION['member_id'] . " " . " AND mi.offer_id=" . $row['offer_id'] . " " . "AND mi.id <> $interest_id ORDER BY mi.added ASC"; //AND jo.status=1 AND jo.expire> now() $query2 = $this->db->query($mysql); } else { } $this->load->library('table'); $this->table->set_template($this->template); $this->table->set_heading(array('data' => 'Added', 'style' => 'width:120px'), 'Interested Client', array('data' => 'Status', 'style' => 'width:90px'), array('data' => '', 'style' => 'width:90px')); $data['job_others_interest_table'] = $this->table->generate($query2); $this->renderSecurePage('jobs/view_manageinterest', $data); } private function getMarketInterestMessage($offer_code, $client_id) { $data = $this->getSessionArray(); $member_id = $_SESSION['member_id']; $mysql = "SELECT m.firstname, s.added::date as msg_added,s.msg FROM members_messages s LEFT JOIN members m ON m.id=s.senders_id " . "WHERE s.msg_type='MRKTINT' AND s.memo='$offer_code' " . "AND s.member_id=$client_id AND s.senders_id = $member_id " . "OR s.member_id= $member_id AND s.senders_id=$client_id " . "ORDER BY s.id DESC LIMIT 4"; $query = $this->db->query($mysql); $tmsg = ""; foreach ($query->result() as $row) { $tmsg .= "" . $row->msg_added . " - From:" . $row->firstname; $tmsg .= "
    "; $tmsg .= $row->msg; $tmsg .= "
    "; } return $tmsg; } public function jobinterest_modal() { $interest_id = $this->input->get('interest_id'); $data = $this->getSessionArray(); $mysql = "SELECT to_char(mi.added, 'YYYY-MM-DD') AS added,jo.offer_code,mjs.title," . "m.firstname AS Client,mi.offer_id,m.id AS client_id, mi.id AS interest_id,md.description AS client_description,m.added::date AS client_added," . " '
    ' AS view " . "FROM members_offer_interest mi " . "LEFT JOIN members m ON m.id = mi.member_id " . "LEFT JOIN members_jobs_offer jo ON jo.id=mi.offer_id " . "LEFT JOIN members_jobs mjs ON mjs.id=jo.job_id " . "LEFT JOIN members_detail md ON md.member_id=m.id " . "WHERE jo.member_id =" . $_SESSION['member_id'] . " " . " AND mi.id=" . $interest_id . " " . "AND jo.status=1 AND mi.status = 1 AND jo.expire> now() ORDER BY mi.added ASC"; $query = $this->db->query($mysql); $num = $query->num_rows(); if ($num > 0) { $row = $query->row_array(); //$data['added'] = $row['added']; $data['client'] = $row['client']; //$data['title'] = $row['title']; //$data['offer_code'] = $row['offer_code']; //$data['interest_id'] = $row['interest_id']; // The interested member id is here $data['client_description'] = $row['client_description']; $data['skills_set'] = $this->getUserSavedSkillsSet($row['client_id']); } else { $data["client"] = "Undefined"; $data["client_description"] = "Failed to load client"; $data["skills_set"] = ""; } $this->load->view('jobs/view_manageinterest_modal', $data); } public function loaduserSkills() { $member_id = $this->input->get('interest_id'); $data = $this->getSessionArray(); $mysql = "SELECT to_char(m.added, 'YYYY-MM-DD') AS added,m.firstname AS client,m.id AS client_id," . "md.description AS client_description " . "FROM members m " . "LEFT JOIN members_detail md ON md.member_id=m.id " . "WHERE m.id=" . $_SESSION['member_id']; $query = $this->db->query($mysql); $num = $query->num_rows(); if ($num > 0) { $row = $query->row_array(); $data['client'] = $row['client']; $data['client_description'] = $row['client_description']; } else { $data["client"] = "Undefined"; $data["client_description"] = "No entry yet..."; $data["skills_set"] = ""; } $data['skills_set'] = $this->getUserSavedSkillsSet($member_id); $this->load->view('jobs/view_manageinterest_modal', $data); } public function offerdetail_modal() { $contract_id = trim($this->input->get('contact_id')); $data = $this->getSessionArray(); $mysql = " SELECT j.title,j.price,j.timeline_days,j.job_detail,j.description FROM members_jobs j LEFT JOIN members_jobs_offer jo ON jo.job_id = j.id WHERE jo.offer_code='$contract_id' "; $query = $this->db->query($mysql); $num = $query->num_rows(); if ($num > 0) { $data = $query->row_array(); $data['contract_id'] = $contract_id; $this->load->view('jobs/modals/view_offerdetail_modal', $data); } } public function jobdetail_modal() { $contract_id = trim($this->input->get('contact_id')); $data = $this->getSessionArray(); $mysql = " SELECT title,price,delivery_date,job_detail,description,delivery_date FROM members_jobs_contract WHERE contract='$contract_id' "; $query = $this->db->query($mysql); $num = $query->num_rows(); if ($num > 0) { $data = $query->row_array(); $data['contract_id'] = $contract_id; $this->load->view('jobs/modals/view_jobdetail_modal', $data); } } public function jobinterest_modal_BAK() { $interest_id = $this->input->get('interest_id'); $data = $this->getSessionArray(); $mysql = "SELECT to_char(mi.added, 'YYYY-MM-DD') AS added,jo.offer_code,mjs.title," . "m.firstname AS Client,mi.offer_id,m.id AS client_id, mi.id AS interest_id,md.description AS client_description,m.added::date AS client_added," . " '
    ' AS view " . "FROM members_offer_interest mi " . "LEFT JOIN members m ON m.id = mi.member_id " . "LEFT JOIN members_jobs_offer jo ON jo.id=mi.offer_id " . "LEFT JOIN members_jobs mjs ON mjs.id=jo.job_id " . "LEFT JOIN members_detail md ON md.member_id=m.id " . "WHERE jo.member_id =" . $_SESSION['member_id'] . " " . " AND mi.id=" . $interest_id . " " . "AND jo.status=1 AND mi.status = 1 AND jo.expire> now() ORDER BY mi.added ASC"; $query = $this->db->query($mysql); $num = $query->num_rows(); if ($num > 0) { $row = $query->row_array(); //$data['added'] = $row['added']; $data['client'] = $row['client']; //$data['title'] = $row['title']; //$data['offer_code'] = $row['offer_code']; //$data['interest_id'] = $row['interest_id']; // The interested member id is here $data['client_description'] = $row['client_description']; $data['skills_set'] = $this->getUserSavedSkillsSet($row['client_id']); } else { $data["client"] = "Undefined"; $data["client_description"] = "Failed to load client"; $data["skills_set"] = ""; } $this->load->view('jobs/view_manageinterest_modal', $data); } private function getUserSavedSkillsSet($client_id) { $skills = ""; $mysql = " SELECT mk.*,sc.category,st.skill " . "FROM members_skills mk " . "LEFT JOIN skill_types st ON st.id = mk.skill_id " . "LEFT JOIN skill_category sc ON sc.id = mk.category_id " . "WHERE mk.member_id = $client_id AND mk.status=1"; $query = $this->db->query($mysql); if ($query->num_rows() > 0) { foreach ($query->result_array() as $row) { $skills .= ""; } } $skills .= "
    " . $row["category"] . "-" . $row["skill"] . "
    "; return $skills; } public function procinterest() { // url: "/jobs/procinterest?proc=ACCEPT&interest_id=" + interest_id // url: "/jobs/procinterest?proc=REJECT&interest_id=" + interest_id // url: "/jobs/procinterest?proc=CANCEL&interest_id=" + interest_id $data = $this->getSessionArray(); $inx= []; $inx['interest_id'] = $this->input->get('interest_id'); $proc = $this->input->get('proc'); $inx['interest'] = 0; $inx['member_id'] = $_SESSION['member_id']; switch ($proc) { case 'ACCEPT': $inx['interest'] = JOB_INTEREST_ACCEPT; break; case 'REJECT': $inx['interest'] = JOB_INTEREST_REJECT; break; case 'CANCEL': $inx['interest'] = JOB_INTEREST_CANCEL; break; } if ($inx['interest'] > 0) { $inx['action'] = WRENCHBOARD_JOB_PROC_INTEREST; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($inx, $out); if ($res == PHP_CREATED_OK) { echo 'Success - ' . $out['status']; } else { echo 'Error - ' . $out['status']; } } // echo "AMEYE $interest_id $proc "; } private function vjobinterest() { // //echo 'ameye'; $data = $this->getSessionArray(); $data['dash_title'] = 'Yes Public Offer Interset'; $mysql = "SELECT to_char(mi.added, 'YYYY-MM-DD HH24:MI') AS added,jo.offer_code,mjs.title," . "m.firstname||' '||m.lastname AS Client," . " '
    ' AS view " . "FROM members_offer_interest mi " . "LEFT JOIN members m ON m.id = mi.member_id " . "LEFT JOIN members_jobs_offer jo ON jo.id=mi.offer_id " . "LEFT JOIN members_jobs mjs ON mjs.id=jo.job_id " . "WHERE jo.member_id =" . $_SESSION['member_id'] . " " . "AND jo.status=1 AND jo.expire> now() ORDER BY mi.added ASC"; $this->load->library('table'); $this->table->set_template($this->template); $query = $this->db->query($mysql); $this->table->set_heading(array('data' => 'Added', 'style' => 'width:140px'), 'Code', 'Title', 'Client', array('data' => 'Action', 'style' => 'width:90px')); $data['job_interest_table'] = $this->table->generate($query); $this->load->view('users/view_header_user', $data); $this->load->view('jobs/vofferinterest', $data); $this->load->view('users/view_footer_user', $data); } public function viewjob() { $data = $this->getSessionArray(); //-----------------active job $acp = array(); $acp = $this->activeProjects(); $data['job_table'] = $acp['job_table']; $data['job_table_result'] = $acp['job_table_result']; //------------------------------------------ $jobOfferID = $this->input->post('jobOfferID'); $data['jobOfferID'] = $jobOfferID; if ($jobOfferID != '') { $this->load->model('job_model'); $out = $this->job_model->loadJobOffer($_SESSION['member_id'], $jobOfferID); if ($out['result'] == 1) { $data["added_date"] = $out["added_date"]; $data["title"] = $out["title"]; $data["description"] = $out["description"]; $data["timeline_days"] = $out["timeline_days"]; $data["price"] = $out["price"]; $data["offer_code"] = $out["offer_code"]; $data["job_description"] = $out["job_description"]; $date = date_create($out["expire"]); $out["expire"] = date_format($date, 'Y-m-d H:i'); $data["expire"] = $out["expire"]; $this->renderSecurePage('jobs/view_viewjoboffer', $data); } else { redirect('dash'); // go back to dash if not valid } } else { redirect('dash'); // go back to dash if not valid } } public function market() { $data = array(); $data = $this->getSessionArray(); $data['offer_dash'] = ''; $this->load->library('table'); $this->table->set_template($this->template); $data["dash_title"] = "Available Jobs & Tasks"; $mysql = 'SELECT jo.offer_code,mj.title,mj.description,mj.timeline_days,mj.price,jo.job_description FROM members_jobs_offer jo ' . ' LEFT JOIN members_jobs mj ON mj.id=jo.job_id ' . ' WHERE mj.status=1 AND jo.status=1 ' . ' 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 = ""; foreach ($query->result_array() as $row) { $myTable .= $this->makeMarketTableRow($row); } $myTable .="
    "; // $this->table->set_heading('Added/Expire', 'Title/Recipient', 'Status', ''); $data['market_table'] = $myTable; // $this->table->generate($query); // $offer_found = true; } else { $data['market_table'] = ''; } $_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('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) { return "" . $row['offer_code'] . "" . $row['title'] . "" . "
    "; } public function showinterest() { $data = $this->getSessionArray(); $in=[]; $in['offer_code'] = $this->input->get('job_contract'); $in['member_id'] = $_SESSION['member_id']; // just maing sure $in['action'] = WRENCHBOARD_JOB_SEND_INTEREST; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); if ($res == PHP_CREATED_OK) { echo 'Success - ' . $out['status']; } else { echo 'Error - ' . $out['status']; } } public function marketrmessage() { $data = $this->getSessionArray(); // echo 'Ameye'; $in=[]; $in['offer_code'] = $this->input->get('offer_code'); $in['yourmessage'] = $this->input->get('yourmessage'); $in['member_id'] = $_SESSION['member_id']; // just maing sure $in['msg_type'] = 'JOB'; $in['action'] = WRENCHBOARD_JOB_SEND_QUESTION; // $this->load->model('backend_model'); $out = array(); $out['status'] = ''; $res = $this->wrenchboard_api($in, $out); if ($res == PHP_CREATED_OK) { echo 'Success - Message sent' . $out['status']; } else { echo 'Error - ' . $out['status']; } } public function offermessage() { $data = $this->getSessionArray(); // echo 'Ameye'; $in =[]; $in['offer_code'] = $this->input->get('offer_code'); $in['yourmessage'] = $this->input->get('yourmessage'); $in['interest_id'] = $this->input->get('interest_id'); $in['member_id'] = $_SESSION['member_id']; // just maing sure $in['msg_type'] = 'MRKTINT'; // MARKET INTEREST $in['action'] = WRENCHBOARD_JOB_MRKTINT_QUEST; // $this->load->model('backend_model'); $out = array(); $out['status'] = ''; $res = $this->wrenchboard_api($in, $out); // print_r($out); if ($res == PHP_CREATED_OK) { //echo rand(100,999)." " .$out['client_id']; echo $this->getMarketInterestMessage( $in['offer_code'], $out['client_id'] ); //'Success - Message sent' . $out['status']; } else { echo 'Error - ' . $out['status']; } } public function marketdetail() { $myTable = ''; $offer_code = $this->input->get('job_contract'); $mysql = "SELECT jo.id AS offer_id,jo.offer_code,mj.title,mj.description,mj.timeline_days,mj.price,jo.job_description,jo.expire::date FROM members_jobs_offer jo " . "LEFT JOIN members_jobs mj ON mj.id=jo.job_id " . " WHERE mj.status=1 AND jo.status=1 AND jo.offer_code ='" . $offer_code . "' "; $query = $this->db->query($mysql); $num = $query->num_rows(); if ($num > 0) { $row = $query->row_array(); $myTable = "
    "; $myTable .= $this->makeMarketDetailTableRow($row); $myTable .="
    "; } echo $myTable; } private function makeMarketDetailTableRow($row) { $data['interest'] = 0; $mysql = "SELECT count(*) AS interest FROM members_offer_interest WHERE offer_id=".$row['offer_id']; $query = $this->db->query($mysql); if( $query->num_rows() > 0 ) { $data = $query->row_array(); } return "
    " . "" . "" . "" . "" ."" . "
    " . $row['offer_code'] . " Timeline:" . $row['timeline_days'] . " day(s) - Budget: " . $row['price'] * 0.01 . " Naira
    Title" . $row['title'] . "
    Description" . $row['description'] . "
    Detail" . $row['job_description'] . "

    If you have any questions about this task:" . "
    " . "" . "
    " . "
    Interested in this task ?
    " . "
    Send Interest Request
    " ."
    Interests : " . $data['interest'] . "

    Expire:
    " . $row['expire']."
    "; } public function viewmyjob() { $data = $this->getSessionArray(); $jobOfferID = $this->input->post('jobOfferID'); $data['jobOfferID'] = $jobOfferID; if ($jobOfferID != '') { $this->load->model('job_model'); $out = $this->job_model->readMyloadJobOffer($_SESSION['member_id'], $jobOfferID); if ($out['result'] == 1) { $data["job_sent_to"] = $out["job_sent_to"]; $data["added_date"] = $out["added_date"]; $data["title"] = $out["title"]; $data["description"] = $out["description"]; $data["timeline_days"] = $out["timeline_days"]; $data["price"] = $out["price"]; $data["offer_code"] = $out["offer_code"]; $data['is_public_view'] = $out['public_view']; $a_from = array('\t','\n','\r','\0','\v'); $a_to = array("\t","\n","\r","",""); $data["job_description"] = trim(trim(str_replace($a_from,$a_to,$out["job_description"])),'"'); // str_replace('"','\"',$out["job_description"]); // $out["job_description"]; $date = date_create($out["expire"]); $out["expire"] = date_format($date, 'Y-m-d H:i'); $data["expire"] = $out["expire"]; $data['job_link'] = 'https://'.$_SERVER['HTTP_HOST']."/plb/viewjob/".$out['offer_code']; $data['page_title'] = 'View Job - '.$out["offer_code"]; $this->RenderUserPage('jobs/view_viewmyjoboffer', $data); } else { redirect('dash'); // go back to dash if not valid } } else { redirect('dash'); // go back to dash if not valid } } public function myoffer() { // $data = array(); $data = $this->getSessionArray(); $this->load->model('offers_model'); $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(); $data['offer_dash'] = ''; $this->load->library('table'); $this->table->set_template($this->template); $data["offer_dash"] = "
    \"Active
    "; $data["dash_title"] = "My Pending Offer(s)"; $jbx = "''/jobs/viewmyjob''"; $mysql = "SELECT jo.added::date||'
    '||jo.expire::date,j.title||'
    To :'||jo.email AS tRec," . '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.member_id = " . $_SESSION['member_id'] . "LIMIT 400"; $mysql = "SELECT jo.added::date||'
    '||jo.expire::date AS job_dates,j.title||'
    To :'||(CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec," . "'' 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," . "'' 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'] = "my Market Job(s)"; /* $this->load->view('users/view_header_user', $data); $this->load->view('jobs/view_pendingoffer', $data); $this->load->view('users/view_footer_user', $data); */ $data['page_title'] = "My Pending Offer(s)"; $this->renderSecurePage('jobs/view_pendingoffer', $data); } public function jobgrp() { if (!isset($_SESSION['username']) or $_SESSION['username'] == '') { redirect(home); return; } $data = $this->getSessionArray(); $data["job_message"] = ""; $data["group_id"] = 0; if ($_POST && isset($_POST['del'])) { $group_id = $this->input->post('del'); $data['job_message'] = $this->deleteMemberGroup($group_id); } else if ($_POST && isset($_POST['delmember'])) { $data["group_id"] = $this->input->post('group_id') + 0; $member_id = $this->input->post('delmember') + 0; $data['job_message'] = $this->deleteMemberGroupMember($data["group_id"], $member_id); } else if ($_POST && isset($_POST['group_id'])) { $data["group_id"] = $this->input->post('group_id') + 0; $data['job_message'] = $this->addMemberGroupMember($data["group_id"]); } else if ($_POST) { $group_name = trim($this->input->post('group_name')); // echo 'ameye....'.$group_name ; $x = array(); $x['member_id'] = $_SESSION['member_id']; $x['group_name'] = $group_name; $x['action'] = WRENCHBOARD_JOB_CREATE_GROUP; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($x, $out); if ($res == PHP_CREATED_OK) { // print_r($out); } else { $data['job_message'] = 'Unable to create job group...'; } } list($data['group_table'], $groups) = $this->getMembersJobGroup($data["group_id"]); if (count($groups) > 0) { if ($data["group_id"] > 0) { $data["group_name"] = $groups[$data["group_id"]]; } else { $data["group_name"] = reset($groups); $data["group_id"] = key($groups); } $data['group_member_table'] = $this->addGroupMemberForm($data["group_id"]) . $this->getJobGroupMembers($data["group_id"]); } else { $data["group_id"] = 0; $data["group_name"] = ""; $data["group_member_table"] = "Please add a group"; } // $this->load->view('users/view_header_user', $data); // $this->load->view('jobs/view_jobgroup', $data); // $this->load->view('users/view_footer_user', $data); $this->renderSecurePage('jobs/view_jobgroup', $data); } public function jobgrp_members() { if (!isset($_SESSION['username']) or $_SESSION['username'] == '') { echo "Denied"; return; } $group_id = $this->input->get('group_id'); echo $this->addGroupMemberForm($group_id) . $this->getJobGroupMembers($group_id); } private function deleteMemberGroup($group_id) { $this->load->model('job_model'); return $this->job_model->deleteMemberGroup($group_id); } private function deleteMemberGroupMember($group_id, $group_member_id) { $this->load->model('job_model'); return $this->job_model->deleteMemberGroupMember($group_id, $group_member_id); } private function addMemberGroupMember($group_id) { $firstname = $this->input->post('firstname'); $lastname = $this->input->post('lastname'); $email = $this->input->post('email'); if ($firstname == '') return 'Invalid first name'; if ($lastname == '') return 'Invalid last name'; if ($email == '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) return 'Invalid_e-mail'; $this->load->model('job_model'); return $this->job_model->addMemberGroupMember($group_id, $firstname, $lastname, $email); } private function getJobGroupMembers($group_id) { $this->load->model('job_model'); return $this->job_model->getJobGroupMembers($group_id); } private function getMembersJobGroup($sel) { $this->load->model('job_model'); return $this->job_model->getMembersJobGroup($sel); } private function addGroupMemberForm($group_id) { $this->load->model('job_model'); return $this->job_model->addGroupMemberForm($group_id); } public function clonejob(){ $jobUid = $this->input->post('jobUid'); if ( $jobUid !=''){ redirect('/jobs/create/'.$jobUid); } } private function getJobTemplateFill($template_page){ $templateList = $this->jobsTemplates(); foreach ($templateList as $row){ if ( $row['ID'] == trim($template_page)){ return $row; } } // You get here if you dont find any template - let see if this is an existimg job // d9bf082d-b72f-45d9-80d7-490d58a3bd2d if (strlen($template_page) < 40 && strlen($template_page) > 15){ // dont et attacked here , clean it up $this->load->model('job_model'); $jobDataRows = $this->job_model->selectUserJobUid($_SESSION['member_id'],$template_page); if (count($jobDataRows) > 0 ){ // var_dump( $jobData ); // exit(); $jobData = $jobDataRows[0]; return [ 'ID'=> $jobData['uid'], 'name'=> $jobData['title'], 'description'=> $jobData['description'], 'delivery'=> trim(trim(str_replace('\n',"\n", $jobData['job_detail'])),'"'), 'img'=>'/site3/assets/media/jobs/share-stories.jpg', 'timeline_days'=> $jobData['timeline_days'], 'price'=> $jobData['price'], 'country' => $jobData['country'] ]; } } // echo strlen($template_page); return []; } /* Table "public.members_jobs" Column | Type | Collation | Nullable | Default ---------------+-----------------------------+-----------+----------+------------------------------------------ id | integer | | not null | nextval('members_jobs_id_seq'::regclass) member_id | integer | | | title | character varying(150) | | | description | character varying(300) | | | job_detail | text | | | timeline_days | integer | | not null | price | integer | | not null | loc | inet | | | created | timestamp without time zone | | | now() updated | timestamp without time zone | | | now() status | integer | | | 1 country | character varying(2) | | | uid | uuid | | | uuid_generate_v4() Indexes: */ public function create() { $data = $this->getSessionArray(); $template_page = ($this->uri->segment(3)) ? $this->uri->segment(3) : ''; $preFill = $this->getJobTemplateFill($template_page); if(!empty($preFill)) { $title = $preFill['name']; $description = $preFill['description']; $job_detail = $preFill['delivery']; $timeline = $preFill['timeline_days']; $price = $preFill['price']; } else { $title = NULL; $description = NULL; $timeline = NULL; $price = 0; $job_detail = NULL; } $mybalance = 0; $data['job_message'] = ''; $country = 'NG'; $submit = NULL; $country_job ='NG'; $amountArray = []; for ($i = 2000; $i <= 10000; $i = $i + 1000) { $amountArray[] = [$i,$i,'Naira']; } $marketArray = []; for ($i = 2; $i <= 6; $i = $i + 1) { $marketArray[] = [$i,$i,'Days']; } for ($i = 7; $i <= 21; $i = $i + 7) { $marketArray[] = [$i,$i,'Week(s)']; } for ($i = 30; $i <= 90; $i = $i + 30) { $marketArray[] = [$i,$i,'Month(s)']; } $data['amount_array'] = $amountArray; $data['timeline_array'] = $marketArray; $mysqlJ = "SELECT id, title,created::date FROM members_jobs WHERE member_id = " . $_SESSION['member_id'] . " AND status = 1 ORDER BY id DESC LIMIT 5"; $query = $this->db->query($mysqlJ); $data['recentjobs'] = $query->result(); $data['recentjobs_count'] = $query->num_rows(); extract($_POST); $redirected = false; if ($_POST) { $in = array(); $in['title'] = $title; $in['description'] = $description; $in['timeline_days'] = $this->input->post('timeline') ; //$timeline; $in['job_detail'] = trim( $this->input->post('job_detail') ); // Somehow this doesnt show when large $job_detail; $price = $this->input->post('price'); $in['price'] = $price * 100; // (is_int($price)? $price:0) * 100; $in['member_id'] = $_SESSION['member_id']; $in['country'] = $country_job; $this->load->model('job_model'); if ($this->job_model->verifyJobInputs($in) == true) { $in['action'] = WRENCHBOARD_JOB_CREATEJOB; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); if ($res == PHP_CREATED_OK) { // print_r($out); if ($out['job_id'] > 0) { $this->processingJob($out['job_id']); $redirected = true; } } else { $data['job_message'] = 'Unable to create job...'; } } else { $data['job_message'] = 'Enter all required fields'; } } $this->load->model('combo_model'); $this->combo_model->defaultComboMessage = 'Select Job Country'; $data['country_job'] = $this->combo_model->getCountryJobCombo('country', $country); $data['job_price'] = $this->combo_model->getJobPriceCombo('price','Naira', $price); $data['timeline_combo'] = $this->combo_model->marketTimeline('timeline', $timeline); $data['title'] = $title; $data['description'] = $description; $data['timeline_days'] = $timeline; $data['job_detail'] = trim( $job_detail ); $data['price'] = $price; $data['country'] = $country_job; $data['page_title'] = "Create Job"; if ($redirected == false) { $this->load->model('dash_model'); $out = $this->dash_model->getDashData($data); $data['active_task'] = $out['active_task']; $data['active_pass_due'] = $out['active_pass_due']; $data['current_balance'] = $out['current_balance']; $data['new_message'] = $out['new_message']; $this->renderSecurePage('jobs/view_create', $data); } } public function processjob() { $jobID = $this->input->post('jobID'); if ($jobID > 0) { $this->processingJob($jobID); // $data = $this->getSessionArray(); } else { redirect('/jobs/manage'); } } public function agreejobterms(){ $data = $this->getSessionArray(); $in = array(); $in['action'] = WRENCHBOARD_ACCOUNT_TERMS; $in['action_item'] = ACCOUNT_AGREE_JOBS; $in['member_id'] = $_SESSION['member_id']; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); //echo $res; //exit; if ($res == PHP_API_OK || $out["terms_update"]=='completed') { redirect('/jobs/create',$data); } } public function jobagree() { $data = $this->getSessionArray(); if ($_POST) { echo "Ameye"; exit; $in = array(); $in['action'] = WRENCHBOARD_ACCOUNT_TERMS; $in['action_item'] = ACCOUNT_AGREE_JOBS; $in['member_id'] = $_SESSION['member_id']; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); if ($res == PHP_API_OK || $out["terms_update"]=='completed') { redirect('/jobs/create'); } } $data['page_key'] = 'WRB_POST_JOB_TERM'; $data['txt_detail'] = $this->readFixedText($data['page_key']); $this->renderSecurePage('jobs/view_jobagree', $data); } private function processingJob($jobID) { // $jobID = $this->input->post('jobID'); if ($jobID > 0) { $data = $this->getSessionArray(); $this->load->model('combo_model'); $data['my_job_group'] = $this->combo_model->getUserJobGroupCombo('job_group', $_SESSION['member_id'], ''); $data['my_post_duration'] = $this->combo_model->getJobPostDuration('job_duration', 0); $this->load->library('table'); $this->table->set_template($this->template); $mysql = "SELECT title,description,timeline_days||' day(s)' AS day_timeline, price*0.01||'Naira' AS price, created::date AS create_date, job_detail" . " FROM members_jobs WHERE id =" . $jobID . " AND member_id = " . $_SESSION['member_id']; $query = $this->db->query($mysql); $data['job_table_row'] = $query->row(); $this->table->set_heading('Title', 'Description', 'Timeline', 'Price', 'Created'); $data['job_table'] = $this->table->generate($query); $this->load->model('job_model'); // too bad I have to run again $jobData = $this->job_model->getJob($jobID); $data['job_description'] = $jobData->job_detail; /*stripslashes(htmlspecialchars_decode( trim(trim(str_replace($a_from,$a_to,$jobData->job_detail)),'"'))); */ $data['jobID'] = $jobID; $activeJobData = $this->job_model->selectMarketJob($jobID); $data['active_job_data'] = $activeJobData; // var_dump( $activeJobData ); // $this->load->view('users/view_header_user', $data); // $this->load->view('jobs/view_joboffer', $data); // $this->load->view('users/view_footer_user', $data); $data['page_title'] ="View Job"; $this->renderSecurePage('jobs/view_joboffer', $data); } else { redirect('/jobs/manage'); } // echo "process job " . $jobID; } /* ./assets/js/pages/editor_wysihtml5.js ./assets/js/plugins/editors/wysihtml5/parsers.js ./assets/js/plugins/editors/wysihtml5/toolbar.js ./assets/js/plugins/editors/wysihtml5/wysihtml5.min.js ./assets/js/plugins/forms/editable/wysihtml5.js ./assets/css/bootstrap.min.css ./assets/css/bootstrap-wysihtml5.css ./assets/js/core/libraries/bootstrap.min.js */ public function viewjob_accept() { // echo 'home....0'; $this->concludeOffer(OFFER_ACCEPT); } public function viewjob_reject() { //echo 'home....1'; $this->concludeOffer(OFFER_REJECT); } public function viewjob_cancel() { //echo 'home....1'; $this->concludeOffer(OFFER_CANCEL); } public function viewjob_sendtome() { $this->concludeOffer(OFFER_SENDTOME); } public function viewjob_resend() { $this->concludeOffer(OFFER_RESEND); } public function viewjob_extend() { $this->concludeOffer(OFFER_EXTEND); } private function concludeOffer($offer_result) { //WRENCHBOARD_JOB_OFFER_CONCLUDE $jobOfferID = $this->input->get('jobOfferID'); $in = array(); $in['offer_code'] = $jobOfferID; $in['member_id'] = $_SESSION['member_id']; $in['offer_result'] = $offer_result; $in['action'] = WRENCHBOARD_JOB_OFFER_CONCLUDE; $this->load->model('backend_model'); $out = array(); if ( $in['member_id']!= 0){ $res = $this->backend_model->wrenchboard_api($in, $out); } if ($out["result"] == "OK") { switch ($offer_result) { case OFFER_ACCEPT: echo "You have accepted this offer and we have notified the client. Please go to manage page to continue "; break; case OFFER_REJECT: echo "You have rejected this offer and we have notified the client."; break; case OFFER_CANCEL: echo "You have cancelled this offer and we have notified the recipient."; break; case OFFER_EXTEND: echo "New time"; break; } } // print_r($out); } public function processjob_individ() { $jobID = $this->input->get('jobID'); $email = $this->input->get('rec_email'); $descr = urldecode( $this->input->get('jobdescription') ); if ($jobID == '' || $jobID < 1) { echo "Invalid job ID"; return; } if ($email == '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) { echo "Invalid recipient e-mail"; return; } if ($descr == '') { echo "Missing job description"; return; } // echo $descr; $this->sendIndividualJobOffer($jobID, $email, $descr); // echo 'Completed'; } public function processjob_group() { $jobID = $this->input->get('jobID'); $group = $this->input->get('job_group'); $descr = urldecode( $this->input->get('jobdescription') ); if ($jobID == '' || $jobID < 1) { echo "Invalid job ID"; return; } if ($group == '' || $group < 1) { echo "Invalid group"; return; } if ($descr == '') { echo "Missing job description"; return; } $group_member_count = 0; $mysql = "SELECT count(id) AS m_count FROM members_job_groupmember WHERE group_id = $group AND member_id= ". $_SESSION['member_id']; $query = $this->db->query($mysql); if ( $query->num_rows()> 0 ) { $qr = $query->result_array(); // print_r($qr); $group_member_count = $qr[0]['m_count']; } if( $group_member_count == 0 ) { echo "cannot send job to empty group"; return; } // echo $jobID." ".$group; $this->sendGroupJobOffer($jobID, $group, $descr); } public function processjob_public() { $jobID = $this->input->get('jobID'); $job_duration = $this->input->get('job_duration'); $descr = urldecode( $this->input->get('jobdescription') ); if ($jobID == '' || $jobID < 1) { echo "Invalid job ID"; return; } if ($job_duration == '' || $job_duration < 1) { echo "Invalid Duration"; return; } if ($descr == '') { echo "Missing job description"; return; } $this->sendPublicJobOffer($jobID, $job_duration, $descr); // echo 'Ameye'; } private function sendPublicJobOffer($jobID, $duration, $descr) { // this function will handle the call to backend // to manage the sending of offer to group of people $in["job_id"] = $jobID; $in["duration"] = $duration; $in["job_description"] = $descr; $in['member_id'] = $_SESSION['member_id']; //var_dump($in); $in['action'] = WRENCHBOARD_JOB_OFFER_PUBLIC; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); //$out["status"] = ''; //$res = $this->wrenchboard_api($in, $out); // print_r($out); if ($res == PHP_CREATED_OK) { // echo "Offer sent to public"; echo "
    We have placed this offer in the public domain. This offer would expire in days you have specified. You will receive email alerts if anybody is interested.
    "; } else { echo "
    Unable to send offer :" . $out["status"] . "
    "; } //echo 'Group Result'; } private function sendIndividualJobOffer($jobID, $email, $descr) { // this function will handle sending offer to invidual $in["job_id"] = $jobID; $in["email"] = $email; $in["job_description"] = $descr; $in['member_id'] = $_SESSION['member_id']; // var_dump($in); $in['action'] = WRENCHBOARD_JOB_OFFER_INDVI; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); if ($res == PHP_CREATED_OK) { // echo "Offer sent"; echo "
    We have notified the user/email about this offer. This offer would expire in a day if the recipient did nothing.
    "; } else { echo "
    We are unable to send the offer to the recipient. This is usually caused by an insufficient balance in your account to pay for the task.
    "; } // echo 'Individual Result'; } private function sendGroupJobOffer($jobID, $group, $descr) { // this function will handle the call to backend // to manage the sending of offer to group of people $in["job_id"] = $jobID; $in["group_id"] = $group; $in["job_description"] = $descr; $in['member_id'] = $_SESSION['member_id']; //var_dump($in); $in['action'] = WRENCHBOARD_JOB_OFFER_GROUP; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); if ($res == PHP_CREATED_OK) { echo "
    We have notified each members by email about this offer. This offer would automatically expire in a day if the recipient(s) did nothing.
    "; } else { // echo "Unable to send offer"; echo "
    We are unable to send the offer to the recipient. This is usually caused by an insufficient balance in your account to pay for the task.
    "; } //echo 'Group Result'; } public function deletejob() { $data = $this->getSessionArray(); $jobID = $this->input->get('job_id'); if ($jobID != '' AND $jobID > 0) { $in["job_id"] = $jobID; $in['member_id'] = $_SESSION['member_id']; $in['action'] = WRENCHBOARD_JOB_DELETEJOB; $this->load->model('backend_model'); $out = array(); $this->backend_model->wrenchboard_api($in, $out); echo $out['status']; } } public function manage() { $data = $this->getSessionArray(); $jbx = "''/jobs/processjob''"; $mysql = "SELECT 'Date: '||created::date||'
    Timeline: '||timeline_days||' day(s)'||'
    Price: '||price*0.01||' ' AS Job," . " 'Title: '||title||'
    Description: '||description AS detail, " . " '
    ' AS manage" . " FROM members_jobs WHERE member_id = " . $_SESSION['member_id'] . " AND status=1 ORDER BY id DESC"; $this->load->library('pagination'); $config = array(); $query = $this->db->query($mysql); $config["total_rows"] = $query->num_rows(); $_SESSION['total_job_count'] = $config["total_rows"]; $config["base_url"] = base_url() . "/jobs/manage"; $config["per_page"] = 10; $config["uri_segment"] = 3; $config["num_links"] = 5; $config['full_tag_open'] = ""; $config['num_tag_open'] = "
  • "; $config['num_tag_close'] = '
  • '; $config['cur_tag_open'] = "
  • "; $config['cur_tag_close'] = "
  • "; $config['next_tag_open'] = "
  • "; $config['next_tagl_close'] = "
  • "; $config['prev_tag_open'] ="
  • "; $config['prev_tagl_close'] = "
  • "; $config['first_tag_open'] = "
  • "; $config['first_tagl_close'] = "
  • "; $config['last_tag_open'] = "
  • "; $config['last_tagl_close'] = "
  • "; $this->pagination->initialize($config); $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0; /* $mysql = "SELECT 'Date: '||created::date||'
    Timeline: '||timeline_days||' day(s)'||'
    Price: '||price*0.01||' ' AS Job," . " 'Title: '||title||'
    Description: '||description AS detail, " . " '
    ' AS manage" . " FROM members_jobs WHERE member_id = " . $_SESSION['member_id'] . " AND status=1 ORDER BY id DESC LIMIT " . $config["per_page"] . " OFFSET " . $page; */ $mysql = "SELECT id AS job_id, 'Date: '||created::date||'
    Timeline: '||timeline_days||' day(s)'||'
    Price: '||price*0.01||' ' AS Job," . " title, description,timeline_days, price*0.01 AS amount," . " '
    ' AS manage" . " FROM members_jobs WHERE member_id = " . $_SESSION['member_id'] . " AND status=1 ORDER BY id DESC LIMIT " . $config["per_page"] . " OFFSET " . $page; $query = $this->db->query($mysql); $data["links"] = $this->pagination->create_links(); $data['page_title'] = "Manage Job(s)"; $data['job_table_rows'] = $query->result(); $this->renderSecurePage('jobs/view_manage', $data); } }