@extends('layouts.master') @section('navigation') @include('local.managers.admins._new_navigation') @stop @section('main')
@foreach ($users as $user) @endforeach
Name School Program Primary Email Role
{{ $user->surnames }}, {{ $user->first_name }} @if(count($user->school)) {{ $user->school->name }} @endif @if(count($user->program)) {{ $user->program->name }} @endif
{{ $users->links() }}
@stop @section('javascript') $(document).ready(function() { // -------------------------------------------------------------------------- // Page load // -------------------------------------------------------------------------- $('#submit_roles').on('click', function() { var userBundle = new Array(); $('tbody tr').each(function() { var user = new Object(); user.email= $(this).find('.email').text(); user.role= $(this).find('.role').find(':selected').val(); var clone = jQuery.extend({}, user); userBundle.push(clone); }); alert(JSON.stringify(userBundle)); // Save activity to the database $.post ( "{{ URL::action('UsersController@update') }}", { users: JSON.stringify(userBundle), submit_roles: true }, function(data) { location.reload(); } ); }); // -------------------------------------------------------------------------- // Functions // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Events // -------------------------------------------------------------------------- }); @stop