Example #1
0
function getMultipleBidList()
{
    $job_id = isset($_REQUEST['job_id']) ? (int) $_REQUEST['job_id'] : 0;
    if ($job_id == 0) {
        echo $job_id;
        return;
    }
    $workItem = new WorkItem();
    $bids = $workItem->getBids($job_id);
    $ret = array();
    foreach ($bids as $bid) {
        $bid['expired'] = $bid['expires'] <= BID_EXPIRE_WARNING;
        $bid['expires_text'] = Utils::relativeTime($bid['expires'], false, false, false, false);
        $ret[] = $bid;
    }
    echo json_encode(array('bids' => $ret));
    return;
}