forked from avored/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbeaadb
commit d21f8c3
Showing
13 changed files
with
7,521 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
resources/js/modules/system/components/report/NewCustomer.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<script> | ||
import { Bar } from 'vue-chartjs' | ||
export default { | ||
extends: Bar, | ||
props: { | ||
customers: { | ||
type: [Object, Array], | ||
default: () => ({}) | ||
}, | ||
chartdata: { | ||
type: Object, | ||
default: () => ({}) | ||
}, | ||
options: { | ||
type: Object, | ||
default: () => ({ | ||
maintainAspectRatio: false, | ||
title: { | ||
display: true, | ||
text: 'New Customer Report' | ||
} | ||
}) | ||
} | ||
}, | ||
data() { | ||
return { | ||
} | ||
}, | ||
mounted () { | ||
this.chartdata.labels = [] | ||
this.chartdata.datasets = [] | ||
this.chartdata.datasets.push({ | ||
label: 'New Customers', | ||
data: [], | ||
fill: false, | ||
borderColor: '#2554FF', | ||
backgroundColor: '#2554FF', | ||
borderWidth: 1 | ||
}) | ||
for (const label in this.customers) { | ||
this.chartdata.labels.push(label) | ||
this.chartdata.datasets[0].data.push(this.customers[label].length) | ||
} | ||
this.renderChart(this.chartdata, this.options) | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace AvoRed\Framework\Report\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
use AvoRed\Framework\Report\Report\NewCustomer; | ||
use Illuminate\Support\Facades\Session; | ||
|
||
class ReportController | ||
{ | ||
|
||
/** | ||
* Show Configuration of an AvoRed Admin. | ||
* @return \Illuminate\View\View | ||
*/ | ||
public function index(string $identifier) | ||
{ | ||
$report = app(NewCustomer::class); | ||
Session::put('report_new_customer', []); | ||
$displayReport = false; | ||
|
||
return view('avored::report.new-customer') | ||
->with('timePeriodOptions', $report->options()) | ||
->with('displayReport', $displayReport); | ||
} | ||
|
||
/** | ||
* Show Configuration of an AvoRed Admin. | ||
* @return \Illuminate\Http\RedirectResponse | ||
*/ | ||
public function results(Request $request) | ||
{ | ||
$displayReport = true; | ||
$report = app(NewCustomer::class); | ||
|
||
Session::put('report_new_customer', $request->all()); | ||
|
||
$customers = $report->data($request); | ||
|
||
return view('avored::report.new-customer') | ||
->with('timePeriodOptions', $report->options()) | ||
->with('customers', $customers) | ||
->with('displayReport', $displayReport); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace AvoRed\Framework\Report\Report; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
interface ReportInterface | ||
{ | ||
/** | ||
* Options that is required to for the report filter | ||
* @return mixed | ||
*/ | ||
public function options(); | ||
|
||
/** | ||
* Report data based on the given filter | ||
* @param Request $request | ||
* @return mixed | ||
*/ | ||
public function data(Request $request); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.