Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 一般输入/输出错误?如何解决当excel工作表出现问题?_Php_Yii Extensions - Fatal编程技术网

Php 一般输入/输出错误?如何解决当excel工作表出现问题?

Php 一般输入/输出错误?如何解决当excel工作表出现问题?,php,yii-extensions,Php,Yii Extensions,在控制器中: Yii::import('application.extensions.phpexcel1.JPhpExcel'); $xls = new JPhpExcel('UTF-8', false, 'My Test Sheet'); $xls->addArray($sheet_generation); $xls->generateXML('my-test'); 在模型中:- $get_user_info=$model->userInfo(); ##

在控制器中:

Yii::import('application.extensions.phpexcel1.JPhpExcel');

$xls = new JPhpExcel('UTF-8', false, 'My Test Sheet');

$xls->addArray($sheet_generation);

$xls->generateXML('my-test');
在模型中:-

 $get_user_info=$model->userInfo();

     ######  Sheet generation
     $sheet_generation=$model->sheetInfo($get_user_info,$month,$year);

怎么了?在哪里?当我打开excel工作表时,它会显示错误我不知道错误的位置你能在记事本中打开生成的excel文件,看看里面是什么吗?文件的大小是多少?记事本中不显示任何内容。
public function sheetInfo($user_info,$sel_month,$sel_year)
    {

      $cnt=0;

      foreach($user_info as $key => $line) {

      $cnt=$cnt+1;
                        $linearr = $line;


                        //$linearr['heading']='';

                        //$linearr['imagess']='';


                        //array_push($linearr, "apple", "raspberry");
                        //print_r($linearr); exit;

                        $p=$line['Place'];
                        $place=Sheet::getWorkin($p);
                        $userid=$line['id'];

                        // Total present days

                        $no_days=Sheet::getPresent($userid,$sel_month,$sel_year);

                        $disti=$line['Designation'];
                        //designation names...............
                        $designation=Sheet::detDesignationName($disti);
                        /// Department name display..............
                        $d=$line['Department']; 
                        $depart=Sheet:: getDepartmantName($d);
                        // Holiday
                        $holiday=Sheet::getHolidayDat($sel_month,$sel_year);
                        $approval=2;
                        $leave_count=Sheet::getLeaveCount($userid,$sel_month,$sel_year,$approval);
                        ###### sunday leave count 
                        $sunday=Sheet::sunday_count($sel_month,$sel_year);
                        ########saturday count
                        $sat_count=Sheet::saturday_count($sel_month,$sel_year);
                        $sat_sunday_count=Sheet::weekday_count($userid,$sel_month,$sel_year);

                        //$heading="Attendance Report January 2014";

                        //$linearr['heading']=Yii::app()->theme->baseUrl/images/."favicon.ico";
                        //$linearr['Sno']=$cnt;
                        $linearr['Place']=$place;
                        $linearr['Designation'] =$designation;
                        $linearr['Department'] =$depart;
                        $sum_present=$sum_present+$no_days; // sum of present days....................
                        $linearr['present'] =$no_days;
                        $linearr['holiday'] =$holiday;
                        $linearr['leave'] =$leave_count;
                        $linearr['weekoffice'] =$sat_sunday_count;
                        $linearr['lop'] =0;

                        $resarr[] = $linearr;
            }
            //print_r($resarr); exit;
            return $resarr;


    }