Example #1
0
 function detail()
 {
     global $G;
     using("area", "industry");
     $area = new Areas();
     $industry = new Industries();
     $tpl_file = "company/detail";
     $this->viewhelper->setTitle(L("yellow_page", "tpl"));
     $this->viewhelper->setPosition(L("yellow_page", "tpl"), "index.php?do=company");
     if (isset($_GET['id'])) {
         $id = intval($_GET['id']);
         $result = $area->dbstuff->GetRow("SELECT * FROM {$area->table_prefix}companies WHERE id='" . $id . "'");
         if (!empty($result)) {
             $login_check = 1;
             //default open
             if (isset($G['setting']['company_logincheck'])) {
                 $login_check = $G['setting']['company_logincheck'];
             }
             $this->viewhelper->setTitle($result['name']);
             $this->viewhelper->setPosition($result['name']);
             $result['tel'] = pb_hidestr(preg_replace('/\\((.+?)\\)/i', '', $result['tel']));
             $result['fax'] = pb_hidestr(preg_replace('/\\((.+?)\\)/i', '', $result['fax']));
             $result['mobile'] = pb_hidestr($result['mobile']);
             $result['industry_names'] = $industry->disSubNames($result['industry_id'], null, true, "company");
             $result['area_names'] = $area->disSubNames($result['area_id'], null, true, "company");
             setvar("item", $result);
             setvar("LoginCheck", $login_check);
         }
     }
     render($tpl_file, 1);
 }
Example #2
0
 function Search($firstcount, $displaypg)
 {
     global $cache_types;
     uses("space", "industry", "area");
     $space = new Space();
     $area = new Areas();
     $industry = new Industries();
     $cache_options = cache_read('typeoption');
     $area_s = $space->array_multi2single($area->getCacheArea());
     $industry_s = $space->array_multi2single($industry->getIndustry());
     $result = $this->findAll("*,name AS title,description AS digest", null, null, $this->orderby, $firstcount, $displaypg);
     if (!isset($_PB_CACHE['membergroup'])) {
         require CACHE_PATH . "cache_membergroup.php";
     }
     while (list($keys, $values) = each($result)) {
         $r = array();
         $result[$keys]['pubdate'] = df($values['created']);
         $result[$keys]['typename'] = $cache_options['manage_type'][$values['manage_type']];
         $result[$keys]['thumb'] = $result[$keys]['logo'] = pb_get_attachmenturl($values['picture'], '', 'small');
         $result[$keys]['gradeimg'] = URL . 'images/group/' . $_PB_CACHE['membergroup'][$result[$keys]['cache_membergroupid']]['avatar'];
         $result[$keys]['gradename'] = $_PB_CACHE['membergroup'][$result[$keys]['cache_membergroupid']]['name'];
         if (!empty($result[$keys]['area_id'])) {
             $r[] = $area_s[$result[$keys]['area_id']];
         }
         if (!empty($result[$keys]['industry_id'])) {
             $r[] = $industry_s[$result[$keys]['industry_id']];
         }
         $r[] = L("integrity_index", "tpl") . "(" . $result[$keys]['cache_credits'] . ")";
         if (!empty($r)) {
             $result[$keys]['extra'] = implode(" - ", $r);
         }
         $result[$keys]['url'] = $space->rewrite($values['member_id'], $values['id']);
     }
     return $result;
 }
Example #3
0
 function lists()
 {
     global $viewhelper, $pos;
     using("industry", "area");
     $area = new Areas();
     $industry = new Industries();
     $conditions[] = "Job.status=1";
     $viewhelper->setTitle(L("hr_information", "tpl"));
     $viewhelper->setPosition(L("hr_information", "tpl"), "index.php?do=job&action=" . __FUNCTION__);
     if (!empty($_GET['q'])) {
         $title = trim($_GET['q']);
         $conditions[] = "Job.name like '%" . $title . "%'";
     }
     if (!empty($_GET['data']['salary_id'])) {
         $conditions[] = "Job.salary_id=" . intval($_GET['data']['salary_id']);
     }
     if (!empty($_GET['data']['area_id'])) {
         $conditions[] = "Job.area_id=" . intval($_GET['data']['area_id']);
     }
     if (isset($_GET['industryid'])) {
         $industry_id = intval($_GET['industryid']);
         $tmp_info = $industry->setInfo($industry_id);
         if (!empty($tmp_info)) {
             $conditions[] = "Job.industry_id=" . $tmp_info['id'];
             $viewhelper->setTitle($tmp_info['name']);
             $viewhelper->setPosition($tmp_info['name'], "index.php?do=job&action=" . __FUNCTION__ . "&industryid=" . $tmp_info['id']);
         }
     }
     if (isset($_GET['areaid'])) {
         $area_id = intval($_GET['areaid']);
         $tmp_info = $area->setInfo($area_id);
         if (!empty($tmp_info)) {
             $conditions[] = "Job.area_id=" . $tmp_info['id'];
             $viewhelper->setTitle($tmp_info['name']);
             $viewhelper->setPosition($tmp_info['name'], "index.php?do=job&action=" . __FUNCTION__ . "&areaid=" . $tmp_info['id']);
         }
     }
     $amount = $this->job->findCount(null, $conditions, "Job.id");
     $result = $this->job->findAll("Job.*,Job.cache_spacename AS userid,Job.created AS pubdate,(select Company.name from " . $this->job->table_prefix . "companies Company where Company.id=Job.id) AS companyname", null, $conditions, "Job.id DESC", $pos, $this->displaypg);
     $viewhelper->setTitle(L("search", "tpl"));
     $viewhelper->setPosition(L("search", "tpl"));
     setvar("items", $result);
     setvar("paging", array('total' => $amount));
     render("job/list", 1);
 }
