本文整理汇总了PHP中Export类的典型用法代码示例。如果您正苦于以下问题:PHP Export类的具体用法?PHP Export怎么用?PHP Export使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Export类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: export
function export($from, $to)
{
$productId = $this->common->getCurrentProduct()->id;
$productName = $this->common->getCurrentProduct()->name;
$data = $this->device->getDeviceTypeDetail($productId);
$this->load->library('export');
$export = new Export();
//设定文件名
$export->setFileName($productName . '_' . $from . '_' . $to . '.csv');
//输出列名第一种方法
$fields = array();
foreach ($data->list_fields() as $field) {
array_push($fields, $field);
}
$export->setTitle($fields);
//输出列名第二种方法
// $excel_title = array (iconv("UTF-8", "GBK", "设备型号"),iconv("UTF-8", "GBK", "总数"),iconv("UTF-8", "GBK", "用户比例") );
// $export->setTitle ($excel_title );
//输出内容
foreach ($data->result() as $row) {
$export->addRow($row);
}
$export->export();
die;
}
开发者ID:jianoll,项目名称:razor,代码行数:25,代码来源:device.php
示例2: actionIndex
public function actionIndex()
{
//registering js file
Yii::app()->clientScript->registerScriptFile(Yii::app()->assetManager->publish(Yii::getPathOfAlias('application.modules.export.assets') . '/js/jquery-ui.1.10.4.js'));
$models = Yii::app()->controller->module->allowedModels;
if ($models == NULL) {
foreach (glob('./protected/models/*.php') as $filename) {
$modelname = str_replace(array("./protected/models/", ".php"), "", $filename);
$models[$modelname]['label'] = $modelname;
}
}
$modelsArray = array();
foreach ($models as $mindex => $smodel) {
$modelsArray[$mindex] = isset($smodel['label']) ? $smodel['label'] : $mindex;
}
if (isset($_POST['export-database'])) {
if (isset($_POST['reqColumns']) and count($_POST['reqColumns']) > 0) {
$model = $_POST['model'];
$format = 'csv';
if (in_array($model, array_keys($modelsArray))) {
$export = new Export();
if (!$export->exportdb($format, $model, $_POST['reqColumns'])) {
$this->redirect(array('index'));
}
} else {
Yii::app()->user->setFlash('exporterror', 'You are not allowed to access this model !!');
$this->redirect(array('index'));
}
} else {
Yii::app()->user->setFlash('exporterror', 'Choose columns to export !!');
$this->redirect(array('index'));
}
}
$this->render('index', array('modelsArray' => $modelsArray));
}
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:35,代码来源:DefaultController.php
示例3: export
function export($from, $to)
{
$this->load->library('export');
$productId = $this->common->getCurrentProduct()->id;
$productName = $this->common->getCurrentProduct()->name;
$data = $this->os->getTotalUserPercentByOS($productId);
$export = new Export();
//设定文件名
$export->setFileName($productName . '.csv');
// //输出列名第一种方法
$fields = array();
foreach ($data->list_fields() as $field) {
array_push($fields, $field);
}
$export->setTitle($fields);
//输出列名第二种方法
// $excel_title = array (iconv("UTF-8", "GBK", "操作系统版本"),iconv("UTF-8", "GBK", "用户比例") );
// $export->setTitle ($excel_title );
//输出内容
foreach ($data->result() as $row) {
$export->addRow($row);
}
$export->export();
die;
}
开发者ID:jianoll,项目名称:razor,代码行数:25,代码来源:os.php
示例4: trigger_salsa_db_date
function trigger_salsa_db_date($jaguar_model, $date)
{
global $DB;
foreach ($jaguar_model as $jaguar) {
$row = $DB->query('select * from export where model = "' . $jaguar . '" ')->fetch_array(MYSQLI_ASSOC);
$export = new Export($row);
$export->reset_export_date($date);
}
}
开发者ID:radicaldesigns,项目名称:jaguar,代码行数:9,代码来源:migration_functions.php
示例5: loadModel
/**
* @param $id
* @return Export
* @throws CHttpException
*/
public function loadModel($id)
{
$model = Export::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, Yii::t('YmlModule.default', 'Page not found!'));
}
return $model;
}
开发者ID:yupe,项目名称:yupe,代码行数:13,代码来源:ExportBackendController.php
示例6: actionView
public function actionView($id)
{
$model = Export::model()->findByPk($id);
if (false === $model) {
throw new CHttpException(404);
}
$criteria = new CDbCriteria();
$criteria->compare('t.status', Product::STATUS_ACTIVE);
if (!empty($model->categories)) {
$criteria->addInCondition('t.category_id', (array) $model->categories);
}
if (!empty($model->brands)) {
$criteria->addInCondition('t.producer_id', (array) $model->brands);
}
$dataProvider = new CActiveDataProvider('Product', ['criteria' => $criteria]);
$offers = new CDataProviderIterator($dataProvider, 100);
ContentType::setHeader(ContentType::TYPE_XML);
$this->renderPartial('view', ['model' => $model, 'currencies' => Yii::app()->getModule('store')->getCurrencyList(), 'categories' => StoreCategory::model()->published()->findAll(), 'offers' => $offers]);
}
开发者ID:syrexby,项目名称:domovoishop.by,代码行数:19,代码来源:ExportController.php
示例7: actionView
public function actionView($id)
{
/* @var $model Export */
$model = Export::model()->findByPk($id);
if (!$model) {
throw new CHttpException(404);
}
$cacheKey = $this->cacheKey . $model->id;
if (!($xml = Yii::app()->getCache()->get($cacheKey))) {
$xml = $this->getXmlHead();
$xml .= CHtml::openTag('yml_catalog', ['date' => date('Y-m-d H:i')]);
$xml .= CHtml::openTag('shop');
$xml .= $this->getShopInfo($model->shop_name, $model->shop_company, $model->shop_url ?: Yii::app()->getBaseUrl(true), $model->shop_platform, $model->shop_version, $model->shop_agency, $model->shop_email, $model->shop_cpa);
$xml .= $this->getCurrenciesElement([['id' => 'RUR', 'rate' => 1]]);
$xml .= $this->getCategoriesElement();
$xml .= $this->getOffersElement($model->categories, $model->brands);
$xml .= CHtml::closeTag('shop');
$xml .= CHtml::closeTag('yml_catalog');
Yii::app()->getCache()->set($cacheKey, $xml, 60 * 60);
}
header("Content-type: text/xml");
echo $xml;
Yii::app()->end();
}
开发者ID:RexGalicie,项目名称:yupe,代码行数:24,代码来源:ExportController.php
示例8: export
private function export($res)
{
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=persons_list_' . date('Ymd') . '.csv');
$contents = array();
$title = array();
$fp = fopen('php://output', 'w');
fputs($fp, $bom = chr(0xef) . chr(0xbb) . chr(0xbf));
$k = 0;
foreach ($res as $row) {
$fields = \Export::person_field($row);
foreach ($fields as $field => $val) {
$title[$k][] = preg_replace('/_[0-9]+$/', '', $field);
$contents[$k][] = $val;
}
if ($k == 0) {
fputcsv($fp, $title[$k]);
}
fputcsv($fp, $contents[$k]);
++$k;
}
fclose($fp);
exit;
}
开发者ID:huylv-hust,项目名称:uosbo,代码行数:24,代码来源:persons.php
示例9: get_lang
$tool_name = get_lang('ImportGlossary');
break;
case 'changeview':
$tool_name = get_lang('List');
break;
}
if (isset($_GET['action']) && $_GET['action'] == 'export') {
$data = GlossaryManager::get_glossary_data(0, GlossaryManager::get_number_glossary_terms(api_get_session_id()), 0, 'ASC');
usort($data, "sorter");
$list = array();
$list[] = array('term', 'definition');
foreach ($data as $line) {
$list[] = array($line[0], $line[1]);
}
$filename = 'glossary_course_' . api_get_course_id();
Export::export_table_csv_utf8($list, $filename);
}
if (isset($_GET['action']) && $_GET['action'] == 'export_to_pdf') {
GlossaryManager::export_to_pdf();
}
Display::display_header($tool_name);
// Tool introduction
Display::display_introduction_section(TOOL_GLOSSARY);
if (isset($_GET['action']) && $_GET['action'] == 'changeview' and in_array($_GET['view'], array('list', 'table'))) {
$_SESSION['glossary_view'] = $_GET['view'];
} else {
if (!isset($_SESSION['glossary_view'])) {
$_SESSION['glossary_view'] = 'table';
//Default option
}
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:index.php
示例10: destroy
public function destroy($export_id)
{
$export = Export::findOrFail($export_id);
$export->delete();
return Redirect::to(action('ExportsController@index'))->with('message', ['content' => 'Export verwijderd.', 'class' => 'danger']);
}
开发者ID:y0sh1,项目名称:logboek,代码行数:6,代码来源:ExportsController.php
示例11: array
} else {
$csv_header[] = array(get_lang('LastName'), get_lang('FirstName'), get_lang('FirstLogin'), get_lang('LastConnexion'));
}
}
$form = new FormValidator('search_user', 'get', api_get_path(WEB_CODE_PATH) . 'mySpace/student.php');
$form = Tracking::setUserSearchForm($form);
$form->setDefaults($params);
if ($export_csv) {
// send the csv file if asked
$content = $table->get_table_data();
foreach ($content as &$row) {
unset($row[4]);
}
$csv_content = array_merge($csv_header, $content);
ob_end_clean();
Export::arrayToCsv($csv_content, 'reporting_student_list');
exit;
} else {
Display::display_header($nameTools);
echo $actions;
$page_title = get_lang('Students');
echo Display::page_subheader($page_title);
if (isset($active)) {
if ($active) {
$activeLabel = get_lang('ActiveUsers');
} else {
$activeLabel = get_lang('InactiveUsers');
}
echo Display::page_subheader2($activeLabel);
}
$form->display();
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:student.php
示例12: get_lang
$extra = '<div style="text-align:center"><h2>' . get_lang('GroupList') . '</h2></div>';
$extra .= '<strong>' . get_lang('Course') . ': </strong>' . $courseInfo['title'] . ' (' . $courseInfo['code'] . ')';
$content = $extra . $content;
$pdf->content_to_pdf($content, null, null, api_get_course_id());
break;
case 'export':
$groupId = isset($_GET['id']) ? intval($_GET['id']) : null;
$data = GroupManager::exportCategoriesAndGroupsToArray($groupId, true);
switch ($_GET['type']) {
case 'csv':
Export::export_table_csv($data);
exit;
break;
case 'xls':
if (!empty($data)) {
Export::export_table_xls($data);
exit;
}
break;
}
break;
}
}
/* Header */
$interbreadcrumb[] = array('url' => 'group.php', 'name' => get_lang('Groups'));
if (!isset($_GET['origin']) || $_GET['origin'] != 'learnpath') {
// So we are not in learnpath tool
if (!$is_allowed_in_course) {
api_not_allowed(true);
}
if (!api_is_allowed_to_edit(false, true)) {
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:group_overview.php
示例13: switch
switch ($exportFormat) {
case 'xls':
//TODO add date if exists
$file_name = !empty($action) ? $action : 'company_report';
$browser = new Browser();
if ($browser->getPlatform() == Browser::PLATFORM_WINDOWS) {
Export::export_table_xls_html($array, $file_name, 'ISO-8859-15');
} else {
Export::export_table_xls_html($array, $file_name);
}
break;
case 'csv':
default:
//TODO add date if exists
$file_name = !empty($action) ? $action : 'company_report';
Export::arrayToCsv($array, $file_name);
break;
}
exit;
}
$i = 0;
if (!empty($result)) {
foreach ($result as $row) {
// if results tab give not id, set id to $i otherwise id="null" for all <tr> of the jqgrid - ref #4235
if (!isset($row['id']) || isset($row['id']) && $row['id'] == '') {
$response->rows[$i]['id'] = $i;
} else {
$response->rows[$i]['id'] = $row['id'];
}
$array = array();
foreach ($columns as $col) {
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:model.ajax.php
示例14: attendance_sheet_export_to_pdf
//.........这里部分代码省略.........
} else {
if (!empty($student_id)) {
$user_id = intval($student_id);
} else {
$user_id = api_get_user_id();
}
$data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id, $user_id);
$data_array['faults'] = $attendance->get_faults_of_user($user_id, $attendance_id);
$data_array['user_id'] = $user_id;
}
$data_array['next_attendance_calendar_id'] = $attendance->get_next_attendance_calendar_id($attendance_id);
//Set headers pdf
$courseCategory = CourseManager::get_course_category($courseInfo['category_code']);
$teacherInfo = CourseManager::get_teacher_list_from_course_code($courseInfo['real_id']);
$teacherName = null;
foreach ($teacherInfo as $dados) {
if ($teacherName != null) {
$teacherName = $teacherName . " / ";
}
$teacherName .= $dados['firstname'] . " " . $dados['lastname'];
}
// Get data table - Marco - ordenacao fixa - just fullname
$data_table = array();
$head_table = array('#', get_lang('Name'));
foreach ($data_array['attendant_calendar'] as $class_day) {
//$head_table[] = api_format_date($class_day['date_time'], DATE_FORMAT_SHORT).' <br />'.api_format_date($class_day['date_time'], TIME_NO_SEC_FORMAT);
$head_table[] = api_format_date($class_day['date_time'], DATE_FORMAT_NUMBER_NO_YEAR);
}
$data_table[] = $head_table;
$dataClass = array();
$max_dates_per_page = 10;
$data_attendant_calendar = $data_array['attendant_calendar'];
$data_users_presence = $data_array['users_presence'];
$count = 1;
if (!empty($data_array['users_in_course'])) {
foreach ($data_array['users_in_course'] as $user) {
$cols = 1;
$result = array();
$result['count'] = $count;
$result['full_name'] = api_get_person_name($user['firstname'], $user['lastname']);
foreach ($data_array['attendant_calendar'] as $class_day) {
if ($class_day['done_attendance'] == 1) {
if ($data_users_presence[$user['user_id']][$class_day['id']]['presence'] == 1) {
$result[$class_day['id']] = get_lang('UserAttendedSymbol');
} else {
$result[$class_day['id']] = get_lang('UserNotAttendedSymbol');
}
} else {
$result[$class_day['id']] = " ";
}
$cols++;
}
$count++;
$data_table[] = $result;
}
}
$max_cols_per_page = 12;
//10 dates + 2 name and number
$max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;
//10
$rows = count($data_table);
if ($cols > $max_cols_per_page) {
$number_tables = round(($cols - 2) / $max_dates_per_page);
$headers = $data_table[0];
$all = array();
$tables = array();
$changed = 1;
for ($i = 0; $i <= $rows; $i++) {
$row = $data_table[$i];
$key = 1;
$max_dates_per_page = 10;
$item = $data_table[$i];
$count_j = 0;
if (!empty($item)) {
foreach ($item as $value) {
if ($count_j >= $max_dates_per_page) {
$key++;
$max_dates_per_page = $max_dates_per_page_original * $key;
//magic hack
$tables[$key][$i][] = $tables[1][$i][0];
$tables[$key][$i][] = $tables[1][$i][1];
}
$tables[$key][$i][] = $value;
$count_j++;
}
}
}
$content = null;
if (!empty($tables)) {
foreach ($tables as $sub_table) {
$content .= Export::convert_array_to_html($sub_table) . '<br /><br />';
}
}
} else {
$content .= Export::convert_array_to_html($data_table, array('header_attributes' => array('align' => 'center')));
}
$params = array('filename' => get_lang('Attendance') . '-' . api_get_local_time(), 'pdf_title' => $courseInfo['title'], 'course_code' => $courseInfo['code'], 'add_signatures' => true, 'orientation' => 'landscape', 'pdf_teachers' => $teacherName, 'pdf_course_category' => $courseCategory['name'], 'format' => 'A4-L', 'orientation' => 'L');
Export::export_html_to_pdf($content, $params);
exit;
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:101,代码来源:attendance_controller.php
示例15: getLpStats
//.........这里部分代码省略.........
if (!$is_allowed_to_edit && $result_disabled_ext_all) {
$output .= '<td>
<img src="' . api_get_path(WEB_IMG_PATH) . 'quiz_na.gif" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '">
</td>';
} else {
$output .= '<td>
<a href="../exercice/exercise_show.php?origin=' . $origin . '&id=' . $my_exe_id . '&cidReq=' . $courseCode . '" target="_parent">
<img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '">
</a></td>';
}
} else {
if (!$is_allowed_to_edit && $result_disabled_ext_all) {
$output .= '<td>
<img src="' . api_get_path(WEB_IMG_PATH) . 'quiz_na.gif" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></td>';
} else {
$output .= '<td>
<a href="../exercice/exercise_show.php?cidReq=' . $courseCode . '&origin=correct_exercise_in_lp&id=' . $my_exe_id . '" target="_parent">
<img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></a></td>';
}
}
}
$output .= '</tr>';
$n++;
}
}
$output .= '<tr><td colspan="12"> </td></tr>';
}
}
}
}
$total_time += $time_for_total;
// QUIZZ IN LP
$a_my_id = array();
if (!empty($my_lp_id)) {
$a_my_id[] = $my_lp_id;
}
}
}
// NOT Extend all "left green cross"
if (!empty($a_my_id)) {
if ($extendedAttempt) {
// "Right green cross" extended
$total_score = self::get_avg_student_score($user_id, $course_id, $a_my_id, $session_id, false, false);
} else {
// "Left green cross" extended
$total_score = self::get_avg_student_score($user_id, $course_id, $a_my_id, $session_id, false, true);
}
} else {
// Extend all "left green cross"
$total_score = self::get_avg_student_score($user_id, $course_id, array($lp_id), $session_id, false, false);
}
$total_time = learnpathItem::getScormTimeFromParameter('js', $total_time);
$total_time = str_replace('NaN', '00' . $h . '00\'00"', $total_time);
if (!$is_allowed_to_edit && $result_disabled_ext_all) {
$final_score = Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting'));
} else {
if (is_numeric($total_score)) {
$final_score = $total_score . '%';
} else {
$final_score = $total_score;
}
}
$progress = learnpath::getProgress($lp_id, $user_id, $course_id, $session_id);
if ($counter % 2 == 0) {
$oddclass = 'row_odd';
} else {
$oddclass = 'row_even';
}
$action = null;
if ($type == 'classic') {
$action = '<td></td>';
}
$output .= '<tr class="' . $oddclass . '">
<td></td>
<td colspan="4">
<i>' . get_lang('AccomplishedStepsTotal') . '</i>
</td>
<td colspan="2">' . $progress . '%</td>
<td colspan="2">
' . $final_score . '
</td>
<td colspan="2">' . $total_time . '</div>
' . $action . '
</tr>';
$output .= '
</tbody>
</table>
</div>
';
if (!empty($export_csv)) {
$temp = array('', '', '', '');
$csv_content[] = $temp;
$temp = array(get_lang('AccomplishedStepsTotal'), '', $final_score, $total_time);
$csv_content[] = $temp;
ob_end_clean();
Export::arrayToCsv($csv_content, 'reporting_learning_path_details');
exit;
}
return $output;
}
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:101,代码来源:tracking.lib.php
示例16: switch
if (isset($_GET['action'])) {
switch ($_GET['action']) {
case 'unsubscribe':
if (CourseManager::get_user_in_course_status($_GET['user_id'], $_GET['course_code']) == STUDENT) {
CourseManager::unsubscribe_user($_GET['user_id'], $_GET['course_code'], $_GET['id_session']);
$message = Display::return_message(get_lang('UserUnsubscribed'));
} else {
$message = Display::return_message(get_lang('CannotUnsubscribeUserFromCourse'), 'error');
}
break;
case 'unsubscribeSessionCourse':
SessionManager::removeUsersFromCourseSession(array($_GET['user_id']), $_GET['id_session'], api_get_course_info($_GET['course_code']));
$message = Display::return_message(get_lang('UserUnsubscribed'));
break;
case 'export':
Export::arrayToCsv($csvContent, 'user_information_' . $user);
exit;
break;
}
}
Display::display_header($tool_name);
echo '<div class="actions">
<a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/myStudents.php?student=' . intval($_GET['user_id']) . '" title="' . get_lang('Reporting') . '">' . Display::return_icon('statistics.png', get_lang('Reporting'), '', ICON_SIZE_MEDIUM) . '
</a>
' . $login_as_icon . '
' . $editUser . '
' . $exportLink . '
</div>';
echo Display::page_header($tool_name);
$fullUrlBig = Usermanager::getUserPicture($user['user_id'], USER_IMAGE_SIZE_BIG);
$fullUrl = Usermanager::getUserPicture($user['user_id'], USER_IMAGE_SIZE_ORIGINAL);
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:user_information.php
示例17: time
Export::updateCount($domainName);
}
setcookie("export_visited", "bloglounge", time() + 86400, "/", ((substr(strtolower($_SERVER['HTTP_HOST']), 0, 4) == 'www.') ? substr($_SERVER['HTTP_HOST'], 3) : $_SERVER['HTTP_HOST']));
}
$params = array();
$params['get'] = $_GET;
$params['post'] = $_POST;
if(!isset($config)) $config = new Settings;
$export->exportURL = $service['path'] . '/exports/' . $programName;
$content = call_user_func($functionName, $params, Export::getConfig($domainName));
echo $content;
} else {
// 함수 없음
}
} else {
// 해당되는 프로그램 없음
header("Location: /");
exit;
}
} else {
// 해당되는 프로그램 없음
header("Location: /");
exit;
}
开发者ID:ncloud,项目名称:bloglounge,代码行数:31,代码来源:export.php
示例18: get_lang
$extra = '<div style="text-align:center"><h2>' . get_lang('GroupList') . '</h2></div>';
$extra .= '<strong>' . get_lang('Course') . ': </strong>' . $courseInfo['title'] . ' (' . $courseInfo['code'] . ')';
$content = $extra . $content;
$pdf->content_to_pdf($content, null, null, api_get_course_id());
break;
case 'export':
$groupId = isset($_GET['id']) ? intval($_GET['id']) : null;
$data = GroupManager::exportCategoriesAndGroupsToArray($groupId, true);
switch ($_GET['type']) {
case 'csv':
Export::arrayToCsv($data);
exit;
break;
case 'xls':
if (!empty($data)) {
Export::arrayToXls($data);
exit;
}
break;
}
break;
}
}
/* Header */
$interbreadcrumb[] = array('url' => 'group.php?' . api_get_cidReq(), 'name' => get_lang('Groups'));
if (!isset($_GET['origin']) || $_GET['origin'] != 'learnpath') {
// So we are not in learnpath tool
if (!$is_allowed_in_course) {
api_not_allowed(true);
}
if (!api_is_allowed_to_edit(false, true)) {
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:group_overview.php
示例19: exportCSV
function exportCSV($label)
{
$fromTime = $this->common->getFromTime();
$toTime = $this->common->getToTime();
$products = $this->common->getCompareProducts();
if (empty($products)) {
$this->common->requireProduct();
return;
}
$this->load->library('export');
$export = new Export();
if ($label == "country") {
$titlename = getExportReportTitle("Compare", lang("v_rpt_re_top10Nations"), $fromTime, $toTime);
} else {
$titlename = getExportReportTitle("Compare", lang("v_rpt_re_top10Provinces"), $fromTime, $toTime);
}
$titlename = iconv("UTF-8", "GBK", $titlename);
$export->setFileName($titlename);
$j = 0;
$mk = 0;
$title[$j++] = iconv("UTF-8", "GBK", lang('t_activeUsers'));
$space[$mk++] = ' ';
for ($i = 0; $i < count($products); $i++) {
$title[$j++] = iconv("UTF-8", "GBK", $products[$i]->name);
$title[$j++] = '';
$space[$mk++] = ' ';
$space[$mk++] = ' ';
}
$export->setTitle($title);
$k = 0;
$maxlength = 0;
$maxlength2 = 0;
$j = 0;
$nextlabel[$j++] = lang('t_newUsers');
for ($m = 0; $m < count($products); $m++) {
if ($label == "country") {
$activedata = $this->region->getactivebycountry($fromTime, $toTime, $products[$m]->id);
$newdata = $this->region->getnewbycountry($fromTime, $toTime, $products[$m]->id);
} else {
$country = $this->default_country;
$activedata = $this->region->getactivebypro($fromTime, $toTime, $products[$m]->id, $country);
$newdata = $this->region->getnewbypro($fromTime, $toTime, $products[$m]->id, $country);
}
$detailData[$m] = $this->change2StandardPrecent($activedata, $label);
$detailNewData[$m] = $this->change2StandardPrecent($newdata, $label);
if (count($detailData[$m]) > $maxlength) {
$maxlength = count($detailData[$m]);
}
if (count($detailNewData[$m]) > $maxlength2) {
$maxlength2 = count($detailNewData[$m]);
}
$nextlabel[$j++] = $products[$m]->name;
$nextlabel[$j++] = ' ';
}
$this->getExportRowData($export, $maxlength, $detailData, $products, $label);
$export->addRow($space);
$export->addRow($nextlabel);
$this->getExportRowData($export, $maxlength2, $detailNewData, $products, $label);
$export->export();
die;
}
开发者ID:newbeess,项目名称:razor,代码行数:61,代码来源:region.php
示例20: sleep
$groups_export = $DIA->get('export', $export_id);
if ($groups_export['Status'] == "Active") {
echo ' waiting for export to reset ';
sleep(30);
$groups_export = check_for_sleep($export_id);
} else {
if ($groups_export['Status'] == "Complete") {
echo 'ready to sync ';
return $groups_export;
} else {
echo 'something bad happened ';
}
}
}
$data['export_KEY'] = $export_id;
$export = new Export($data);
$export->reset_export();
check_for_sleep($export_id);
$groups_export = $DIA->get('export', $export_id);
print_r($groups_export);
if ($groups_export['Status'] == "Complete") {
$file = get_file_from_export($groups_export);
echo ' file fetched ';
if ($del == 1) {
$object = new $model_name(array());
$sql = "truncate " . $object::$table_name;
$DB->query($sql);
echo 'db deleted ';
if ($DB->error) {
echo new Exception($DB->error . $sql);
}
开发者ID:radicaldesigns,项目名称:jaguar,代码行数:31,代码来源:import_exported_salsa_files.php
注:本文中的Export类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论