예제 #1
0
function adsReturn($ads_db, $showform_params, $return_id)
{
    $cols = array('id', 'private', 'seller_name', 'email', 'allow_mails', 'phone', 'location_id', 'category_id', 'title', 'description', 'price');
    $query = 'SELECT ' . implode(',', $cols) . ' FROM `ads_container` WHERE id = ' . $return_id;
    $ad_toreturn = adsLoad($ads_db, $query, $cols);
    if (!$ad_toreturn) {
        return $showform_params;
    }
    $return = $ad_toreturn[$return_id];
    $showform_params = array('return_private' => $return['private'], 'namereturn' => $return['seller_name'], 'email_return' => $return['email'], 'phonereturn' => $return['phone'], 'city' => $return['location_id'], 'returncategory' => $return['category_id'], 'returntitle' => $return['title'], 'returndescription' => $return['description'], 'returnprice' => $return['price'], 'return_id' => $return_id, 'notice_title_is_empty' => "");
    $showform_params['return_send_email'] = $return['allow_mails'] ? 'checked=""' : '';
    return $showform_params;
}
예제 #2
0
function adsReturn($ads_db, $showform_params, $return_id)
{
    $cols = array('id', 'private', 'allow_mails', 'phone', 'location_id', 'category_id', 'title', 'description', 'price', 'seller_name', 'email');
    $query = 'SELECT ads.id, ads.private, ads.allow_mails,ads.phone, ads.location_id, ads.category_id, ads.title, ads.description, ads.price,auth.seller_name, auth.email FROM `ads_container` as `ads` INNER JOIN `ads_authors` as `auth` on ads.author_id=auth.id WHERE ads.id = ' . $return_id;
    //теперь без implode
    $ad_toreturn = adsLoad($ads_db, $query, $cols);
    if (!$ad_toreturn) {
        return $showform_params;
    }
    $return = $ad_toreturn[$return_id];
    $showform_params = array('return_private' => $return['private'], 'namereturn' => $return['seller_name'], 'email_return' => $return['email'], 'phonereturn' => $return['phone'], 'city' => $return['location_id'], 'returncategory' => $return['category_id'], 'returntitle' => $return['title'], 'returndescription' => $return['description'], 'returnprice' => $return['price'], 'return_id' => $return_id, 'notice_title_is_empty' => "");
    $showform_params['return_send_email'] = $return['allow_mails'] ? 'checked=""' : '';
    return $showform_params;
}