当前位置: 首页>>代码示例>>PHP>>正文


PHP get_suppliers_list函数代码示例

本文整理汇总了PHP中get_suppliers_list函数的典型用法代码示例。如果您正苦于以下问题:PHP get_suppliers_list函数的具体用法?PHP get_suppliers_list怎么用?PHP get_suppliers_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_suppliers_list函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

	if(isset($_GET['sotring'])){
		    if($_GET['sotring'] == 'by_alphabet')$order = array ('nickName','ASC');
			if($_GET['sotring'] == 'by_creating_date')$order = array ('id','ASC');
	}
	elseif(isset($_POST['search_client'])) $order = array ('search',$_POST['search_client']);
	else $order =  array('nickName','ASC');
	
		
	$filters = array();
	if(isset($_GET['filter_by_rating']) && $_GET['filter_by_rating']) $filters[] = array ('type' =>'by_rating','val' => $_GET['filter_by_rating']);
	if(isset($_GET['filter_by_letter']) && $_GET['filter_by_letter']) $filters[] = array ('type' =>'by_letter','col' =>'nickName','val' => $_GET['filter_by_letter']);
	if(isset($_GET['filter_by_profies']) && $_GET['filter_by_profies']) $filters[] = array ('type' =>'by_profies','val' => $_GET['filter_by_profies']);
	
	$range = isset($_GET['filter_by_cities'])? array ('by' =>'cities','val' => $_GET['filter_by_cities']):false;
	
	$suppliers_data = get_suppliers_list($range,$order,$filters,$search,false/*$limit_str*/);
	/*echo '<pre>';
	print_r($suppliers_data);
	echo '</pre>';*/
	
	$file_prefix = ($curViewType == 'ordinary' || $curViewType == 'short')? 'ordinary':$curViewType;
	//$tpl_name = './skins/tpl/clients/client_list/'.$curViewType.'_row.tpl';
    $tpl_name = './skins/tpl/suppliers/suppliers_list/'.$file_prefix.'_row.tpl';
	$fd = fopen($tpl_name,'r');
	$tpl = fread($fd,filesize($tpl_name));
	fclose($fd);
	
	ob_start();	
	
	if(is_array($suppliers_data)){
	
开发者ID:apelburg,项目名称:test,代码行数:30,代码来源:suppliers_list_controller.php

示例2: delivery_list

/**
 *  获取发货单列表信息
 *
 * @access  public
 * @param
 *
 * @return void
 */
function delivery_list()
{
    $result = get_filter();
    if ($result === false) {
        $aiax = isset($_GET['is_ajax']) ? $_GET['is_ajax'] : 0;
        /* 过滤信息 */
        $filter['delivery_sn'] = empty($_REQUEST['delivery_sn']) ? '' : trim($_REQUEST['delivery_sn']);
        $filter['order_sn'] = empty($_REQUEST['order_sn']) ? '' : trim($_REQUEST['order_sn']);
        $filter['order_id'] = empty($_REQUEST['order_id']) ? 0 : intval($_REQUEST['order_id']);
        if ($aiax == 1 && !empty($_REQUEST['consignee'])) {
            $_REQUEST['consignee'] = json_str_iconv($_REQUEST['consignee']);
        }
        $filter['consignee'] = empty($_REQUEST['consignee']) ? '' : trim($_REQUEST['consignee']);
        $filter['status'] = isset($_REQUEST['status']) ? $_REQUEST['status'] : -1;
        $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'update_time' : trim($_REQUEST['sort_by']);
        $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
        $where = 'WHERE 1 ';
        if ($filter['order_sn']) {
            $where .= " AND order_sn LIKE '%" . mysql_like_quote($filter['order_sn']) . "%'";
        }
        if ($filter['consignee']) {
            $where .= " AND consignee LIKE '%" . mysql_like_quote($filter['consignee']) . "%'";
        }
        if ($filter['status'] >= 0) {
            $where .= " AND status = '" . mysql_like_quote($filter['status']) . "'";
        }
        if ($filter['delivery_sn']) {
            $where .= " AND delivery_sn LIKE '%" . mysql_like_quote($filter['delivery_sn']) . "%'";
        }
        /* 获取管理员信息 */
        $admin_info = admin_info();
        /* 如果管理员属于某个办事处,只列出这个办事处管辖的发货单 */
        if ($admin_info['agency_id'] > 0) {
            $where .= " AND agency_id = '" . $admin_info['agency_id'] . "' ";
        }
        /* 如果管理员属于某个供货商,只列出这个供货商的发货单 */
        if ($admin_info['suppliers_id'] > 0) {
            $where .= " AND suppliers_id = '" . $admin_info['suppliers_id'] . "' ";
        }
        /* 分页大小 */
        $filter['page'] = empty($_REQUEST['page']) || intval($_REQUEST['page']) <= 0 ? 1 : intval($_REQUEST['page']);
        if (isset($_REQUEST['page_size']) && intval($_REQUEST['page_size']) > 0) {
            $filter['page_size'] = intval($_REQUEST['page_size']);
        } elseif (isset($_COOKIE['ECSCP']['page_size']) && intval($_COOKIE['ECSCP']['page_size']) > 0) {
            $filter['page_size'] = intval($_COOKIE['ECSCP']['page_size']);
        } else {
            $filter['page_size'] = 15;
        }
        /* 记录总数 */
        $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('delivery_order') . $where;
        $filter['record_count'] = $GLOBALS['db']->getOne($sql);
        $filter['page_count'] = $filter['record_count'] > 0 ? ceil($filter['record_count'] / $filter['page_size']) : 1;
        /* 查询 */
        $sql = "SELECT delivery_id, delivery_sn, order_sn, order_id, add_time, action_user, consignee, country,\n                       province, city, district, tel, status, update_time, email, suppliers_id\n                FROM " . $GLOBALS['ecs']->table("delivery_order") . "\n                {$where}\n                ORDER BY " . $filter['sort_by'] . " " . $filter['sort_order'] . "\n                LIMIT " . ($filter['page'] - 1) * $filter['page_size'] . ", " . $filter['page_size'] . " ";
        set_filter($filter, $sql);
    } else {
        $sql = $result['sql'];
        $filter = $result['filter'];
    }
    /* 获取供货商列表 */
    $suppliers_list = get_suppliers_list();
    $_suppliers_list = array();
    foreach ($suppliers_list as $value) {
        $_suppliers_list[$value['suppliers_id']] = $value['suppliers_name'];
    }
    $row = $GLOBALS['db']->getAll($sql);
    /* 格式化数据 */
    foreach ($row as $key => $value) {
        $row[$key]['add_time'] = local_date($GLOBALS['_CFG']['time_format'], $value['add_time']);
        $row[$key]['update_time'] = local_date($GLOBALS['_CFG']['time_format'], $value['update_time']);
        if ($value['status'] == 1) {
            $row[$key]['status_name'] = $GLOBALS['_LANG']['delivery_status'][1];
        } elseif ($value['status'] == 2) {
            $row[$key]['status_name'] = $GLOBALS['_LANG']['delivery_status'][2];
        } else {
            $row[$key]['status_name'] = $GLOBALS['_LANG']['delivery_status'][0];
        }
        $row[$key]['suppliers_name'] = isset($_suppliers_list[$value['suppliers_id']]) ? $_suppliers_list[$value['suppliers_id']] : '';
    }
    $arr = array('delivery' => $row, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
    return $arr;
}
开发者ID:norain2050,项目名称:benhu,代码行数:90,代码来源:order.php

示例3: delivery_list


//.........这里部分代码省略.........
                $where .= " AND o.store_id = '" . $filter['sid'] . "' ";
            }
        }
        //获取当前管理员负责的store_id列表
        if ($search) {
            //如果是查看自己的订单,就获取仓库列表
            $storeid_list = "";
            if ($_SESSION['action_list'] == 'all') {
                //自营超级管理员,可以查看所有
                $sql2 = "select store_id from " . $GLOBALS['ecs']->table('store_main') . " where supplier_id=0 and parent_id > 0";
                $res2 = $GLOBALS['db']->query($sql2);
                while ($row2 = $GLOBALS['db']->fetchRow($res2)) {
                    $storeid_list .= $storeid_list ? " or " : "";
                    $storeid_list .= " sub_id like '%|" . $row2['store_id'] . "|%' ";
                }
            } else {
                $sql1 = "select store_id from " . $GLOBALS['ecs']->table('store_adminer') . " where supplier_id=0 and admin_id = " . $_SESSION['admin_id'];
                $res1 = $GLOBALS['db']->query($sql1);
                while ($row1 = $GLOBALS['db']->fetchRow($res1)) {
                    $storeid_list .= $storeid_list ? " or " : "";
                    $storeid_list .= " sub_id like '%|" . $row1['store_id'] . "|%' ";
                    $sql2 = "select store_id from " . $GLOBALS['ecs']->table('store_main') . " where supplier_id=0 and parent_id = '{$row1['store_id']}' ";
                    $res2 = $GLOBALS['db']->query($sql2);
                    while ($row2 = $GLOBALS['db']->fetchRow($res2)) {
                        $storeid_list .= $storeid_list ? " or " : "";
                        $storeid_list .= " sub_id like '%|" . $row2['store_id'] . "|%' ";
                    }
                }
            }
            if ($storeid_list) {
                $where .= " AND  ({$storeid_list}) ";
            }
        }
        /* 代码增加_end   By morestock_morecity */
        if ($filter['order_sn']) {
            $where .= " AND do.order_sn LIKE '%" . mysql_like_quote($filter['order_sn']) . "%'";
        }
        if ($filter['consignee']) {
            $where .= " AND do.consignee LIKE '%" . mysql_like_quote($filter['consignee']) . "%'";
        }
        if ($filter['status'] >= 0) {
            $where .= " AND do.status = '" . mysql_like_quote($filter['status']) . "'";
        }
        if ($filter['delivery_sn']) {
            $where .= " AND do.delivery_sn LIKE '%" . mysql_like_quote($filter['delivery_sn']) . "%'";
        }
        /* 获取管理员信息 */
        $admin_info = admin_info();
        /* 如果管理员属于某个办事处,只列出这个办事处管辖的发货单 */
        if ($admin_info['agency_id'] > 0) {
            $where .= " AND do.agency_id = '" . $admin_info['agency_id'] . "' ";
        }
        /* 如果管理员属于某个供货商,只列出这个供货商的发货单 */
        if ($admin_info['suppliers_id'] > 0) {
            $where .= " AND do.suppliers_id = '" . $admin_info['suppliers_id'] . "' ";
        }
        /* 分页大小 */
        $filter['page'] = empty($_REQUEST['page']) || intval($_REQUEST['page']) <= 0 ? 1 : intval($_REQUEST['page']);
        if (isset($_REQUEST['page_size']) && intval($_REQUEST['page_size']) > 0) {
            $filter['page_size'] = intval($_REQUEST['page_size']);
        } elseif (isset($_COOKIE['ECSCP']['page_size']) && intval($_COOKIE['ECSCP']['page_size']) > 0) {
            $filter['page_size'] = intval($_COOKIE['ECSCP']['page_size']);
        } else {
            $filter['page_size'] = 15;
        }
        $where .= " AND do.order_id=o.order_id ";
        /* 记录总数 */
        $sql = "SELECT COUNT(do.delivery_id) FROM " . $GLOBALS['ecs']->table('delivery_order') . " as do," . $GLOBALS['ecs']->table('order_info') . " as o " . $where;
        $filter['record_count'] = $GLOBALS['db']->getOne($sql);
        $filter['page_count'] = $filter['record_count'] > 0 ? ceil($filter['record_count'] / $filter['page_size']) : 1;
        /* 查询 */
        $sql = "SELECT do.delivery_id, do.delivery_sn, do.order_sn, do.order_id, do.add_time, do.action_user, do.consignee, do.country,\n                       do.province, do.city, do.district, do.tel, do.status, do.update_time, do.email, do.suppliers_id\n                FROM " . $GLOBALS['ecs']->table("delivery_order") . "as do," . $GLOBALS['ecs']->table("order_info") . " as o  \n                {$where} \n                ORDER BY " . $filter['sort_by'] . " " . $filter['sort_order'] . "\n                LIMIT " . ($filter['page'] - 1) * $filter['page_size'] . ", " . $filter['page_size'] . " ";
        set_filter($filter, $sql);
    } else {
        $sql = $result['sql'];
        $filter = $result['filter'];
    }
    /* 获取供货商列表 */
    $suppliers_list = get_suppliers_list();
    $_suppliers_list = array();
    foreach ($suppliers_list as $value) {
        $_suppliers_list[$value['suppliers_id']] = $value['suppliers_name'];
    }
    $row = $GLOBALS['db']->getAll($sql);
    /* 格式化数据 */
    foreach ($row as $key => $value) {
        $row[$key]['add_time'] = local_date($GLOBALS['_CFG']['time_format'], $value['add_time']);
        $row[$key]['update_time'] = local_date($GLOBALS['_CFG']['time_format'], $value['update_time']);
        if ($value['status'] == 1) {
            $row[$key]['status_name'] = $GLOBALS['_LANG']['delivery_status'][1];
        } elseif ($value['status'] == 2) {
            $row[$key]['status_name'] = $GLOBALS['_LANG']['delivery_status'][2];
        } else {
            $row[$key]['status_name'] = $GLOBALS['_LANG']['delivery_status'][0];
        }
        $row[$key]['suppliers_name'] = isset($_suppliers_list[$value['suppliers_id']]) ? $_suppliers_list[$value['suppliers_id']] : '';
    }
    $arr = array('delivery' => $row, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
    return $arr;
}
开发者ID:moonlight-wang,项目名称:feilun,代码行数:101,代码来源:order.php


注:本文中的get_suppliers_list函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。