Example #1
0
 function deal_list_table($d_id, $nds)
 {
     $deal = $this->get_deal_properties($d_id);
     // get deal properties
     $sql = "SELECT \n\t\tPRODUCTS.PR_ID,\n\t\tPRODUCTS.PR_NAME,\n\t\tPRODUCTS.PR_SDESC,\n\t\tDEAL_ITEMS_LIST.DIL_PRICE,\n\t\tDEAL_ITEMS_LIST.DIL_PRI\n\t\tFROM DEALS\n\t\tINNER JOIN DEAL_ITEMS_LIST ON DEAL_ITEMS_LIST.DIL_D_ID = DEALS.D_ID\n\t\tINNER JOIN PRODUCTS ON PRODUCTS.PR_ID = DEAL_ITEMS_LIST.DIL_PR_ID\n\t\tWHERE DEAL_ITEMS_LIST.DIL_D_ID=" . $d_id . " ORDER BY DEAL_ITEMS_LIST.DIL_PRI , DEAL_ITEMS_LIST.DIL_ID;";
     $result = $this->mysqli->query($sql);
     if ($result) {
         while ($row = $result->fetch_row()) {
             $pr_id = $row[0];
             $pr_name = $row[1];
             $pr_sdesc = $row[2];
             $dil_price = $row[3];
             $dil_pri = $row[4];
             $sum = $sum + $row[3];
             //group
             $tab[$pr_id]['name'] = $pr_name;
             $tab[$pr_id]['sdesc'] = $pr_sdesc;
             //$tab[$pr_id]['sdesc']=$this->trim_str($pr_sdesc,60);
             $tab[$pr_id]['sum'] = $tab[$pr_id]['sum'] + $dil_price;
             $tab[$pr_id]['count']++;
             $tab[$pr_id]['pri'] = $dil_pri;
         }
     }
     if ($tab) {
         foreach ($tab as $pr_id => $val) {
             //average price per position
             $pr_price = (int) ($val['sum'] / $val['count']);
             $tbl .= "\n<tr class='printtable_row'><td>" . $val['pri'] . "</td><td>" . $val['name'] . "</td><td><div  class='prod_desc'>" . $val['sdesc'] . "</div></td><td>" . $this->getprice($pr_price) . "&nbsp" . $val['cur_name'] . "</td><td>" . $val['count'] . "</td><td>" . trade::getprice($val['sum']) . "</td></tr>";
             $all_sum = $all_sum + $val['sum'];
         }
         $sum = $all_sum;
         $sum_show = $this->getprice($sum);
         $ndss = $sum * $this->sp['nds_percent'] / 100;
         $nds_round = (int) $ndss;
         $nds_show = $this->getprice($nds_round);
         $total = $sum + $ndss;
         $total_round = (int) $total;
         $total_show = $this->getprice($total_round);
         $tbl .= "\n<tr><td colspan='5' align=right>Сумма :</td><td align='right'>" . $sum_show . " Грн</td></tr>";
         $ans['sum_str'] = $this->num2str($sum_show);
         if ($nds) {
             $tbl .= "\n<tr><td colspan='5'align=right >НДС " . $this->sp['nds_percent'] . "%:</td><td align='right'>" . $nds_show . " Грн</td></tr>";
             $tbl .= "\n<tr><td colspan='5' align=right><b>Итого :</b></td><td align='right'><b>" . $total_show . " Грн</b></td></tr>";
             $ans['sum_str'] = $this->num2str($total_show);
         }
         $table = "\n<div id='list_table'><table class='printtable' ><tr><th width=20px>№</th><th width=130px>Модель</th><th width=420px>Краткое описание</th><th>Цена за единицу</th><th width=20px>Кол-во</th><th width=110px>Всего</th></tr>" . $tbl . "</table></div>";
     }
     $ans['table'] = $table;
     return $ans;
 }
Example #2
0
<?php

/**
 * 最新供求信息文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	trade
 */
