Есть код на js на стороне клиента
$input = $('input[name="available.all"]');
let editfullsqlcondition="";
let fullsqlquery="";
if $(input).on("change", function () {
if $input.checked {
pickupavailable="and goods.deliveryvalue=1";
editfullsqlcondition+=pickupavailable;
/*select * from goods where goods.deliveryvalue=1*/
} else{
if editfullsqlcondition.includes("goods.deliveryvalue=1", 0) {
if editfullsqlcondition.endsWith("goods.deliveryvalue=1")
{
fullsqlcondition=editfullsqlcondition.slice(0, editfullsqlcondition.length-" and goods.deliveryvalue=1".length);
}
else {
fullsqlcondition=editfullsqlcondition.slice(0, editfullsqlcondition.indexOf("goods.deliveryvalue=1 and ",
0))+editfullsqlcondition.slice(editfullsqlcondition.length - editfullsqlcondition.indexOf("goods.deliveryvalue=1 and ", 0) - editfullsqlcondition.length,
editfullsqlcondition.length)
}
}
}
}
console.log(fullsqlcondition);
);
Каким образом можно оформить передачу и обработку выбора чекбокса на стороне сервера? Событие if $(input).on("change", function () { ... })
должно быть оформлено в рhp коде.