1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- /**
- * Created by PhpStorm.
- * User: lionared
- * Date: 2018/3/15
- * Time: 上午11:18
- */
- defined('InShopNC') or exit('Access Invalid!');
- require_once(BASE_ROOT_PATH . '/helper/car/importer.php');
- class car_importControl extends SystemControl {
- public function __construct(){
- parent::__construct();
- }
- public function indexOp()
- {
- if(isset($_POST['import'])) {
- $file = $_FILES['csv_cars'];
- $file_type = substr(strstr($file['name'], '.'), 1);
- //上传文件存在判断
- if(empty($file['name'])){
- showMessage('请选择要上传csv的文件!','','html','error');
- }
- // 检查文件格式
- if ($file_type != 'csv') {
- showMessage('文件格式不对,请重新上传!','','html','error');
- exit;
- }
- $delimiter = trim($_POST['delimiter']);
- $importer = new car\importer($delimiter);
- //暂时屏蔽车型数据导入
- //$importer->run($file['tmp_name']);
- showMessage('操作完成,暂未开放' , urlAdmin('car_import', 'index'));
- return;
- }
- Tpl::showpage('car_import.index');
- }
- }
|