PHP code
<?php
//for service 1
$all_activities = "select * from activity join displayserviceactivitymap on activity.activity_id = displayserviceactivitymap.activity_id right join services on services.service_id = displayserviceactivitymap.service_id";
$all_activities = $conn->query($all_activities) or die ($conn>error.__LINE__);
$activities = [];
while ($row = $all_activities->fetch_assoc()) {
$activities[] = $row;
}
$repeated = 'repeated';
foreach ($activities as $act) {
if($act['servicename'] != $repeated){
echo '<br><input type="checkbox" name="arr['.$act['service_id'].'][service]" value="'.$act['service_id'].'" id="'.$act['service_id'].'">'.$act['service_id'].$act['servicename'].'<br>';
$repeated = $act['servicename'];
}
if($act['activity_id'] != '')
echo '<input type="checkbox" name="arr['.$act['service_id'].'][activity][]" value="'.$act['activity_id'].'" id="'.$act['activity_id'].'">'.$act['nameofactivity'].'<br>';
}
?>
Output of This code is
- Incometax
- Return
- Filling
- Billing
- Tax Invoice
- GST
- Compnay
- Format
- GSTR
- TDS
- Return
- ICRT
- Accomplish
In this Output Incometax,GST,TDS are services. I want To display related activity when check service checkbox and hide activity when uncheck checkbox.
For example :-
When I click on Incometax service1 checkbox then activity related to service 1 return,filling,billing,tax invoice display.
When I click on GST service2 checkbox then activity related to service 2 display.
Same for all. Thank you.
Aucun commentaire:
Enregistrer un commentaire