This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| $('#exhibit_id_field').change(function() { | |
| if ($('#exhibit_id_field option:selected').val() > 0){ | |
| $('#art_objects-grid table').load('/art_objects/search_objects/'+$('#exhibit_id_field option:selected').val()); | |
| $("exhibit_id_field").selectedIndex=0; | |
| } | |
| }); | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function UserExhibit() | |
| { | |
| return $this->belongsToMany('UserExhibit','user_id'); | |
| } | |
| public function UserExhibit() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function users(){ | |
| return $this->belongsToMany('User','user_exhibits','exhibit_id','user_id'); | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ids = Input::get('tour_object_id'); | |
| TourObj::destroy($ids); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| View::composer('*', function($view) | |
| { | |
| $role = UserPermission::where('user_role_id','=',Auth::user()->role_id)->select('permissions_data')->get(); | |
| $role->toArray(); | |
| // $replace = array('"','[',']'); | |
| //$data = str_replace($replace, "", $role->permissions_data); | |
| //$permissions = explode(',',$data ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function getpermissions($mid){ | |
| $roleid = UserPermission::where('module_id','=',$mid)->where('user_role_id','=',Auth::user()->role_id)->first(); | |
| return $roleid; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected 'attributes' => | |
| array (size=4) | |
| 'user_permission_id' => int 30 | |
| 'user_role_id' => int 1 | |
| 'module_id' => int 18 | |
| 'permissions_data' => string '["index","add","edit","delete"]' (length=31) | |
| protected 'original' => | |
| array (size=4) | |
| 'user_permission_id' => int 30 | |
| 'user_role_id' => int 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $i=0; | |
| $pr; | |
| $user_per = new UserPermission; | |
| foreach($per_data as $user_role_id => $permissions_data){ | |
| $pr[$i]['user_role_id']= $user_role_id; | |
| $pr[$i]['permissions']=$permissions_data; | |
| $pr[$i]['module_id']=$mid; | |
| $user_per->fill($pr); | |
| $user_per->save($pr); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $d=''; | |
| $datas = Input::get('data'); | |
| $i=0; | |
| foreach($datas as $data){ | |
| $d += $data->index . $data->add; | |
| } | |
| return $d; | |
| //data input example {"index":"index","add":"add","edit":"edit","delete":"delete"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class ArtObj extends Eloquent { | |
| protected $table = 'art_objects'; | |
| public $primaryKey = 'object_id'; | |
| public $timestamps = false; | |