|
@@ -184,16 +184,38 @@ Route::group(['middleware' => 'auth'],function(){
|
|
|
}
|
|
}
|
|
|
if ($_GET["filterCategories"] != "null")
|
|
if ($_GET["filterCategories"] != "null")
|
|
|
{
|
|
{
|
|
|
- $cc = array();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $categories = [];
|
|
|
$cats = explode(",", $_GET["filterCategories"]);
|
|
$cats = explode(",", $_GET["filterCategories"]);
|
|
|
|
|
+
|
|
|
|
|
+ // Per ogni causale, se ha dei figli allora aggiungo le causali figlio
|
|
|
foreach($cats as $c)
|
|
foreach($cats as $c)
|
|
|
|
|
+ {
|
|
|
|
|
+ $categories[] = $c;
|
|
|
|
|
+ $childs = \App\Models\Category::where('parent_id', $c)->get();
|
|
|
|
|
+ foreach($childs as $_cc)
|
|
|
|
|
+ {
|
|
|
|
|
+ $categories[] = $_cc->id;
|
|
|
|
|
+ $childss = \App\Models\Category::where('parent_id', $_cc->id)->get();
|
|
|
|
|
+ foreach($childss as $ccc)
|
|
|
|
|
+ {
|
|
|
|
|
+ $categories[] = $ccc->id;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $cc = array();
|
|
|
|
|
+ foreach($categories as $c)
|
|
|
{
|
|
{
|
|
|
$m_ids = \App\Models\MemberCategory::where('category_id', $c)->pluck('member_id')->toArray();
|
|
$m_ids = \App\Models\MemberCategory::where('category_id', $c)->pluck('member_id')->toArray();
|
|
|
- if (sizeof($cc) > 0)
|
|
|
|
|
|
|
+ /*if (sizeof($cc) > 0)
|
|
|
$cc = array_intersect($cc, $m_ids);
|
|
$cc = array_intersect($cc, $m_ids);
|
|
|
else
|
|
else
|
|
|
$cc = $m_ids;
|
|
$cc = $m_ids;
|
|
|
|
|
+ */
|
|
|
|
|
+ $cc = array_merge($cc, $m_ids);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
$x = $x->whereIn('id', $cc);
|
|
$x = $x->whereIn('id', $cc);
|
|
|
//$cats_ids = \App\Models\MemberCategory::whereIn('category_id', explode(",", $_GET["filterCategories"]))->pluck('member_id');
|
|
//$cats_ids = \App\Models\MemberCategory::whereIn('category_id', explode(",", $_GET["filterCategories"]))->pluck('member_id');
|
|
|
//$x = $x->whereIn('id', $cats_ids);
|
|
//$x = $x->whereIn('id', $cats_ids);
|
|
@@ -365,14 +387,16 @@ Route::group(['middleware' => 'auth'],function(){
|
|
|
|
|
|
|
|
$datas = [];
|
|
$datas = [];
|
|
|
|
|
|
|
|
- $x = \App\Models\Record::select('records.*', \DB::raw('members.first_name as first_name'), \DB::raw('members.last_name as last_name'), \DB::raw('payment_methods.name as payment')) // , \DB::raw('SUM(records.id) As total'))
|
|
|
|
|
|
|
+ $x = \App\Models\Record::select('records.*', \DB::raw('members.first_name as first_name'), \DB::raw('members.last_name as last_name'), \DB::raw('payment_methods.name as payment'), \DB::raw('receipts.created_at as receipt_date')) // , \DB::raw('SUM(records.id) As total'))
|
|
|
->leftJoin('members', 'records.member_id', '=', 'members.id')
|
|
->leftJoin('members', 'records.member_id', '=', 'members.id')
|
|
|
->leftJoin('payment_methods', 'records.payment_method_id', '=', 'payment_methods.id')
|
|
->leftJoin('payment_methods', 'records.payment_method_id', '=', 'payment_methods.id')
|
|
|
|
|
+ ->leftJoin('receipts', 'records.id', '=', 'receipts.record_id')
|
|
|
->where('records.type', 'IN');
|
|
->where('records.type', 'IN');
|
|
|
|
|
|
|
|
$y = \App\Models\Record::select('records_rows.amount', 'records.member_id', 'records.corrispettivo_fiscale', 'records.deleted', 'records.financial_movement', 'records_rows.causal_id', \DB::raw('members.first_name as first_name'), \DB::raw('members.last_name as last_name')) // , \DB::raw('SUM(records.id) As total'))
|
|
$y = \App\Models\Record::select('records_rows.amount', 'records.member_id', 'records.corrispettivo_fiscale', 'records.deleted', 'records.financial_movement', 'records_rows.causal_id', \DB::raw('members.first_name as first_name'), \DB::raw('members.last_name as last_name')) // , \DB::raw('SUM(records.id) As total'))
|
|
|
->leftJoin('members', 'records.member_id', '=', 'members.id')
|
|
->leftJoin('members', 'records.member_id', '=', 'members.id')
|
|
|
->leftJoin('records_rows', 'records.id', '=', 'records_rows.record_id')
|
|
->leftJoin('records_rows', 'records.id', '=', 'records_rows.record_id')
|
|
|
|
|
+ //->leftJoin('receipts', 'records.id', '=', 'receipts.record_id')
|
|
|
->where('records.type', 'IN');
|
|
->where('records.type', 'IN');
|
|
|
|
|
|
|
|
$hasFilter = false;
|
|
$hasFilter = false;
|
|
@@ -415,32 +439,48 @@ Route::group(['middleware' => 'auth'],function(){
|
|
|
if ($_GET["filterCommercial"] == 1)
|
|
if ($_GET["filterCommercial"] == 1)
|
|
|
{
|
|
{
|
|
|
$hasFilter = true;
|
|
$hasFilter = true;
|
|
|
- $x = $x->where('commercial', true );
|
|
|
|
|
|
|
+ $x = $x->where('records.commercial', true );
|
|
|
$y = $y->where('records.commercial', true );
|
|
$y = $y->where('records.commercial', true );
|
|
|
}
|
|
}
|
|
|
if ($_GET["filterCommercial"] == 2)
|
|
if ($_GET["filterCommercial"] == 2)
|
|
|
{
|
|
{
|
|
|
$hasFilter = true;
|
|
$hasFilter = true;
|
|
|
- $x = $x->where('commercial', false);
|
|
|
|
|
|
|
+ $x = $x->where('records.commercial', false);
|
|
|
$y = $y->where('records.commercial', false);
|
|
$y = $y->where('records.commercial', false);
|
|
|
}
|
|
}
|
|
|
if ($_GET["filterMember"] > 0)
|
|
if ($_GET["filterMember"] > 0)
|
|
|
{
|
|
{
|
|
|
$hasFilter = true;
|
|
$hasFilter = true;
|
|
|
- $x = $x->where('member_id', $_GET["filterMember"]);
|
|
|
|
|
- $y = $y->where('member_id', $_GET["filterMember"]);
|
|
|
|
|
|
|
+ $x = $x->where('records.member_id', $_GET["filterMember"]);
|
|
|
|
|
+ $y = $y->where('records.member_id', $_GET["filterMember"]);
|
|
|
}
|
|
}
|
|
|
if ($_GET["filterPaymentMethod"] != "null")
|
|
if ($_GET["filterPaymentMethod"] != "null")
|
|
|
{
|
|
{
|
|
|
$hasFilter = true;
|
|
$hasFilter = true;
|
|
|
$payments = explode(",", $_GET["filterPaymentMethod"]);
|
|
$payments = explode(",", $_GET["filterPaymentMethod"]);
|
|
|
- $x = $x->whereIn('payment_method_id', $payments);
|
|
|
|
|
- $y = $y->whereIn('payment_method_id', $payments);
|
|
|
|
|
|
|
+ $x = $x->whereIn('records.payment_method_id', $payments);
|
|
|
|
|
+ $y = $y->whereIn('records.payment_method_id', $payments);
|
|
|
}
|
|
}
|
|
|
if ($_GET["filterCausals"] != "null")
|
|
if ($_GET["filterCausals"] != "null")
|
|
|
{
|
|
{
|
|
|
$hasFilter = true;
|
|
$hasFilter = true;
|
|
|
$causals = explode(",", $_GET["filterCausals"]);
|
|
$causals = explode(",", $_GET["filterCausals"]);
|
|
|
|
|
+
|
|
|
|
|
+ // Per ogni causale, se ha dei figli allora aggiungo le causali figlio
|
|
|
|
|
+ foreach($causals as $c)
|
|
|
|
|
+ {
|
|
|
|
|
+ $childs = \App\Models\Causal::where('parent_id', $c)->get();
|
|
|
|
|
+ foreach($childs as $cc)
|
|
|
|
|
+ {
|
|
|
|
|
+ $causals[] = $cc->id;
|
|
|
|
|
+ $childss = \App\Models\Causal::where('parent_id', $cc->id)->get();
|
|
|
|
|
+ foreach($childss as $ccc)
|
|
|
|
|
+ {
|
|
|
|
|
+ $causals[] = $ccc->id;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//$causals = \App\Models\RecordRow::where('causal_id', $_GET["filterCausals"])->pluck('record_id');
|
|
//$causals = \App\Models\RecordRow::where('causal_id', $_GET["filterCausals"])->pluck('record_id');
|
|
|
$causals = \App\Models\RecordRow::whereIn('causal_id', $causals)->pluck('record_id');
|
|
$causals = \App\Models\RecordRow::whereIn('causal_id', $causals)->pluck('record_id');
|
|
|
$x = $x->whereIn('records.id', $causals);
|
|
$x = $x->whereIn('records.id', $causals);
|
|
@@ -449,13 +489,13 @@ Route::group(['middleware' => 'auth'],function(){
|
|
|
if ($_GET["filterFrom"] != '')
|
|
if ($_GET["filterFrom"] != '')
|
|
|
{
|
|
{
|
|
|
$hasFilter = true;
|
|
$hasFilter = true;
|
|
|
- $x = $x->where('date', '>=', $_GET["filterFrom"]);
|
|
|
|
|
|
|
+ $x = $x->where('records.date', '>=', $_GET["filterFrom"]);
|
|
|
$y = $y->where('date', '>=', $_GET["filterFrom"]);
|
|
$y = $y->where('date', '>=', $_GET["filterFrom"]);
|
|
|
}
|
|
}
|
|
|
if ($_GET["filterTo"] != '')
|
|
if ($_GET["filterTo"] != '')
|
|
|
{
|
|
{
|
|
|
$hasFilter = true;
|
|
$hasFilter = true;
|
|
|
- $x = $x->where('date', '<=', $_GET["filterTo"]);
|
|
|
|
|
|
|
+ $x = $x->where('records.date', '<=', $_GET["filterTo"]);
|
|
|
$y = $y->where('date', '<=', $_GET["filterTo"]);
|
|
$y = $y->where('date', '<=', $_GET["filterTo"]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -553,12 +593,14 @@ Route::group(['middleware' => 'auth'],function(){
|
|
|
$datas[] = array(
|
|
$datas[] = array(
|
|
|
//'id' => $r->id,
|
|
//'id' => $r->id,
|
|
|
'date' => $r->date,
|
|
'date' => $r->date,
|
|
|
|
|
+ //'date' => $r->receipt_date != null ? $r->receipt_date : "",
|
|
|
'total' => formatPrice($r->getTotal()),
|
|
'total' => formatPrice($r->getTotal()),
|
|
|
'first_name' => $r->first_name,
|
|
'first_name' => $r->first_name,
|
|
|
'last_name' => $r->last_name,
|
|
'last_name' => $r->last_name,
|
|
|
'commercial' => $r->financial_movement ? 'Movimento finanziario' : ($r->commercial ? 'SI' : 'NO'),
|
|
'commercial' => $r->financial_movement ? 'Movimento finanziario' : ($r->commercial ? 'SI' : 'NO'),
|
|
|
'causals' => $causals,
|
|
'causals' => $causals,
|
|
|
'payment' => $r->payment_method->name,
|
|
'payment' => $r->payment_method->name,
|
|
|
|
|
+ //'payment_date' => date("d/m/Y", strtotime($r->date)),
|
|
|
'status' => $r->deleted ? 'Annullato' : '',
|
|
'status' => $r->deleted ? 'Annullato' : '',
|
|
|
'action' => $r->id . "||" . ($r->deleted ? 'x' : '')
|
|
'action' => $r->id . "||" . ($r->deleted ? 'x' : '')
|
|
|
);
|
|
);
|
|
@@ -617,6 +659,22 @@ Route::group(['middleware' => 'auth'],function(){
|
|
|
if ($_GET["filterCausals"] != "null")
|
|
if ($_GET["filterCausals"] != "null")
|
|
|
{
|
|
{
|
|
|
$causals = explode(",", $_GET["filterCausals"]);
|
|
$causals = explode(",", $_GET["filterCausals"]);
|
|
|
|
|
+
|
|
|
|
|
+ // Per ogni causale, se ha dei figli allora aggiungo le causali figlio
|
|
|
|
|
+ foreach($causals as $c)
|
|
|
|
|
+ {
|
|
|
|
|
+ $childs = \App\Models\Causal::where('parent_id', $c)->get();
|
|
|
|
|
+ foreach($childs as $cc)
|
|
|
|
|
+ {
|
|
|
|
|
+ $causals[] = $cc->id;
|
|
|
|
|
+ $childss = \App\Models\Causal::where('parent_id', $cc->id)->get();
|
|
|
|
|
+ foreach($childss as $ccc)
|
|
|
|
|
+ {
|
|
|
|
|
+ $causals[] = $ccc->id;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//$causals = \App\Models\RecordRow::where('causal_id', $_GET["filterCausals"])->pluck('record_id');
|
|
//$causals = \App\Models\RecordRow::where('causal_id', $_GET["filterCausals"])->pluck('record_id');
|
|
|
$causals = \App\Models\RecordRow::whereIn('causal_id', $causals)->pluck('record_id');
|
|
$causals = \App\Models\RecordRow::whereIn('causal_id', $causals)->pluck('record_id');
|
|
|
$x = $x->whereIn('records.id', $causals);
|
|
$x = $x->whereIn('records.id', $causals);
|
|
@@ -761,6 +819,76 @@ Route::group(['middleware' => 'auth'],function(){
|
|
|
|
|
|
|
|
$xxx = 1;
|
|
$xxx = 1;
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ $sortColumn = '';
|
|
|
|
|
+ if (isset($_GET["order"]))
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+ $column = '';
|
|
|
|
|
+ $sort_value = 0;
|
|
|
|
|
+ if (isset($_GET["order"]))
|
|
|
|
|
+ {
|
|
|
|
|
+ $f = $_GET["order"][0]["column"];
|
|
|
|
|
+ $d = $_GET["order"][0]["dir"];
|
|
|
|
|
+ if ($f >= 5 && $f <= 16)
|
|
|
|
|
+ {
|
|
|
|
|
+ $column = 'column_' . ($f - 2);
|
|
|
|
|
+ if (session()->get('sort_column'))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (session()->get('sort_column') != $f)
|
|
|
|
|
+ {
|
|
|
|
|
+ session()->put('sort_column', $f);
|
|
|
|
|
+ session()->put('sort_order', $d);
|
|
|
|
|
+ session()->put('sort_value', 0);
|
|
|
|
|
+ $sort_value = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (session()->get('sort_order') == $d)
|
|
|
|
|
+ {
|
|
|
|
|
+ //session()->put('sort_value', 0);
|
|
|
|
|
+ $sort_value = session()->get('sort_value', 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (session()->get('sort_value', 0) == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $sort_value = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (session()->get('sort_value', 0) == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ $sort_value = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (session()->get('sort_value', 0) == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ $sort_value = 3;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (session()->get('sort_value', 0) == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ $sort_value = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ session()->put('sort_value', $sort_value);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ session()->put('sort_order', $d);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ session()->put('sort_column', $f);
|
|
|
|
|
+ session()->put('sort_order', $d);
|
|
|
|
|
+ session()->put('sort_value', 0);
|
|
|
|
|
+ $sort_value = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //print $sort_value;
|
|
|
|
|
+
|
|
|
$member_course_totals = $member_course->get();
|
|
$member_course_totals = $member_course->get();
|
|
|
foreach($member_course_totals as $x)
|
|
foreach($member_course_totals as $x)
|
|
|
{
|
|
{
|
|
@@ -804,8 +932,6 @@ Route::group(['middleware' => 'auth'],function(){
|
|
|
$totals[$i]['orange'] = 0;
|
|
$totals[$i]['orange'] = 0;
|
|
|
$totals[$i]['yellow'] = 0;
|
|
$totals[$i]['yellow'] = 0;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
if ($cls == 'yellow')
|
|
if ($cls == 'yellow')
|
|
|
{
|
|
{
|
|
|
$totals[$i][$cls] += 1;
|
|
$totals[$i][$cls] += 1;
|
|
@@ -824,6 +950,135 @@ Route::group(['middleware' => 'auth'],function(){
|
|
|
else
|
|
else
|
|
|
$totalIsc[$sub] = $subPrice;
|
|
$totalIsc[$sub] = $subPrice;
|
|
|
|
|
|
|
|
|
|
+ $s = 0;
|
|
|
|
|
+ if ($column != '')
|
|
|
|
|
+ {
|
|
|
|
|
+ $z = 0;
|
|
|
|
|
+ switch ($column) {
|
|
|
|
|
+ case 'column_3':
|
|
|
|
|
+ $z = 9;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'column_4':
|
|
|
|
|
+ $z = 10;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'column_5':
|
|
|
|
|
+ $z = 11;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'column_6':
|
|
|
|
|
+ $z = 12;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'column_7':
|
|
|
|
|
+ $z = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'column_8':
|
|
|
|
|
+ $z = 2;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'column_9':
|
|
|
|
|
+ $z = 3;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'column_10':
|
|
|
|
|
+ $z = 4;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'column_11':
|
|
|
|
|
+ $z = 5;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'column_12':
|
|
|
|
|
+ $z = 6;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'column_13':
|
|
|
|
|
+ $z = 7;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'column_14':
|
|
|
|
|
+ $z = 8;
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ $z = 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ $c = getColor($x->months, $z);
|
|
|
|
|
+ if ($sort_value == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch ($c) {
|
|
|
|
|
+ case 'wgrey':
|
|
|
|
|
+ $s = 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'orange':
|
|
|
|
|
+ $s = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'green':
|
|
|
|
|
+ $s = 2;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'yellow':
|
|
|
|
|
+ $s = 3;
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ $s = 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($sort_value == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch ($c) {
|
|
|
|
|
+ case 'wgrey':
|
|
|
|
|
+ $s = 3;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'orange':
|
|
|
|
|
+ $s = 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'green':
|
|
|
|
|
+ $s = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'yellow':
|
|
|
|
|
+ $s = 2;
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ $s = 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($sort_value == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch ($c) {
|
|
|
|
|
+ case 'wgrey':
|
|
|
|
|
+ $s = 2;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'orange':
|
|
|
|
|
+ $s = 3;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'green':
|
|
|
|
|
+ $s = 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'yellow':
|
|
|
|
|
+ $s = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ $s = 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($sort_value == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch ($c) {
|
|
|
|
|
+ case 'wgrey':
|
|
|
|
|
+ $s = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'orange':
|
|
|
|
|
+ $s = 2;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'green':
|
|
|
|
|
+ $s = 3;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'yellow':
|
|
|
|
|
+ $s = 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ $s = 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$datas[] = array(
|
|
$datas[] = array(
|
|
|
"column_19" => $x->course->name,
|
|
"column_19" => $x->course->name,
|
|
|
"column_0" => $x->member->last_name,
|
|
"column_0" => $x->member->last_name,
|
|
@@ -844,7 +1099,8 @@ Route::group(['middleware' => 'auth'],function(){
|
|
|
"column_15" => $x->course_id,
|
|
"column_15" => $x->course_id,
|
|
|
"column_16" => $x->id,
|
|
"column_16" => $x->id,
|
|
|
"column_17" => $x->member_id,
|
|
"column_17" => $x->member_id,
|
|
|
- "column_18" => $xxx++
|
|
|
|
|
|
|
+ "column_18" => $xxx++,
|
|
|
|
|
+ "column_20" => $s
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -890,7 +1146,10 @@ Route::group(['middleware' => 'auth'],function(){
|
|
|
{
|
|
{
|
|
|
$s = $_GET["order"][0]["column"];
|
|
$s = $_GET["order"][0]["column"];
|
|
|
if ($s == 1) $s = 21;
|
|
if ($s == 1) $s = 21;
|
|
|
- array_multisort(array_column($datas, 'column_' . ($s - 2)), $_GET["order"][0]["dir"] == "asc" ? SORT_ASC : SORT_DESC, SORT_NATURAL|SORT_FLAG_CASE, $datas);
|
|
|
|
|
|
|
+ if ($column != '')
|
|
|
|
|
+ array_multisort(array_column($datas, 'column_20'), SORT_ASC, SORT_NATURAL|SORT_FLAG_CASE, $datas);
|
|
|
|
|
+ else
|
|
|
|
|
+ array_multisort(array_column($datas, 'column_' . ($s - 2)), $_GET["order"][0]["dir"] == "asc" ? SORT_ASC : SORT_DESC, SORT_NATURAL|SORT_FLAG_CASE, $datas);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$xxx = 1;
|
|
$xxx = 1;
|
|
@@ -1270,3 +1529,39 @@ Route::get('/updateCourseCausal', function(){
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+Route::get('/test_sms', function()
|
|
|
|
|
+{
|
|
|
|
|
+
|
|
|
|
|
+ $expire_date = date("Y-m-d", strtotime("+1 month"));
|
|
|
|
|
+ $expire_date_it = date("d/m/Y", strtotime("+1 month"));
|
|
|
|
|
+ $certificates = \App\Models\MemberCertificate::where('expire_date', $expire_date)->get();
|
|
|
|
|
+ foreach($certificates as $certificate)
|
|
|
|
|
+ {
|
|
|
|
|
+ //$phone = $certificate->member->phone;
|
|
|
|
|
+ $phone = '3893163265';
|
|
|
|
|
+ $params = array(
|
|
|
|
|
+ 'to' => '+39' . $phone,
|
|
|
|
|
+ 'from' => env('SMS_FROM', 'Test'),
|
|
|
|
|
+ 'message' => $certificate->member->first_name . ', il tuo certificato medico scadrà il ' . $expire_date_it,
|
|
|
|
|
+ 'format' => 'json',
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ sms_send($params);
|
|
|
|
|
+ print "Inviato";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /*
|
|
|
|
|
+
|
|
|
|
|
+ $params = array(
|
|
|
|
|
+ 'to' => '+393893163265',
|
|
|
|
|
+ 'from' => env('SMS_FROM', 'Test'),
|
|
|
|
|
+ 'message' => 'Prova SMS da IAO',
|
|
|
|
|
+ 'format' => 'json',
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ echo sms_send($params);
|
|
|
|
|
+
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+});
|