コード例 #1
1
ファイル: GroupsController.php プロジェクト: buguelos/make
 function postSave($id = 0)
 {
     $trackUri = $this->data['trackUri'];
     $rules = $this->validateForm();
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->passes()) {
         $data = $this->validatePost('tb_groups');
         $ID = $this->model->insertRow($data, Input::get('group_id'));
         // Input logs
         if (Input::get('group_id') == '') {
             $this->inputLogs("New Entry row with ID : {$ID}  , Has Been Save Successfull");
             $id = SiteHelpers::encryptID($ID);
         } else {
             $this->inputLogs(" ID : {$ID}  , Has Been Changed Successfull");
         }
         // Redirect after save
         $md = str_replace(" ", "+", Input::get('md'));
         $redirect = !is_null(Input::get('apply')) ? 'groups/add/' . $id . '?md=' . $md . $trackUri : 'groups?md=' . $md . $trackUri;
         return Redirect::to($redirect)->with('messagetext', Lang::get('core.note_success'))->with('msgstatus', 'success');
     } else {
         $md = str_replace(" ", "+", Input::get('md'));
         return Redirect::to('groups/add/' . $id . '?md=' . $md)->with('messagetext', Lang::get('core.note_error'))->with('msgstatus', 'error')->withErrors($validator)->withInput();
     }
 }
