예제 #1
0
 public function show()
 {
     //
     $useradmin = UserDetails::where('employee_id', Auth::user()->employee_id)->first();
     $table = Datatable::table()->addColumn('EmployeeID', 'Fullname', 'Department', 'Email', 'Action')->setUrl(route('alluser'))->noScript();
     return View::make('admindashboard.viewusers')->with('table', $table)->with('admin', $useradmin)->with('title', 'All Users');
 }
/**
 * @param array                    $params
 * @param string                   $content
 * @param Smarty_Internal_Template $smarty
 * @param boolean                  $repeat
 *
 * @throws SmartyException
 * @return string
 *
 * @author Kovács Vince
 */
function smarty_block_datatable($params, $content, Smarty_Internal_Template &$smarty, &$repeat)
{
    if (!class_exists('Datatable')) {
        throw new SmartyException('chumper/datatable not installed');
    }
    if ($repeat) {
        $options = array('language' => \Lang::get('datatable', array()), 'processing' => true, 'bProcessing' => true, 'stateSave' => true, 'autoWidth' => false, 'columns' => array());
        $table = Datatable::table();
        if (isset($params['id'])) {
            $table->setId($params['id']);
            unset($params['id']);
        }
        if (isset($params['url'])) {
            $table->setUrl($params['url']);
            unset($params['url']);
        } elseif (isset($params['action'])) {
            $table->setUrl(URL::action($params['action']));
            unset($params['action']);
        }
        if (isset($params['searching'])) {
            $options['searching'] = $params['searching'];
        }
        if (isset($params['lengthChange'])) {
            $options['lengthChange'] = $params['lengthChange'];
        }
        if (isset($params['class'])) {
            $table->setClass($params['class']);
        }
        $table->setOptions($options);
        $smarty->append('datatables', $table);
    } else {
        $tables = $smarty->getVariable('datatables')->value;
        $table = array_pop($tables);
        $smarty->assign('datatables', $tables);
        if (isset($params['view'])) {
            return $table->render($params['view']);
        }
        return $table->render('datatable');
    }
    return '';
}
예제 #3
0
 public function dkk_pegawai()
 {
     $tabel = Datatable::table()->addColumn('Nama Pegawai', 'NIP', 'Jabatan', 'Unit Kerja', 'Action')->setUrl(route('get-pegawai'))->setClass('table datatable')->noScript();
     $m['unit'] = DB::table('pkm_puskesmas')->where('id', '<', 63)->get();
     return View::make('dkk_pegawai', compact('tabel'), compact('m'));
 }
예제 #4
0
 public function dkk_unit()
 {
     $tabel = Datatable::table()->addColumn('Kode Unit', 'Nama Unit/Ruangan', 'Action')->setUrl(route('get-unit'))->setClass('table datatable')->noScript();
     return View::make('dkk_unit', compact('tabel'));
 }
예제 #5
0
@extends('admin.layouts.app')

<?php 
$table = Datatable::table()->addColumn('id', 'Name', 'Created at', 'Updated at', 'Actions')->setOptions(array('sDom' => "<'row' <'col-md-12'>><'row'<'col-md-6 col-sm-12'l><'col-md-6 col-sm-12'f>r><'table-scrollable't><'row'<'col-md-5 col-sm-12'i><'col-md-7 col-sm-12'p>>", 'tableTools' => array('sSwfPath' => asset('admin/global/plugins/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf'))))->setUrl(route('api.users'));
// this is the route where data will be retrieved
?>

@include('admin.partials._datatables')


 public function users()
 {
     $table = Datatable::table()->addColumn('username', 'roles', 'View')->setUrl(route('api.users'))->noScript();
     $this->layout->content = View::make('database', array('table' => $table));
 }
예제 #7
0
 public function alokasi_barang()
 {
     $m = array();
     $tabel = Datatable::table()->addColumn('Nomor', 'Tanggal', 'Unit Alokasi', 'Action')->setUrl(route('get-pkm-alo'))->setOptions(array('order' => array(array(0, 'desc'))))->setClass('table datatable')->noScript();
     $m['inventori'] = DB::table('pkm_inventori')->get();
     $maks = DB::table('pkm_alokasi')->max('nomor');
     if ($maks == '') {
         $m['baru'] = 'ALO-' . date('ym') . sprintf("%04d", 1);
     } else {
         $m['baru'] = substr($maks, 0, 8) . sprintf("%04d", substr($maks, 8) + 1);
     }
     $m['unit'] = DB::table('pkm_unit')->get();
     return View::make('pkm_alokasi', compact('tabel'), compact('m'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $table = Datatable::table()->addColumn('first_name', 'last_login', 'id')->setOptions('aoColumnDefs', array(array('bVisible' => 'Name', 'aTargets' => [0]), array('bVisible' => false, 'aTargets' => [1]), array('bVisible' => false, 'aTargets' => [2])))->setUrl(route('api.users'))->noScript();
     return View::make('percobaan', array('table' => $table));
 }