Esempio n. 1
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require "room.share.php";
uses("product", "producttype");
$tpl_file = "producttype";
$product = new Products();
$producttype = new Producttypes();
$conditions[] = "member_id = " . $the_memberid;
if (!$company->Validate($companyinfo)) {
    flash("pls_complete_company_info", "company.php", 0);
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (isset($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "del" && !empty($id)) {
        $product_amount = $pdb->GetOne("SELECT count(id) FROM {$tb_prefix}products WHERE type_id={$id} AND member_id={$the_memberid}");
        if ($product_amount > 0) {
            flash('pls_del_first');
        } else {
            $result = $producttype->del($id, $conditions);
        }
    }
Esempio n. 2
0
require "../libraries/common.inc.php";
require "room.share.php";
uses("product", "producttype", "form", "attachment", "tag", "brand", "productcategory", "area", "industry");
require PHPB2B_ROOT . 'libraries/page.class.php';
require CACHE_PATH . 'cache_membergroup.php';
require CACHE_PATH . 'cache_type.php';
check_permission("product");
$area = new Areas();
$industry = new Industries();
$productcategory = new Productcategories();
$page = new Pages();
$brand = new Brands();
$tag = new Tags();
$form = new Forms();
$product = new Products();
$producttype = new Producttypes();
$attachment = new Attachment('pic');
$conditions[] = "member_id = " . $the_memberid;
setvar("Countries", $countries = cache_read("country"));
setvar("ProductSorts", $_PB_CACHE['productsort']);
setvar("ProductTypes", $producttype->findAll('id,name', null, $conditions, "id DESC"));
setvar("Productcategories", $productcategory->getTypeOptions());
$tpl_file = "product";
if (!$company->Validate($companyinfo)) {
    flash("pls_complete_company_info", "company.php", 0);
}
if (isset($_POST['save'])) {
    $company->newCheckStatus($companyinfo['status']);
    if (!empty($_POST['data']['product'])) {
        $product->setParams();
        $now_product_amount = $product->findCount(null, "created>" . $today_start . " AND member_id=" . $the_memberid);