I am using DataTable to generate a table where it has a Status field that receives values 1 or 2 and Status with value 1 is Active and 2 is Inactive. how do I show Active / Inactive instead of #
Try to do if else here to print the result but I could not.
This is where I make array of Status: array ('db' = > 'status', 'dt' = > 6),
obs. db is the result that comes from the database and dt is the column in the datatable.
$columns = array(
array( 'db' => 'id', 'dt' => 0),
array( 'db' => 'empresa', 'dt' => 1),
array( 'db' => 'ar', 'dt' => 2),
array( 'db' => 'nf', 'dt' => 3),
array( 'db' => 'tp', 'dt' => 4),
array( 'db' => 'descricao', 'dt' => 5,
'formatter' => function( $d,$row ){
return substr (($d), 0, 46);
}
),
array( 'db' => 'status', 'dt' => 6),
array( 'db' => 'created','dt' => 7,
'formatter' => function( $d, $row ) {
return date( 'd-m-Y - H:i:s', strtotime($d));
}
),
array( 'db' => 'modified','dt' => 8,
'formatter' => function( $d, $row ) {
return date( 'd-m-Y - H:i:s', strtotime($d));
}
)
);
Thank you very much!