Beispiel #1
0
/**
 *      [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";
require PHPB2B_ROOT . './libraries/page.class.php';
require CACHE_COMMON_PATH . "cache_type.php";
uses("companynews", "typeoption");
check_permission("companynews");
$companynews = new Companynewses();
$typeoption = new Typeoption();
$tables = $companynews->getTable(true);
$tpl_file = "news";
$page = new Pages();
setvar("CompanynewsTypes", $_PB_CACHE['companynewstype']);
if (isset($company_id)) {
    $conditions = "company_id=" . $company_id;
}
if (!$company->Validate($companyinfo)) {
    flash("pls_complete_company_info", "company.php", 0);
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "edit") {
Beispiel #2
0
$member = new Members();
$page = new Pages();
$company = new Companies();
$companynews = new Companynewses();
$conditions = $joins = array();
$tpl_file = "companynews";
$common_status = cache_read("typeoption", "common_status");
if (isset($_POST['del']) && is_array($_POST['id'])) {
    if (!$companynews->del($_POST['id'])) {
        flash();
    }
}
if (isset($_POST['check']) && !empty($_POST['id']) && is_array($_POST['id'])) {
    $strCompanyNewsId = implode(",", $_POST['id']);
    $strCompanyNewsId = "(" . $strCompanyNewsId . ")";
    $arrResult = $pdb->GetArray("select id,status from " . $companynews->getTable() . " where id in " . $strCompanyNewsId);
    if (!empty($arrResult)) {
        foreach ($arrResult as $key => $val) {
            if (1 == $val['status']) {
                $result = $pdb->Execute("update " . $companynews->getTable() . " set status='0' where id=" . $val['id']);
            } else {
                $result = $pdb->Execute("update " . $companynews->getTable() . " set status='1' where id=" . $val['id']);
            }
        }
        if (!$result) {
            flash();
        } else {
            flash("success");
        }
    }
}