本文整理汇总了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);
}
}
}