日常笔记

复选框和文字对齐:

PHP 导出Excel

//加载phpexcel类
        $this->load->library('PHPExcel');
        //加载IOF类型
        $this ->load ->library('PHPExcel/IOFactory');
        $objPHPExcel = new PHPExcel();
        $objPHPExcel->getProperties()-> setTitle("export") -> setDescription("none");
        $objPHPExcel -> setActiveSheetIndex(0);
        //遍历excel列名
        $col = 0;
        foreach($items as $K=>$V){
            $objPHPExcel -> getActiveSheet() -> setCellValueByColumnAndRow($col, 1,$V);
            $col++;
        }
        //遍历数据
        $row = 2;
        foreach($getResult as $K=>$V){
            $col = 0;
            foreach($items as $sk=>$sv){
                $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,$V[$sk]);
                $col++;
            }
            $row++;
        }
        $objPHPExcel -> setActiveSheetIndex(0);
        $objWriter = IOFactory :: createWriter($objPHPExcel, 'Excel5');

        header('Content-Type:application/vnd.ms-excel');
        header('Content-Disposition:attachment;filename="orderdate_' . date('Y-m-d') . '.xls"');
        header('Cache-Control:max-age=0');
        $objWriter -> save('php://output');

前端CSS角标:

.jiaobiao{
	border-radius:4px;
	padding:2px 8px;
	vertical-align:super;
	background-color:#006633;
	font-size: 12px;
	color: #FFFFFF;
}
1
DIV span里都可以放~


PHPajax报错:

Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version.
打开PHP.ini

修改下列选项,要是未打开,给打开;

always_populate_raw_post_data = -1
小乌龟GIT,不显示角标设置这个就可以了(windows10下,通过~其他系统没测)
日常笔记_第1张图片


你可能感兴趣的:(记事本)