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


PHP Spreadsheet_Excel_Reader::dump方法代码示例

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


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

示例1: excelreader

 public function excelreader()
 {
     $this->load->library('Spreadsheet_Excel_Reader.php');
     $data = new Spreadsheet_Excel_Reader("./data/example01.xls");
     //	$data = json_decode('{$data}',true);
     echo $data->dump(true, true);
 }
开发者ID:biao0102,项目名称:local_gwadmin,代码行数:7,代码来源:mylib.php

示例2: showFormat

 public function showFormat()
 {
     //get the link of the file
     $file = new Files($this->formatfile_id);
     $path = $file->fileWithPath();
     if (preg_match("/xlsx\$/", $file->originalname) != 0) {
         Yii::import('application.vendors.simplexlsx.*');
         $xlsx = new SimpleXLSX($excelfile);
         return $xlsx->dump();
     } else {
         if (preg_match("/xls\$/", $file->originalname) != 0) {
             Yii::import('application.vendors.php-excel-reader.*');
             $xls = new Spreadsheet_Excel_Reader($excelfile);
             return $xls->dump();
         }
     }
 }
开发者ID:ranvirp,项目名称:rdp,代码行数:17,代码来源:Formats.php

示例3: integrationExcel

 public function integrationExcel()
 {
     $controller = $this->config();
     echo "<br />Excel Spreadsheet<br/>";
     echo $spreadsheet = $controller->buildExcelTable(1, 1, 1, 1, 1, 1, array(1989, 1992));
     $data = new Spreadsheet_Excel_Reader($spreadsheet);
     echo $data->dump(true, true);
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:8,代码来源:ReportIntegrationTest.php

示例4: actionLogin

 /**
  * Displays the login page
  */
 public function actionLogin()
 {
     $data = new Spreadsheet_Excel_Reader("example.xls");
     echo $data->dump(true, true);
     $model = new LoginForm();
     // if it is ajax validation request
     if (isset($_POST['ajax']) && $_POST['ajax'] === 'login-form') {
         echo CActiveForm::validate($model);
         Yii::app()->end();
     }
     // collect user input data
     if (isset($_POST['LoginForm'])) {
         $model->attributes = $_POST['LoginForm'];
         // validate user input and redirect to the previous page if valid
         if ($model->validate() && $model->login()) {
             $this->redirect(Yii::app()->user->returnUrl);
         }
     }
     // display the login form
     $this->render('login', array('model' => $model));
 }
开发者ID:anasswoow,项目名称:coba,代码行数:24,代码来源:SiteController.php

示例5: utf8_decode

//    echo "<tr>";
//    for($coluna=0; $coluna<=10; $coluna++){ //Navega na coluna
//        if($linha == 2){
//            echo "<th>".utf8_decode($dataPhp->getActiveSheet()->getCellByColumnAndRow($coluna, $linha)->getValue()); // Atualiza com caracteres especiais;
//            echo "</th>";
//        }else{
//            echo "<td>".utf8_decode($dataPhp->getActiveSheet()->getCellByColumnAndRow($coluna, $linha)->getValue()); // Atualiza com caracteres especiais;
//            echo "</td>";
//        }
////        $dataPhp->getActiveSheet()->getCellByColumnAndRow($coluna, $linha)->getValue();//Chama as linhas e colunas;
//    }
//    echo "</tr>";
//}
//echo "</table>";
//LEITURA EXCEL 1
echo utf8_decode($data->dump(true, true));
//LEITURA CSV
//$delimitador = ',';
//$cerca = '"';
//
//// Abrir arquivo para leitura
//$f = fopen('semana421.csv', 'r');
//if ($f) {
//
//    // Ler cabecalho do arquivo
//    $cabecalho = fgetcsv($f, 0, $delimitador, $cerca);
//
//    // Enquanto nao terminar o arquivo
//    while (!feof($f)) {
//
//        // Ler uma linha do arquivo
开发者ID:pereiraMichel,项目名称:redeunavida,代码行数:31,代码来源:eSemana421.php

示例6: explode

 if ($_FILES['file']['error'] == 0) {
     $file = explode(".", $_FILES['file']['name']);
     $extension = array_pop($file);
     /*  echo "<script type='text/javascript'> alert('".$extension."'); </script>";  */
     if (in_array($extension, $allowed_extensions)) {
         $source = $_FILES['file']['tmp_name'];
         $t = "Subjective" . time() . "" . date('Ymd') . ".xls";
         $target = $upload_path . "/" . $t;
         $tempUploadedValue = move_uploaded_file($source, $target);
         if ($tempUploadedValue) {
             /*    echo "<script type='text/javascript'> alert('test1'); </script>";  */
             if (($handle = fopen($upload_path . '/' . $t, "r")) !== false) {
                 $_FILES['file']['name'];
                 $expiryDate = $_POST['expiryDate'];
                 $data = new Spreadsheet_Excel_Reader($upload_path . '/' . $t);
                 $data->dump(true, true);
                 $data_array = array();
                 for ($i = 1; $i <= $data->rowcount(); $i++) {
                     $data_array[$i] = array();
                     for ($j = 1; $j <= $data->colcount(); $j++) {
                         $data_array[$i][$j] = $data->val($i, $j);
                     }
                     // inner For
                 }
                 // outer For
                 $myFile = $t;
                 $url = "./excelfiles/" . $t;
                 $newUploadedQuizURL = $newBaseURL . "/excelfiles/" . str_replace(' ', '%20', $myFile);
                 $newQuizName = $_POST['questionFileName'];
                 $newQuizFileName = $myFile;
                 $duration = $_POST['hours'] * 3600 + $_POST['minutes'] * 60;
开发者ID:tush241191,项目名称:elearn,代码行数:31,代码来源:uploadSubQuiz.php

示例7: actionImport

 public function actionImport()
 {
     $model = new A();
     if (isset($_POST['A'])) {
         Yii::import('ext.phpexcelreader.excel_reader2', true);
         $model->attributes = $_POST['A'];
         $import = CUploadedFile::getInstance($model, 'filee');
         if ($import == null) {
             Yii::app()->user->setFlash('error', 'File Kosong');
             $this->redirect(array(''));
         } else {
             $import->saveAs('coba/' . $import);
         }
         if ($import->type == "application/ynd.ms.excel") {
             $data = new Spreadsheet_Excel_Reader('/../controller/coba1.xls/');
             echo $data->dump(true, true);
             $id = array();
             $nama = array();
             for ($j = 2; $j <= $data->rowcount(); $j++) {
                 if (empty($data->sheets[0]['cells'][$j][1]) || empty($data->sheets[0]['cells'][$j][2])) {
                     Yii::app()->user->setFlash('error', 'Data Gagal di Import (File excel harus diisi semua)');
                     $id[$j] = null;
                     $nama[$j] = null;
                 } else {
                     $id[$j] = $data->sheets[0]['cells'][$j][1];
                     $nama[$j] = $data->sheets[0]['cells'][$j][2];
                 }
             }
             $niki = $data->rowcount(0);
             for ($i = 1; $i < $niki; $i++) {
                 $model = new A();
                 $model->id = $id[$i];
                 $model->nama = $nama[$i];
                 $model2 = A::model()->findByPk($id[$i]);
                 if ($model2 != null) {
                     Yii::app()->user->setFlash('error', 'Data Gagal di Import (NIDN sudah ada sebelumnya)');
                     $this->redirect(array('import'));
                 } else {
                     $model->save();
                 }
             }
             $this->redirect(array('index'));
         } else {
             Yii::app()->user->setFlash('error', 'Format file tidak dikenali (format file harus .xls)');
             $this->redirect(array('import'));
         }
     }
     $this->render('import', array('model' => $model));
     /* $model = new A();
         if (isset($_POST['A'])) {
         $model->attributes = $_POST['A'];
         $itu = CUploadedFile::getInstance($model, 'filee');
         $path = 'coba1.xls';
         //$itu->saveAs($path);
         $data = new Spreadsheet_Excel_Reader('coba1.xls');
        
         }*/
 }
开发者ID:anasswoow,项目名称:coba,代码行数:58,代码来源:AController.php

示例8:

 function parse_xls_file($params)
 {
     $params = $params[0];
     Common::inc_module_factory('ExcelReader', true);
     $data = new Spreadsheet_Excel_Reader(PATH_ . $params['xls_file']);
     return $data->dump(false, false, 0, $params['class']);
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:7,代码来源:helpers.tpl.php

示例9:

table.excel tbody td {
	vertical-align:bottom;
}
table.excel tbody td {
    padding: 0 3px;
	border: 1px solid #EEEEEE;
}
</style>
</head>

<body>
<?php 
$row = 0;
$col = 0;
echo '<table>';
for ($row = 0; $row < 5; $row++) {
    echo '<tr>';
    for ($col = 0; $col < 5; $col++) {
        echo '<td>';
        echo $data->val($row, $col);
        echo '</td>';
    }
    echo '</tr>';
}
echo '</table>';
echo $data->dump(true, true);
echo $data->dump(true, true);
?>
</body>
</html>
开发者ID:superdol,项目名称:xlsimport,代码行数:30,代码来源:example.php

示例10: elseif

    }
    if ($type == 'w') {
        return str_replace($conv['utf'], $conv['win'], $str);
    } elseif ($type == 'u') {
        return str_replace($conv['win'], $conv['utf'], $str);
    } else {
        return $str;
    }
}
if (isset($_POST["act"])) {
    require_once 'excel_reader2.php';
    $data = new Spreadsheet_Excel_Reader($_FILES['fname']["tmp_name"]);
    if ($_POST["clearall"] == 'clearall') {
        print "<script>importexcelDialog.clear()</script>";
    }
    print "<script>importexcelDialog.insert('<p>" . str_replace("\\'", "\\\\'", str_replace("\n", "", Encode($data->dump(false, false, 0, 'price'), 'w'))) . "</p>')</script>";
}
?>
 
 
 Загрузите файл для вставки в код:
 <input type="file" name="fname">
 <input type="hidden" name="act" value="send"><br>
 <input type="checkbox" name="clearall" checked=checked value="clearall" id="clearall"><label for="clearall">Очистить содержимое перед вставкой</label>
 </br>
	<div class="mceActionPanel">
		<div style="float: left">
			<input type="submit" id="insert" name="insert" value="Вставить" onclick="" />
		</div>

		<div style="float: right">
开发者ID:ramainen,项目名称:doit-cms,代码行数:31,代码来源:dialog.php

示例11: array

        }), array('db' => '3', 'dt' => 4, 'formatter' => function ($d, $row) {
            return substr(html_entity_decode(htmlspecialchars_decode($d, ENT_NOQUOTES)), 0, 15) . "...";
        }), array('db' => '4', 'dt' => 5, 'formatter' => function ($d, $row) {
            return substr(html_entity_decode(htmlspecialchars_decode($d, ENT_NOQUOTES)), 0, 15) . "...";
        }));
        $where = "id_kategori = {$id}";
        $datatable->get_table($table, $primaryKey, $columns, $where);
        break;
    case 'view':
        ini_set('memory_limit', '-1');
        $filesave = $purifier->purify($_POST['filename']);
        $data = new Spreadsheet_Excel_Reader($path_upload . $filesave);
        echo '<html>
    <head>
    <title>Sistem Informasi Pelaporan | Ristek Dikti</title>
    <link rel="shortcut icon" type="image/png" href="' . $url_rewrite . "static/dist/img/risetdikti.png" . '"/>
    <style>
    table.excel {border-style:ridge;border-width:1;border-collapse:collapse;font-family:sans-serif;font-size:12px;}
    table.excel thead th, table.excel tbody th {background:#CCCCCC;border-style:ridge;border-width:1;text-align: center;vertical-align:bottom;}
    table.excel tbody th {text-align:center;width:20px;}
    table.excel tbody td {vertical-align:bottom;}
    table.excel tbody td {padding: 0 3px;border: 1px solid #EEEEEE;}
    </style>
    </head>
    <body>' . $data->dump(true, true, 1) . '</body>
    </html>';
        break;
    default:
        $utility->location_goto(".");
        break;
}
开发者ID:datadigicore,项目名称:admin_cat,代码行数:31,代码来源:upload.php

示例12: json_encode

<?php

/**
 * Argumentos
 * $argv[0] Archivo php actual
 * $argv[1] Archivo excel
 * $argv[2] Hoja
 * $argv[3] Patrond e separación para hojas
 */
include "excel_reader2.php";
$data = new Spreadsheet_Excel_Reader($argv[1]);
$sheets = array();
for ($i = 0; $i < count($data->sheets); $i++) {
    $sheets[] = $data->boundsheets[$i]['name'];
}
echo json_encode($sheets);
echo $argv[3];
echo $data->dump(true, true, $argv[2]);
开发者ID:boriscy,项目名称:motoEx,代码行数:18,代码来源:excel_to_html.php

示例13: buildExcelHTML

 private function buildExcelHTML($spreadsheetFile)
 {
     $data = new Spreadsheet_Excel_Reader($spreadsheetFile);
     return $data->dump(true, true);
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:5,代码来源:TableExcelReport.php


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