Disable html button within an associative array php

McGooks :

I have created an associative array, based on a variables i already initalised. The idea is to output the items in the array to an html table. I have the table populating and working fine, except for one small issue - if the user returns a NULL value for $aid, the html control below is still clickable.

$User[] = array('acc_id' => $acc_id, 
                'uid' => $uid, 
                'fname' => $fname, 
                'lname' => $lname, 
                'gender' => $gender, 
                'utype' => $utype, 
                'isArt' => $isArt, 
                'isAct' => $isAct, 
                'cont' => "<p class='buttons is-right'>
                               <a href='artistadmin.php?performer=**$aid**' class='button is-small'>
                                   <span class='icon'>
                                       <i class='fas fa-crown'></i>
                                   </span>
                               </a>
                               <a href='useradmin.php?account=$acc_id' class='button is-small'>
                                   <span class='icon'>
                                       <i class='fas fa-edit'></i>
                                   </span>
                               </a>
                               <a class='button is-small is-danger'>
                                   <span class='icon'>
                                       <i class='fas fa-trash-alt'></i>
                                   </span>
                               </a>
                           </p>");

I was looking for a way to disable this? The table is being populated by a nested foreach statement also.

Any advice would be great

Wong :

You can use (empty($aid)? '' : '<your html code here>') in your array

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=33070&siteId=1