I'm making a form, and I have not found anything similar in the searches I've done.
I have the code link I am getting popular they usually,
When selecting a date, it populates the region, when the popular region populate a professional, and when popular the professional, it populates the schedule.
However, I need to select a checkbox for 'type of supplementary exam', it will bring information from the JSON of professional and also from checkbox to the time select. What I need is to create an array that has both ids, both professional and checkbox, in time.
I need to have the 2 parameters (professional and (type of exam) be sent to the same array, and return to the select (schedules) I'm using a json switch case
I have to pass the checkbox parameter and it interacts with the array of professional, and refresh the schedule, that's basically it
<?php
header('Content-type: text/json'); $retorno = array();
switch($_POST['profissional']) { case '21': //
$retorno = array( 0 => "Selecione um horário",
41 => "18h30",
);
break; case '24': //
$retorno = array( 0 => "Selecione um horário",
42 => "18h50",
);
break;
case '27': //
$retorno = array( 0 => "Selecione um horário",
43 => "20h30",
);
break; case '30': //
$retorno = array( 0 => "Selecione um horário",
44 => "20h00",
);
break;
case '33': //
$retorno = array( 0 => "Selecione um horário",
45 => "22h45",
);
break;
case '35': //
$retorno = array( 0 => "Selecione um horário",
46 => "22h00",
);
break; }
echo json_encode($retorno);
?>
// call checkbox
<?php
header('Content-type: text/json');
$retorno = array();
switch($_POST['inlineCheckbox1'])
{
case 'option1': // regiao 1
$retorno = array(
0 => "Selecione um horário (checkbox)",
91 => "18h30",
95 => "19h30",
);
break;
case 'option2': // regiao 2
$retorno = array(
0 => "Selecione um horário (checkbox)",
92 => "18h50",
99 => "22h50",
);
break;
case 'option3': // regiao 2
$retorno = array(
0 => "Selecione um horário (checkbox)",
93 => "20h30",
97 => "22h30",
);
break;
}
echo json_encode($retorno);
?>
How can I make this change in the array to receive the 2 parameters?
Can anyone help me? Thanks in advance.