ordini
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use App\Article;
|
use App\Article;
|
||||||
|
use Codexshaper\WooCommerce\Facades\Order;
|
||||||
use Codexshaper\WooCommerce\Facades\Product;
|
use Codexshaper\WooCommerce\Facades\Product;
|
||||||
use Codexshaper\WooCommerce\Facades\Variation;
|
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()
|
function libriInPrevendita()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<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>
|
||||||
</form>
|
</form>
|
||||||
<div id="result"></div>
|
<div id="result"></div>
|
||||||
<div id="loading"></div>
|
<div id="loading"></div>
|
||||||
|
|||||||
@@ -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) {
|
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) {
|
$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);
|
return loadArticleByIdArticle($id);
|
||||||
} elseif ($action == 'inprevendita') {
|
} elseif ($action == 'inprevendita') {
|
||||||
return libriInPrevendita();
|
return libriInPrevendita();
|
||||||
|
} elseif ($action == 'showOrdini') {
|
||||||
|
return showOrdini();
|
||||||
|
|
||||||
} elseif ($action == 'setPreOrder') {
|
} elseif ($action == 'setPreOrder') {
|
||||||
setPreOrder($id, "1", true);
|
setPreOrder($id, "1", true);
|
||||||
|
|||||||
Reference in New Issue
Block a user