Example #4
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: 2205 $
 */
require "../libraries/common.inc.php";
require "room.share.php";
require PHPB2B_ROOT . 'libraries/page.class.php';
check_permission("offer");
$tpl_file = "offer";
$page = new Pages();
uses("trade", "tradefield", "product", "tag", "attachment", "form", "typeoption", "point", "industry", "area");
$attachment = new Attachment("pic");
$area = new Areas();
$industry = new Industries();
$form = new Forms();
$point = new Points();
$tradefield = new Tradefields();
$tag = new Tags();
$trade = new Trades();
$trade_controller = new Trade();
$typeoption = new Typeoption();
$conditions = array();
$conditions[] = "member_id = " . $the_memberid;
setvar("TradeTypes", $trade_controller->getTradeTypes());
setvar("TradeNames", $trade_controller->getTradeTypeNames());
$tmp_personalinfo = $memberinfo;
setvar("MemberInfo", $tmp_personalinfo);
$expires = $trade_controller->getOfferExpires();
setvar("TradeTypes", $trade_controller->getTradeTypes());
Example #5
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 LIB_PATH . 'page.class.php';
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
require CACHE_COMMON_PATH . "cache_type.php";
$_PB_CACHE['industry'] = cache_read("industry");
uses("industry", "typeoption");
$cache = new Caches();
$typeoption = new Typeoption();
$industry = new Industries();
$condition = null;
$conditions = array();
$tpl_file = "industry";
$page = new Pages();
setvar("Types", $_PB_CACHE['industrytype']);
$cache_items = $_PB_CACHE['industry'];
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['del'])) {
    if (!empty($_POST['id'])) {
        $industry->del($_POST['id']);
    }
}
if (isset($_POST['hide_batch'])) {
    if (!empty($_POST['id'])) {
        $industry->saveField('available', 0, $_POST['id']);
Example #6
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: 2083 $
 */
session_cache_limiter('nocache');
require "../libraries/common.inc.php";
require "session_cp.inc.php";
require CACHE_COMMON_PATH . "cache_type.php";
uses("friendlink", "industry", "typeoption", "area");
require PHPB2B_ROOT . 'libraries/page.class.php';
$link = new Friendlinks();
$page = new Pages();
$area = new Areas();
$industry = new Industries();
$industry = new Industries();
$typeoption = new Typeoption();
$conditions = null;
$tpl_file = "friendlink";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (!empty($_PB_CACHE['friendlinktype'])) {
    setvar("FriendlinkTypes", $_PB_CACHE['friendlinktype']);
}
if (isset($_POST['save']) && !empty($_POST['data']['friendlink']['title'])) {
    $vals = array();
    $vals = $_POST['data']['friendlink'];
    if (isset($_POST['id'])) {
        $id = intval($_POST['id']);
    }
    if (!preg_match("/^(http|ftp):/", $_POST['data']['friendlink']['url'])) {
        $vals['url'] = 'http://' . $_POST['data']['friendlink']['url'];
Example #7
0
 /**
  * search
  * @list
  */
 function lists()
 {
     global $G, $viewhelper, $pos;
     uses("trade", "industry", "area", "tradefield", "form", "tag");
     $trusttypes = cache_read("trusttype");
     $countries = cache_read("country");
     $membergroups = cache_read("membergroup");
     $area = new Areas();
     $offer = new Tradefields();
     $trade = new Trades();
     $form = new Forms();
     $industry = new Industries();
     $tag = new Tags();
     $conditions = array();
     $industry_id = $area_id = 0;
     $conditions[] = "t.status=1";
     !empty($_GET) && ($_GET = clear_html($_GET));
     if (isset($_GET['navid'])) {
         setvar("nav_id", intval($_GET['navid']));
     }
     $viewhelper->setTitle(L('offer', 'tpl'));
     $viewhelper->setPosition(L('offer', 'tpl'), "index.php?do=offer");
     $trade_types = cache_read("type", "offertype");
     if (isset($_GET['typeid'])) {
         $type_id = intval($_GET['typeid']);
         $conditions[] = "t.type_id='" . $type_id . "'";
         setvar("typeid", $type_id);
         $type_name = $trade_types[$type_id];
         $viewhelper->setTitle($type_name);
         $viewhelper->setPosition($type_name, "index.php?do=offer&action=lists&typeid=" . $type_id);
     }
     if (isset($_GET['industryid'])) {
         $industry_id = intval($_GET['industryid']);
         $tmp_info = $industry->setInfo($industry_id);
         if (!empty($tmp_info)) {
             $sub_ids = $industry->getSubDatas($tmp_info['id']);
             $sub_ids = array_keys($sub_ids);
             $conditions[] = "t.industry_id IN (" . implode(",", $sub_ids) . ")";
             $viewhelper->setTitle($tmp_info['name']);
             $viewhelper->setPosition($tmp_info['name'], "index.php?do=offer&action=lists&industryid=" . $tmp_info['id']);
         }
     }
     if (isset($_GET['areaid'])) {
         $area_id = intval($_GET['areaid']);
         $tmp_info = $area->setInfo($area_id);
         if (!empty($tmp_info)) {
             $sub_ids = $area->getSubDatas($tmp_info['id']);
             $sub_ids = array_keys($sub_ids);
             $conditions[] = "t.area_id IN (" . implode(",", $sub_ids) . ")";
             $viewhelper->setTitle($tmp_info['name']);
             $viewhelper->setPosition($tmp_info['name'], "index.php?do=offer&action=lists&areaid=" . $tmp_info['id']);
         }
     }
     if (isset($_GET['type'])) {
         if ($_GET['type'] == "urgent") {
             $conditions[] = "t.if_urgent='1'";
         }
     }
     if (!empty($_GET['price_start']) || !empty($_GET['price_end'])) {
         $conditions[] = "t.price BETWEEN " . intval($_GET['price_start']) . " AND " . intval($_GET['price_end']);
     }
     if (!empty($_GET['picture'])) {
         $conditions[] = "t.picture!=''";
     }
     if (!empty($_GET['urgent'])) {
         $conditions[] = "t.if_urgent=1";
     }
     if (!empty($_GET['commend'])) {
         $conditions[] = "t.if_commend=1";
     }
     if (!empty($_GET['country'])) {
         $conditions[] = "t.country_id='" . intval($_GET['country']) . "'";
     }
     if (!empty($_GET['sure'])) {
         $conditions[] = "m.trusttype_ids='" . intval($_GET['sure']) . "'";
     }
     if (!empty($_GET['date'])) {
         $d = intval($_GET['date']);
         if ($d <= 7948800) {
             $conditions[] = "t.submit_time<='" . intval($_GET['date']) . "'";
         }
     }
     if (isset($_GET['q'])) {
         $searchkeywords = $_GET['q'];
         $viewhelper->setTitle(L("search_in_keyword", "tpl", $searchkeywords));
         $viewhelper->setPosition(L("search_in_keyword", "tpl", $searchkeywords));
         $conditions[] = "t.title like '%" . $searchkeywords . "%'";
         setvar("highlight_str", $searchkeywords);
     }
     if (isset($_GET['pubdate'])) {
         switch ($_GET['pubdate']) {
             case "l3":
                 $conditions[] = "t.submit_time>" . ($offer->timestamp - 3 * 86400);
                 break;
             case "l10":
                 $conditions[] = "t.submit_time>" . ($offer->timestamp - 10 * 86400);
                 break;
             case "l30":
                 $conditions[] = "t.submit_time>" . ($offer->timestamp - 30 * 86400);
                 break;
             default:
                 break;
         }
     }
     if ($G['setting']['offer_expire_method'] == 2 || $G['setting']['offer_expire_method'] == 3) {
         $conditions[] = "t.expire_time>" . $offer->timestamp;
     }
     $amount = $trade->findCount(null, $conditions, null, "t");
     $result = $trade->getRenderDatas($conditions, $G['setting']['offer_filter']);
     $important_result = $trade->getStickyDatas();
     setvar("StickyItems", $important_result);
     setvar('items', $result);
     setvar('trusttype', $trusttypes);
     setvar('countries', $countries);
     setvar("paging", array('total' => $amount));
     render("offer/list");
 }
Example #8
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: 2048 $
 */
define('CURSCRIPT', 'content');
require "../libraries/common.inc.php";
require "../share.inc.php";
uses("product", "company", "member", "form", "tag", "area", "industry");
$company = new Companies();
$area = new Areas();
$industry = new Industries();
$tag = new Tags();
$member = new Members();
$product = new Products();
$form = new Forms();
$tmp_status = explode(",", L('product_status', 'tpl'));
$viewhelper->setPosition(L("product_center", 'tpl'), 'product/');
$viewhelper->setTitle(L("product_center", 'tpl'));
if (isset($_GET['title'])) {
    $title = rawurldecode(trim($_GET['title']));
    $res = $product->findByName($title);
    $id = $res['id'];
}
if (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
$info = $product->getProductById($id);
Example #9
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: 2223 $
 */
require "../libraries/common.inc.php";
require "room.share.php";
require LIB_PATH . 'time.class.php';
uses("job", "typeoption", "area", "industry");
check_permission("job");
$job = new Jobs();
$area = new Areas();
$industry = new Industries();
$typeoption = new Typeoption();
$tpl_file = "job";
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)) {
        $job->del($id, "member_id=" . $the_memberid);
    }
    if ($do == "edit") {
        setvar("Genders", $typeoption->get_cache_type('gender'));
Example #10
0
         $file->rmDirs(DATA_PATH . "dbcache", false, false);
         $file->rmDirs(DATA_PATH . "dbcache", false, true);
     }
     flash("success", "htmlcache.php?do=clear");
     break;
 case "update":
     if (in_array("area", $_POST['data']['type'])) {
         $cache->writeCache("area", "area");
         $cache->writeCache("country", "country");
     }
     if (in_array("options", $_POST['data']['type'])) {
         $cache->updateTypevars();
     }
     if (in_array("industry", $_POST['data']['type'])) {
         uses("industry");
         $industry = new Industries();
         $industry->updateCache();
         $cache->writeCache("industry", "industry");
     }
     if (in_array("language", $_POST['data']['type'])) {
         $cache->updateLanguages();
     }
     if (in_array("setting", $_POST['data']['type'])) {
         $cache->updateIndexCache();
         $cache->updateTypes();
         $cache->writeCache("setting", "setting");
         $cache->writeCache("nav", "nav");
     }
     if (in_array("ext", $_POST['data']['type'])) {
         $cache->writeCache("userpage", "userpage");
         $cache->writeCache("trusttype", "trusttype");
Example #11
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: 2133 $
 */
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)) {
Example #12
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: 2214 $
 */
function smarty_function_get($params, &$smarty)
{
    $op = null;
    extract($params);
    global $tb_prefix, $pdb;
    if (empty($var)) {
        $var = "item";
    }
    if (!empty($from)) {
        switch ($from) {
            case "market":
                $num = 4;
                if (isset($params['row'])) {
                    $num = intval($params['row']);
                }
                $latest_commend_markets = $industry->GetArray("SELECT * FROM " . $tb_prefix . "markets WHERE if_commend='1' AND status='1' AND picture!='' ORDER BY id DESC LIMIT " . $num);
                $urls = $infos = $images = array();
                if (!empty($latest_commend_markets)) {
                    while (list($key, $val) = each($latest_commend_markets)) {
                        $urls[] = $industry->getPermaLink($val['id'], null, 'market');
                        $infos[] = pb_lang_split($val['name']);
                        $images[] = pb_get_attachmenturl($val['picture'], '', $size);
                    }
                    $items['url'] = implode("|", $urls);
                    $items['info'] = implode("|", $infos);
                    $items['image'] = implode("|", $images);
                    $return = $items;
                }
                break;
            case "area":
                if (class_exists("Areas")) {
                    $area = new Areas();
                } else {
                    uses("area");
                    $area = new Areas();
                }
                $return = $area->getLevelAreas();
                break;
            case "industry":
                //depth
                if (class_exists("Industries")) {
                    $industry = new Industries();
                    $obj_controller = new Industry();
                } else {
                    uses("industry");
                    $industry = new Industries();
                    $obj_controller = new Industry();
                }
                $return = $industry->getCacheIndustry();
                break;
            case "type":
                if (!empty($name)) {
                    //depth
                    if (class_exists("Industries")) {
                        $industry = new Industries();
                        $obj_controller = new PbController();
                    } else {
                        uses("industry");
                        $industry = new Industries();
                        $obj_controller = new PbController();
                    }
                    $name = $obj_controller->pluralize($name);
                    $industry->findIt($name);
                    $return = $industry->params['data'][1];
                    if (isset($multi)) {
                        $return = $obj_controller->flatten_array($return);
                    }
                    if (empty($var)) {
                        $var = "Items";
                    }
                }
                break;
            default:
                $return = cache_read($name, $key);
                break;
        }
    }
    if (!empty($sql)) {
        //replace table prefix
        $pdb->setFetchMode(ADODB_FETCH_ASSOC);
        $sql = str_replace("pb_", $tb_prefix, $sql);
        //for secure
        if (eregi('insert|update|delete|union|into|load_file|outfile|replace', $sql)) {
            trigger_error('no supported sql.');
        }
        //mysql_escape_string()
        $return = $industry->GetArray($sql);
    }
    if (isset($name)) {
        switch ($name) {
            case "language":
                global $G;
                $languages = unserialize($G['setting']['languages']);
                if (!empty($languages)) {
                    if (!isset($echo)) {
                        $smarty->assign($var, $languages);
                    } else {
                        foreach ($languages as $lang_key => $lang_val) {
                            $tmp = "<a href='" . URL . 'redirect.php?url=' . pb_getenv("REQUEST_URI") . "&app_lang=" . $lang_key . "' title='" . $lang_val['title'] . "'>";
                            if ($image && !empty($lang_val['img'])) {
                                $tmp .= "<img src='" . $lang_val['img'] . "' alt='" . $lang_val['title'] . "' />";
                            } else {
                                $tmp .= $lang_val['title'];
                            }
                            $tmp .= "</a>";
                            if ($sep) {
                                $tmp .= $sep;
                            }
                            if (isset($title_li) && $title_li == "list") {
                                $op .= "<li>" . $tmp . "</li>";
                            } else {
                                $op .= $tmp;
                            }
                        }
                    }
                }
                break;
            case "nav":
                $_nav = cache_read("nav");
                $navs = $_nav['navs'];
                if (!empty($exclude)) {
                    $_exclude_navs = explode(",", $exclude);
                    foreach ($_exclude_navs as $_exkey => $_exval) {
                        unset($navs[$_exval]);
                    }
                }
                if (empty($echo)) {
                    $smarty->assign($var, $navs);
                } else {
                    foreach ($navs as $nav) {
                        $op .= '<li id="mn_' . $nav['id'] . '" class="nav_item nav-item-' . $nav['id'];
                        $file_name = pb_getenv('REQUEST_URI');
                        if (strpos($file_name, $nav['url']) !== false && $nav['url'] != 'index.php') {
                            $op .= ' current_nav_item';
                        }
                        $op .= '"><a href="' . $nav['url'] . '" target="_self"><span>' . pb_lang_split($nav['name']) . '</span></a></li>';
                    }
                }
                break;
            default:
                if (is_file(CACHE_COMMON_PATH . "cache_" . $name . ".php")) {
                    require CACHE_COMMON_PATH . "cache_" . $name . ".php";
                }
                if (isset($_PB_CACHE)) {
                    $smarty->assign($var, $_PB_CACHE);
                }
                break;
        }
    }
    if (!empty($return)) {
        $smarty->assign($var, $return);
    }
    return $op;
}
				<div class="icon-wrapper">
					<?php 
$industries = $fields['charts'][0]['industries'];
?>
					<script> var barArray = JSON.parse( '<?php 
echo json_encode(array_column($industries, "industry"));
?>
' );</script>

					<?php 
foreach ($industries as $key => $industry) {
    ?>
						<div class="icon">
							<?php 
    $industriesClass = new Industries();
    $industryInfo = $industriesClass->getIndustryList($industry['industry']);
    ?>
							<img src="/wp-content/themes/digital-river-translated/img/crossborder/<?php 
    echo $industryInfo['img'];
    ?>
" />
							<span><?php 
    echo $industryInfo['label'];
    ?>
</span>
							<span data-barid="<?php 
    echo $key;
    ?>
" class="score"></span>
						</div>
Example #14
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: 2154 $
 */
require "../libraries/common.inc.php";
require "room.share.php";
require LIB_PATH . 'time.class.php';
require LIB_PATH . 'validation.class.php';
$validate = new Validation();
check_permission("company");
uses("industry", "area", "attachment", "companyfield", "typeoption");
$attachment = new Attachment('pic');
$area = new Areas();
$industry = new Industries();
$companyfield = new Companyfields();
$typeoption = new Typeoption();
$tpl_file = "company";
if (isset($_POST['do']) && !empty($_POST['data']['company'])) {
    pb_submit_check('data');
    $vals = $_POST['data']['company'];
    $company->doValidation($vals);
    if (!empty($company->validationErrors)) {
        setvar("item", $vals);
        setvar("Errors", $validate->show($company));
        template($tpl_file, true);
    }
    if (isset($companyinfo)) {
        if (empty($companyinfo['name'])) {
            $i18n = new L10n();
Example #15
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: 2124 $
 */
function smarty_function_get($params, &$smarty)
{
    extract($params);
    global $tb_prefix, $pdb;
    if (empty($var)) {
        $var = "item";
    }
    //depth
    if (class_exists("Industries")) {
        $industry = new Industries();
        $obj_controller = new Industry();
    } else {
        uses("industry");
        $industry = new Industries();
        $obj_controller = new Industry();
    }
    switch ($from) {
        case "market":
            $latest_commend_markets = $industry->GetArray("SELECT * FROM " . $tb_prefix . "markets WHERE if_commend='1' AND status='1' AND picture!='' ORDER BY id DESC LIMIT 0,10");
            $urls = $infos = $images = array();
            if (!empty($latest_commend_markets)) {
                while (list($key, $val) = each($latest_commend_markets)) {
                    $urls[] = $industry->getPermaLink($val['id'], null, 'market');
                    $infos[] = $val['name'];
                    $images[] = pb_get_attachmenturl($val['picture'], '', $size);
                }
                $items['url'] = implode("|", $urls);
                $items['info'] = implode("|", $infos);
                $items['image'] = implode("|", $images);
                $return = $items;
            }
            break;
        case "area":
            if (class_exists("Areas")) {
                $area = new Areas();
            } else {
                uses("area");
                $area = new Areas();
            }
            $return = $area->getLevelAreas();
            break;
        case "industry":
            $return = $industry->getCacheIndustry();
            break;
        case "type":
            if (!empty($name)) {
                $name = $obj_controller->pluralize($name);
                $industry->findIt($name);
                $return = $industry->params['data'][1];
                if (isset($multi)) {
                    $return = $obj_controller->flatten_array($return);
                }
                if (empty($var)) {
                    $var = "Items";
                }
            }
            break;
        default:
            $return = cache_read($name, $key);
            break;
    }
    if (!empty($sql)) {
        //replace table prefix
        $pdb->setFetchMode(ADODB_FETCH_ASSOC);
        $sql = str_replace("pb_", $tb_prefix, $sql);
        //for secure
        if (eregi('insert|update|delete|union|into|load_file|outfile|replace', $sql)) {
            trigger_error('no supported sql.');
        }
        //mysql_escape_string()
        $return = $industry->GetArray($sql);
    }
    $smarty->assign($var, $return);
    unset($return, $from, $item);
}
Example #16
0
            <?php 
echo $form->dropDownList($model, 'experience', $this->getExperienceList(), array('class' => 'form-control', 'empty' => 'Select Experience'));
?>
            <?php 
echo $form->error($model, 'experience');
?>
        </div>
    </div>

    <div class="form-group">
        <?php 
echo $form->labelEx($model, 'industry', array('class' => 'col-sm-offset-2 col-sm-2'));
?>
        <div class="col-sm-6">
            <?php 
$list = CHtml::listData(Industries::model()->findAll(array('order' => 'industry')), 'id', 'industry');
?>
            <?php 
echo $form->dropDownList($model, 'industry', $list, array('class' => 'form-control', 'empty' => 'Select Category', 'style' => 'text-transform: capitalize', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('functionalAreas', array('form' => 'User')), 'update' => '#User_functional_area')));
?>
            <?php 
echo $form->error($model, 'industry');
?>
        </div>
    </div>

    <div class="form-group">
        <?php 
echo $form->labelEx($model, 'functional_area', array('class' => 'col-sm-offset-2 col-sm-2'));
?>
        <div class="col-sm-6">
Example #17
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: 2193 $
 */
function smarty_block_industry($params, $content, &$smarty, &$repeat)
{
    $conditions = array();
    $param_count = count($smarty->_tag_stack);
    if (empty($params['name'])) {
        $params['name'] = "industry";
    }
    if (class_exists("Industries")) {
        $industry = new Industries();
        $industry_controller = new Industry();
    } else {
        uses("industry");
        $industry = new Industries();
        $industry_controller = new Industry();
    }
    $conditions[] = "available=1";
    if (isset($params['depth'])) {
        //depth
        if ($params['depth'] == -1) {
            if (!empty($_GET['level']) && !isset($_GET['areaid'])) {
                $conditions['level'] = "level=" . intval($_GET['level']);
            } else {
                $conditions['level'] = "level=1";
            }
        }
    }
    if (!empty($params['typeid'])) {
        $conditions[] = "indusrytype_id=" . $params['typeid'];
    }
    if (!empty($params['id'])) {
        $conditions[] = "id=" . $params['id'];
    }
    if (!empty($params['topid'])) {
        $conditions[] = "top_parentid='" . $params['topid'] . "'";
    }
    if (!empty($params['level'])) {
        $conditions['level'] = "level=" . $params['level'];
    }
    if (!empty($params['parentid'])) {
        $conditions[] = "parent_id='" . $params['parentid'] . "' OR id=" . intval($params['parentid']);
    } elseif (isset($_GET['parentid'])) {
        $i_id = intval($_GET['parentid']);
        $conditions[] = "parent_id='" . $i_id . "' OR id=" . $i_id;
    }
    if (!empty($params['topparentid'])) {
        $conditions[] = "top_parentid='" . $params['topparentid'] . "'";
    }
    if (!empty($params['exclude'])) {
        $conditions[] = "id NOT IN (" . $params['exclude'] . ")";
    }
    if (!empty($params['include'])) {
        $conditions[] = "id IN (" . $params['include'] . ")";
    }
    $orderby = null;
    if (isset($params['orderby'])) {
        $orderby = " ORDER BY " . trim($params['orderby']) . " ";
    } else {
        $orderby = " ORDER BY id DESC";
    }
    $industry->setCondition($conditions);
    $limit = $offset = 0;
    if (isset($params['row'])) {
        $limit = $params['row'];
    }
    if (isset($params['start'])) {
        $offset = $params['start'];
    }
    if (!empty($limit)) {
        $industry->setLimitOffset($offset, $limit);
    } else {
        $industry->limit_offset = 0;
    }
    $sql = "SELECT id,name,level,name as title,alias_name,highlight,url,parent_id FROM {$industry->table_prefix}industries i " . $industry->getCondition() . "{$orderby}" . $industry->getLimitOffset();
    $industry->dbstuff->setFetchMode(ADODB_FETCH_ASSOC);
    if (empty($smarty->blockvars[$param_count])) {
        $smarty->blockvars[$param_count] = $industry->GetArray($sql);
        if (!$smarty->blockvars[$param_count]) {
            return $repeat = false;
        }
    }
    if (!function_exists("smarty_function_the_url")) {
        require "function.the_url.php";
    }
    if (list($key, $item) = each($smarty->blockvars[$param_count])) {
        $repeat = true;
        if (!empty($item['url'])) {
            $url = $item['url'];
        } else {
            $url = smarty_function_the_url(array("module" => "special", "type" => "industry", "id" => $item['id'], "do" => $smarty->_tpl_vars['do']));
        }
        $item['url'] = $url;
        if (isset($params['titlelen'])) {
            $item['title'] = mb_substr(strip_tags($item['title']), 0, $params['titlelen']);
        }
        $item['style'] = parse_highlight($item['highlight']);
        $item['link'] = '<a title="' . $item['name'] . '" href="' . $url . '">' . $item['title'] . '</a>';
        if (isset($_GET['industryid'])) {
            $id = intval($_GET['industryid']);
            if ($id > 0 && $id == $item['id']) {
                $item['child'] = $industry->GetArray("SELECT *,name AS title FROM {$industry->table_prefix}industries WHERE parent_id=" . $id . " AND available=1 ORDER BY display_order ASC");
            }
        }
        $smarty->assign($params['name'], $item);
    } else {
        $repeat = false;
        reset($smarty->blockvars[$param_count]);
    }
    if (!is_null($content)) {
        print $content;
    }
    if (!$repeat) {
        $smarty->blockvars[$param_count] = array();
    }
}
Example #18
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: 2116 $
 */
function smarty_block_offer($params, $content, &$smarty, &$repeat)
{
    global $_PB_CACHE;
    $conditions[] = "t.status='1'";
    $param_count = count($smarty->_tag_stack);
    if (empty($params['name'])) {
        $params['name'] = "offer";
    }
    if (!class_exists("Trades")) {
        uses("trade");
        $trade = new Trades();
        $trade_controller = new Trade();
    } else {
        $trade = new Trades();
        $trade_controller = new Trade();
    }
    if ($_PB_CACHE['setting']['offer_expire_method']) {
        switch ($_PB_CACHE['setting']['offer_expire_method']) {
            case "2":
                $conditions[] = "t.expire_time>" . $trade->timestamp;
                break;
            case "3":
                $conditions[] = "t.expire_time>" . $trade->timestamp;
                break;
            default:
                break;
        }
    }
    if (isset($params['type'])) {
        $type = explode(",", $params['type']);
        $type = array_unique($type);
        foreach ($type as $val) {
            switch ($val) {
                case 'image':
                    $conditions[] = "t.picture!=''";
                    break;
                case 'urgent':
                    $conditions[] = "t.if_urgent='1'";
                    break;
                case 'company':
                    $conditions[] = "t.company_id>0";
                    break;
                case 'commend':
                    $conditions[] = "t.if_commend>0";
                    break;
                default:
                    break;
            }
        }
    }
    if (isset($params['industryid'])) {
        if (isset($params['depth'])) {
            $depth = intval($params['depth']);
            if ($depth) {
                if (class_exists("Industries")) {
                    $industry = new Industries();
                    $industry_controller = new Industry();
                } else {
                    uses("industry");
                    $industry = new Industries();
                    $industry_controller = new Industry();
                }
                $ids_s = $industry->getConditionIds($params['industryid']);
                if (is_array($ids_s)) {
                    $ids_s = array_filter($ids_s);
                    $conditions['industry'] = "t.industry_id IN (" . implode(",", $ids_s) . ")";
                } else {
                    $conditions['industry'] = "t.industry_id='" . $ids_s . "'";
                }
            }
        } else {
            $conditions[] = "t.industry_id = '" . $params['industryid'] . "'";
        }
    }
    if (isset($params['areaid'])) {
        if (isset($params['depth'])) {
            $depth = intval($params['depth']);
            if ($depth) {
                global $industry;
                $ids_s = $industry->getConditionIds($params['areaid']);
                if (is_array($ids_s)) {
                    $ids_s = array_filter($ids_s);
                    $conditions['area'] = "t.area_id IN (" . implode(",", $ids_s) . ")";
                } else {
                    $conditions['area'] = "t.area_id='" . $ids_s . "'";
                }
            }
        } else {
            $conditions['area'] = "t.area_id = '" . $params['areaid'] . "'";
        }
    }
    if (!empty($_GET['industryid'])) {
        $conditions['industry'] = "t.industry_id=" . intval($_GET['industryid']);
    }
    if (!empty($_GET['areaid'])) {
        $conditions['area'] = "t.area_id=" . intval($_GET['areaid']);
    }
    if (isset($params['exclude'])) {
        $conditions[] = $trade->getExcludeIds($params['exclude']);
    }
    if (isset($params['include'])) {
        $conditions[] = $trade->getIncludeIds($params['include']);
    }
    if (isset($params['country_id'])) {
        $conditions[] = "t.country_id='" . $params['country_id'] . "'";
    }
    if (isset($params['expday'])) {
        $conditions[] = "t.expire_time<'" . ($params['expday'] * 86400 + $trade->timestamp) . "'";
    }
    if (isset($params['subday'])) {
        $conditions[] = "t.submit_time>'" . ($trade->timestamp - $params['expireday'] * 86400) . "'";
    }
    if (isset($params['typeid'])) {
        if (!empty($params['typeid'])) {
            if (strpos($params['typeid'], ",") > 0) {
                $tmp_ids = explode(",", $params['typeid']);
                $conditions[] = "t.type_id in ('" . implode("','", $tmp_ids) . "')";
            } else {
                $conditions[] = "t.type_id='" . $params['typeid'] . "'";
            }
        }
    }
    if (isset($params['urgent'])) {
        $conditions[] = "t.if_urgent='1'";
    }
    if (!empty($params['memberid'])) {
        $conditions[] = "t.member_id='" . $params['memberid'] . "'";
    }
    if (!empty($params['companyid'])) {
        $conditions[] = "t.company_id='" . $params['companyid'] . "'";
    }
    if (isset($params['cash'])) {
        $conditions[] = "t.require_point>0";
    }
    $trade->setCondition($conditions);
    $orderby = null;
    $orderby = isset($params['orderby']) ? " ORDER BY " . trim($params['orderby']) . " " : " ORDER BY modified DESC";
    $limit = $offset = 0;
    if (isset($params['row'])) {
        $limit = $params['row'];
    }
    if (isset($params['start'])) {
        $offset = $params['start'];
    }
    if (isset($_GET['pos'])) {
        $offset = intval($_GET['pos']);
    }
    $trade->setLimitOffset($offset, $limit);
    $mysql_limit = $trade->getLimitOffset();
    if (isset($params['limit'])) {
        $mysql_limit = " " . trim($params['limit']);
    }
    if (!$params['recursive']) {
        $sql = "SELECT *,title as name,title as fulltitle,content as fullcontent FROM {$trade->table_prefix}trades t " . $trade->getCondition() . "{$orderby}" . $mysql_limit;
    } else {
        $sql = "SELECT *,content as fullcontent FROM {$trade->table_prefix}trades t " . $trade->getCondition() . " ORDER BY t.display_order ASC,t.id DESC" . $mysql_limit;
    }
    $offer_typenames = $trade_controller->getTradeTypes();
    if (empty($smarty->blockvars[$param_count])) {
        $smarty->blockvars[$param_count] = $trade->GetArray($sql);
        if (!$smarty->blockvars[$param_count]) {
            return $repeat = false;
        }
    }
    if (!function_exists("smarty_function_the_url")) {
        require "function.the_url.php";
    }
    if (list($key, $item) = each($smarty->blockvars[$param_count])) {
        $repeat = true;
        $item['rownum'] = $key;
        $item['iteration'] = ++$key;
        $url = smarty_function_the_url(array("id" => $item['id'], "typeid" => $item['type_id'], "module" => "offer"));
        $item['url'] = $url;
        $item['title'] = strip_tags($item['title']);
        $item['content'] = strip_tags($item['content']);
        if (isset($params['titlelen'])) {
            $item['title'] = mb_substr($item['title'], 0, $params['titlelen']);
        }
        if (isset($params['infolen'])) {
            $item['content'] = mb_substr($item['content'], 0, $params['infolen']);
        }
        if (isset($params['titlestart'])) {
            $item['title'] = $params['titlestart'] . $item['title'];
        }
        $item['pubdate'] = df($item['submit_time']);
        $item['typeid'] = $item['type_id'];
        $item['typename'] = $offer_typenames[$item['type_id']];
        $item['src'] = $item['thumb'] = URL . "attachment/" . $item['picture'] . ".small.jpg";
        $item['link'] = '<a title="' . $item['fulltitle'] . '" href="' . $url . '">' . $item['title'] . '</a>';
        $item['style'] = parse_highlight($item['highlight']);
        $smarty->assign($params['name'], $item);
    } else {
        $repeat = false;
        reset($smarty->blockvars[$param_count]);
    }
    if (!is_null($content)) {
        print $content;
    }
    if (!$repeat) {
        $smarty->blockvars[$param_count] = array();
    }
}
Example #19
0
 *
 *      @version $Revision: 2048 $
 */
define('CURSCRIPT', 'list');
require "../libraries/common.inc.php";
require "../share.inc.php";
uses("trade", "industry", "area", "tradefield", "form");
require CACHE_PATH . 'cache_trusttype.php';
require CACHE_PATH . 'cache_country.php';
require CACHE_PATH . 'cache_membergroup.php';
$area = new Areas();
$offer = new Tradefields();
$trade = new Trades();
$trade_controller = new Trade();
$form = new Forms();
$industry = new Industries();
$conditions = array();
$industry_id = $area_id = 0;
$conditions[] = "t.status=1";
if (isset($_GET['navid'])) {
    setvar("nav_id", intval($_GET['navid']));
}
uses("tag");
$tag = new Tags();
$viewhelper->setTitle(L('offer', 'tpl'));
$viewhelper->setPosition(L('offer', 'tpl'), "offer/");
if (isset($_GET['typeid'])) {
    $type_id = intval($_GET['typeid']);
    $conditions[] = "t.type_id='" . $type_id . "'";
    setvar("typeid", $type_id);
    $trade_controller->setTypeInfo($type_id);