elseif($val == 3) { $where1 = ' AND del.is_deleted = 1'; $where2 = ' where del.is_deleted = 1'; } else { $where1 = ' AND del.is_deleted = 0'; $where2 = ' where del.is_deleted = 0'; } $columns = array( array( 'db' => 'del.delivery_order_no', 'dt' => 0 , 'field' => 'delivery_order_no'), array( 'db' => 'del.delivery_order_date', 'dt' => 1 , 'field' => 'delivery_order_date'), array( 'db' => 'del.branch_id', 'dt' => 2, 'formatter' => function( $d, $row ) { return SSP::get_branch_name($d); } , 'field' => 'branch_id'), array( 'db' => 'cus.customername', 'dt' => 3 , 'field' => 'customername'), array( 'db' => 'del.delivery_address', 'dt' => 4 , 'field' => 'delivery_address'), array( 'db' => 'del.customer_address', 'dt' => 5 , 'field' => 'customer_address'), array( 'db' => 'del.attn', 'dt' => 6, 'formatter' => function( $d, $row ) { return SSP::get_attn_name($d); } , 'field' => 'attn'), array( 'db' => 'del.phone', 'dt' => 7 , 'field' => 'phone'), array( 'db' => 'del.email', 'dt' => 8 , 'field' => 'email' ), array( 'db' => 'del.salesorder_id', 'dt' => 9 , 'field' => 'salesorder_id' ), array( 'db' => 'del.quotationno', 'dt' => 10 , 'field' => 'quotationno' ), array( 'db' => 'del.ref_no', 'dt' => 11 , 'field' => 'ref_no'), array( 'db' => 'del.id', 'dt' => 12 ,'formatter' => function ( $d, $row) {