• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_attr_list函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sys_msg

        $link[0]['href'] = 'category.php?act=add';
        $link[1]['text'] = $_LANG['back_list'];
        $link[1]['href'] = 'category.php?act=list';
        sys_msg($_LANG['catadd_succed'], 0, $link);
    }
}
/*------------------------------------------------------ */
//-- 编辑商品分类信息
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'edit') {
    admin_priv('cat_manage');
    // 权限检查
    $cat_id = intval($_REQUEST['cat_id']);
    $cat_info = get_cat_info($cat_id);
    // 查询分类信息数据
    $attr_list = get_attr_list();
    $filter_attr_list = array();
    if ($cat_info['filter_attr']) {
        $filter_attr = explode(",", $cat_info['filter_attr']);
        //把多个筛选属性放到数组中
        foreach ($filter_attr as $k => $v) {
            $attr_cat_id = $db->getOne("SELECT cat_id FROM " . $ecs->table('attribute') . " WHERE attr_id = '" . intval($v) . "'");
            $filter_attr_list[$k]['goods_type_list'] = goods_type_list($attr_cat_id);
            //取得每个属性的商品类型
            $filter_attr_list[$k]['filter_attr'] = $v;
            $attr_option = array();
            foreach ($attr_list[$attr_cat_id] as $val) {
                $attr_option[key($val)] = current($val);
            }
            $filter_attr_list[$k]['option'] = $attr_option;
        }
开发者ID:GYWang1983,项目名称:fruit,代码行数:31,代码来源:category.php


示例2: build_attr_html

/**
 * 根据属性数组创建属性的表单
 *
 * @access  public
 * @param   int     $cat_id     分类编号
 * @param   int     $goods_id   商品编号
 * @return  string
 */
function build_attr_html($cat_id, $goods_id = 0, $bar_code = 0)
{
    $attr = get_attr_list($cat_id, $goods_id);
    $html = '<table width="100%" id="attrTable">';
    $spec = 0;
    foreach ($attr as $key => $val) {
        $html .= "<tr><td class='label'>";
        if ($val['attr_type'] == 1 || $val['attr_type'] == 2) {
            $html .= $spec != $val['attr_id'] ? "<a href='javascript:;' onclick='addSpec(this)'>[+]</a>" : "<a href='javascript:;' onclick='removeSpec(this)'>[-]</a>";
            $spec = $val['attr_id'];
        }
        $html .= "{$val['attr_name']}</td><td><input type='hidden' name='attr_id_list[]' value='{$val['attr_id']}' txm='{$val['attr_txm']}' class='ctxm_{$val['attr_txm']}' />";
        if ($val['attr_input_type'] == 0) {
            $html .= '<input name="attr_value_list[]" type="text" value="' . htmlspecialchars($val['attr_value']) . '" size="40" /> ';
        } elseif ($val['attr_input_type'] == 2) {
            $html .= '<textarea name="attr_value_list[]" rows="3" cols="40">' . htmlspecialchars($val['attr_value']) . '</textarea>';
        } else {
            /*
             *
             *
             *
             *条形码点击事件开始
             */
            if ($val[attr_txm] > 0) {
                $html .= '<select class=attr_num_' . $val[attr_id] . ' name="attr_value_list[]" onchange="getType(' . $val[attr_txm] . ',' . $cat_id . ',' . $this . value . ',' . $goods_id . ')">';
            } else {
                $html .= '<select class=attr_num_' . $val[attr_id] . ' name="attr_value_list[]" >';
            }
            /*条形码点击事件结束*/
            $html .= '<option value="">' . $GLOBALS['_LANG']['select_please'] . '</option>';
            $attr_values = explode("\n", $val['attr_values']);
            foreach ($attr_values as $opt) {
                $opt = trim(htmlspecialchars($opt));
                $html .= $val['attr_value'] != $opt ? '<option value="' . $opt . '">' . $opt . '</option>' : '<option value="' . $opt . '" selected="selected">' . $opt . '</option>';
            }
            $html .= '</select> ';
        }
        $html .= $val['attr_type'] == 1 || $val['attr_type'] == 2 ? $GLOBALS['_LANG']['spec_price'] . ' <input type="text" name="attr_price_list[]" value="' . $val['attr_price'] . '" size="5" maxlength="10" />' : ' <input type="hidden" name="attr_price_list[]" value="0" />';
        $html .= '</td></tr>';
    }
    /*
     *
     *702460594
     *
     *条形码的显示开始
     *
     */
    if ($bar_code) {
        $html .= '<table id="input" width="100%"  ><tbody>';
        foreach ($bar_code as $value) {
            $html .= '<tr><td class="label">条形码</td><td><input type="hidden" name="txm_shu[]" value=' . $value['taypes'] . '>' . $value['taypes'] . '<td/><td><input type="text" name="tiaoxingm[]" value=' . $value['bar_code'] . '></td></tr>';
        }
        $html .= '</table >';
    }
    $html .= '<table id="input"  width="100%" ></table >';
    /*条形码显示结束*/
    $html .= '</table>';
    return $html;
}
开发者ID:moonlight-wang,项目名称:feilun,代码行数:67,代码来源:lib_goods.php


示例3: build_attr_html

/**
 * 根据属性数组创建属性的表单
 *
 * @access  public
 * @param   int     $cat_id     分类编号
 * @param   int     $goods_id   商品编号
 * @return  string
 */
function build_attr_html($cat_id, $goods_id = 0)
{
    $attr = get_attr_list($cat_id, $goods_id);
    $html = '<table width="100%" id="attrTable">';
    $spec = 0;
    foreach ($attr as $key => $val) {
        $html .= "<tr><td class='label'>";
        if ($val['attr_type'] == 1 || $val['attr_type'] == 2) {
            $html .= $spec != $val['attr_id'] ? "<a href='javascript:;' onclick='addSpec(this)'>[+]</a>" : "<a href='javascript:;' onclick='removeSpec(this)'>[-]</a>";
            $spec = $val['attr_id'];
        }
        $html .= "{$val['attr_name']}</td><td><input type='hidden' name='attr_id_list[]' value='{$val['attr_id']}' />";
        if ($val['attr_input_type'] == 0) {
            $html .= '<input name="attr_value_list[]" type="text" value="' . htmlspecialchars($val['attr_value']) . '" size="40" /> ';
        } elseif ($val['attr_input_type'] == 2) {
            $html .= '<textarea name="attr_value_list[]" rows="3" cols="40">' . htmlspecialchars($val['attr_value']) . '</textarea>';
        } else {
            $html .= '<select name="attr_value_list[]">';
            $html .= '<option value="">' . $GLOBALS['_LANG']['select_please'] . '</option>';
            $attr_values = explode("\n", $val['attr_values']);
            foreach ($attr_values as $opt) {
                $opt = trim(htmlspecialchars($opt));
                $html .= $val['attr_value'] != $opt ? '<option value="' . $opt . '">' . $opt . '</option>' : '<option value="' . $opt . '" selected="selected">' . $opt . '</option>';
            }
            $html .= '</select> ';
        }
        $html .= $val['attr_type'] == 1 || $val['attr_type'] == 2 ? $GLOBALS['_LANG']['spec_price'] . ' <input type="text" name="attr_price_list[]" value="' . $val['attr_price'] . '" size="5" maxlength="10" />' : ' <input type="hidden" name="attr_price_list[]" value="0" />';
        $html .= '</td></tr>';
    }
    $html .= '</table>';
    return $html;
}
开发者ID:jz233,项目名称:TheProject,代码行数:40,代码来源:lib_goods.php


示例4: build_attr_html

/**
 * 根据属性数组创建属性的表单
 *
 * @access  public
 * @param   int     $cat_id     分类编号
 * @param   int     $goods_id   商品编号
 * @return  string
 */
function build_attr_html($cat_id, $goods_id = 0)
{
    $attr = get_attr_list($cat_id, $goods_id);
    $html = '<table width="100%" id="attrTable">';
    $spec = 0;
    foreach ($attr as $key => $val) {
        $html .= "<tr><td class='label'>";
        if ($val['attr_type'] == 1 || $val['attr_type'] == 2) {
            $html .= $spec != $val['attr_id'] ? "<a href='javascript:;' onclick='addSpec(this)'>[+]</a>" : "<a href='javascript:;' onclick='removeSpec(this)'>[-]</a>";
            $spec = $val['attr_id'];
        }
        /*模板堂修改 start by zhouH*/
        $html .= "{$val['attr_name']}</td><td><input type='hidden' name='attr_id_list[]' value='{$val['attr_id']}' /><input type='hidden' name='attr_img_id[]' value='" . $val['img_id'] . "' />";
        /*模板堂修改 end by zhouH*/
        if ($val['attr_input_type'] == 0) {
            $html .= '<input name="attr_value_list[]" type="text" value="' . htmlspecialchars($val['attr_value']) . '" size="40" /> ';
        } elseif ($val['attr_input_type'] == 2) {
            $html .= '<textarea name="attr_value_list[]" rows="3" cols="40">' . htmlspecialchars($val['attr_value']) . '</textarea>';
        } else {
            $html .= '<select name="attr_value_list[]">';
            $html .= '<option value="">' . $GLOBALS['_LANG']['select_please'] . '</option>';
            $attr_values = explode("\n", $val['attr_values']);
            foreach ($attr_values as $opt) {
                $opt = trim(htmlspecialchars($opt));
                $html .= $val['attr_value'] != $opt ? '<option value="' . $opt . '">' . $opt . '</option>' : '<option value="' . $opt . '" selected="selected">' . $opt . '</option>';
            }
            $html .= '</select> ';
        }
        /*模板堂修改 start by zhouH*/
        $sql = 'SELECT is_show_img FROM ' . $GLOBALS['ecs']->table('attribute') . ' WHERE attr_id = ' . $val['attr_id'];
        $is_show_img = $GLOBALS['db']->getOne($sql);
        if ($is_show_img == 1) {
            $html .= $val['attr_type'] == 1 || $val['attr_type'] == 2 ? $GLOBALS['_LANG']['spec_price'] . ' <input type="text" name="attr_price_list[]" value="' . $val['attr_price'] . '" size="5" maxlength="10" /> <input type="button" value="选择属性图片" class="button"onclick="show_goods_gallery(' . $goods_id . ',this);">' : ' <input type="hidden" name="attr_price_list[]" value="0" />';
        } else {
            $html .= $val['attr_type'] == 1 || $val['attr_type'] == 2 ? $GLOBALS['_LANG']['spec_price'] . ' <input type="text" name="attr_price_list[]" value="' . $val['attr_price'] . '" size="5" maxlength="10" />' : ' <input type="hidden" name="attr_price_list[]" value="0" />';
        }
        /*模板堂修改 end by zhouH*/
        $html .= '</td></tr>';
    }
    $html .= '</table>';
    return $html;
}
开发者ID:ChanHarold,项目名称:ecshop,代码行数:50,代码来源:lib_goods.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_audience_sql_query函数代码示例发布时间:2022-05-15
下一篇:
PHP get_attachment_template函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap