本文整理汇总了PHP中FileUtil::exportCsv方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUtil::exportCsv方法的具体用法?PHP FileUtil::exportCsv怎么用?PHP FileUtil::exportCsv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtil
的用法示例。
在下文中一共展示了FileUtil::exportCsv方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionExport
public function actionExport()
{
$checkids = EnvUtil::getRequest("checkids");
$bgcheckArr = ResumeBgchecks::model()->fetchAll("FIND_IN_SET(checkid, '{$checkids}')");
$fieldArr = array(Ibos::lang("Name"), Ibos::lang("Company name"), Ibos::lang("Position"), Ibos::lang("Entry time"), Ibos::lang("Departure time"), Ibos::lang("Details"));
$str = implode(",", $fieldArr) . "\n";
foreach ($bgcheckArr as $bgcheck) {
$realname = ResumeDetail::model()->fetchRealnameByResumeid($bgcheck["resumeid"]);
$company = $bgcheck["company"];
$position = $bgcheck["position"];
$entryTime = empty($bgcheck["entrytime"]) ? "" : date("Y-m-d", $bgcheck["entrytime"]);
$quitTime = empty($bgcheck["quittime"]) ? "" : date("Y-m-d", $bgcheck["quittime"]);
$detail = $bgcheck["detail"];
$str .= $realname . "," . $company . "," . $position . "," . $entryTime . "," . $quitTime . "," . $detail . "\n";
}
$outputStr = iconv("utf-8", "gbk//ignore", $str);
$filename = date("Y-m-d") . mt_rand(100, 999) . ".csv";
FileUtil::exportCsv($filename, $outputStr);
}
示例2: actionExport
public function actionExport()
{
$contactids = EnvUtil::getRequest("contactids");
$contactArr = ResumeContact::model()->fetchAll("FIND_IN_SET(contactid, '{$contactids}')");
$fieldArr = array(Ibos::lang("Name"), Ibos::lang("Contact date"), Ibos::lang("Contact staff"), Ibos::lang("Contact method"), Ibos::lang("Contact purpose"), Ibos::lang("Content"));
$str = implode(",", $fieldArr) . "\n";
foreach ($contactArr as $contact) {
$realname = ResumeDetail::model()->fetchRealnameByResumeid($contact["resumeid"]);
$input = User::model()->fetchRealnameByUid($contact["input"]);
$inputtime = empty($contact["inputtime"]) ? "" : date("Y-m-d", $contact["inputtime"]);
$method = $contact["contact"];
$purpose = $contact["purpose"];
$detail = $contact["detail"];
$str .= $realname . "," . $inputtime . "," . $input . "," . $method . "," . $purpose . "," . $detail . "\n";
}
$outputStr = iconv("utf-8", "gbk//ignore", $str);
$filename = date("Y-m-d") . mt_rand(100, 999) . ".csv";
FileUtil::exportCsv($filename, $outputStr);
}
示例3: export
public function export()
{
$userDatas = $this->getUserData();
$fieldArr = array(Ibos::lang("Real name"), Ibos::lang("Position"), Ibos::lang("Telephone"), Ibos::lang("Cell phone"), Ibos::lang("Email"), Ibos::lang("QQ"));
$str = implode(",", $fieldArr) . "\n";
foreach ($userDatas as $user) {
$realname = $user["realname"];
$posname = $user["posname"];
$telephone = $user["telephone"];
$mobile = $user["mobile"];
$email = $user["email"];
$qq = $user["qq"];
$str .= $realname . "," . $posname . "," . $telephone . "," . $mobile . "," . $email . "," . $qq . "\n";
}
$outputStr = iconv("utf-8", "gbk//ignore", $str);
$filename = date("Y-m-d") . mt_rand(100, 999) . ".csv";
FileUtil::exportCsv($filename, $outputStr);
}
示例4: actionExport
public function actionExport()
{
$interviews = EnvUtil::getRequest("interviews");
$interviewArr = ResumeInterview::model()->fetchAll("FIND_IN_SET(interviewid, '{$interviews}')");
$fieldArr = array(Ibos::lang("Name"), Ibos::lang("Interview time"), Ibos::lang("Interview people"), Ibos::lang("Interview types"), Ibos::lang("Interview process"));
$str = implode(",", $fieldArr) . "\n";
foreach ($interviewArr as $interview) {
$realname = ResumeDetail::model()->fetchRealnameByResumeid($interview["resumeid"]);
$time = empty($interview["interviewtime"]) ? "" : date("Y-m-d", $interview["interviewtime"]);
$interviewer = User::model()->fetchRealnameByUid($interview["interviewer"]);
$type = $interview["type"];
$process = $interview["process"];
$str .= $realname . "," . $time . "," . $interviewer . "," . $type . "," . $process . "\n";
}
$outputStr = iconv("utf-8", "gbk//ignore", $str);
$filename = date("Y-m-d") . mt_rand(100, 999) . ".csv";
FileUtil::exportCsv($filename, $outputStr);
}