<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Firma_model extends CI_Model {
    
    public function pobierzMojeStatusy($user_id){
        $zap = "SELECT up.*, u.first_name, u.last_name, u.company, u.email, cpj.project_name FROM users_projects up, company_projects cpj, users u WHERE u.id = up.id_student AND up.id_project = cpj.id AND cpj.company_id = ".$user_id;
        return $this->db->query($zap)->result_array();
    }
    
    public function AkceptujKontraktacje($idKontr, $status){
        if($status == 0){
            $status = 1;
        }
        else{
            $status = 0;
        }
        
        $zap = "UPDATE users_projects SET status=".$status." WHERE id = ".$idKontr;
        return $this->db->query($zap);
    }
    
    
}