|
@@ -74,7 +74,7 @@ class MainController extends Controller
|
74
|
74
|
|
75
|
75
|
$csvData = "\xEF\xBB\xBF" . "Nama,Bilangan,No Tel\n";
|
76
|
76
|
foreach ($vips as $vip) {
|
77
|
|
- $csvData .= "{$vip->name},{$vip->member},\t{$vip->phone}\n";
|
|
77
|
+ $csvData .= "\t{$vip->name},{$vip->member},\t{$vip->phone}\n";
|
78
|
78
|
}
|
79
|
79
|
|
80
|
80
|
$fileName = "vip_data.csv";
|
|
@@ -85,4 +85,22 @@ class MainController extends Controller
|
85
|
85
|
|
86
|
86
|
return Response::make($csvData, 200, $headers);
|
87
|
87
|
}
|
|
88
|
+
|
|
89
|
+ public function downloadGeneralCsv()
|
|
90
|
+ {
|
|
91
|
+ $generals = RSVP::where('is_vip', false)->get();
|
|
92
|
+
|
|
93
|
+ $csvData = "\xEF\xBB\xBF" . "Nama,Bilangan,No Tel\n";
|
|
94
|
+ foreach ($generals as $general) {
|
|
95
|
+ $csvData .= "\t{$general->name},{$general->member},\t{$general->phone}\n";
|
|
96
|
+ }
|
|
97
|
+
|
|
98
|
+ $fileName = "general_data.csv";
|
|
99
|
+ $headers = [
|
|
100
|
+ 'Content-Type' => 'text/csv',
|
|
101
|
+ 'Content-Disposition' => "attachment; filename=\"$fileName\"",
|
|
102
|
+ ];
|
|
103
|
+
|
|
104
|
+ return Response::make($csvData, 200, $headers);
|
|
105
|
+ }
|
88
|
106
|
}
|