public function getOrderslist() { $Orders = DB::table('Orders'); $Orders->leftJoin('order_shipping', 'Orders.id', '=', 'order_shipping.order_id'); $Orders->select('Orders.id', 'Orders.buy_tel', 'Orders.order_created', 'Orders.voucher_name', 'Orders.pay_total', 'order_shipping.shipping_code', 'order_shipping.created_at', 'Orders.buy_name', 'Orders.taopix_order_id', 'Orders.item_count', 'Orders.status'); $orderid = Input::get('orderid'); if ($orderid) { $Orders->where('taopix_order_id', $orderid); } $buytel = Input::get('buy_tel'); if ($buytel) { $Orders->where('buy_tel', $buytel); } $buyname = Input::get('buy_name'); if ($buyname) { $Orders->where('buy_name', $buyname); } $createdStart = Input::get('order_created_start'); $createdEnd = Input::get('order_created_end'); if ($createdStart && $createdEnd) { //$where .= ' AND order_created between ' . $createdStart."'"." AND ' ".$createdEnd ."'"; $Orders->whereBetween('order_created', [$createdStart, $createdEnd]); } $orders['search']['orderid'] = $orderid; $orders['search']['buytel'] = $buytel; $orders['search']['buyname'] = $buyname; $orders['search']['createdStart'] = $createdStart; $orders['search']['createdEnd'] = $createdEnd; $orders['data'] = $Orders->orderBy('Orders.id', 'desc')->paginate(10); return $orders; }
public function updateRecord($id) { $inputs = Input::all(); $rules = ['name' => 'required', 'url' => 'required', 'icon' => 'required', 'module' => 'required']; $record = $this->doUpdate($id, $inputs, $rules); if ($record['status'] == 1) { return Redirect::to('/crm/feature/' . $id)->withMessage(Generate::message('SUCCESS', $record['message'])); } return Redirect::to('/crm/feature/' . $id)->withMessage(Generate::message('FAILED', $record['message'])); }
public function updateEntry($fid, $pid) { $inputs = Input::all(); $rules = ['feature_id' => 'required', 'name' => 'required', 'module' => 'required', 'position' => 'required', 'url' => 'required', 'page' => 'required', 'prompt_type' => 'required']; $updated = $this->doUpdate($pid, $inputs, $rules); //if create function return 1 - Success, !1 - Not Success if ($updated['status'] == 1) { //redirect to the url you wan along with the message return Redirect::to('/crm/feature/' . $fid)->withMessage(Generate::message('SUCCESS', $updated['message'])); } //redirect to the proper handling url along with the message return Redirect::to('/crm/feature/' . $fid)->withMessage(Generate::message('FAILED', $updated['message'])); }
public static function insertDocument($request) { $result = Result::find($request->results_id); $result->res_status = 1; $result->save(); $validacion = Validation::find($result->validations_id); $data = explode('|', $validacion->val_data); $documento = \Input::file('document'); $nombre = $result->res_referen . '_' . $data[0]; $dir = '../../public_html/clientes/ftp/' . Session::get('empresa') . '/pdf/'; if (null === $documento) { $documento->move($dir, $nombre); } $nombredoc = \DB::connection('master')->table('mdb_tipodocum')->where('doc_clave', $data[0])->first(); \DB::connection('users')->table('opauimg')->insert(['pk_referencia' => $result->res_referen, 'imgNameFile' => $nombre, 'strImageName' => $nombredoc->doc_nombre, 'imgtipo' => 'application/pdf', 'imgtipodoc' => $data[0]]); }
public function daftar_input() { $no = "1"; $sinput = Input::orderBy('kode_input', 'asc')->get(); return view('admin.daftar_input', compact('sinput', 'no')); }
$matchingChars = similar_text(strtolower($match[1]), strtolower($test)); if ($matchingChars >= 3 && $matchingChars > $mostMatcing) { $mostMatcing = $matchingChars; $mostSimilar = $prefix; } } } Response::fail("Unsupported prefix: {$match[1]}. " . (isset($mostSimilar) ? "<em>Did you mean <span class='color-ui'>{$mostSimilar}</span></em>?" : 'Use a backslash if the colon is part of the title (e.g. <code>\\:</code>)')); } $title = Episodes::removeTitlePrefix($value); if (Input::checkStringLength($title, $range, $code)) { return $code; } $value = "{$match[1]}: {$title}"; } else { if (Input::checkStringLength($value, $range, $code)) { return $code; } } }, array(Input::IN_RANGE => [5, 35], Input::CUSTOM_ERROR_MESSAGES => array(Input::ERROR_MISSING => "{$What} title is missing", Input::ERROR_RANGE => "{$What} title must be between @min and @max characters", 'prefix-movieonly' => "Prefixes can only be used for movies"))))->out(); CoreUtils::checkStringValidity($insert['title'], "{$What} title", INVERSE_EP_TITLE_PATTERN); $airs = (new Input('airs', 'timestamp', array(Input::CUSTOM_ERROR_MESSAGES => array(Input::ERROR_MISSING => 'No air date & time specified', Input::ERROR_INVALID => 'Invalid air date and/or time (@value) specified'))))->out(); if (empty($airs)) { Response::fail('Please specify an air date & time'); } $insert['airs'] = date('c', strtotime('this minute', $airs)); if ($editing) { if (!$Database->whereEp($Episode)->update('episodes', $insert)) { Response::dbError('Updating episode failed'); } } else {
public function assignRolePermission($rid) { $inputs = Input::all(); //get all the permission that this role has. $current_permissions_id = Role::getPermissionsAssignedToCurrentRole($rid); foreach ($inputs as $key => $value) { $is_permission_added_in_current_role = false; if ($key == '_token') { continue; } $permission_id = explode("_", $key)[1]; $is_permission_added_in_current_role = in_array($permission_id, $current_permissions_id); if (!$is_permission_added_in_current_role && $value == 'on') { echo 'ON'; print_r($current_permissions_id); echo $permission_id . '->'; echo $is_permission_added_in_current_role; echo '<br>'; //if the permission is not exist, create new permission role record. $new_permission = new PermissionRole(); $new_permission->role_id = $rid; $new_permission->permission_id = $permission_id; $new_permission->order = '1'; $new_permission->save(); //else since it is already exist, and it is on, no need to do anything. } else { if ($is_permission_added_in_current_role) { if ($value == 'off') { echo 'OFF'; print_r($current_permissions_id); echo $permission_id . '->'; echo $is_permission_added_in_current_role; echo '<br>'; //if permission record is exist (true), find and do a delete. $perm = PermissionRole::where('role_id', $rid)->where('permission_id', $permission_id)->first(); if (isset($perm)) { $perm->delete(); } //else it is not exist, do nothing. } else { if ($value == 'on') { //echo 'ON'; print_r ($current_permissions_id); echo $permission_id.'->'; echo $is_permission_added_in_current_role; echo '<br>'; //do nothing .... } } } } } //return ''; return Redirect::to('/crm/role/' . $rid)->withMessage(Generate::message('Success', 'New Permissions Applied, please relogin to see the changes.')); }
public function ajaxImageUpload() { $user_id = Input::get('user_id'); $file = Input::file('display_image'); //get the image folder to store the image, in this case the specific restaurant folder. $image_folder = '/assets/images/users/'; //upload the image and return the file path $file_path = Image::uploadImage($file, $image_folder); if ($file_path['status'] != 1) { return Response::json(['success' => false, 'errors' => $file_path['errors']]); } $user = User::find($user_id); $user->display_image = $file_path['data']; $user->save(); User::updateUserSession(); return Response::json(['success' => true, 'message' => 'Profile Image Updated.', 'file' => $user->display_image]); }