reenadak icon

user column in mate

reenadak | PRO | 03/27/18 06:39:54 PM UTC | 0 ⭐ | 398 👁️ | Never ⏰ | []
PHP |

500 B

|

None

|

0 👍

/

0 👎

        $userColumns[] = array('call_back_fun' => array(&$this,'get_days'), 'title' => 'Remaining Days');
        $this->Editor->setConfig('userColumns',$userColumns); 
 
and then 
    function get_days($row)
    {
        $whois = "<a href=\"http://whois.domaintools.com/".$row['domain']."\" target=_blank>whois</a> ";
        $diff = strtotime($row['expiry']) - strtotime(date('Y-m-d'));
        $diff_days = floor($diff/(60*60*24));
        $html = abs($diff_days)<10000 ? '<td>'.$whois.$diff_days.'</td>' : '<td> </td>';
        return $html;
    }

Comments