This commit is contained in:
paoloar77
2024-07-22 11:37:56 +02:00
parent 9df0e3a51b
commit 550712acb6
4 changed files with 72 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ use Illuminate\Support\Facades\DB;
use App\Orderdetail;
use App\Services\ProductLogger;
use App\Order as AppOrder;
use App\OrderdetailWeb;
use App\OrderWeb as AppOrderWeb;
use Illuminate\Support\Facades\Schema;
@@ -524,6 +525,57 @@ function showOrdini()
return $str;
}
function showOrdiniWeb()
{
$str = "";
try {
// $str = Schema::getColumnListing('Orderdetails');
$orders = OrderdetailWeb::orderBy('DataOra', 'desc')
->take(5)
->get();
$sep = "";
$baseUrl = Request::root(); // URL di base (dominio)
// Show the fields of the orders
foreach ($orders as $order) {
$product = Product::where('sku', $order->CodArticoloGM)->first();
if ($product)
$titolo = "<a href='" . $product['permalink'] . "' target='_blank'><span style='font-weigth: bold;'>" . $product['name'] . "</span></a>";
else
$titolo = "";
$str .= getvalstr("", $order->Codice) . " ";
$str .= getvalstr("", $order->DataOra);
$str .= getvalstr("", $titolo);
$str .= getvalstr("Ordine", $order->IdInternet, true) . " ";
$str .= getvalstr("Articolo", $order->CodArticoloGM, true);
$str .= getvalstr("Prezzo", $order->PrezzoLordo);
$str .= getvalstr("Quantità", $order->Qta);
if ($order->PercSconto)
$str .= getvalstr("Sconto", $order->PercSconto);
if ($order->Descrizione)
$str .= getvalstr("Descr", $order->Descrizione);
$str .= '<a href="' . $baseUrl . '/setordine/' . $order->IdInternet . '/del/" target="_blank">ELIMINA!</a>' . $sep;
// $str .= getarraystr($product) . "<br>";
// $str .= $product;
$str .= '<br>';
}
} catch (\Exception $e) {
return "Errore: " . $e->getMessage();
}
return $str;
}
function getStructTable($tableName)
{
$str = '';