Reputation: 321
how to create a button to hide the value of the database. for example :
<a href="#alatrusak" class="btn pull-right btn-danger btn3d" id="alatrusakshow" value="<?php echo $detail['status'] ?> ">
value status = 1 and 2
if button1 value status = 1 results show
and
if button1 value status = 2 results hidden
Upvotes: 2
Views: 1424
Reputation: 3855
That's it!! For more detail on conditional statement check this
<?php if($detail['status']=='1') { ?>
<!-- Show anything you want to display when status = 1 -->
<a href="#alatrusak" class="btn pull-right btn-danger btn3d" id="alatrusakshow" value="<?php echo $detail['status'] ?>">
<?php } ?>
Upvotes: 0
Reputation: 408
Underneath your button you would just check the value of $detail['status']
<?php
if ($detail['status'] == 1) {
// echo results
} else {
// echo no result message
}
?>
Upvotes: 1
Reputation: 2094
get the value from db $status=$detail['status'] ; and check if present and show it . very simple :)
<?php
$status=$detail['status'] ;
if($status==1){
?>
<a href="#alatrusak" class="btn pull-right btn-danger btn3d" id="alatrusakshow" value="<?php echo $status;?> ">
<?php
}
elseif($status==2){
?>
<a href="#alatrusak" class="btn pull-right btn-danger btn3d" id="alatrusakshow" value="<?php echo $status;?> ">
<?php
}
Upvotes: 0