aa
This commit is contained in:
@@ -18,6 +18,7 @@ use Illuminate\Support\Facades\DB;
|
|||||||
use App\Orderdetail;
|
use App\Orderdetail;
|
||||||
use App\Services\ProductLogger;
|
use App\Services\ProductLogger;
|
||||||
use App\Order as AppOrder;
|
use App\Order as AppOrder;
|
||||||
|
use App\OrderdetailWeb;
|
||||||
use App\OrderWeb as AppOrderWeb;
|
use App\OrderWeb as AppOrderWeb;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
@@ -524,6 +525,57 @@ function showOrdini()
|
|||||||
return $str;
|
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)
|
function getStructTable($tableName)
|
||||||
{
|
{
|
||||||
$str = '';
|
$str = '';
|
||||||
|
|||||||
17
app/OrderdetailWeb.php
Normal file
17
app/OrderdetailWeb.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class OrderdetailWeb extends Model
|
||||||
|
{
|
||||||
|
//protected $connection = 'mysql_test';
|
||||||
|
protected $connection = 'sqlsrv_test';
|
||||||
|
protected $table = 'T_WEB_Ordini';
|
||||||
|
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
|
|
||||||
<button type="button" data-action="inprevendita">Libri in Prevendita</button>
|
<button type="button" data-action="inprevendita">Libri in Prevendita</button>
|
||||||
<button type="button" data-action="showOrdini">Mostra Ordini</button>
|
<button type="button" data-action="showOrdini">Mostra Ordini</button>
|
||||||
|
<button type="button" data-action="showOrdiniWeb">Mostra Ordini Web</button>
|
||||||
<button type="button" data-action="showDettOrdini">Dettaglio Ordini</button>
|
<button type="button" data-action="showDettOrdini">Dettaglio Ordini</button>
|
||||||
</form>
|
</form>
|
||||||
<div id="result"></div>
|
<div id="result"></div>
|
||||||
|
|||||||
@@ -6192,6 +6192,8 @@ Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) {
|
|||||||
return libriInPrevendita();
|
return libriInPrevendita();
|
||||||
} elseif ($action == 'showOrdini') {
|
} elseif ($action == 'showOrdini') {
|
||||||
return showOrdini();
|
return showOrdini();
|
||||||
|
} elseif ($action == 'showOrdiniWeb') {
|
||||||
|
return showOrdiniWeb();
|
||||||
} elseif ($action == 'setOrdine') {
|
} elseif ($action == 'setOrdine') {
|
||||||
return setOrdine($id, '');
|
return setOrdine($id, '');
|
||||||
} elseif ($action == 'showDettOrdini') {
|
} elseif ($action == 'showDettOrdini') {
|
||||||
|
|||||||
Reference in New Issue
Block a user