aa
This commit is contained in:
@@ -36,7 +36,8 @@
|
|||||||
<h1>Links</h1>
|
<h1>Links</h1>
|
||||||
<form id="articleForm">
|
<form id="articleForm">
|
||||||
<label for="article_id">ID Articolo:</label>
|
<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>
|
<br>
|
||||||
<button type="button" data-action="search">Cerca Articolo</button>
|
<button type="button" data-action="search">Cerca Articolo</button>
|
||||||
<button type="button" data-action="checkPrevendita">E' in PreVendita?</button>
|
<button type="button" data-action="checkPrevendita">E' in PreVendita?</button>
|
||||||
@@ -59,10 +60,13 @@
|
|||||||
buttons.forEach(button => button.addEventListener('click', handleButtonClick));
|
buttons.forEach(button => button.addEventListener('click', handleButtonClick));
|
||||||
|
|
||||||
function handleButtonClick(event) {
|
function handleButtonClick(event) {
|
||||||
const action = event.target.dataset.action;
|
let action = event.target.dataset.action;
|
||||||
let id = '0';
|
let id = '0';
|
||||||
try {
|
try {
|
||||||
id = form.querySelector('input[name="id"]').value;
|
id = form.querySelector('input[name="id"]').value;
|
||||||
|
if (!action) {
|
||||||
|
action = form.querySelector('input[name="action"]').value;
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
id = 0;
|
id = 0;
|
||||||
}
|
}
|
||||||
@@ -85,4 +89,5 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -6171,10 +6171,12 @@ Route::get('/paolibri', function () {
|
|||||||
Route::get('/mylinkspao', function (Illuminate\Http\Request $request) {
|
Route::get('/mylinkspao', function (Illuminate\Http\Request $request) {
|
||||||
try {
|
try {
|
||||||
$id = $request->query('id');
|
$id = $request->query('id');
|
||||||
|
$action = $request->query('action');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$id = '';
|
$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) {
|
Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) {
|
||||||
|
|||||||
Reference in New Issue
Block a user