批量导出用户信息
2016-07-07 15:21 来源:www.chinab4c.com 作者:ecshop专家
批量导出用户信息,只导出一行数据,不知道是怎么回事,已下是我的代码。 <?php define('IN_ECS', true); include ('includes/init.php'); $filename='excel_export'; header("Content-type: application/vnd.ms-excel; charset=utf-8"); header("Content-Disposition: attachment; filename=$filename.xls"); $sql="SELECT `user_id` , `email` , `user_name` , `office_phone` , `home_phone` , `mobile_phone` FROM `ecs_users` "; $res=$db->getAll($sql); $data1.='用户编号'."\t"; $data1.='用户邮箱'."\t"; $data1.='用户名称'."\t"; $data1.='用户办公电话'."\t"; $data1.='用户家电话'."\t"; $data1.='用户手机'."\t\n"; foreach ($res as $keys=>$vars) { $res1[$key]['user_id']=$vars['user_id']; $res1[$key]['email']=$vars['email']; $res1[$key]['user_name']=$vars['user_name']; $res1[$key]['office_phone']=$vars['office_phone']; $res1[$key]['home_phone']=$vars['home_phone']; $res1[$key]['mobile_phone']=$vars['mobile_phone']; unset ($res[$keys]); } foreach ($res1 as $key =>$var) { $data.=$var['user_id']."\t"; $data.=$var['email']."\t"; $data.=$var['user_name']."\t"; $data.=$var['office_phone']."\t"; $data.=$var['home_phone']."\t"; $data.=$var['mobile_phone']."\t"; $data.="\t\n"; } if (EC_CHARSET != 'gbk') { echo $data1.ecs_iconv(EC_CHARSET, 'gbk', $data) . "\t"; } else { echo $data1.$data. "\t"; } ?> |
回答:
不错。好想法。支持一个 |
那麻烦修改一下啊。。。。没出来呢 |
呵呵,麻烦修改一下啊, |
最近更新
常用插件
- ecshop快递发货单打印商品
ecshop快递发货单打印商品信息,大家都知道ecshop快递单打印的时候,只能...
- ecshop二次开发售后维修卡
插件介绍: 本插件是用于专门从事电子,信息,软件等售后服务关键比...
- ecshop按分类筛选销售排行
ecshop按分类筛选销售排行...
- ecshop供应商插件免费下载
ecshop供应商插件免费下载...
- ecshop选择下单时间插件
ecshop选择下单时间插件主要是根据不同的下单配送要求,在ecshop购物车...
ecshop热门问答
ecshop热门资料
ecshop实惠
ecshop重新
ecshop用户名缩写
ecshoppassword
ecshop订单打印
伪静态
ecshoputf8
ecshoplogin
ecshopnormal
ecshop商品属性筛选
ecshop524
ecshop模式
ecshop1106
zen cart下架商品
centos
ecshopIE8
ecshopmod
ecshop360浏览器
ecshop储值卡
ecshop商户
ecshop常量
ecshopparseJSON
ecshop底部
ecshopinclude
ecshop搞活动设置
ecshop追踪
ecshopmagiczoom
ecshop翻倍
ecshop网站迁移
ecshop查看网店