Пример #1
0
    }
    $attachment->rename_file = "product-" . $time_stamp;
    if (isset($_POST['id'])) {
        $id = intval($_POST['id']);
    }
    if (!empty($id)) {
        $attachment->rename_file = "product-" . $id;
    }
    if (!empty($vals['content'])) {
        $vals['content'] = stripcslashes($vals['content']);
    }
    if (!empty($_FILES['pic']['name'])) {
        $attachment->upload_process();
        $vals['picture'] = $attachment->file_full_url;
    }
    $vals['tag_ids'] = $tag->setTagId($_POST['data']['tag']);
    if (!empty($id)) {
        $vals['modified'] = $time_stamp;
        $result = $product->save($vals, "update", $id);
    } else {
        $vals['created'] = $vals['modified'] = $time_stamp;
        $result = $product->save($vals);
    }
    if (!$result) {
        flash();
    }
}
if (isset($_POST['recommend'])) {
    foreach ($_POST['id'] as $val) {
        $commend_now = $product->field("ifcommend", "id=" . $val);
        if ($commend_now == "0") {
Пример #2
0
     $product->params['data']['product']['status'] = 1;
 } else {
     $product->params['data']['product']['status'] = 0;
     $message_info = 'msg_wait_check';
 }
 if (isset($_POST['id'])) {
     $id = intval($_POST['id']);
 }
 if (!empty($_FILES['pic']['name'])) {
     $attach_id = empty($id) ? "product-" . $the_memberid . "-" . ($product->getMaxId() + 1) : "product-" . $the_memberid . "-" . $id;
     $attachment->rename_file = $attach_id;
     $attachment->upload_process();
     $product->params['data']['product']['picture'] = $attachment->file_full_url;
 }
 $form_type_id = 2;
 $product->params['data']['product']['tag_ids'] = $tag->setTagId($_POST['data']['tag']);
 $product->params['data']['product']['cache_companyname'] = $companyinfo['name'];
 $product->params['data']['product']['industry_id'] = PbController::getMultiId($_POST['industry']['id']);
 $product->params['data']['product']['area_id'] = PbController::getMultiId($_POST['area']['id']);
 if (!empty($id)) {
     $item_ids = $form->Add($id, $_POST['data']['formitem'], 1, $form_type_id);
     $product->params['data']['product']['modified'] = $time_stamp;
     $product->params['data']['product']['formattribute_ids'] = $item_ids;
     $result = $product->save($product->params['data']['product'], "update", $id, null, $conditions);
 } else {
     if ($g['max_product'] && $now_product_amount >= $g['max_product']) {
         flash('one_day_max');
     }
     $product->params['data']['product']['member_id'] = $the_memberid;
     $product->params['data']['product']['company_id'] = $company_id;
     $product->params['data']['product']['created'] = $product->params['data']['product']['modified'] = $time_stamp;