aa
This commit is contained in:
@@ -36,13 +36,14 @@
|
||||
<h1>Links</h1>
|
||||
<form id="articleForm">
|
||||
<label for="article_id">ID Articolo:</label>
|
||||
<input type="text" id="article_id" name="id" value="{{$id}}"/>
|
||||
<input type="text" id="article_id" name="id" value="{{$id}}" />
|
||||
<input type="text" id="action" name="action" value="{{$action}}" hidden />
|
||||
<br>
|
||||
<button type="button" data-action="search">Cerca Articolo</button>
|
||||
<button type="button" data-action="checkPrevendita">E' in PreVendita?</button>
|
||||
<button type="button" data-action="setPreOrder">Impostalo in PreVendita!</button>
|
||||
<br><br>
|
||||
|
||||
|
||||
<button type="button" data-action="inprevendita">Libri in Prevendita</button>
|
||||
<button type="button" data-action="showOrdini">Mostra Ordini</button>
|
||||
<button type="button" data-action="showDettOrdini">Dettaglio Ordini</button>
|
||||
@@ -59,18 +60,21 @@
|
||||
buttons.forEach(button => button.addEventListener('click', handleButtonClick));
|
||||
|
||||
function handleButtonClick(event) {
|
||||
const action = event.target.dataset.action;
|
||||
let action = event.target.dataset.action;
|
||||
let id = '0';
|
||||
try {
|
||||
id = form.querySelector('input[name="id"]').value;
|
||||
} catch (e) {
|
||||
id = 0;
|
||||
if (!action) {
|
||||
action = form.querySelector('input[name="action"]').value;
|
||||
}
|
||||
} catch (e) {
|
||||
id = 0;
|
||||
}
|
||||
|
||||
if (!id) {
|
||||
id = 0;
|
||||
}
|
||||
|
||||
|
||||
loading.style.display = 'block'; // Mostra la clessidra
|
||||
|
||||
let baseUrl = window.location.href;
|
||||
@@ -85,4 +89,5 @@
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
||||
@@ -6171,10 +6171,12 @@ Route::get('/paolibri', function () {
|
||||
Route::get('/mylinkspao', function (Illuminate\Http\Request $request) {
|
||||
try {
|
||||
$id = $request->query('id');
|
||||
$action = $request->query('action');
|
||||
} catch (\Exception $e) {
|
||||
$id = '';
|
||||
$action = '';
|
||||
}
|
||||
return view('mylinkspao', ['id' => $id]);
|
||||
return view('mylinkspao', ['id' => $id, 'action' => $action]);
|
||||
});
|
||||
|
||||
Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) {
|
||||
|
||||
Reference in New Issue
Block a user