if (is_object($objWebInit)) {
    if (!isset($objtrade)) {
        include_once __WEB_ROOT . "/trade/class/trade.class.php";
        include_once __WEB_ROOT . "/trade/config/var.inc.php";
        $objtrade = new trade();
        $objtrade->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objtrade->db = $objWebInit->db;
        } else {
            $objtrade->db();
        }
    }
    $arrToptrade1 = array();
    $arrToptrade1[0] = $objtrade->getInfoList("where type_id=1 and pass=1", "  ORDER BY recommendflag DESC,submit_date DESC", 0, 1);
    unset($arrToptrade1[0]['COUNT_ROWS']);
    $arrToptrade1[1] = $objtrade->getInfoList("where type_id=2 and pass=1", "  ORDER BY recommendflag DESC,submit_date DESC", 0, 10);
    unset($arrToptrade1[1]['COUNT_ROWS']);
    $arrToptrade1[2] = $objtrade->getInfoList("where type_id=3 and pass=1", "  ORDER BY recommendflag DESC,submit_date DESC", 0, 10);
    unset($arrToptrade1[2]['COUNT_ROWS']);
    $arrToptrade1[3] = $objtrade->getInfoList("where type_id=4 and pass=1", "  ORDER BY recommendflag DESC,submit_date DESC", 0, 10);
Example #3
0
<?php

/**
 * 供求信息 列表文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	trade
 */
