Advertisement
reenadak

user column in mate

Mar 27th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1.         $userColumns[] = array('call_back_fun' => array(&$this,'get_days'), 'title' => 'Remaining Days');
  2.         $this->Editor->setConfig('userColumns',$userColumns);
  3.  
  4. and then
  5.     function get_days($row)
  6.     {
  7.         $whois = "<a href=\"http://whois.domaintools.com/".$row['domain']."\" target=_blank>whois</a> ";
  8.         $diff = strtotime($row['expiry']) - strtotime(date('Y-m-d'));
  9.         $diff_days = floor($diff/(60*60*24));
  10.         $html = abs($diff_days)<10000 ? '<td>'.$whois.$diff_days.'</td>' : '<td> </td>';
  11.         return $html;
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement