本文整理匯總了PHP中notification::export_to_csv方法的典型用法代碼示例。如果您正苦於以下問題:PHP notification::export_to_csv方法的具體用法?PHP notification::export_to_csv怎麽用?PHP notification::export_to_csv使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類notification
的用法示例。
在下文中一共展示了notification::export_to_csv方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: redirect
init_var($_POST['btn_submit']);
if ($_POST['btn_cancel']) {
log_action('Pressed cancel button');
redirect("listview_notification.php");
}
if ($_POST['btn_submit']) {
log_action('Pressed submit button');
require 'subclasses/notification.php';
$dbh_notification = new notification();
if ($message == "") {
log_action('Exported table data to CSV');
$timestamp = date('Y-m-d');
$token = generate_token(0, 'fs');
$csv_name = $token . $_SESSION['user'] . '_notification_' . $timestamp . '.csv';
$filename = TMP_DIRECTORY . '/' . $csv_name;
$csv_contents = $dbh_notification->export_to_csv();
$csv_file = fopen($filename, "wb");
fwrite($csv_file, $csv_contents);
fclose($csv_file);
chmod($filename, 0755);
$csv_name = urlencode($csv_name);
$message = 'CSV file successfully generated: <a href="/' . BASE_DIRECTORY . '/download_generic.php?filename=' . $csv_name . '">Download the CSV file.</a>';
$message_type = 'system';
}
}
}
require 'subclasses/notification_html.php';
$html = new notification_html();
$html->draw_header('CSV Exporter: Notification', $message, $message_type);
echo '<div class="container">';
echo '<fieldset class="container_invisible">';