</div> <?php $Table = new ifx_Table2($TableData); $DateCol = new ifx_TColumn('createddate', 'Date', $Table); $DateCol->formatter(function ($Row, $Date) { return date('d-m-y', mysql_to_unix($Date)); })->defaultSort('DESC'); $OrderID = new ifx_TColumn('nice_id', 'Order ID', $Table); $Customer = new ifx_TColumn(null, 'Customer', $Table); $Customer->formatter(function ($Row) { return $Row->firstname . ' ' . $Row->lastname; })->sortable(true, 'concat(firstname, lastname)'); $Email = new ifx_TColumn('email', 'E-Mail Address', $Table); $Total = new ifx_TColumn(null, 'Total', $Table); $Total->formatter(function ($Row) { return '£' . number_format($Row->total + $Row->postage, 2); })->sortable(true, 'total+postage'); $Status = new ifx_TColumn(null, 'Status', $Table); $Status->formatter(function ($Row) { if (!is_null($Row->nextstatusid)) { $Link = ' [<a href="/site-admin/orders/updateorderstatus/' . $Row->order_id . '/' . $Row->nextstatusid . '/">' . $Row->nextstatusnoun . '</a>]'; } else { $Link = ''; } return $Row->name . $Link; })->sortable(true, 'orderstatus.name'); $Actions = new ifx_TColumn(null, null, $Table); $Actions->formatter(function ($Row) { return '<a href="/site-admin/orders/view/' . $Row->order_id . '" class="fa fa-eye"></a><a confirm-href="/site-admin/orders/delete/' . $Row->order_id . '" class="fa fa-remove"></a>'; }); $Table->display();
$DateCol->formatter(function ($Row, $Date) { return date('d-m-y', $Date); })->defaultSort('DESC'); $Updated = new ifx_TColumn('updateddate', 'Updated', $Table); $Updated->formatter(function ($Row, $Date) { return date('d-m-y', $Date); }); $Title = new ifx_TColumn('title', 'Title', $Table); $Title->formatter(function ($Row, $Title) { return '<span ifx-inline-edit name="title" ifx-ie-url="/site-admin/store/update/' . $Row->id() . '/">' . $Title . '</span>'; }); $Price = new ifx_TColumn('price', 'Price', $Table); $Price->formatter(function ($Row, $Price) { $Title = '£' . number_format($Price, 2); return '<span ifx-inline-edit name="price" ifx-ie-url="/site-admin/store/update/' . $Row->id() . '/">' . $Title . '</span>'; }); $Active = new ifx_TColumn('active', 'Active', $Table); $Active->formatter(function ($Row, $isActive) { $Title = $isActive ? 'Yes' : 'No'; return '<span ifx-inline-edit ifx-ie-select=\'' . json_encode(array('No', 'Yes')) . '\' name="active" ifx-ie-url="/site-admin/store/update/' . $Row->id() . '/">' . $Title . '</span>'; }); $Available = new ifx_TColumn('available', 'Qty Remain', $Table); $Available->formatter(function ($Row, $QtyLeft) { $Title = $QtyLeft === 0 ? 'Sold Out' : $QtyLeft; return '<span ifx-inline-edit name="available" ifx-ie-url="/site-admin/store/update/' . $Row->id() . '/">' . $Title . '</span>'; }); $Actions = new ifx_TColumn(null, null, $Table); $Actions->formatter(function ($Row) { return '<a href="/site-admin/store/edit/' . $Row->id() . '" class="fa fa-eye"></a><a confirm-href="/site-admin/store/delete/' . $Row->id() . '" class="fa fa-remove"></a>'; }); $Table->display();