query('SELECT id FROM responses WHERE adid = '.$adid.' AND uid = '.$b_user['id'].' LIMIT 1') or dash_fatal($db->error); if ($result->num_rows > 0) { $result->free(); dash_fatal('You have already applied to this ad!', $b_config['base_url'].'dash/'); } $db->query('INSERT INTO responses (adid, uid, comment) VALUES ('.$adid.', '.$b_user['id'].', \''.$db->escape_string($_POST['comments']).'\')') or dash_fatal($db->error); 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, 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.' 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(); ?>
Pays $=number_format($row['pay'], 2);?>
=htmlentities($row['location']);?> at =date('g:i a', intval($row['time'])).' on '.date('M j, Y', intval($row['time']));?>
=htmlentities($row['description']);?>