diff --git a/app/CustomFuncPao.php b/app/CustomFuncPao.php index 65f76b0a..924180f5 100644 --- a/app/CustomFuncPao.php +++ b/app/CustomFuncPao.php @@ -2,6 +2,7 @@ use Illuminate\Support\Facades\DB; use App\Article; +use Codexshaper\WooCommerce\Facades\Order; use Codexshaper\WooCommerce\Facades\Product; use Codexshaper\WooCommerce\Facades\Variation; @@ -236,6 +237,24 @@ function loadArticleByIdArticle($id, $checkprevendita = false) } } +function showOrdini() +{ + $orders = Order::all(); + + $str = ""; + + // Show the fields of the orders + foreach ($orders as $order) { + $str .= "Ordine: "; + $str .= getvalstr("Id", $order->id); + $str .= getvalstr("DataOra", $order->DataOra); + $str .= getvalstr("Totale", $order->Totale); + } + + return $str; + +} + function libriInPrevendita() { try { diff --git a/resources/views/mylinkspao.blade.php b/resources/views/mylinkspao.blade.php index 39518cdc..6b1ad184 100644 --- a/resources/views/mylinkspao.blade.php +++ b/resources/views/mylinkspao.blade.php @@ -44,6 +44,7 @@

+
diff --git a/routes/web.php b/routes/web.php index 290a6f37..8f88fcb4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1865,19 +1865,6 @@ function getvalstr($mystr, $value) { } -Route::get('/test6', function () { - $orders = Order::all(); - - // Show the fields of the orders - foreach ($orders as $order) { - echo "Ordine: "; - getvalstr("Id", $order->id); - getvalstr("DataOra", $order->DataOra); - getvalstr("Totale", $order->Totale); - } - - -}); Route::get('/test7/{name}', function ($name) { $articles = Article::join(DB::raw('(SELECT IdArticolo, MAX(DataOra) AS data FROM T_WEB_Articoli WHERE Titolo LIKE \'%' . $name . '%\' GROUP BY IdArticolo) b'), function ($join) { @@ -6169,6 +6156,8 @@ Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) { return loadArticleByIdArticle($id); } elseif ($action == 'inprevendita') { return libriInPrevendita(); + } elseif ($action == 'showOrdini') { + return showOrdini(); } elseif ($action == 'setPreOrder') { setPreOrder($id, "1", true);