if (isset($_POST['do']) && !empty($_POST['data']['trade'])) { pb_submit_check('data'); $res = $_POST['data']['trade']; $now_offer_amount = $trade->findCount(null, "created>" . $today_start . " AND member_id=" . $the_memberid); if (isset($_POST['id'])) { $id = intval($_POST['id']); } if ($g['offer_check']) { $res['status'] = 0; $msg = 'msg_wait_check'; } else { $res['status'] = 1; $msg = 'success'; } if (!empty($_FILES['pic']['name'])) { $attach_id = empty($id) ? "offer-" . $the_memberid . "-" . ($trade->getMaxId() + 1) : "offer-" . $the_memberid . "-" . $id; $attachment->rename_file = $attach_id; $attachment->upload_process(); $res['picture'] = $attachment->file_full_url; } $res['tag_ids'] = $tag->setTagId($_POST['data']['tag']); $form_type_id = 1; if (!empty($company_id)) { $res['company_id'] = $company_id; } else { $res['company_id'] = 0; } if (!empty($_POST['data']['prim_im'])) { if (!empty($_POST['data']['prim_imaccount'])) { $im_arr = array(); switch ($_POST['data']['prim_im']) {
if (isset($_POST['do']) && !empty($_POST['data']['trade'])) { pb_submit_check('data'); $res = $_POST['data']['trade']; $now_offer_amount = $trade->findCount(null, "created>" . $today_start . " AND member_id=" . $_SESSION['MemberID']); if (isset($_POST['id'])) { $id = intval($_POST['id']); } if ($g['offer_check']) { $res['status'] = 0; $msg = 'msg_wait_check'; } else { $res['status'] = 1; $msg = 'success'; } if (!empty($_FILES['pic']['name'])) { $attach_id = empty($id) ? "offer-" . $_SESSION['MemberID'] . "-" . ($trade->getMaxId() + 1) : "offer-" . $_SESSION['MemberID'] . "-" . $id; $attachment->rename_file = $attach_id; $attachment->upload_process(); $res['picture'] = $attachment->file_full_url; } $res['tag_ids'] = $tag->setTagId($_POST['data']['tag']); $form_type_id = 1; if (!empty($company_id)) { $res['company_id'] = $company_id; } else { $res['company_id'] = 0; } $res['cache_contacts'] = serialize(array('qq' => $memberinfo['qq'], 'icq' => $memberinfo['icq'], 'skype' => $memberinfo['skype'], 'yahoo' => $memberinfo['yahoo'], 'msn' => $memberinfo['msn'])); if (!empty($id)) { $item_ids = $form->Add($id, $_POST['data']['formitem']); $res['formattribute_ids'] = $item_ids;