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


PHP Spreadsheet_Excel_Reader::rowCount方法代码示例

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


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

示例1: upload

 function upload_excel_file()
 {
     $excel_file = $_FILES['excel_file'];
     $this->directory = PATH . "Excel_File/";
     if ($excel_file['name'] != "") {
         if ($excel_file["type"] == "application/vnd.ms-excel") {
             $excel_file_upload = new upload($excel_file);
             $excel_file_upload->file_overwrite = true;
             $excel_file_upload->file_new_name_body = "student_current_enroll";
             $excel_file_upload->process($this->directory);
             //if ($image_upload->processed) {
             //$this->registered();
             $this->template->setAlert("File was Successfully Uploaded!..", Template::ALERT_SUCCESS);
             $excel_file_upload->clean();
             $filename = "../Excel_File/student_current_enroll.xls";
             if (file_exists($filename)) {
                 $this->template->assign('excel_file', 'true');
             }
             /* inserting into database table */
             $excel_data = new Spreadsheet_Excel_Reader('../Excel_File/student_current_enroll.xls');
             for ($y = 2; $y <= $excel_data->rowCount(); $y++) {
                 $student_id = $excel_data->val($y, A);
                 $lastname = $excel_data->val($y, B);
                 $firstname = $excel_data->val($y, C);
                 $middle_initial = $excel_data->val($y, D);
                 if ($this->registered_student_model->isValid($student_id, $lastname, $firstname) && $this->administrator_model->isValid($student_id, $lastname, $firstname)) {
                     $this->registered_student_model->insert($student_id, $lastname, $firstname, $middle_initial);
                 }
             }
             /* ------------------------------- */
         } else {
             $this->template->setAlert("You can Upload a XLS file only!..", Template::ALERT_ERROR);
         }
     }
 }
开发者ID:bilfspk,项目名称:student-online-clearance-system,代码行数:35,代码来源:index.php


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