first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
class Offers_model extends CI_Model {
|
||||
|
||||
var $optCons = '';
|
||||
var $currentStyle = 'form-control select';
|
||||
|
||||
function __construct() {
|
||||
|
||||
}
|
||||
|
||||
public function attachOffers($email) {
|
||||
$emailTrim = trim($email);
|
||||
$mysql = "SELECT id AS member_id FROM members WHERE username = '$emailTrim' LIMIT 1 ";
|
||||
$query = $this->db->query($mysql);
|
||||
|
||||
$num = $query->num_rows();
|
||||
if ($num == 1) {
|
||||
|
||||
// $out = $query->result_array();
|
||||
// print_r($out);
|
||||
$mysqlU = " UPDATE members_jobs_offer SET client_id ='". $query->row()->member_id ."' WHERE client_id = 0 AND email='$emailTrim' AND expire> now()";
|
||||
$this->db->query($mysqlU);
|
||||
}
|
||||
}
|
||||
|
||||
// NOT completed --
|
||||
public function getUserPendingOffers($member_id) {
|
||||
|
||||
$out = array();
|
||||
$error_state = false;
|
||||
$out['error'] = '';
|
||||
|
||||
$sqlOffer ="SELECT o.*,j.title,j.description,j.timeline_days,j.price FROM members_jobs_offer o LEFT JOIN members_jobs j ON j.id =o.job_id";
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user