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


PHP getImportExcelFields函数代码示例

本文整理汇总了PHP中getImportExcelFields函数的典型用法代码示例。如果您正苦于以下问题:PHP getImportExcelFields函数的具体用法?PHP getImportExcelFields怎么用?PHP getImportExcelFields使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: getPreviewDataFromExcel

 /**
  * A wrapper for the import function getPreviewDataFromExcel 
  * @param String filePath
  * @param String ext
  * @return Array
  */
 protected function getPreviewDataFromExcel($filePath, $ext)
 {
     $fileHandle = openImportExcelFile($filePath, $ext);
     $headerFieldsFromExcel = getImportExcelFields($fileHandle);
     $fieldsData = $this->getCorrespondingImportFieldsData($headerFieldsFromExcel);
     $previewData = getPreviewDataFromExcel($fileHandle, $fieldsData);
     $previewData["fieldsData"] = $fieldsData;
     return $previewData;
 }
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:15,代码来源:importpage.php

示例2: ImportFromExcel

function ImportFromExcel($uploadfile)
{
    $autoinc = false;
    $ret = 1;
    global $error_message, $keys, $goodlines, $total_records, $conn, $strOriginalTableName, $strTableName, $keys_present;
    $data = openImportExcelFile($uploadfile);
    // populate field names array
    $fields = array();
    $fields = getImportExcelFields($data);
    $fields = getFieldNamesByHeaders($fields);
    $keys_present = 1;
    for ($k = 0; $k < count($keys); $k++) {
        if (!in_array(RemoveFieldWrappers($keys[$k]), $fields)) {
            $keys_present = 0;
            break;
        }
    }
    if (in_array("Record ID", $fields)) {
        $autoinc = true;
    }
    if ($autoinc) {
        $sql = "SET IDENTITY_INSERT " . AddTableWrappers($strOriginalTableName) . " ON";
        db_exec($sql, $conn);
    }
    $ret = getImportExcelData($data, $fields);
    if ($autoinc) {
        $sql = "SET IDENTITY_INSERT " . AddTableWrappers($strOriginalTableName) . " OFF";
        db_exec($sql, $conn);
    }
    return $ret;
}
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:31,代码来源:Readings_import.php

示例3: ImportFromExcel

function ImportFromExcel($uploadfile)
{
    $autoinc = false;
    $ret = 1;
    global $error_message, $keys, $goodlines, $total_records, $conn, $strOriginalTableName, $strTableName, $keys_present;
    $data = openImportExcelFile($uploadfile);
    // populate field names array
    $fields = array();
    $fields = getImportExcelFields($data);
    $fields = getFieldNamesByHeaders($fields);
    $keys_present = 1;
    for ($k = 0; $k < count($keys); $k++) {
        if (!in_array(RemoveFieldWrappers($keys[$k]), $fields)) {
            $keys_present = 0;
            break;
        }
    }
    $ret = getImportExcelData($data, $fields);
    return $ret;
}
开发者ID:aagusti,项目名称:padl-tng,代码行数:20,代码来源:pad_pad_spt_type_import.php

示例4: ImportFromExcel

function ImportFromExcel($uploadfile, $strOriginalTableName, $ext, $keys, &$keys_present, &$total_records, &$error_message, &$goodlines, $pageObject, $cipherer)
{
	global $conn, $strTableName;
	
	$autoinc = false;
	$ret = 1;
	
	$data = openImportExcelFile($uploadfile);
	
	// populate field names array
	
	$fields = array();
	
	$fields = getImportExcelFields($data);
	
	$fields = getFieldNamesByHeaders($fields, $strOriginalTableName, $ext);	
	if($fields == null) // if error happened
		return;
	
	$keys_present=1;
	
	for($k=0; $k<count($keys); $k++)
	{
		if (!in_array(RemoveFieldWrappers($keys[$k]),$fields))
		{
			$keys_present=0;
			break;
		}
	}

		if(in_array("id",$fields))
		$autoinc=true;
				
if(GetDatabaseType() == 2 && $autoinc)
{
	$sql = "SET IDENTITY_INSERT ".AddTableWrappers($strOriginalTableName)." ON";
	db_exec($sql,$conn);
}
$ret = getImportExcelData($data, $fields, $error_message, $goodlines, $keys, $keys_present, $strOriginalTableName, $pageObject, $cipherer, $autoinc, $total_records);
if(GetDatabaseType() == 2 && $autoinc)
{
	$sql="SET IDENTITY_INSERT ".AddTableWrappers($strOriginalTableName)." OFF";
	db_exec($sql,$conn);
}
		
	
	return $ret;

}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:49,代码来源:webreport_users_import.php


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