当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPExcel::exports方法代码示例

本文整理汇总了PHP中PHPExcel::exports方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel::exports方法的具体用法?PHP PHPExcel::exports怎么用?PHP PHPExcel::exports使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPExcel的用法示例。


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

示例1: index


//.........这里部分代码省略.........
                //pr($_POST);
                //pr($materi);die();
                foreach ($materi as $id => $data) {
                    unset($data['id']);
                    unset($data['id_sekolah']);
                    unset($data['id_pegawai']);
                    unset($data['id_parent']);
                    unset($data['id_pelajaran']);
                    unset($data['semester']);
                    unset($data['id_mengajar']);
                    unset($data['id_kelas']);
                    unset($data['id_pembelajaran']);
                    unset($data['ta']);
                    unset($data['tanggal_kumpul']);
                    //$tgl= $this->auth->tanggal($data['tanggal_diberikan']." 00:00:00");
                    $tglx = $this->auth->tanggal($data['tanggal_buat'] . " 00:00:00");
                    //$data['tanggal_diberikan']=$tgl[2];
                    $data['tanggal_buat'] = $tglx[2];
                    $array[] = $data;
                }
                unset($arrayfirst);
                break;
            case "UTS":
                $header = array(array('Data', 'UTS'), array('Guru Pengajar', $this->session->userdata['user_authentication']['nama']), array('Pelajaran', $_POST['pelajarannya']), array('Kelas', $_POST['kelasnya']), array('Tahun Ajaran', $this->session->userdata['ak_setting']['ta_nama']), array('Semester', $this->session->userdata['ak_setting']['semester_nama']));
                $this->load->model('ad_uts');
                $uts = $this->ad_uts->getUtsByKelasPelajaran($_POST['pelajaran'], $_POST['id_kelas']);
                //pr($_POST);
                //pr($uts);die();
                foreach ($uts as $id => $data) {
                    unset($data['id']);
                    unset($data['id_sekolah']);
                    unset($data['id_pegawai']);
                    unset($data['id_parent']);
                    unset($data['id_pelajaran']);
                    unset($data['semester']);
                    unset($data['id_mengajar']);
                    unset($data['id_kelas']);
                    unset($data['id_pembelajaran']);
                    unset($data['ta']);
                    unset($data['tanggal_kumpul']);
                    //$tgl= $this->auth->tanggal($data['tanggal_diberikan']." 00:00:00");
                    $tglx = $this->auth->tanggal($data['tanggal_buat'] . " 00:00:00");
                    //$data['tanggal_diberikan']=$tgl[2];
                    $data['tanggal_buat'] = $tglx[2];
                    $array[] = $data;
                }
                unset($arrayfirst);
                break;
            case "UAS":
                $header = array(array('Data', 'UAS'), array('Guru Pengajar', $this->session->userdata['user_authentication']['nama']), array('Pelajaran', $_POST['pelajarannya']), array('Kelas', $_POST['kelasnya']), array('Tahun Ajaran', $this->session->userdata['ak_setting']['ta_nama']), array('Semester', $this->session->userdata['ak_setting']['semester_nama']));
                $this->load->model('ad_uas');
                $uts = $this->ad_uas->getUasByKelasPelajaran($_POST['pelajaran'], $_POST['id_kelas']);
                //pr($_POST);
                //pr($uts);die();
                foreach ($uts as $id => $data) {
                    unset($data['id']);
                    unset($data['id_sekolah']);
                    unset($data['id_pegawai']);
                    unset($data['id_parent']);
                    unset($data['id_pelajaran']);
                    unset($data['semester']);
                    unset($data['id_mengajar']);
                    unset($data['id_kelas']);
                    unset($data['id_pembelajaran']);
                    unset($data['ta']);
                    unset($data['tanggal_kumpul']);
                    //$tgl= $this->auth->tanggal($data['tanggal_diberikan']." 00:00:00");
                    $tglx = $this->auth->tanggal($data['tanggal_buat'] . " 00:00:00");
                    //$data['tanggal_diberikan']=$tgl[2];
                    $data['tanggal_buat'] = $tglx[2];
                    $array[] = $data;
                }
                unset($arrayfirst);
                break;
            case "Nilai":
                $header = array(array('Data', $_POST['namanilai']), array('Guru Pengajar', $this->session->userdata['user_authentication']['nama']), array('Pelajaran', $_POST['pelajarannya']), array('Kelas', $_POST['kelasnya']), array('Tahun Ajaran', $this->session->userdata['ak_setting']['ta_nama']), array('Semester', $this->session->userdata['ak_setting']['semester_nama']));
                foreach ($_POST['nama'] as $id => $datax) {
                    $data[$id]['nama'] = $datax;
                    $data[$id]['nis'] = $_POST['nis'][$id];
                    $data[$id]['kelas'] = $_POST['kelas'][$id];
                    $data[$id]['nilai'] = $_POST['nilai'][$id];
                    $array = $data;
                }
                //pr($array);die();
                break;
        }
        /** Include PHPExcel */
        require_once 'application/libraries/PHPExcel.php';
        // Create new PHPExcel object
        $objPHPExcel = new PHPExcel();
        if (!empty($array) && !empty($header)) {
            $objPHPExcel->exports('pertemuan rpp', $array, 'PertemuanPembelajaran', $header);
        } else {
            echo '<script>
				alert("Data kosong");
				window.location="' . base_url() . 'akademik/mainakademik/index";
				window.close();
				</script>';
        }
    }
开发者ID:arjint2004,项目名称:uni912015,代码行数:101,代码来源:export.php


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