本文整理汇总了PHP中Branch::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Branch::all方法的具体用法?PHP Branch::all怎么用?PHP Branch::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Branch
的用法示例。
在下文中一共展示了Branch::all方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: branches
public function branches()
{
$ids = DB::table('tblBranches')->select('strBrchID')->orderBy('updated_at', 'desc')->orderBy('strBrchID', 'desc')->take(1)->get();
$ID = $ids["0"]->strBrchID;
$newID = $this->smart($ID);
$branches = Branch::all();
return View::make('branches')->with('branches', $branches)->with('newID', $newID);
}
示例2: format
private static function format($data)
{
$branches = Branch::all(['key' => true, 'all' => true]);
foreach ($data as $key => &$row) {
$row['bname'] = $branches[$row['bid']]['name'];
$row['is_freeze'] = $row['status'] == self::STATUS_FREEZE;
$row['status_text'] = $row['is_freeze'] ? '已冻结' : '正常';
}
return $data;
}
示例3: branches
public function branches()
{
$ids = DB::table('tblBranches')->select('strBrchID')->orderBy('updated_at', 'desc')->orderBy('strBrchID', 'desc')->take(1)->get();
$ID = $ids["0"]->strBrchID;
$arrID = str_split($ID);
$new = "";
$somenew = "";
$arrNew = [];
$boolAdd = TRUE;
for ($ctr = count($arrID) - 1; $ctr >= 0; $ctr--) {
$new = $arrID[$ctr];
if ($boolAdd) {
if (is_numeric($new) || $new == '0') {
if ($new == '9') {
$new = '0';
$arrNew[$ctr] = $new;
} else {
$new = $new + 1;
$arrNew[$ctr] = $new;
$boolAdd = FALSE;
}
//else
} else {
$arrNew[$ctr] = $new;
}
//else
}
//if ($boolAdd)
$arrNew[$ctr] = $new;
}
//for
for ($ctr2 = 0; $ctr2 < count($arrID); $ctr2++) {
$somenew = $somenew . $arrNew[$ctr2];
}
// Get all products from the database
$branches = Branch::all();
return View::make('branches')->with('branches', $branches)->with('somenew', $somenew);
}
示例4: compact
$leaveapplications = Leaveapplication::all();
return View::make('leaveapplications.rejected', compact('leaveapplications'));
});
});
Route::group(['before' => 'manage_settings'], function () {
Route::get('migrate', function () {
return View::make('migration');
});
});
/*
* Template routes and generators
*/
Route::get('template/employees', function () {
$bank_data = Bank::all();
$bankbranch_data = BBranch::all();
$branch_data = Branch::all();
$department_data = Department::all();
$employeetype_data = EType::all();
$jobgroup_data = JGroup::all();
Excel::create('Employees', function ($excel) use($bank_data, $bankbranch_data, $branch_data, $department_data, $employeetype_data, $jobgroup_data, $employees) {
require_once base_path() . "/vendor/phpoffice/phpexcel/Classes/PHPExcel/NamedRange.php";
require_once base_path() . "/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DataValidation.php";
$excel->sheet('employees', function ($sheet) use($bank_data, $bankbranch_data, $branch_data, $department_data, $employeetype_data, $jobgroup_data, $employees) {
$sheet->row(1, array('PERSONAL FILE NUMBER', 'EMPLOYEE', 'FIRST NAME', 'LAST NAME', 'ID', 'KRA PIN', 'BASIC PAY', ''));
$empdata = array();
foreach ($employees as $d) {
$empdata[] = $d->personal_file_number . ':' . $d->first_name . ' ' . $d->last_name . ' ' . $d->middle_name;
}
$emplist = implode(", ", $empdata);
$listdata = array();
foreach ($data as $d) {
示例5: index
/**
* Display a listing of branches
*
* @return Response
*/
public function index()
{
$branches = Branch::all();
return View::make('branches.index', compact('branches'));
}
示例6: edit
/**
* Show the form for editing the specified branch.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$employee = Employee::find($id);
$branches = Branch::all();
$departments = Department::all();
$jgroups = JGroup::all();
$etypes = EType::all();
$banks = Bank::all();
$bbranches = BBranch::all();
return View::make('employees.edit', compact('branches', 'departments', 'etypes', 'jgroups', 'banks', 'bbranches', 'employee'));
}
示例7: period_summary
public function period_summary()
{
$branches = Branch::all();
$depts = Department::all();
return View::make('pdf.summarySelect', compact('branches', 'depts'));
}
示例8: aiOrder
/**
* Function that generates order.
*
* @return Response
*/
public function aiOrder()
{
// Get all branches.
$branches = Branch::all();
// Get all providers.
$providers = Provider::where('AIManaged', '=', true)->get();
// Prepare order array.
$order = array();
// Loop through providers.
foreach ($providers as $provider) {
$order[$provider->Id] = array();
// Get all products.
$products = Stock::where('Provider', '=', $provider)->get();
foreach ($products as $product) {
$order[$provider->Id][$product->Code][$provider->BranchId] = array('Code' => $product->Code, 'Description' => $product->Description, 'Exist' => $product->Quantity, 'Cost' => $product->Cost, 'Minimum' => $product->Minimum, 'Order' => 0, 'Average' => 0, 'Sold' => 0);
}
// Get all the products sold in selected sample range.
$today = date('Y-m-d H:i:s');
switch ($provider->SampleRange) {
case '1week':
$startDate = date('Y-m-d H:i:s', strtotime($today) - 604800);
$sales = Sale::where('BranchId', '=', $branchId)->where('Created', '>=', $startDate)->where('Created', '<=', $today)->get();
foreach ($sales as $sale) {
$breakdown = SaleBreakdown::where('SaleId', '=', $sale->Id)->get();
foreach ($breakdown as $item) {
if (array_key_exists($item->Code, $order)) {
$order[$item->Code]['Sold'] += $item->Quantity;
}
}
}
// Now calculate average of each product.
foreach ($order as $index => $product) {
$order[$index]['Average'] = $product['Sold'] / 7;
}
break;
case '2week':
$startDate = date('Y-m-d H:i:s', strtotime($today) - 1209600);
$sales = Sale::where('BranchId', '=', $branchId)->where('Created', '>=', $startDate)->where('Created', '<=', $today)->get();
foreach ($sales as $sale) {
$breakdown = SaleBreakdown::where('SaleId', '=', $sale->Id)->get();
foreach ($breakdown as $item) {
if (array_key_exists($item->Code, $order)) {
$order[$item->Code]['Sold'] += $item->Quantity;
}
}
}
// Now calculate average of each product.
foreach ($order as $index => $product) {
$order[$index]['Average'] = $product['Sold'] / 14;
}
break;
case '1month':
$startDate = date('Y-m-d H:i:s', strtotime($today) - 2419200);
$sales = Sale::where('BranchId', '=', $branchId)->where('Created', '>=', $startDate)->where('Created', '<=', $today)->get();
foreach ($sales as $sale) {
$breakdown = SaleBreakdown::where('SaleId', '=', $sale->Id)->get();
foreach ($breakdown as $item) {
if (array_key_exists($item->Code, $order)) {
$order[$item->Code]['Sold'] += $item->Quantity;
}
}
}
// Now calculate average of each product.
foreach ($order as $index => $product) {
$order[$index]['Average'] = $product['Sold'] / 30;
}
break;
case '3month':
$startDate = date('Y-m-d H:i:s', strtotime($today) - 7257600);
$sales = Sale::where('BranchId', '=', $branchId)->where('Created', '>=', $startDate)->where('Created', '<=', $today)->get();
foreach ($sales as $sale) {
$breakdown = SaleBreakdown::where('SaleId', '=', $sale->Id)->get();
foreach ($breakdown as $item) {
if (array_key_exists($item->Code, $order)) {
$order[$item->Code]['Sold'] += $item->Quantity;
}
}
}
// Now calculate average of each product.
foreach ($order as $index => $product) {
$order[$index]['Average'] = $product['Sold'] / 90;
}
break;
case '1year':
$startDate = date('Y-m-d H:i:s', strtotime($today) - 29030400);
$sales = Sale::where('BranchId', '=', $branchId)->where('Created', '>=', $startDate)->where('Created', '<=', $today)->get();
foreach ($sales as $sale) {
$breakdown = SaleBreakdown::where('SaleId', '=', $sale->Id)->get();
foreach ($breakdown as $item) {
if (array_key_exists($item->Code, $order)) {
$order[$item->Code]['Sold'] += $item->Quantity;
}
}
}
// Now calculate average of each product.
//.........这里部分代码省略.........
示例9: GetAllBranch
public function GetAllBranch()
{
return Branch::all();
}
示例10: listAction
/**
* 门店列表
*/
public function listAction()
{
$branches = Branch::all(['all' => true]);
$this->view->setVar('branches', $branches);
}
示例11: postGuestPosts
public function postGuestPosts()
{
//verify the user input and create account
$validator = Validator::make(Input::all(), array('Type' => 'required|in:Notice,Eventsq,Job,Offer', 'Title' => 'required|max:40', 'Description' => 'required', 'Name' => 'required|max:120', 'Email' => 'required|email|max:60', 'Pic' => 'image|max:3000'));
if ($validator->fails()) {
return Redirect::route('advanced_squeeb-get')->withErrors($validator)->withInput()->with('global', 'Sorry!! Your Squeeb was not posted, please retry.');
} else {
$type = Input::get('Type');
$title = Input::get('Title');
$description = Input::get('Description');
$description = $this->MakeUrls($description);
$squeeb = substr(strip_tags($description), 0, 300);
$name = Input::get('Name');
$email = Input::get('Email');
$file = Input::file('Pic');
$package = Input::get('Package');
if ($package == 'pkg3') {
$campuses = Branch::all();
}
//check whether the user with this email existed before
$user = User::where('email', '=', $email);
$firstname = NULL;
$lastname = NULL;
//extract the firstname and last name from the name
if (preg_match('/\\s/', $name)) {
$names = explode(" ", $name);
$firstname = $names[0];
$lastname = $names[1];
} else {
$firstname = $name;
}
if ($user->count()) {
$user = $user->orderBy('id', 'DESC')->first();
} else {
//store the user details
$user = User::create(array('email' => $email, 'firstname' => $firstname, 'lastname' => $lastname));
}
//get the model name
$model = $type;
$result = $this->postUploadPhoto($type, $file);
$the_squeeb_array = array();
foreach ($campuses as $campus) {
$the_squeeb = Squeeb::create(array('model' => $model, 'views' => 0, 'branch_id' => $campus->id, 'create_day' => date("Y-m-d")));
array_push($the_squeeb_array, $the_squeeb->id);
//create the post details
$squeeb_id = 0;
$squeeb_id = $this->createSqueeb($model, $the_squeeb->id, $user->id, $title, $description, $squeeb);
//finally post the squeebe photo
if ($squeeb_id) {
if ($result != FALSE) {
//photos validation
$modelname = $type;
$tablename = lcfirst($modelname) . 's';
$modelphoto = $modelname . 'Photo';
$savesuccess = $modelphoto::create(array($tablename . '_id' => $squeeb_id, 'name' => $result));
}
}
}
if ($user && $the_squeeb) {
if ($squeeb_id) {
$squeeb = Squeeb::where('id', '=', $the_squeeb->id)->first();
View::share('squeeb', $squeeb);
view::share('model', $type);
$the_squeeb_array = implode(",", $the_squeeb_array);
View::share('the_squeeb_array', $the_squeeb_array);
return View::make('guest.advanced_squeeb_preview');
}
}
}
return Redirect::route('advanced_squeeb-get')->with('global', 'Some Error Occured, Please try again');
}
示例12: function
Route::get('leaveReports/selectRejectedPeriod', 'ReportsController@rejectedperiod');
Route::post('leaveReports/rejectedleaves', 'ReportsController@rejectedleaves');
Route::get('leaveReports/selectLeave', 'ReportsController@balanceselect');
Route::post('leaveReports/leaveBalances', 'ReportsController@leavebalances');
Route::get('leaveReports/selectLeaveType', 'ReportsController@leaveselect');
Route::post('leaveReports/Employeesonleave', 'ReportsController@employeesleave');
Route::get('leaveReports/selectEmployee', 'ReportsController@employeeselect');
Route::post('leaveReports/IndividualEmployeeLeave', 'ReportsController@individualleave');
Route::get('api/dropdown', function () {
$id = Input::get('option');
$bbranch = Bank::find($id)->bankbranch;
return $bbranch->lists('bank_branch_name', 'id');
});
Route::get('empedit/{id}', function ($id) {
$employee = Employee::find($id);
$branches = Branch::all();
$departments = Department::all();
$jgroups = JGroup::all();
$etypes = EType::all();
$banks = Bank::all();
$bbranches = BBranch::all();
return View::make('employees.cssedit', compact('branches', 'departments', 'etypes', 'jgroups', 'banks', 'bbranches', 'employee'));
});
Route::get('css/payslips', function () {
$employeeid = DB::table('employee')->where('personal_file_number', '=', Confide::user()->username)->pluck('id');
$employee = Employee::findorfail($employeeid);
return View::make('css.payslip', compact('employee'));
});
Route::get('css/leave', function () {
$employeeid = DB::table('employee')->where('personal_file_number', '=', Confide::user()->username)->pluck('id');
$employee = Employee::findorfail($employeeid);
示例13: edit
/**
* Show the form for editing the specified member.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$member = Member::find($id);
$branches = Branch::all();
$groups = Group::all();
return View::make('members.edit', compact('member', 'branches', 'groups'));
}