php - How to Create Color Status When Pending/Approval/Disapprove -


i'm planning create status notification. example, whenever information

"pending", turns color orange. when "approved" turns color green , when  "disapproved", turns color red 

i've created "status" column in every data submitted. so, when call value. here's code

while($objstat = $query->fetch_object()){   echo "status: ".$objstat->status; } 

i want put bootstrap danger,success,info etc color of status. please there. :)

you need add if/else condition it. btw returning in $objstat->status?

try sample below

<?php while($objstat = $query->fetch_object()) {     //echo "status: ".$objstat->status;     if($objstat->status == "approved")     {         echo '<div class="alert alert-success" role="alert">                 done! pending message.             </div>';     }     else if($objstat->status == "pending")     {         echo '<div class="alert alert-warning" role="alert">                 warning! pending message.             </div>';     }     else if($objstat->status == "disapproved")     {         echo '<div class="alert alert-danger" role="alert">                 danger! disapproved message.             </div>';     } } ?> 

Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -