I realized a very significant problem in my application. It\'s about hire function.What happens is even an applicant has already been hired, if the client clicks the reject butt
You can check your database to ensure the proposal has not already been accepted with something along these lines. If you want to do it for both instances (accept, and reject), perhaps you could move the check into an additional function that checks to see if a proposal is already in an 'ending' state (i.e. Accepted or Rejected).
A sample addition to your reject_job_proposal
method could be...
public function reject_job_proposal ($job_id, $provider_id, $proposal_id)
{
$this->db->select('status');
$this->db->from('job_proposal');
$this->db->where('id', $proposal_id);
$query = $this->db->get();
$result = $query->row();
if ($result->status === 'Accepted') {
// Throw error message, e.g. 'Sorry, this job has been accepted!'
return;
}
...
}