コード例 #2
0
 public function getIndex(Request $request)
 {
     $sort = !is_null($request->input('sort')) ? $request->input('sort') : '';
     $order = !is_null($request->input('order')) ? $request->input('order') : 'asc';
     // End Filter sort and order for query
     // Filter Search for query
     $filter = !is_null($request->input('search')) ? '' : '';
     $page = $request->input('page', 1);
     $params = array('page' => $page, 'limit' => !is_null($request->input('rows')) ? filter_var($request->input('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
     // Get Query
     $results = $this->model->getRows($params);
     // Build pagination setting
     $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
     $pagination = new Paginator($results['rows'], $results['total'], $params['limit']);
     $pagination->setPath('esireport');
     $this->data['rowData'] = $results['rows'];
     // Build Pagination
     $this->data['pagination'] = $pagination;
     // Build pager number and append current param GET
     $this->data['pager'] = $this->injectPaginate();
     // Row grid Number
     $this->data['i'] = $page * $params['limit'] - $params['limit'];
     // Grid Configuration
     $this->data['tableGrid'] = $this->info['config']['grid'];
     $this->data['tableForm'] = $this->info['config']['forms'];
     $this->data['colspan'] = \SiteHelpers::viewColSpan($this->info['config']['grid']);
     // Group users permission
     $this->data['access'] = $this->access;
     // Detail from master if any
     // Master detail link if any
     $this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array();
     // Render into template
     return view('esireport.index', $this->data);
 }
コード例 #3
0
 public static function dc_addition($id)
 {
     //get the delivery object
     $delivery_object = DB::table('tb_request_delivery')->where('id', $id)->first();
     $user_id = \SiteHelpers::getUserIdFromCustomerId($delivery_object->cid);
     DB::table('tb_request_delivery')->where('id', $id)->update(['parcel_delivery_code' => \SiteHelpers::delivery_code($user_id)]);
 }
コード例 #4
0
ファイル: MenuController.php プロジェクト: alvarobfdev/applog
 function postSave(Request $request, $id = 0)
 {
     $rules = array('menu_name' => 'required', 'active' => 'required', 'menu_type' => 'required', 'position' => 'required');
     $validator = Validator::make($request->all(), $rules);
     if ($validator->passes()) {
         $pos = $request->input('position');
         $data = $this->validatePost('tb_menu');
         if (CNF_MULTILANG == 1) {
             $lang = \SiteHelpers::langOption();
             $language = array();
             foreach ($lang as $l) {
                 if ($l['folder'] != 'en') {
                     $menu_lang = isset($_POST['language_title'][$l['folder']]) ? $_POST['language_title'][$l['folder']] : '';
                     $language['title'][$l['folder']] = $menu_lang;
                 }
             }
             $data['menu_lang'] = json_encode($language);
         }
         $arr = array();
         $groups = \DB::table('tb_groups')->get();
         foreach ($groups as $g) {
             $arr[$g->group_id] = isset($_POST['groups'][$g->group_id]) ? "1" : "0";
         }
         $data['access_data'] = json_encode($arr);
         $data['allow_guest'] = $request->input('allow_guest');
         $this->model->insertRow($data, $request->input('menu_id'));
         return Redirect::to('sximo/menu?pos=' . $pos)->with('messagetext', 'Data Has Been Save Successfull')->with('msgstatus', 'success');
     } else {
         return Redirect::to('sximo/menu?pos=' . $pos)->with('messagetext', 'The following errors occurred')->with('msgstatus', 'error')->withErrors($validator)->withInput();
     }
 }
コード例 #5
0
 public function getIndex()
 {
     if ($this->access['is_view'] == 0) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', ' Your are not allowed to access the page '));
     }
     // Filter sort and order for query
     $sort = !is_null(Input::get('sort')) ? Input::get('sort') : '';
     $order = !is_null(Input::get('order')) ? Input::get('order') : 'asc';
     // End Filter sort and order for query
     // Filter Search for query
     $filter = !is_null(Input::get('search')) ? $this->buildSearch() : '';
     // End Filter Search for query
     $page = Input::get('page', 1);
     $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
     // Get Query
     $results = $this->model->getRows($params);
     // Build pagination setting
     $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
     $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']);
     $this->data['rowData'] = $results['rows'];
     // Build Pagination
     $this->data['pagination'] = $pagination;
     // Build pager number and append current param GET
     $this->data['pager'] = $this->injectPaginate();
     // Row grid Number
     $this->data['i'] = $page * $params['limit'] - $params['limit'];
     // Grid Configuration
     $this->data['tableGrid'] = $this->info['config']['grid'];
     $this->data['tableForm'] = $this->info['config']['forms'];
     $this->data['colspan'] = SiteHelpers::viewColSpan($this->info['config']['grid']);
     // Group users permission
     $this->data['access'] = $this->access;
     // Render into template
     $this->layout->nest('content', 'rinvoices.index', $this->data)->with('menus', SiteHelpers::menus());
 }
コード例 #6
0
 public function postData()
 {
     if ($this->access['is_view'] == 0) {
         echo SiteHelpers::alert('error', Lang::get('core.note_restric'));
         die;
     }
     $sort = !is_null(Input::get('sort')) ? Input::get('sort') : $this->info['setting']['orderby'];
     $order = !is_null(Input::get('order')) ? Input::get('order') : $this->info['setting']['ordertype'];
     $filter = !is_null(Input::get('search')) ? $this->buildSearch() : '';
     $page = Input::get('page', 1);
     $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : $this->info['setting']['perpage'], 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
     $results = $this->model->getRows($params);
     $this->data['param'] = $params;
     $this->data['rowData'] = $results['rows'];
     $this->data['tableGrid'] = $this->info['config']['grid'];
     $this->data['tableForm'] = $this->info['config']['forms'];
     $this->data['access'] = $this->access;
     $this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array();
     $this->data['masterdetail'] = $this->masterDetailParam();
     // Build pagination setting
     $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
     $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']);
     // Build Pagination
     $this->data['pagination'] = $pagination;
     // Build pager number and append current param GET
     $this->data['pager'] = $this->injectPaginate();
     // Row grid Number
     $this->data['i'] = $page * $params['limit'] - $params['limit'];
     return View::make('areportinvoices.table', $this->data);
 }
コード例 #7
0
 public function getDelete($id = null)
 {
     if (!is_null($id)) {
         $id = SiteHelpers::encryptID($id, true);
         PlotModel::where('id', $id)->delete();
         return Redirect::to('plot')->with('message', SiteHelpers::alert('success', "Data deleted esuccessfully"));
     }
 }
コード例 #8
0
 public function getDelete($id = null)
 {
     if (!is_null($id)) {
         $id = SiteHelpers::encryptID($id, true);
         $del = FileModel::where('id', $id)->first();
         @unlink(public_path('uploads/' . $del->filename));
         FileModel::where('id', $id)->delete();
         return Redirect::to('files')->with('message', SiteHelpers::alert('success', "Data deleted successfully"));
     }
 }
コード例 #9
0
 public function getDestroy()
 {
     $ids = Input::get('del');
     $i = 0;
     foreach ($ids as $id) {
         $del = FileModel::where('id', $id)->first();
         @unlink(public_path('uploads/' . $del->filename));
         FileModel::where('id', $id)->delete();
         $i++;
     }
     return Redirect::to('files')->with('message', SiteHelpers::alert('success', $i . " Data deleted successfully"));
 }
コード例 #10
0
ファイル: PublicHelpers.php プロジェクト: buguelos/make
 public static function view($class)
 {
     $id = Input::get('id');
     $id = SiteHelpers::encryptID($id, true);
     $results = $class::getRow($id);
     if (count($results) >= 1) {
         $config = $class::makeInfo($class);
         $data['tableGrid'] = $config['config']['grid'];
         $data['row'] = $results;
         return View::make('public.view', $data);
     } else {
         return "NO PAGE FOUND !";
     }
 }
コード例 #11
0
ファイル: UsersController.php プロジェクト: buguelos/make
 function getShow($id = null)
 {
     if ($this->access['is_detail'] == 0) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', ' Your are not allowed to access the page '));
     }
     $ids = $id == null ? '' : SiteHelpers::encryptID($id, true);
     $row = $this->model->getRow($ids);
     if ($row) {
         $this->data['row'] = $row;
     } else {
         $this->data['row'] = $this->model->getColumnTable('tb_users');
     }
     $this->data['id'] = $id;
     $this->data['access'] = $this->access;
     $this->layout->nest('content', 'users.view', $this->data)->with('menus', $this->menus);
 }
コード例 #12
0
 public function index(Request $request)
 {
     $check = self::authentication($request);
     if (is_array($check)) {
         return \Response::json($check);
     } else {
         $class = ucwords($request->input('module'));
         $config = $this->model->makeInfo($class);
         $tables = $config['config']['grid'];
         $page = (!is_null($request->input('page')) or $request->input('page') != 0) ? $request->input('page') : 1;
         $param = array('page' => $page, 'sort' => '', 'order' => 'asc', 'limit' => '');
         if (!is_null($request->input('limit')) or $request->input('limit') != 0) {
             $param['limit'] = $request->input('limit');
         }
         if (!is_null($request->input('order'))) {
             $param['order'] = $request->input('order');
         }
         if (!is_null($request->input('sort'))) {
             $param['sort'] = $request->input('sort');
         }
         $results = $this->model->getRows($param);
         $json = array();
         foreach ($results['rows'] as $row) {
             $rows = array();
             foreach ($tables as $table) {
                 $conn = isset($table['conn']) ? $table['conn'] : array();
                 $rows[$table['field']] = \SiteHelpers::gridDisplay($row->{$table}['field'], $table['field'], $conn);
                 //$rows[$table['field']] = '';
             }
             $json[] = $rows;
         }
         $jsonData = array('total' => $results['total'], 'rows' => $json, 'control' => $param, 'key' => $config['key']);
         if (!is_null($request->input('option')) && $request->input('option') == 'true') {
             $label = array();
             foreach ($tables as $table) {
                 $label[] = $table['label'];
             }
             $field = array();
             foreach ($tables as $table) {
                 $field[] = $table['field'];
             }
             $jsonData['option'] = array('label' => $label, 'field' => $field);
         }
         return \Response::json($jsonData, 200);
     }
 }
コード例 #13
0
 public static function get_zip_content($name, $zip)
 {
     $contents = '';
     if (file_exists($zip)) {
         $fp = fopen('zip://' . $zip . '#' . $name, 'r');
         if (!$fp) {
             SiteHelpers::alert("error", "cannot open zip file: {$zip}n");
         }
         while (!feof($fp)) {
             $contents .= fread($fp, 2);
         }
     } else {
         SiteHelpers::alert("error", "cannot find zip file: {$zip}n");
     }
     fclose($fp);
     return $contents;
 }
コード例 #14
0
 public static function delete_action($ids)
 {
     foreach ($ids as $id) {
         //get the customer ID and User ID
         $delivery_object = DB::table('tb_request_delivery')->where('id', $id)->first();
         $customer_id = $delivery_object->cid;
         $user_id = \SiteHelpers::getUserIdFromCustomerId($customer_id);
         $bill = DB::table('tb_bills')->where('delivery_id', $id)->get();
         if (count($bill) == 1) {
             $bill_amount = $bill[0]->bill;
             //refund now
             if (\SiteHelpers::is_payg_customer()) {
                 DB::table('tb_payg_balance')->where('user_id', $user_id)->increment('balance', $bill_amount);
                 //remove the bill
                 self::remove_bills($id);
             }
         }
     }
 }
コード例 #15
0
ファイル: Sximo.php プロジェクト: vinodjoshi/laravel
 static function makeInfo($id)
 {
     $row = \DB::table('tb_module')->where('module_name', $id)->get();
     $data = array();
     foreach ($row as $r) {
         $data['id'] = $r->module_id;
         $data['title'] = $r->module_title;
         $data['note'] = $r->module_note;
         $data['table'] = $r->module_db;
         $data['key'] = $r->module_db_key;
         $data['config'] = \SiteHelpers::CF_decode_json($r->module_config);
         $field = array();
         foreach ($data['config']['grid'] as $fs) {
             foreach ($fs as $f) {
                 $field[] = $fs['field'];
             }
         }
         $data['field'] = $field;
     }
     return $data;
 }
コード例 #16
0
ファイル: page.php プロジェクト: HRVConsultores/elearning
 function submitcontact()
 {
     $rules = array(array('field' => 'name', 'label' => ' Please Fill Name', 'rules' => 'required'), array('field' => 'email', 'label' => 'email ', 'rules' => 'required|email'), array('field' => 'message', 'label' => 'message', 'rules' => 'required'));
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run()) {
         $data = array('name' => $this->input->post('name', true), 'email' => $this->input->post('email', true), 'subject' => 'New Form Submission', 'notes' => $this->input->post('message', true));
         $message = $this->load->view('emails/contact', $data, true);
         $to = CNF_EMAIL;
         $subject = 'New Form Submission';
         $headers = 'MIME-Version: 1.0' . "\r\n";
         $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
         $headers .= 'From: ' . $this->input->post('name', true) . ' <' . $this->input->post('sender', true) . '>' . "\r\n";
         //mail($to, $subject, $message, $headers);
         $message = "Thank You , Your message has been sent !";
         $this->session->set_flashdata('message', SiteHelpers::alert('success', $message));
         redirect('contact-us', 301);
     } else {
         $message = "The following errors occurred";
         $this->session->set_flashdata(array('message' => SiteHelpers::alert('error', $message), 'errors' => validation_errors('<li>', '</li>')));
         redirect('contact-us', 301);
     }
 }
