Skip to main content
Topic: Show Data with if statement (Read 1855 times) previous topic - next topic

Show Data with if statement

Hi All

How to show data in List Page Column with if statement
 for example
i have column data "Status" int(1), if data 1 = Success, 0 = Failed.

i struggle with this !! HELP

Re: Show Data with if statement

Reply #1
@cnmycrl‍ go to the List Page Field Properties of that field and change DisplayType to Custom, then replace the CustomCode content
Code: [Select]
<span><?php echo $data['Status']; ?></span>
with this
Code: [Select]
<span><?php echo ($data['Status'] == 1) ? "Success" : "Failed"; ?></span>

Re: Show Data with if statement

Reply #2
Hi Thanks for code!!. I will try it , God Bless

Re: Show Data with if statement

Reply #3
That a error !!

Notice: Undefined variable: data in C:\xampp\htdocs\serverbackup\app\views\partials\backup_ifs\list.php on line 88
Failed

What i miss?


 

Re: Show Data with if statement

Reply #5
Thanks i used PHPRAD vue before and doesn't work. but in classic phprad its work fine. Thanks !! God Bless