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