Пример #1
0
 public static function setData($input)
 {
     $Category = $input['id'] == NULL || !isset($input['id']) ? new Status() : Status::find($input['id']);
     $Category->status_name = Str::title($input['data']);
     $Category->status_desc = $input['description'];
     $Category->save();
     $action = $input['id'] == NULL || !isset($input['id']) ? 'Insert' : '<b>(' . $input['id'] . ')</b> Update';
     Log::write('Data', 'Status <b>' . $input['data'] . '</b> ' . $action . ' by ' . Auth::user()->username);
 }
Пример #2
0
 public static function userSearchList($input)
 {
     $operator = stripos($input['searchval'], '*') ? 'LIKE' : '=';
     $val = str_replace("*", "", $input['searchval']);
     $refval = stripos($input['searchval'], '*') ? '%' . $val . '%' : $val;
     $allUser = User::left_join('users_profiles', 'users.userid', '=', 'users_profiles.userid')->where('icno', $operator, $refval)->or_where('fullname', $operator, $refval)->paginate(Config::get('system.pagination'));
     $datagrid = new Datagrid();
     $datagrid->setFields(array('userprofile/fullname' => Str::upper(Str::title(Lang::line('admin.fullname')->get()))));
     $datagrid->setFields(array('userprofile/emel' => Str::upper(Str::title(Lang::line('admin.activeemel')->get()))));
     $datagrid->setFields(array('userprofile/icno' => Str::upper(Str::title(Lang::line('admin.idno')->get()))));
     $datagrid->setFields(array('status' => Str::upper('Status')));
     $datagrid->setAction(Lang::line('global.edit')->get(), 'viewUser', true, array('userid'));
     $datagrid->setAction(Lang::line('global.delete')->get(), 'deleteAccount', true, array('userid'));
     $datagrid->setAction(Lang::line('global.reset')->get(), 'resetAccount', true, array('userid'));
     $datagrid->setTable('users', 'table table-bordered table-hover table-striped table-condensed');
     $datagrid->build($allUser, 'userid');
     return $datagrid->render();
 }
Пример #3
0
 public static function dataModeling()
 {
     $list = array('Select Model');
     $dataModel = glob('bundles/admin/models/data/*');
     $namespace = 'Admin/Models/Data';
     foreach ($dataModel as $folder) {
         if (is_dir($folder)) {
             $base = basename($folder);
             $namespace2 = $namespace . Str::title($base);
             $modelNode = glob($folder . '/*');
             foreach ($modelNode as $value) {
                 $class = basename($value, '.php');
                 $list[$namespace2 . '/' . $class] = $namespace2 . '/' . $class;
             }
         } else {
             $class = basename($folder, '.php');
             $list[$namespace . '/' . $class] = $namespace . '/' . $class;
         }
     }
     return $list;
 }
Пример #4
0
 public static function schema($action, $module_slug)
 {
     try {
         // Does the schema task file exists?
         $schema_path = path('bundle') . $module_slug . DS . 'tasks' . DS . 'schema' . EXT;
         if (\Laravel\File::exists($schema_path)) {
             include_once $schema_path;
             // Does the class exists?
             $class = Str::title($module_slug . '_Schema_Task');
             if (class_exists($class)) {
                 $schema_class = new $class();
                 // The action is callable?
                 if (is_callable(array($schema_class, $action))) {
                     $schema_class->{$action}();
                     return true;
                 } else {
                     Log::error('Failed to run data schema for module ' . $module_slug . '. Schema action [' . $action . '] not found.');
                 }
             } else {
                 Log::error('Failed to run data schema for module ' . $module_slug . '. Schema class [' . $class . '] not found.');
             }
         }
         // we dont have task schema to run
         return true;
     } catch (\Exception $e) {
         Log::error($e->getMessage());
         return false;
     }
 }
Пример #5
0
 public function post_step()
 {
     $input = Input::get();
     if (!isset($input['stepid'])) {
         $logs = 'Add New Step ';
         $step = new Step();
     } else {
         $step = Step::find($input['stepid']);
         $logs = 'Edit Step ';
     }
     $step->step = Str::title($input['step']);
     $step->flowid = $input['flowid'];
     $step->parentid = $input['parentid'];
     $step->roleid = $input['roleid'];
     $step->page = $input['page'];
     $step->state = $input['state'];
     $step->timestamp();
     $step->save();
     Log::write('Modul', $logs . $input['step'] . ' by ' . Auth::user()->username);
     return Menu::flowtree($input['flowid']);
 }
Пример #6
0
 protected static function looper($child)
 {
     $structure = '';
     if (!empty($child)) {
         $structure .= '<ul class="nav nav-list" style="margin-left:60px;padding-left:0px;padding-right:0px;border-left-width:3px;border-left-style:solid;border-left-color:#000">';
         foreach ($child as $key => $value) {
             $structure .= '<li>';
             $structure .= '<a href="#" onclick="deleteStep(' . $key . ')"  data-toggle="tooltip" data-title="remove step" style="float:right">&nbsp;<i class="icon-remove-sign"></i></a>';
             $structure .= '<a href="#" onclick="editStep(' . $key . ')" style="float:right">&nbsp;<i class="icon-edit"></i></a>';
             $structure .= '<a href="#" onclick="addStep(' . $key . ')" data-toggle="modal" ><i class="icon-arrow-right"></i>&nbsp;' . Str::title($value['desc']) . '&nbsp;<i class="icon-plus-sign"></i></a>';
             $structure .= self::looper($value['child']);
             $structure .= '</li>';
         }
         $structure .= '</ul>';
     }
     return $structure;
 }