require_once 'config/config.inc.php';
require_once "class/trade.class.php";
$objWebInit = new trade();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$arrGSmarty['caching'] = false;
$objWebInit->arrGSmarty = $arrGSmarty;
//翻页参数
$objWebInit->arrGPage = $arrGPage;
$objWebInit->db();
$arrWhere = array();
$arrLink = array();
$arrWhere[] = "pass='******'";
$strLink = '';
$isGo = false;
if (empty($_GET['page'])) {
    $isGo = true;
    $intPage = 1;
} else {
Example #4
0
<?php

/*
 * 供求信息数据库安装文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * modified		2009-1-3
 */
include_once dirname(__FILE__) . '/config/config.inc.php';
include_once dirname(__FILE__) . '/class/trade.class.php';
$objWebInit = new trade();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
$objWebInit->db();
if (empty($charset)) {
    $charset = str_replace('-', '', $arrGWeb['charset']);
}
if (empty($charset)) {
    $extend = $objWebInit->db->getAttribute(PDO::ATTR_SERVER_VERSION) > '4.1' ? " DEFAULT CHARSET={$charset} " : "";
}
$intDbSummaryLen = $arrGWeb['db_summary_len'];
//写入频道数组
if (empty($strWEB_ROOT_pre)) {
    $strWEB_ROOT_pre = $arrGWeb['WEB_ROOT_pre'];
}
if (empty($strWEBADMIN_ROOT)) {
    $strWEBADMIN_ROOT = $arrGWeb['WEBADMIN_ROOT'];
Example #5
0
 function insert_new_item($pr_id, $i_status)
 {
     // place id - virtual procurement storage for current partner
     $pl_id = trade::get_pl_id_by_partner_and_type($this->user['p_id'], 1);
     $sql = "INSERT INTO `ITEMS`(\r`I_ID`,\r`I_PR_ID`,\r`I_PL_ID`,\r`I_SERIAL`,\r`I_DESC`,\r`I_IS_ID`,\r`I_P_ID`\r) VALUES ('0','" . (int) $pr_id . "','" . $pl_id . "','','','" . (int) $i_status . "','" . $this->user['p_id'] . "');";
     $result = $this->mysqli->query($sql);
     return $this->mysqli->insert_id;
 }
Example #6
0
<?php

/**
 * 供求信息后台管理栏目新增文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	trade
 */
require_once '../config/config.inc.php';
require_once "../class/trade.class.php";
require_once '../../useradmin/checklogin.php';
$objWebInit = new trade();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//图片上传参数
$objWebInit->arrGPic = $arrGPic;
$objWebInit->db();
//print_r($_POST);exit;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST['submitpass']) || $_POST['submitpass'] != $_SESSION['submitpasskey']) {
        exit;
    }
    if (empty($_POST['type_id']) || empty($_POST['title']) || empty($_POST['intro'])) {
        check::AlertExit("错误:有必填选项没填!", -1);
    }
    $arrTemp = explode('|', $_POST['type_id']);
Example #7
0
 function basic_margin_form()
 {
     $abs_margin_abs_val_box = "<input type='text' size='7' maxlength='7' id='abs_margin_abs_val' class='input_text' onchange=\"x_cl_call2('trade','save_basic_margin',\$('#abs_margin_abs_val').val(),1,'show_result');\" value='" . trade::getprice(trade::get_margin_by_id(1)) . "'>";
     $abs_margin_prc_val_box = "<input type='text' size='7' maxlength='7' id='abs_margin_prc_val' class='input_text' onchange=\"x_cl_call2('trade','save_basic_margin',\$('#abs_margin_prc_val').val(),2,'show_result');\" value='" . trade::getprice(trade::get_margin_by_id(2)) . "'>";
     $abs_margin_form = "Базовая абсолютная :" . $abs_margin_abs_val_box . "Грн + Процентная :" . $abs_margin_prc_val_box . "%";
     $partners_margin_form = $this->margin_by_partners_table();
     // check direct url
     if ($this->request['marginproduct'] != '') {
         $this->a('margin_management.php');
         $prod_margin = $this->margin_by_product_form($this->request['marginproduct']);
     }
     $prod_margin = $prod_margin ? $prod_margin : "<div align=center>товар не выбран</div>";
     $ans .= "<table>\r\t\t<tr></td><div class='headpost'>Наценки на все товары</div></td></tr>\r\t\t<tr></td>" . $abs_margin_form . "</td></tr>\r\t\t<tr></td>" . $partners_margin_form . "</td></tr>\r\t\t<tr></td><hr></td></tr>\r\t\t<tr></td><div class='headpost'>Наценка на выбранный товар:</div></td></tr>\r\t\t<tr></td><div id='product_margin'>" . $prod_margin . "</td></tr></table>";
     return $ans;
 }
Example #8
0
<?php

/**
 * 供求信息后台管理栏目首页文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	trade
 */
require_once '../config/config.inc.php';
require_once "../class/trade.class.php";
require_once '../..' . __WEBADMIN_ROOT . '/checklogin.php';
$objWebInit = new trade();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//翻页参数
$objWebInit->arrGPage = $arrGPage;
//图片上传参数
$objWebInit->arrGPic = $arrGPic;
$objWebInit->db();
//访问权限检查
if (!$objWebInit->checkPopedomG($_SESSION['user_id'])) {
    check::AlertExit('对不起,您没有权限访问此页', -1);
}
$arrWhere = array();
$arrLink = array();
if (isset($_GET['action'])) {
Example #9
0
<?php

$back_names[] = "cl_call";
$back_names[] = "cl_call2";
$back_names[] = "cl_call3";
$back_names[] = "cl_call4";
$back_names[] = "cl_call5";
$dt_id = $this->request['deal_type'];
$d_id = $this->request['deal'];
$todo = $this->request['todo'];
// trade class
$trade = new trade();
$trade->sp = $this->sp;
$trade->mysqli = $this->mysqli;
$trade->user = $this->user;
// vars for product margin
$trade->m_basic = $trade->get_basic_margins();
$trade->margin_groups = $trade->get_margin_groups();
$trade->m_groups_basic = $trade->get_basic_groups_margin();
Example #10
0
 function partner_deals($dt_id, $p_id)
 {
     // deal type properties
     $d_type = trade::get_deal_type_by_type_id((int) $dt_id);
     // head
     $ans .= "<div class='headpost' align=center >" . $d_type['name'] . "</div>";
     $sql = "SELECT \n\t\tDEALS.D_ID,\n\t\tUSERS.USR_LOGIN,\n\t\tDEALS.D_DATE,\n\t\tDEALS.D_DESC,\n\t\tDEALS.D_NR\n\t\tFROM DEALS\n\t\tINNER JOIN USERS ON USERS.USR_ID=DEALS.D_USR_ID\n\t\tWHERE DEALS.D_DT_ID=" . $dt_id . " AND D_2P_ID =" . $p_id . " ORDER BY D_ID DESC;";
     $result = $this->mysqli->query($sql);
     if ($result) {
         while ($row = $result->fetch_row()) {
             if ($style == 'multitable2' or $style == '') {
                 $style = 'multitable1';
             } else {
                 $style = 'multitable2';
             }
             $d_id = $row[0];
             $d_usr_login = $row[1];
             $d_date = $this->fdate($row[2]);
             $d_desc = $row[3];
             $d_num = $row[4];
             $d_num_msg = $d_num ? $d_id . "  (" . $d_num . ")" : $d_id;
             $action = "onclick=\"x_cl_call2('trade','edit_deal_selector','" . $d_id . "','" . $dt_id . "','bottom_block')\"";
             $deal_link = "<a href='trade&deal=" . $d_id . "'><img class='menu_img' src='img/site/business-contact.png'></a>";
             $tbl .= "<tr class='" . $style . "' " . $action . "><td>" . $d_num_msg . "</td><td>" . $d_usr_login . "</td><td>" . $d_date . "</td><td>" . $d_desc . "</td><td>" . $deal_link . "</td></tr>";
         }
     }
     $out .= $ans;
     $out .= $tbl ? "<table id='multutable' class='multitable'><tr><th width=30px>№</th><th width=90px>Пользователь</th><th>Дата</th><th>Пометка</th><th>переход</th></tr>" . $tbl . "</table>" : "Список пуст";
     return $out;
 }
Example #11
0
<?php

$back_names[] = "cl_call";
$back_names[] = "cl_call2";
$back_names[] = "cl_call3";
$back_names[] = "cl_call4";
$back_names[] = "cl_call5";
$dt_id = $this->request['deal_type'];
$d_id = $this->request['deal'];
$todo = $this->request['todo'];
// trade class
$trade = new trade();
$trade->sp = $this->sp;
$trade->mysqli = $this->mysqli;
$trade->user = $this->user;
$js_functions[] = $trade->show_js();
$js_include[] = 'js/trade.js';
// procurement product select event ;
$js_functions[] = $trade->show_js_sel_prod_event_list();
$js_functions[] = $trade->show_js_sel_cat_event_list();
//deal settings
if ($todo == "settings") {
    $main = $trade->deal_settings($d_id);
}
//detect deals table calling
if (isset($dt_id) and $dt_id != '') {
    $main = $main ? $main : $trade->get_deals_by_type_table($this->request['deal_type']);
}
// detect deal calling
if (isset($d_id) and $d_id != '') {
    $main = $main ? $main : $trade->edit_deal_selector($this->request['deal']);
Example #12
0
$this->a('procurements.php');
$back_names[] = "cl_call";
$back_names[] = "cl_call2";
$back_names[] = "cl_call3";
$back_names[] = "cl_call4";
$back_names[] = "cl_call5";
// create tree navigation
$basemng = new basemng();
$basemng->mysqli = $this->mysqli;
$basemng->user = $this->user;
$js_include[] = 'js/treeNavigation.js';
$string_out .= $basemng->show_map();
$string_out .= $basemng->show_div_selectors();
$string_out .= "<div id='tree_selector' class='div_outer_tree'>" . $basemng->product_tree(0, 1) . "</div>";
// trade class
$trade = new trade();
$trade->mysqli = $this->mysqli;
$js_functions[] = $trade->show_js();
$js_include[] = 'js/trade.js';
// procurement product select event ;
$js_functions[] = $trade->show_js_sel_prod_event_procurement();
// detect deal calling
if (isset($this->request['deal'])) {
    $main = $trade->edit_deal_selector($this->request['deal']);
} else {
    $main = $trade->get_deals_by_type_table(2);
}
// first action
$string_out .= "<div id='action_buttons' class='divactionbuttons'>Закупки :" . $trade->procurement_buttons() . "</div>";
$string_out .= "<div id ='main_div' class='divmain'>" . $main . "</div>";
Example #13
0
<?php

/**
 * 供求信息后台分类管理文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	trade
 */
require_once '../config/config.inc.php';
require_once "../class/trade.class.php";
require_once '../..' . __WEBADMIN_ROOT . '/checklogin.php';
$objWebInit = new trade();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$arrMOutput["template_file"] = "admin.html";
$objWebInit->arrGSmarty = $arrGSmarty;
$objWebInit->db();
//图形参数
$objWebInit->arrGPic = $arrGPic;
//访问权限检查
if (!$objWebInit->checkPopedomG($_SESSION['user_id'])) {
    check::AlertExit('对不起,您没有权限访问此页', -1);
}
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        // 显示新增页面
        case 'add':
Example #14
0
 function sell_price_selector($pr_id, $d_id)
 {
     $deal = trade::get_deal_properties($d_id);
     $existance = trade::get_product_existance($pr_id);
     $margin = trade::get_margins_by_product($pr_id);
     $m_basic = trade::get_basic_margins();
     $margin_groups = trade::get_margin_groups();
     $m_groups_basic = trade::get_basic_groups_margin();
     $product = basemng::get_product_info($pr_id);
     //for every mergin group ( now- partner )
     $m_basic_abs = $m_basic['abs'];
     $m_basic_prc = $m_basic['prc'];
     // start price
     // if have a USD price
     if (isset($existance['maxprice'][2]['price'])) {
         // rate
         $rate = (int) $this->sp['usd_rate'] / 100;
         // start price
         $start_price = $existance['maxprice'][2]['price'] * $rate;
         $max_price = $start_price;
         $min_price = $existance['minprice'][2]['price'] * $rate;
     } else {
         $start_price = (int) $existance['maxprice'][1]['price'];
         $max_price = $start_price;
         $min_price = $existance['minprice'][1]['price'];
     }
     // incoming price
     if ($max_price == $min_price and $max_price != '') {
         $prod_price = "Закупочная цена :" . trade::getprice($max_price) . " Грн";
     }
     if ($max_price != $min_price) {
         $prod_price = "Закупочная цена : от " . trade::getprice((int) $min_price) . " до " . trade::getprice((int) $max_price) . " Грн";
     }
     if (!$max_price) {
         $prod_price = "Закупочная цена : неизвестна ";
     }
     $pr_fix = trade::get_absolute_prod_price($pr_id);
     if ($pr_fix) {
         $sell_price = $pr_fix;
         $margin_msg = "Установлена фиксированная цена";
     } else {
         if ($start_price > 0) {
             // by margin group cycle
             foreach ($margin_groups as $mg_id => $mg_name) {
                 $m_all_mg_abs = $m_groups_basic[$mg_id][2]['val'];
                 $m_all_mg_prc = $m_groups_basic[$mg_id][3]['val'];
                 $m_pr_mg_abs = $margin[$mg_id][9]['val'];
                 $m_pr_mg_prc = $margin[$mg_id][10]['val'];
                 $m_pr_mg_fix = $margin[$mg_id][11]['val'];
                 if (!$m_pr_mg_fix) {
                     // margin !
                     // basic margin
                     $price = $start_price + $m_basic_abs;
                     $price = $price + (int) ($price * $m_basic_prc) / 10000;
                     // by margin group for all products
                     $price1 = $price;
                     $price = $price + $m_all_mg_abs;
                     $price = $price + (int) ($price * $m_all_mg_prc / 10000);
                     // by margin groups for this product
                     $price = $price + $m_pr_mg_abs;
                     $price = $price + (int) ($price * $m_pr_mg_prc / 10000);
                 } else {
                     $price = $m_pr_mg_fix;
                 }
                 // fixed price for product by margin group
                 $price = (int) $price;
                 // sell mng for current partner ( margin group )
                 $_2p_selection = '';
                 if ($mg_id == trade::get_margin_group_by_partner($deal['2p_id'])) {
                     $sell_price = trade::getprice($price);
                     $_2p_selection = "bgcolor='#88bbaa'";
                 }
                 // generate form
                 $m_action = "\$('#sell_price').val('" . trade::getprice($price) . "');";
                 $m_form_names .= "<td width=10% " . $_2p_selection . " onclick=\"" . $m_action . "\" ><div><font class='microfont'>" . $mg_name . "</font></div></td>";
                 $m_form_prices .= "<td width=10% " . $_2p_selection . " onclick=\"" . $m_action . "\" ><div id='mg_" . $mg_id . "_price'>" . trade::getprice($price) . "</div></td>";
             }
             $margin_msg = "<table class='multitable'><tr>" . $m_form_names . "</tr><tr>" . $m_form_prices . "</tr></table>";
         } else {
             $margin_msg = "Нет закупочной цены для наценки";
         }
     }
     // main sell selector
     // product existance form
     $product_existance_form = "Количество всего: " . (int) $existance['exist'] . "\n\t\t<table class='multitable'><tr><td>Склад</td><td>План.</td><td>Едет</td><td>Отлож.</td></tr>\n\t\t<tr><td>" . (int) $existance['stored'] . "</td><td>" . (int) $existance['planned'] . "</td><td>" . (int) $existance['purchased'] . "</td><td>" . (int) $existance['saved'] . "</td></tr></table>";
     //sell price area
     $selling_price_box = "<input type='text' size='7' maxlength='7' id='sell_price' class='input_text' value='" . $sell_price . "'>";
     $sell_price_area = $prod_price . "<br> Продать за " . $selling_price_box;
     $main_sell_selector = "<table><tr valign='top'><td><div id='product_existance'>" . $product_existance_form . "</div></td><td>" . $sell_price_area . "</td></tr></table>\n\t\t";
     // $product_table_sell_selector
     foreach ($existance['places'] as $pl_id => $val) {
         $place = trade::get_place_properties_by_id($pl_id);
         $out[$pl_id] .= "Склад '" . $place['pl_name'] . "'<br><table class='multitable' >";
         foreach ($val as $i_id => $prop) {
             if ($style == 'multitable2' or $style == '') {
                 $style = 'multitable1';
             } else {
                 $style = 'multitable2';
             }
             $add_act = "onclick=\"x_cl_call5('trade','insert_item_to_list'," . $i_id . "," . $d_id . ",\$('#sell_price').val(),1," . $pr_id . ",'show_result');\"";
             if ($prop['is_id'] == 1 or $prop['is_id'] == 2 or $prop['is_id'] == 3) {
                 $add_butt = "<button class='button' " . $add_act . " ><img class='menu_img' src='/img/site/add.png'></button>";
             } else {
                 $add_butt = '';
             }
             $out[$pl_id] .= "<tr class='" . $style . "'><td width=60px>" . $prop['serial'] . "</td><td>" . $prop['desc'] . "</td><td width=130px>" . $prop['owner'] . "</td><td width=100px>" . $prop['status'] . "</td><td width=2%>" . $add_butt . "</td></tr>";
         }
         $out[$pl_id] .= "</table>";
     }
     $product_table_sell_selector = implode($out);
     $pr_foto = basemng::get_product_foto($pr_id);
     $pr_foto = "<div class='prod_small_foto'>" . $pr_foto . "</div>";
     // full selling product form
     $ans = "<table width=130%>\n\t\t<tr><td><table><tr><td>" . $pr_foto . "</td><td><h3>" . $product['NAME'] . "</h3></td></tr></table></td></tr>\n\t\t<tr><td>" . $main_sell_selector . "</td></tr>\n\t\t<tr><td>" . $margin_msg . "</td></tr>\n\t\t<tr><td><div id='product_table_sell_selector'>" . $product_table_sell_selector . "</div></td></tr>\n\t\t</table>\n\t\t";
     return $ans;
 }
Example #15
0
<?php

/**
 * 相关新闻 列表文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	trade
 */
if (is_object($objWebInit)) {
    if (!isset($objtrade)) {
        include_once __WEB_ROOT . "/trade/class/trade.class.php";
        include_once __WEB_ROOT . "/trade/config/var.inc.php";
        $objtrade = new trade();
        $objtrade->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objtrade->db = $objWebInit->db;
        } else {
            $objtrade->db();
        }
    }
    if (isset($arrInfo['tag']) && !empty($arrInfo['tag'])) {
        $arrTag = explode(',', $arrInfo['tag']);
        $where = array();
        foreach ($arrTag as $strTag) {
            $where[] = "'%" . $strTag . "%'";
        }
        //echo $arrInfo['id'];
        //print_r($where);
Example #16
0
<?php

/**
 * 供求信息 列表文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	trade
 */
require_once 'config/config.inc.php';
require_once "class/trade.class.php";
$objWebInit = new trade();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//翻页参数
$objWebInit->arrGPage = $arrGPage;
$objWebInit->db();
if (!is_array($arrMType) || empty($arrMType)) {
    $arrMType = $objWebInit->getTypeList();
    $arrMType = $objWebInit->formatTypeList(0, $arrMType);
}
foreach ($arrMType as $k => $v) {
    $arrToptrade[$k] = array();
    if (is_array($v)) {
        $arrToptrade[$k]['type_title'] = $v['type_title'];
        $arrToptrade[$k]['type_id'] = $v['type_id'];
    } else {
Example #17
0
<?php

/**
 * 供求信息 列表文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	trade
 */
require_once 'config/config.inc.php';
require_once "class/trade.class.php";
$objWebInit = new trade();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
$objWebInit->db();
//图像参数
$objWebInit->arrGPic = $arrGPic;
//smarty参数
if ($arrGWeb['URL_static']) {
    $arrGSmarty['caching'] = false;
} else {
    $arrGSmarty['cache_lifetime'] = 3600;
}
$objWebInit->arrGSmarty = $arrGSmarty;
if ($_GET['id'] === null) {
    exit;
}
$intID = intval($_GET['id']);
$arrInfo = $objWebInit->getInfo($intID);
Example #18
0
<?php

/**
 * 公司风采后台管理栏目新增文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	trade
 */
require_once '../config/config.inc.php';
require_once "../class/trade.class.php";
require_once '../..' . __WEBADMIN_ROOT . '/checklogin.php';
$objWebInit = new trade();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//图片上传参数
$objWebInit->arrGPic = $arrGPic;
$objWebInit->db();
//访问权限检查
if (!$objWebInit->checkPopedomG($_SESSION['user_id'])) {
    check::AlertExit('对不起,您没有权限访问此页', -1);
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST['type_id']) || empty($_POST['title']) || empty($_POST['intro'])) {
        check::AlertExit("错误:有必填选项没填!", -1);
    }
    //新图上传
Example #19
0
<?php

$this->a('margin_management.php');
$back_names[] = "cl_call";
$back_names[] = "cl_call2";
$back_names[] = "cl_call3";
$back_names[] = "cl_call4";
$back_names[] = "cl_call5";
// create tree navigation
$basemng = new basemng();
$basemng->mysqli = $this->mysqli;
$js_include[] = 'js/treeNavigation.js';
$string_out .= $basemng->show_map();
$string_out .= $basemng->show_div_selectors();
$string_out .= "<div id='tree_selector' class='div_outer_tree'>" . $basemng->product_tree(0, 1) . "</div>";
// trade class
$trade = new trade();
$trade->mysqli = $this->mysqli;
$trade->user = $this->user;
$trade->request = $this->request;
$trade->sp = $this->sp;
$js_functions[] = $trade->show_js();
// auto product select js function for margin
$js_functions[] = $trade->show_js_sel_prod_event_margin();
// first action
$string_out .= "<div id='action_buttons' class='divactionbuttons'>Наценки :" . $trade->margin_management_buttons() . "</div>";
$string_out .= "<div id ='main_div' class='divmain'>" . $trade->basic_margin_form() . "</div>";
Example #20
0
 function del_prod_procurement($pr_id, $d_id)
 {
     $sql = "DELETE FROM ITEMS ,DEAL_ITEMS_LIST\r\t\tUSING DEAL_ITEMS_LIST\r\t\tINNER JOIN ITEMS ON ITEMS.I_ID = DEAL_ITEMS_LIST.DIL_I_ID\r\t\tWHERE \r\t\tDEAL_ITEMS_LIST.DIL_D_ID=" . $d_id . " \r\t\tAND \r\t\tITEMS.I_PR_ID=" . $pr_id . " ;";
     $result = $this->mysqli->query($sql);
     return trade::edit_procurement_form($d_id);
 }
Example #21
0
<?php

/**
 * 最新新闻 列表文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	trade
 */
if (is_object($objWebInit)) {
    if (!isset($objtrade)) {
        include_once __WEB_ROOT . "/trade/class/trade.class.php";
        include_once __WEB_ROOT . "/trade/config/var.inc.php";
        $objtrade = new trade();
        $objtrade->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objtrade->db = $objWebInit->db;
        } else {
            $objtrade->db();
        }
    }
    $arrNewest = array();
    $arrNewest = $objtrade->getInfoList("where pass=1", " ORDER BY clicktimes DESC,submit_date DESC,recommendflag DESC,clicktimes DESC", 0, 5, true);
    unset($arrNewest['COUNT_ROWS']);
    //print_r($arrNewest);
    // 输出到模板
    $arrMOutput["smarty_assign"]['arrNewest'] = $arrNewest;
}
Example #22
0
<?php

// trade class
$trade = new trade();
$trade->mysqli = $this->mysqli;
$trade->user = $this->user;
$trade->sp = $this->sp;
if ($this->request['todo'] != 'pdf') {
    $print_list = $trade->print_form($this->request['id'], $this->request['type']);
}
if ($this->request['todo'] == 'pdf') {
    $trade->htmltopdf($this->request['id'], $this->request['type']);
} elseif ($this->request['todo'] == 'convert') {
    $string_out = $print_list;
} else {
    $string_out = "\r<div style=\"margin-top:5px;\"><img src=\"./img/site/print.png\" width =15px onclick=\"window.print();\"></div>\r<frame>\r" . $print_list . "\r</html>\r</frame>";
}
$string_out .= " ";
/*
$this->mime=true;
// trade class
$trade= new trade ;
$trade->mysqli=$this->mysqli;
$trade->user=$this->user;
$trade->sp=$this->sp;
$print_list=$trade->do_pdf_form($this->request['id'],$this->request['type']);
/*
$string_out = "
<div style=\"margin-top:5px;\"><img src=\"./img/site/print.png\" width =15px onclick=\"window.print();\"></div>
<frame>
".$print_list."
Example #23
0
<?php

// trade class
$trade = new trade();
$trade->mysqli = $this->mysqli;
$trade->sp = $this->sp;
$print_list = $trade->print_form($this->request['id']);
$string_out = "\r<div style=\"margin-top:5px;\"><a href=\"javascript://\" onclick=\"window.print();\">Печать</a> • <a href=\"javascript://\" onclick=\"window.close();\">Закрыть окно</a></div>\r<frame>\r" . $print_list . "\r</html>\r</frame>";
Example #24
0
<?php

$this->a('items_storage.php');
$back_names[] = "cl_call";
$back_names[] = "cl_call2";
$back_names[] = "cl_call3";
$back_names[] = "cl_call4";
$back_names[] = "cl_call5";
// create tree navigation
$basemng = new basemng();
$basemng->mysqli = $this->mysqli;
$basemng->user = $this->user;
$js_include[] = 'js/treeNavigation.js';
$string_out .= $basemng->show_map();
$string_out .= $basemng->show_div_selectors();
$string_out .= "<div id='tree_selector' class='div_outer_tree'>" . $basemng->product_tree(0, 1) . "</div>";
// trade class
$trade = new trade();
$trade->mysqli = $this->mysqli;
$trade->user = $this->user;
$trade->request = $this->request;
$js_functions[] = $trade->show_js();
$js_functions[] = $trade->show_js_sel_prod_event_storage();
$js_functions[] = $trade->show_js_sel_cat_event_stor();
$string_out .= "<div id='action_buttons' class='divactionbuttons'>" . $trade->storage_buttons() . "</div>";
$string_out .= "<div id ='main_div' class='divmain'>" . $trade->def_storage_form() . "<div>";
Example #25
0
<?php

/**
 * 促销产品大block文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	trade
 */
if (is_object($objWebInit)) {
    if (!isset($objtrade)) {
        include_once __WEB_ROOT . "/trade/class/trade.class.php";
        include_once __WEB_ROOT . "/trade/config/var.inc.php";
        $objtrade = new trade();
        $objtrade->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objtrade->db = $objWebInit->db;
        } else {
            $objtrade->db();
        }
    }
    $arrCommendtrade = array();
    $intMax = $objtrade->getRecordsG($objtrade->tablename2, 'where pass=1 and recommendflag = 1');
    if ($intMax < 1) {
        $intMax = $objtrade->getRecordsG($objtrade->tablename2, 'where pass=1 and recommendflag = 0');
        if ($intMax > 10) {
            $intMax -= 10;
        }
        $arrCommendtrade = $objtrade->getInfoList('where pass=1 and recommendflag = 0', ' order by submit_date desc', rand(0, $intMax), 10);