コード例 #17
0
 public function getIndex(Request $request)
 {
     if ($this->access['is_view'] == 0) {
         return Redirect::to('admin/dashboard')->with('messagetext', \Lang::get('core.note_restric'))->with('msgstatus', 'error');
     }
     $sort = !is_null($request->input('sort')) ? $request->input('sort') : 'id';
     $order = !is_null($request->input('order')) ? $request->input('order') : 'asc';
     // End Filter sort and order for query
     // Filter Search for query
     $filter = !is_null($request->input('search')) ? '' : '';
     $filter .= " AND tb_users.group_id >= '" . \Session::get('gid') . "'";
     $page = $request->input('page', 1);
     $params = array('page' => $page, 'limit' => !is_null($request->input('rows')) ? filter_var($request->input('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
     // Get Query
     $results = $this->model->getRows($params);
     // Build pagination setting
     $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
     $pagination = new Paginator($results['rows'], $results['total'], $params['limit']);
     $pagination->setPath('users');
     $this->data['rowData'] = $results['rows'];
     // Build Pagination
     $this->data['pagination'] = $pagination;
     // Build pager number and append current param GET
     $this->data['pager'] = $this->injectPaginate();
     // Row grid Number
     $this->data['i'] = $page * $params['limit'] - $params['limit'];
     // Grid Configuration
     $this->data['tableGrid'] = $this->info['config']['grid'];
     $this->data['tableForm'] = $this->info['config']['forms'];
     $this->data['colspan'] = \SiteHelpers::viewColSpan($this->info['config']['grid']);
     // Group users permission
     $this->data['access'] = $this->access;
     // Detail from master if any
     // Master detail link if any
     $this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array();
     // Render into template
     return view('admin.core.users.index', $this->data);
 }
コード例 #18
0
ファイル: Sximo.php プロジェクト: vtvmd2015/symtec
 static function makeInfo($id)
 {
     $row = \DB::table('tb_module')->where('module_name', $id)->get();
     $data = array();
     foreach ($row as $r) {
         $langs = json_decode($r->module_lang, true);
         $data['id'] = $r->module_id;
         $data['title'] = \SiteHelpers::infoLang($r->module_title, $langs, 'title');
         $data['note'] = \SiteHelpers::infoLang($r->module_note, $langs, 'note');
         $data['table'] = $r->module_db;
         $data['key'] = $r->module_db_key;
         $data['config'] = \SiteHelpers::CF_decode_json($r->module_config);
         $field = array();
         foreach ($data['config']['grid'] as $fs) {
             foreach ($fs as $f) {
                 $field[] = $fs['field'];
             }
         }
         $data['field'] = $field;
         $data['setting'] = array('gridtype' => isset($data['config']['setting']['gridtype']) ? $data['config']['setting']['gridtype'] : 'native', 'orderby' => isset($data['config']['setting']['orderby']) ? $data['config']['setting']['orderby'] : $r->module_db_key, 'ordertype' => isset($data['config']['setting']['ordertype']) ? $data['config']['setting']['ordertype'] : 'asc', 'perpage' => isset($data['config']['setting']['perpage']) ? $data['config']['setting']['perpage'] : '10', 'frozen' => isset($data['config']['setting']['frozen']) ? $data['config']['setting']['frozen'] : 'false', 'form-method' => isset($data['config']['setting']['form-method']) ? $data['config']['setting']['form-method'] : 'native', 'view-method' => isset($data['config']['setting']['view-method']) ? $data['config']['setting']['view-method'] : 'native', 'inline' => isset($data['config']['setting']['inline']) ? $data['config']['setting']['inline'] : 'false');
     }
     return $data;
 }
コード例 #19
0
 public function postDestroy()
 {
     if ($this->access['is_remove'] == 0) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric')));
     }
     // delete multipe rows
     //$this->model->destroy(Input::get('id'));
     foreach (Input::get('id') as $idpro) {
         $data_pro = $this->model->getRow($idpro);
         @unlink(ROOT . '/uploads/advertise/' . $data_pro->image);
         @unlink(ROOT . '/uploads/advertise/thumb/' . $data_pro->image);
     }
     $this->model->destroy(Input::get('id'));
     $this->inputLogs("ID : " . implode(",", Input::get('id')) . "  , Has Been Removed Successfull");
     // redirect
     Session::flash('message', SiteHelpers::alert('success', Lang::get('core.note_success_delete')));
     return Redirect::to('advertise?md=' . Input::get('md'));
 }
コード例 #20
0
 public function postDelete(Request $request)
 {
     if ($this->access['is_remove'] == 0) {
         return Redirect::to('dashboard')->with('messagetext', \Lang::get('core.note_restric'))->with('msgstatus', 'error');
     }
     // delete multipe rows
     if (count($request->input('id')) >= 1) {
         $this->model->destroy($request->input('id'));
         \SiteHelpers::auditTrail($request, "ID : " . implode(",", $request->input('id')) . "  , Has Been Removed Successfull");
         // redirect
         return Redirect::to('itemvariant')->with('messagetext', \Lang::get('core.note_success_delete'))->with('msgstatus', 'success');
     } else {
         return Redirect::to('itemvariant')->with('messagetext', 'No Item Deleted')->with('msgstatus', 'error');
     }
 }
コード例 #21
0
 public function getRebuild(Request $request, $id = 0)
 {
     $row = \DB::table('tb_module')->where('module_id', $id)->get();
     if (count($row) <= 0) {
         return Redirect::to('sximo/module')->with('messagetext', 'Can not find module')->with('msgstatus', 'error');
     }
     $row = $row[0];
     $this->data['row'] = $row;
     $config = \SiteHelpers::CF_decode_json($row->module_config);
     $class = $row->module_name;
     $ctr = ucwords($row->module_name);
     $path = $row->module_name;
     // build Field entry
     $f = '';
     $req = '';
     // End Build Field Entry
     $codes = array('controller' => ucwords($class), 'class' => $class, 'fields' => $f, 'required' => $req, 'table' => $row->module_db, 'title' => $row->module_title, 'note' => $row->module_note, 'key' => $row->module_db_key, 'sql_select' => $config['sql_select'], 'sql_where' => $config['sql_where'], 'sql_group' => $config['sql_group']);
     if (!isset($config['form_layout'])) {
         $config['form_layout'] = array('column' => 1, 'title' => $row->module_title, 'format' => 'grid', 'display' => 'horizontal');
     }
     $codes['form_javascript'] = \SiteHelpers::toJavascript($config['forms'], $path, $class);
     $codes['form_entry'] = \SiteHelpers::toForm($config['forms'], $config['form_layout']);
     $codes['form_display'] = isset($config['form_layout']['display']) ? $config['form_layout']['display'] : 'horizontal';
     $codes['form_view'] = \SiteHelpers::toView($config['grid']);
     $codes['masterdetailmodel'] = '';
     $codes['masterdetailinfo'] = '';
     $codes['masterdetailgrid'] = '';
     $codes['masterdetailsave'] = '';
     $codes['masterdetailform'] = '';
     $codes['masterdetailview'] = '';
     $codes['masterdetailjs'] = '';
     $codes['masterdetaildelete'] = '';
     /* Master detail */
     if (isset($config['subgrid']) && count($config['subgrid']) >= 1) {
         $md = \SiteHelpers::toMasterDetail($config['subgrid'][0]);
         $codes['masterdetailmodel'] = $md['masterdetailmodel'];
         $codes['masterdetailinfo'] = $md['masterdetailinfo'];
         $codes['masterdetailgrid'] = $md['masterdetailgrid'];
         $codes['masterdetailsave'] = $md['masterdetailsave'];
         $codes['masterdetailform'] = $md['masterdetailform'];
         $codes['masterdetailjs'] = $md['masterdetailjs'];
         $codes['masterdetailview'] = $md['masterdetailview'];
         $codes['masterdetaildelete'] = $md['masterdetaildelete'];
     }
     /* End Master Detail */
     $dir = base_path() . '/resources/views/' . $class;
     $dirC = app_path() . '/Http/Controllers/';
     $dirM = app_path() . '/Models/';
     if (!is_dir($dir)) {
         mkdir($dir, 0777);
     }
     // BLANK TEMPLATE
     if ($row->module_type == 'generic') {
         $template = base_path() . '/resources/views/sximo/module/template/blank/';
         $controller = file_get_contents($template . 'controller.tpl');
         $grid = file_get_contents($template . 'grid.tpl');
         $view = file_get_contents($template . 'view.tpl');
         $form = file_get_contents($template . 'form.tpl');
         $model = file_get_contents($template . 'model.tpl');
         $build_controller = \SiteHelpers::blend($controller, $codes);
         $build_view = \SiteHelpers::blend($view, $codes);
         $build_form = \SiteHelpers::blend($form, $codes);
         $build_grid = \SiteHelpers::blend($grid, $codes);
         $build_model = \SiteHelpers::blend($model, $codes);
         file_put_contents($dirC . "{$ctr}Controller.php", $build_controller);
         file_put_contents($dirM . "{$ctr}.php", $build_model);
         file_put_contents($dir . "/index.blade.php", $build_grid);
         file_put_contents($dir . "/form.blade.php", $build_form);
         file_put_contents($dir . "/view.blade.php", $build_view);
     }
     if ($row->module_type == 'report') {
         $template = base_path() . '/resources/views/sximo/module/template/report/';
         $controller = file_get_contents($template . 'controller.tpl');
         $grid = file_get_contents($template . 'grid.tpl');
         $model = file_get_contents($template . 'model.tpl');
         $build_controller = \SiteHelpers::blend($controller, $codes);
         $build_grid = \SiteHelpers::blend($grid, $codes);
         $build_model = \SiteHelpers::blend($model, $codes);
         file_put_contents($dirC . "{$ctr}Controller.php", $build_controller);
         file_put_contents($dirM . "{$ctr}.php", $build_model);
         file_put_contents($dir . "/index.blade.php", $build_grid);
     }
     if ($row->module_type == 'addon') {
         $template = base_path() . '/resources/views/sximo/module/template/native/';
         $controller = file_get_contents($template . 'controller.tpl');
         $grid = file_get_contents($template . 'grid.tpl');
         $view = file_get_contents($template . 'view.tpl');
         $form = file_get_contents($template . 'form.tpl');
         $model = file_get_contents($template . 'model.tpl');
         $build_controller = \SiteHelpers::blend($controller, $codes);
         $build_view = \SiteHelpers::blend($view, $codes);
         $build_form = \SiteHelpers::blend($form, $codes);
         $build_grid = \SiteHelpers::blend($grid, $codes);
         $build_model = \SiteHelpers::blend($model, $codes);
         if (!is_null($request->input('rebuild'))) {
             // rebuild spesific files
             if ($request->input('c') == 'y') {
                 file_put_contents($dirC . "{$ctr}Controller.php", $build_controller);
             }
             if ($request->input('m') == 'y') {
                 file_put_contents($dirM . "{$ctr}.php", $build_model);
             }
             if ($request->input('g') == 'y') {
                 file_put_contents($dir . "/index.blade.php", $build_grid);
             }
             if ($row->module_db_key != '') {
                 if ($request->input('f') == 'y') {
                     file_put_contents($dir . "/form.blade.php", $build_form);
                 }
                 if ($request->input('v') == 'y') {
                     file_put_contents($dir . "/view.blade.php", $build_view);
                 }
             }
         } else {
             file_put_contents($dirC . "{$ctr}Controller.php", $build_controller);
             file_put_contents($dirM . "{$ctr}.php", $build_model);
             file_put_contents($dir . "/index.blade.php", $build_grid);
             file_put_contents($dir . "/form.blade.php", $build_form);
             file_put_contents($dir . "/view.blade.php", $build_view);
         }
     }
     self::createRouters();
     return Redirect::to('sximo/module')->with('messagetext', 'Code Script has been replaced successfull')->with('msgstatus', 'success');
 }
コード例 #22
0
 public function getRemovecomm($id, $alias)
 {
     if (Session::get('uid') != 1) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric')));
     }
     // delete multipe rows
     DB::table('tb_blogcomments')->where('commentID', $id)->delete();
     // redirect
     Session::flash('message', SiteHelpers::alert('success', 'Comment has been removed !'));
     return Redirect::to('blog/read/' . $alias);
 }
コード例 #23
0
ファイル: index.blade.php プロジェクト: vtvmd2015/symtec
	
	
	 {!! Form::open(array('url'=>'currencyentry/delete/', 'class'=>'form-horizontal' ,'id' =>'SximoTable' )) !!}
	 <div class="table-responsive" style="min-height:300px;">
    <table class="table table-striped ">
        <thead>
			<tr>
				<th class="number"> No </th>
				<th> <input type="checkbox" class="checkall" /></th>
				
				@foreach ($tableGrid as $t)
					<?php 
if ($t['view'] == '1') {
    $limited = isset($t['limited']) ? $t['limited'] : '';
    if (SiteHelpers::filterColumn($limited)) {
        echo '<th align="' . $t['align'] . '" width="' . $t['width'] . '">' . \SiteHelpers::activeLang($t['label'], isset($t['language']) ? $t['language'] : array()) . '</th>';
    }
}
?>
				@endforeach
				<th width="70" >{{ Lang::get('core.btn_action') }}</th>
			  </tr>
        </thead>

        <tbody>        						
            @foreach ($rowData as $row)
                <tr>
					<td width="30"> {{ ++$i }} </td>
					<td width="50"><input type="checkbox" class="ids" name="ids[]" value="{{ $row->currecncy_id }}" />  </td>									
				 @foreach ($tableGrid as $field)
					 @if($field['view'] =='1')
コード例 #24
0
 public function postDestroy()
 {
     if ($this->access['is_remove'] == 0) {
         echo SiteHelpers::alert('error', Lang::get('core.note_restric'));
         die;
     }
     // delete multipe rows
     if (!is_null(Input::get('id'))) {
         //	$this->model->destroy(Input::get('id'));
         //	$this->inputLogs("ID : ".implode(",",Input::get('id'))."  , Has Been Removed Successfull");
         return Response::json(array('status' => 'success', 'message' => SiteHelpers::alert('success', Lang::get('core.note_success_delete'))));
     } else {
         return Response::json(array('status' => 'error', 'message' => SiteHelpers::alert('error', Lang::get('core.note_error'))));
     }
 }
コード例 #25
0
ファイル: home.blade.php プロジェクト: Yashwanth1/aregudam
</div>
<div class="right-column-sub">
<div class="banner">
<img src="{{ URL::asset('images/duh-add.jpg') }}" alt="">
<!--banner --></div>

<div class="featured-head">
<h2>FEATURED</h2>
@if(count($featured))
	@foreach($featured as $fkey)
	<?php 
/*params*/
$fp[0] = $fkey->fk_category_id;
$fp[1] = $fkey->fk_sub_category_id;
$fp[2] = $fkey->pk_poll_id;
$fpArr = SiteHelpers::CF_encode_json($fp);
?>
	<div class="tab-sub-section">
		<div class="soon-image">
			<img src="{{ URL::asset('uploads/polls/thumb/'.$fkey->thumbnail) }}" alt="">
		</div>
		<div class="soon-des">
			<a href = "{{URL::to('poll/'.$fpArr)}}"  class = "single-poll">{{$fkey->title}}</a>
		</div>
	</div>
	@endforeach
	@else
	{{"No Featured Polls"}}
@endif

<!--featured-head --></div>
コード例 #26
0
ファイル: sidemenu.blade.php プロジェクト: alvarobfdev/applog
	  <?php 
$sidebar = SiteHelpers::menus('sidebar');
?>
<nav role="navigation" class="navbar-default navbar-static-side">
     <div class="sidebar-collapse">				  
       <ul id="sidemenu" class="nav expanded-menu">
		<li class="logo-header" >
		 <a class="navbar-brand" href="{{ URL::to('dashboard')}}">
		 	@if(file_exists(public_path().'/sximo/images/'.CNF_LOGO) && CNF_LOGO !='')
		 	<img src="{{ asset('sximo/images/'.CNF_LOGO)}}" alt="{{ CNF_APPNAME }}" />
		 	@else
			<img src="{{ asset('sximo/images/logo.png')}}" alt="{{ CNF_APPNAME }}" />
			@endif
		 </a>
		</li>
		<li class="nav-header">
			<div class="dropdown profile-element" style="text-align:center;"> <span>
				{!! SiteHelpers::avatar() !!}
				 </span>
				<a href="{{ URL::to('user/profile') }}" >
				<span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">{{ Session::get('fid') }}</strong>
				 <br />
				{{ Lang::get('core.lastlogin') }} : <br />
				<small>{{ date("H:i F j, Y", strtotime(Session::get('ll'))) }}</small>				
				 </span> 
				 </span>
				 </a>
			</div>
			<div class="photo-header "> {!! SiteHelpers::avatar( 40 ) !!} </div>
		</li> 
		@foreach ($sidebar as $menu)
コード例 #27
0
    ?>
</td>
            <td>
				<div class="input-group input-group-sm">
				<span class="input-group-addon xlick bg-default btn-xs " >EN</span>		
				<input type="text" name="label[<?php 
    echo $id;
    ?>
]" class="form-control input-sm" value="<?php 
    echo $rows['label'];
    ?>
