diff --git a/app/CustomFuncPao.php b/app/CustomFuncPao.php index c61f5e7a..c9bf7cfb 100644 --- a/app/CustomFuncPao.php +++ b/app/CustomFuncPao.php @@ -706,7 +706,61 @@ function showDettOrdini() return $str; } -function showDettOrdiniWeb($idordine) +function showDettSingleOrdine($idordine) +{ + $str = "Ordini Woocommerce:" . PHP_EOL . '
'; + + try { + // sort DataOra desc + $orders = AppOrder::where('IdInternet', $idordine)->get(); + + // Show the fields of the orders + foreach ($orders as $order) { + $str .= getvalstr("IdInternet", $order->IdInternet, true) . " "; + $str .= getvalstr("CodCliente", $order->CodClienteInternet, true); + $str .= getvalstr("IdSito", $order->IdSito, true); + $str .= getvalstr("Note", $order->Note, true); + $str .= getvalstr("Totale", $order->Totale, true); + $str .= getvalstr("DataOra", $order->DataOra, true); + $str .= getvalstr("DataSpedizione", $order->DataSpedizione, true); + $str .= '
'; + } + + } catch (\Exception $e) { + return "Errore showDettOrdini: " . $e->getMessage(); + } + + return $str; +} + +function showDettOrdiniWeb() +{ + try { + + $str = "Ordini T_WEB_TestateOrdini:" . PHP_EOL . '
'; + + $orders = AppOrderWeb::all()->sortByDesc('DataOra'); + + // Show the fields of the orders + foreach ($orders as $order) { + $str .= "Ordine: "; + $str .= getvalstr("IdInternet", $order->IdInternet, true) . " "; + $str .= getvalstr("CodCliente", $order->CodClienteInternet, true); + $str .= getvalstr("IdSito", $order->IdSito, true); + $str .= getvalstr("Note", $order->Note, true); + $str .= getvalstr("Totale", $order->Totale, true); + $str .= getvalstr("DataOra", $order->DataOra, true); + $str .= getvalstr("DataSpedizione", $order->DataSpedizione, true); + $str .= '
'; + } + } catch (\Exception $e) { + return "Errore showDettOrdini: " . $e->getMessage(); + } + + return $str; +} + +function showDettSingleOrdineWeb($idordine) { try { diff --git a/resources/views/mylinkspao.blade.php b/resources/views/mylinkspao.blade.php index e2853770..e8de82ab 100644 --- a/resources/views/mylinkspao.blade.php +++ b/resources/views/mylinkspao.blade.php @@ -50,6 +50,8 @@ + +

diff --git a/routes/web.php b/routes/web.php index b044995a..9f8d52e0 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6200,7 +6200,11 @@ Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) { } elseif ($action == 'showDettOrdini') { return showDettOrdini(); } elseif ($action == 'showDettOrdiniWeb') { - return showDettOrdiniWeb($id); + return showDettOrdiniWeb(); + } elseif ($action == 'showDettSingleOrdine') { + return showDettSingleOrdine($id); + } elseif ($action == 'showDettSingleOrdineWeb') { + return showDettSingleOrdineWeb($id); } elseif ($action == 'setDataPubblicazione') { setDataPubblicazione($id, true); } elseif ($action == 'setPreOrder') {