private function firstRun() { $branches = Branch::all(); foreach ($branches as $branch) { $new = Branch::find($branch->id); $new->id = Branch::get_uid(); $new->save(); } }
public function run() { DB::table('users')->delete(); $branches = Branch::all(); $users = []; foreach ($branches as $branch) { array_push($users, ['username' => strtolower($branch->code) . '-manager', 'name' => $branch->code . ' Manager', 'branchid' => $branch->id, 'email' => strtolower($branch->code) . '*****@*****.**', 'password' => bcrypt('giligans'), 'id' => $branch->id]); $this->command->info($branch->descriptor); } DB::table('users')->insert($users); $this->command->info('Users table seeded!'); }
public function run() { //DB::table('user')->delete(); //DB::connection('hr')->table('company')->delete(); DB::table('user')->insert(array(array('username' => 'admin', 'name' => 'Giligans Admin', 'email' => '*****@*****.**', 'password' => bcrypt('giligans'), 'admin' => 1, 'branchid' => '0C17FE2D78A711E587FA00FF59FBB323', 'id' => '29E4E2FA672C11E596ECDA40B3C0AA12'), array('username' => 'cashier', 'name' => 'Giligans Cashier', 'email' => '*****@*****.**', 'password' => bcrypt('giligans'), 'admin' => 5, 'branchid' => '0C17FE2D78A711E587FA00FF59FBB323', 'id' => '3060F4F3BE6011E5A3FA00FF59FBB323'))); $branches = Branch::all(); $users = []; foreach ($branches as $branch) { array_push($users, ['username' => strtolower($branch->code) . '-cashier', 'name' => $branch->code . ' Cashier', 'branchid' => $branch->id, 'email' => strtolower($branch->code) . '*****@*****.**', 'password' => bcrypt('giligans'), 'admin' => 5, 'id' => $branch->id]); $this->command->info(strtolower($branch->code) . '-cashier'); } DB::table('user')->insert($users); $this->command->info('User table seeded!'); }
public function getBranch() { $branches = Branch::all(); return Datatables::of($branches)->edit_column('image', function ($row) { if (!empty($row->image)) { return showImage($row->image, BRANCH_IMAGE . showDate($row->created, 1)); } })->edit_column('status', function ($row) { return showSelectStatus($row->id, $row->status, 'Kacana.product.branch.setStatusBranch(' . $row->id . ', 1)', 'Kacana.product.branch.setStatusBranch(' . $row->id . ', 0)'); })->edit_column('created', function ($row) { return showDate($row->created); })->edit_column('updated', function ($row) { return showDate($row->updated); })->add_column('action', function ($row) { return showActionButton('Kacana.product.branch.showEditBranchForm(' . $row->id . ')', 'Kacana.product.branch.removeBranch(' . $row->id . ')', true); })->make(true); }
public function index() { $branchs = Branch::all(['id', 'name']); $branchselectlist = array(); array_push($branchselectlist, ':เลือกสาขา'); foreach ($branchs as $item) { array_push($branchselectlist, $item->id . ':' . $item->name); } $departments = Department::all(['id', 'name']); $departmentselectlist = array(); array_push($departmentselectlist, ':เลือกแผนก'); foreach ($departments as $item) { array_push($departmentselectlist, $item->id . ':' . $item->name); } $teams = Team::all(['id', 'name']); $teamselectlist = array(); array_push($teamselectlist, ':เลือกทีม'); foreach ($teams as $item) { array_push($teamselectlist, $item->id . ':' . $item->name); } return view('employee', ['branchselectlist' => implode(";", $branchselectlist), 'departmentselectlist' => implode(";", $departmentselectlist), 'teamselectlist' => implode(";", $teamselectlist)]); }
public function getBranchManager() { $postions = Position::all(); $branches = Branch::all(); return view('branch.manager')->with('postions', $postions)->with('branches', $branches); }
public function index() { if (!$this->hasPermission($this->menuPermissionName)) { return view($this->viewPermissiondeniedName); } $branchs = Branch::all(['id', 'name']); $branchselectlist = array(); array_push($branchselectlist, ':เลือกสาขา'); foreach ($branchs as $item) { array_push($branchselectlist, $item->id . ':' . $item->name); } $departments = Department::all(['id', 'nameth', 'nameen']); $departmentselectlist = array(); array_push($departmentselectlist, ':เลือกแผนก'); foreach ($departments as $item) { array_push($departmentselectlist, $item->id . ':' . str_replace('&', '\\u0026', $item->nameth) . ' - ' . str_replace('&', '\\u0026', $item->nameen)); } $teams = Team::all(['id', 'name']); $teamselectlist = array(); array_push($teamselectlist, ':เลือกทีม'); foreach ($teams as $item) { array_push($teamselectlist, $item->id . ':' . $item->name); } return view('employee', ['branchselectlist' => implode(";", $branchselectlist), 'departmentselectlist' => implode(";", $departmentselectlist), 'teamselectlist' => implode(";", $teamselectlist)]); }