query('SELECT id FROM responses WHERE adid = '.$adid.' AND (uid = '.$b_user['id'].' OR matched = 1) LIMIT 1') or dash_fatal($db->error); if ($result->num_rows > 0) { $result->free(); dash_fatal('You have already applied to this ad or the provider has already selected someone for the task!', $b_config['base_url'].'dash/'); } $result->free(); $db->query('INSERT INTO responses (adid, uid, comment) VALUES ('.$adid.', '.$b_user['id'].', \''.$db->escape_string($_POST['comments']).'\')') or dash_fatal($db->error); app_trigger($db->insert_id); dash_fatal('Your application has been submitted.', $b_config['base_url'].'dash/'); } $result = $db->query('SELECT ads.id, ads.title, ads.pay, ads.time, ads.location, ads.description, users.name, users.picture, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM ads INNER JOIN users ON users.id = ads.uid LEFT JOIN ratings ON ratings.rated = ads.uid WHERE ads.id = '.$adid.' GROUP BY ads.id LIMIT 1') or dash_fatal($db->error); if ($result->num_rows < 1) dash_fatal('No ad with this ID has been found.'); $row = $result->fetch_assoc(); $result->free(); ?>

Pays $

at

Profile Picture

Comments (Optional)