" />
				
              </div>
			  <?php 
    $lang = SiteHelpers::langOption();
    if (CNF_MULTILANG == 1) {
        foreach ($lang as $l) {
            if ($l['folder'] != 'en') {
                ?>
			   <div class="input-group input-group-sm" style="margin:1px 0 !important;">
			   		<span class="input-group-addon xlick bg-default btn-sm " ><?php 
                echo strtoupper($l['folder']);
                ?>
</span>
			  	 <input name="language[<?php 
                echo $id;
                ?>
][<?php 
                echo $l['folder'];
                ?>
コード例 #28
0
 function getDownload(Request $request)
 {
     if ($this->access['is_excel'] == 0) {
         return Redirect::to('')->with('messagetext', \Lang::get('core.note_restric'))->with('msgstatus', 'error');
     }
     $info = $this->model->makeInfo($this->module);
     // Take param master detail if any
     $filter = !is_null($request->input('search')) ? $this->buildSearch() : '';
     $params = array('params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
     $results = $this->model->getRows($params);
     $fields = $info['config']['grid'];
     $rows = $results['rows'];
     $content = $this->data['pageTitle'];
     $content .= '<table border="1">';
     $content .= '<tr>';
     foreach ($fields as $f) {
         if ($f['download'] == '1') {
             $content .= '<th style="background:#f9f9f9;">' . $f['label'] . '</th>';
         }
     }
     $content .= '</tr>';
     foreach ($rows as $row) {
         $content .= '<tr>';
         foreach ($fields as $f) {
             if ($f['download'] == '1') {
                 $conn = isset($f['conn']) ? $f['conn'] : array();
                 $content .= '<td>' . \SiteHelpers::gridDisplay($row->{$f}['field'], $f['field'], $conn) . '</td>';
             }
         }
         $content .= '</tr>';
     }
     $content .= '</table>';
     @header('Content-Type: application/ms-excel');
     @header('Content-Length: ' . strlen($content));
     @header('Content-disposition: inline; filename="' . $title . ' ' . date("d/m/Y") . '.xls"');
     echo $content;
     exit;
 }
コード例 #29
0
 public function postDestroy()
 {
     if ($this->access['is_remove'] == 0) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric')));
     }
     // delete multipe rows
     foreach (Input::get('id') as $id) {
         $data = $this->model->getRow($id);
         @unlink(ROOT . '/uploads/slideshow/' . $data->slideshow_image);
         @unlink(ROOT . '/uploads/slideshow/thumb/' . $data->slideshow_image);
     }
     $this->model->destroy(Input::get('id'));
     $this->inputLogs("ID : " . implode(",", Input::get('id')) . " , " . Lang::get('core.note_success_delete'));
     // redirect
     Session::flash('message', SiteHelpers::alert('success', Lang::get('core.note_success_delete')));
     return Redirect::to('Slideshow?md=' . Input::get('md'));
 }
コード例 #30
0
 public function postDestroy()
 {
     if ($this->access['is_remove'] == 0) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric')));
     }
     // delete multipe rows
     //$this->model->destroy(Input::get('id'));
     $this->inputLogs("ID : " . implode(",", Input::get('id')) . "  , Has Been Removed Successfull");
     // redirect
     Session::flash('message', SiteHelpers::alert('success', Lang::get('core.note_success_delete')));
     return Redirect::to('norders?md=' . Input::get('md'));
 }