Esempio n. 1
0
 public function create()
 {
     $input = Input::all();
     $customers = Customer::all();
     $salesmen = Employee::all();
     return view('return.create', compact('input', 'customers', 'salesmen'));
 }
Esempio n. 2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     // Get all of the models from the database in a collection sorted by name field
     $employees = Employee::all()->sortBy('name');
     // Passes the collection of model instances in JSON format to the view for listing
     return view('phonebook.index', ['employees' => $employees]);
 }
 public function getAssigntarget()
 {
     $employee = Employee::all();
     $categories = Event::all();
     $userdetails = User::all();
     $targets = Targetassign::all();
     $deals = Deal::all();
     $userData = array();
     $key = 0;
     foreach ($targets as $target) {
         $achieved = 0;
         $userData[$key]['eventcode'] = $target->Eventcode;
         $userData[$key]['event'] = $target->Eventname;
         $userData[$key]['employee'] = $target->Employeeid;
         $userData[$key]['targetVal'] = $target->Targetvalue;
         foreach ($deals as $deal) {
             if ($target->Eventcode == $deal->Eventcode && $target->Employeeid == $deal->Empid) {
                 $achieved = $achieved + $deal->Dealvalue;
             }
         }
         $userData[$key]['achieved'] = $achieved;
         $userData[$key]['variance'] = $achieved - $target->Targetvalue;
         $userData[$key]['cur'] = $target->Currency;
         $key++;
     }
     return View('approval/assigntarget')->with(array('categories' => $categories, 'employee' => $employee, 'userdata' => $userData, 'targets' => $targets, 'eventtable' => $categories));
 }
Esempio n. 4
0
 public function __construct()
 {
     $count = Employee::count();
     $countProj = Project::count();
     $data = Employee::all();
     $YourRole = "";
     if (count(Auth::user()) > 0) {
         $YourRole = Auth::user()->UserRoles->role;
     }
     $Role2 = $this->Role1;
     // Count Unconfirmed
     $cc = 0;
     foreach ($data as $da) {
         if ($da->confirm == 0) {
             $cc++;
         }
     }
     $countConf = $cc;
     // Count Confirmed
     $cc1 = 0;
     foreach ($data as $dat) {
         if ($dat->confirm == 1) {
             $cc1++;
         }
     }
     $countConfirmed = $cc1;
     View::share('countConf', $countConf);
     View::share('YourRole', $YourRole);
     View::share('countConfirmed', $countConfirmed);
     View::share('count', $count);
     View::share('countProj', $countProj);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $employee_ids = Employee::all()->lists('id')->toArray();
     $order_states = OrderState::lists('id')->toArray();
     $products = Product::all();
     $municipalities = Municipality::all();
     factory(App\Customer::class, 50)->create()->each(function ($customer) use($employee_ids, $products, $municipalities, $order_states) {
         shuffle($employee_ids);
         shuffle($order_states);
         $customer->user()->save(factory(User::class, 'customer')->create());
         $customer->city_id = $municipalities->shuffle()->first()->id;
         $customer->save();
         $customer->products()->attach($products->shuffle()->first(), ['vote' => rand(1, 5), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
         $customer->orders()->save(factory(App\Order::class)->create(['acquired_by' => $employee_ids[0], 'state_id' => $order_states[0]]));
     });
     $user = new User();
     $user->name = 'Vid';
     $user->surname = 'Mahovic';
     $user->email = '*****@*****.**';
     $user->password = '******';
     $user->verified = true;
     $user->save();
     $customer = new Customer();
     $customer->street = 'Celovška 21';
     $customer->city_id = $municipalities->shuffle()->first()->id;
     $customer->phone = '+38640850993';
     $customer->save();
     $customer->user()->save($user);
 }
Esempio n. 6
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function getData()
 {
     if (!\Request::ajax()) {
         \App::abort(404, 'not found naja');
     }
     $data = App\Employee::all();
     return \Response::json($data);
 }
Esempio n. 7
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = \Faker\Factory::create();
     $rows = Employee::all();
     foreach ($rows as $row) {
         Employee::find($row->id)->account()->where('employee_id', $row->user_id)->update(['access_level' => $faker->randomElement(['User', 'Admin']), 'status' => $faker->randomElement(['Active', 'Deactivated']), 'password' => bcrypt('8d')]);
     }
 }
Esempio n. 8
0
 public function getIndex()
 {
     $categories = Event::all();
     $employee = Employee::all();
     $invoice = Invoice::all();
     $invnull = Invoice::where('Status', '=', 'Null')->get();
     return View('home2')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull));
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $all_emp = Employee::all();
     $dev_number = Device::all()->count();
     $dev_list = range(1, $dev_number);
     foreach ($all_emp as $employee) {
         $employee->devices()->attach($dev_list[array_rand($dev_list)]);
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data = Employee::all();
     $name = Auth::user()->name;
     $pos = ProjectOfficer::all();
     $adms = Admin::all();
     $tls = Teamleader::all();
     $mems = Member::all();
     return view('dropmin.dashboard.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('data', $data);
 }
Esempio n. 11
0
 public function testChildModelKeepsScope()
 {
     factory(User::class, 2)->create(['type' => Employee::class]);
     factory(User::class)->create(['type' => null]);
     $employees = Employee::all();
     $this->assertCount(2, $employees);
     $employees->each(function ($employee) {
         $this->assertInstanceOf(Employee::class, $employee);
     });
 }
 public function getHome()
 {
     $varr = Auth::user()->empid;
     $evarr = User::where('empid', $varr)->get();
     $edetails = Employee::where('emp_ide_id', $varr)->get();
     $categories = Event::all();
     $employee = Employee::all();
     $invoice = Invoice::all();
     $invnull = Invoice::where('Status', '=', 'Null')->get();
     return View('reviewer/home')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull, 'edetails' => $edetails));
 }
Esempio n. 13
0
 /**
  * Display list device be assigned to
  * 
  * @return Response view
  */
 public function index()
 {
     $devices = Device::all();
     $employees = Employee::all();
     $employall = array();
     $employall += array('0' => 'None');
     foreach ($employees as $key => $value) {
         $employall += array($value->id => $value->lastname . " " . $value->firstname);
     }
     $statusall = StatusDevice::lists('status', 'id');
     return view('devices.borrow', compact('devices', 'employall', 'statusall'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $interviews = Candidate::where('status_record_id', 3)->get();
     $employees = Employee::all();
     $employall = array();
     $employall += array('0' => 'None');
     foreach ($employees as $key => $value) {
         $employall += array($value->id => $value->lastname . " " . $value->firstname);
     }
     $statusrecord = StatusRecord::lists('name', 'id');
     return view('employee.interview', compact('statusrecord', 'interviews', 'employall'));
 }
 public function getHome()
 {
     $year = date("Y");
     $varr = Auth::user()->empid;
     $evarr = User::where('empid', $varr)->get();
     $edetails = Employee::where('emp_ide_id', $varr)->get();
     $categories = Event::where(DB::raw('year(date)'), $year)->get();
     $employee = Employee::all();
     $invoice = Invoice::orderBy('Id', 'DESC')->where(DB::raw('year(InvoiceDate)'), $year)->where(DB::raw('year(DueDate)'), $year)->get();
     $invnull = Invoice::where('Status', '=', 'Null')->get();
     return View('reviewer/home')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull, 'edetails' => $edetails));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data = Employee::all();
     $name = Auth::user()->name;
     $pos = ProjectOfficer::all();
     $adms = Admin::all();
     $tls = Teamleader::all();
     $mems = Member::all();
     $proj = Project::all();
     $ac = Auth::user()->id;
     $acc = AccessClient::where('id_users', $ac)->get();
     return view('dropmin.dashboard.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('projs', $proj)->with('accss', $acc)->with('datas', $data);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function getIndex($dealid)
 {
     $id = $dealid;
     $invoicedata = Deal::where('Id', $id)->get();
     // dd($invoicedata);
     foreach ($invoicedata as $dat) {
         # code...
         $evname = $dat['Eventname'];
     }
     $categories = Event::where('event', $evname)->get();
     foreach ($categories as $category) {
         $EventDate = $category['date'];
     }
     $employee = Employee::all();
     $invoice = Invoice::all();
     return View('createinvoice')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invoicedata' => $invoicedata, 'EventDate' => $EventDate));
 }
Esempio n. 18
0
 public function __construct()
 {
     $count = Employee::count();
     $countProj = Project::count();
     $data = Employee::all();
     $DataEm = "";
     $YourRole = "";
     $undisplayRoleAcc = "";
     if (count(Auth::user()) > 0) {
         $YourRole = Auth::user()->UserRoles->role;
         if (Auth::user()->id_employees > 0) {
             $DataEm = Employee::where('id', Auth::user()->id_employees)->get();
         }
     }
     if ($YourRole == 11) {
         $undisplayRoleAcc = "undisplayRole";
     }
     $Role2 = $this->Role1;
     // Count Unconfirmed
     $cc = 0;
     foreach ($data as $da) {
         if ($da->confirm == 0) {
             $cc++;
         }
     }
     $countConf = $cc;
     // Count Confirmed
     $cc1 = 0;
     foreach ($data as $dat) {
         if ($dat->confirm == 1) {
             $cc1++;
         }
     }
     $countConfirmed = $cc1;
     View::share('countConf', $countConf);
     View::share('DataEm', $DataEm);
     View::share('undisplayRoleAcc', $undisplayRoleAcc);
     View::share('YourRole', $YourRole);
     View::share('countConfirmed', $countConfirmed);
     View::share('count', $count);
     View::share('countProj', $countProj);
 }
Esempio n. 19
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     //
     $employees = Employee::all();
     $rules = ['employee_id' => 'unique_with:reports,months'];
     foreach ($employees as $employees) {
         // $report=new Report();
         $report['employee_id'] = $employees->id;
         // $report['months']='2015-08-01';
         $report['months'] = Carbon::now()->firstOfMonth();
         $report['months_string'] = $report['months'];
         $report['fee'] = 0;
         $report['flag_id'] = 1;
         $v = \Validator::make($report, $rules);
         if ($v->fails()) {
         } else {
             $r = Report::create($report);
         }
     }
 }
Esempio n. 20
0
 public function index(Request $request)
 {
     $employees = Employee::all();
     if ($request->sort == 'status_dsc') {
         $employees = Employee::all()->sortByDesc('status');
     } else {
         if ($request->sort == 'status_asc') {
             $employees = Employee::all()->sortBy('status');
         } else {
             if ($request->sort == 'name') {
                 $employees = Employee::all()->sortBy('name');
             } else {
                 if ($request->sort == 'id') {
                     $employees = Employee::all()->sortBy('id');
                 }
             }
         }
     }
     return view('hr.employee.index', compact('employees'));
 }
Esempio n. 21
0
 public function import()
 {
     /************* Base ***********/
     Excel::load('data/base_stcs.csv', function ($reader) {
         foreach ($reader->get() as $employee) {
             Employee::create(["no_emp" => $employee->noemp, "first_name" => ucwords(mb_strtolower($employee->nombre, 'UTF-8')), "last_name" => '', "gender" => "f", "status" => 1, "payrollID" => 3, "syndicateID" => 1]);
         }
     });
     Excel::load('data/base_sthcs.csv', function ($reader) {
         foreach ($reader->get() as $employee) {
             Employee::create(["no_emp" => $employee->noemp, "first_name" => ucwords(mb_strtolower($employee->nombre, 'UTF-8')), "last_name" => '', "gender" => "f", "status" => 1, "payrollID" => 3, "syndicateID" => 2]);
         }
     });
     Excel::load('data/base_sitcs.csv', function ($reader) {
         foreach ($reader->get() as $employee) {
             Employee::create(["no_emp" => $employee->noemp, "first_name" => ucwords(mb_strtolower($employee->nombre, 'UTF-8')), "last_name" => '', "gender" => "f", "status" => 1, "payrollID" => 3, "syndicateID" => 3]);
         }
     });
     return Employee::all();
 }
Esempio n. 22
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('infos')->delete();
     $faker = \Faker\Factory::create();
     foreach (range(1, 20) as $index) {
         $employee = Employee::all();
         $originator = $employee->random();
         $close_by = Employee::where('station', 'quality assurance')->first();
         $issuedTo = $employee->random();
         $major = 'major';
         $year = Carbon::now('Asia/Manila')->format('y');
         $info = Info::create(['control_id' => $year . "-" . sprintf("%'.04d", $index), 'customer' => $faker->randomElement(array_flatten(Option::all('customer')->toArray())), 'package_type' => $faker->firstNameFemale, 'device_name' => $faker->address, 'lot_id_number' => $faker->randomDigit, 'lot_quantity' => $faker->randomNumber(4), 'job_order_number' => $faker->randomElement(['0', '1', '2']), 'machine' => $faker->randomElement(['at01', 'at02', 'at03', 'at04', 'at05']), 'station' => $faker->randomElement(['pl1', 'pl2', 'pl3', 'pl4', 'pl5']), 'created_at' => $faker->dateTimeThisMonth, 'major' => $major, 'disposition' => $faker->randomElement(['use as is', 'ncmr#', 'rework', 'split lot', 'shutdown', 'shipback']), 'problem_description' => $faker->paragraph(2), 'failure_mode' => $faker->randomelement(['assembly', 'environment', 'machine', 'man', 'material', 'method / process']), 'discrepancy_category' => $faker->randomelement(['MISSING UNIT(S)', 'LOW YIELD', 'WRONG TRANSACTION', 'CANT CREATE', 'FOREIGN MATERIAL', 'WRONG MERGING', 'DATECODE DISCREPANCY', 'MARKING PROBLEM', 'MIXED DEVICE', 'BENT LEAD', 'LEAD CONTAMINATION', 'LEAD DISCOLORATION', 'LEAD COPLANARITY']), 'quantity' => $faker->randomNumber(4)]);
         CauseOfDefect::create(['info_id' => $info->id, 'cause_of_defect' => $faker->randomElement(['PRODUCTION', 'PROCESS', 'MAINTENANCE', 'FACILITIES', 'QUALITY ASSURANCE', 'OTHERS']), 'cause_of_defect_description' => $faker->paragraph(2), 'objective_evidence' => 'N/A']);
         ContainmentAction::create(['info_id' => $info->id, 'what' => $faker->paragraph(2), 'who' => $faker->name('male' | 'female'), 'objective_evidence' => 'N/A', 'created_at' => $info->created_at]);
         CorrectiveAction::create(['info_id' => $info->id, 'what' => $faker->paragraph(2), 'who' => $faker->name('male' | 'female'), 'objective_evidence' => 'N/A', 'created_at' => $info->created_at]);
         PreventiveAction::create(['info_id' => $info->id, 'what' => $faker->paragraph(2), 'who' => $faker->name('male' | 'female'), 'objective_evidence' => 'N/A', 'created_at' => $info->created_at]);
         QdnCycle::create(['info_id' => $info->id, 'cycle_time' => '24', 'production_cycle_time' => '24', 'process_engineering_cycle_time' => '24', 'quality_assurance_cycle_time' => '24', 'other_department_cycle_time' => '24', 'created_at' => $info->created_at]);
         InvolvePerson::create(['info_id' => $info->id, 'station' => $originator->station, 'originator_id' => $originator->user_id, 'originator_name' => $originator->name, 'receiver_id' => $issuedTo->user_id, 'receiver_name' => $issuedTo->name, 'created_at' => $info->created_at]);
         Closure::create(['info_id' => $info->id, 'containment_action_taken' => $faker->randomElement(['yes', 'no']), 'corrective_action_taken' => $faker->randomElement(['yes', 'no']), 'close_by' => $close_by->name, 'date_sign' => Carbon::parse($info->created_at)->addDay(), 'production' => $employee->where('department', 'production')->random()->name, 'process_engineering' => $employee->where('department', 'process_engineering')->random()->name, 'quality_assurance' => $employee->where('department', 'quality_assurance')->random()->name, 'other_department' => $employee->where('department', 'other_department')->random()->name, 'status' => 'Closed', 'created_at' => $info->created_at]);
     }
 }
Esempio n. 23
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     // Start Check Authorization
     $invalid_auth = 1;
     $authRole = Auth::user()->UserRoles->role;
     if ($authRole == 1 or $authRole == 3 or $authRole == 5 or $authRole == 7 or $authRole == 9) {
         $invalid_auth = 0;
     }
     if ($invalid_auth == 1) {
         Alert::error('Anda tidak memilik akses ini')->persistent('close');
         return redirect('dashboard');
     }
     // End Check Authorization
     $data = Employee::all();
     $name = Auth::user()->name;
     $pos = ProjectOfficer::all();
     $adms = Admin::all();
     $tls = Teamleader::all();
     $mems = Member::all();
     return view('dropmin.record.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('datas', $data);
 }
Esempio n. 24
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $employees = Employee::all();
     $results = array();
     foreach ($employees as $key => $value) {
         if (count($value->user()->get()) == 0) {
             $results += array($value->id => $value->lastname . " " . $value->firstname);
         }
     }
     $emloyee_relation = User::find($id)->employee()->first();
     $fullname = $emloyee_relation->lastname . " " . $emloyee_relation->firstname;
     $user = User::find($id);
     $resultchoose = User::find($id)->employee_id;
     $results += array($resultchoose => $fullname);
     $groups = Group::lists('groupname', 'id');
     $groupssl = $user->group->lists('id');
     if (is_null($user)) {
         return redirect()->route('users.index');
     }
     return View('users.edituser', compact('user', 'groups', 'groupssl', 'results', 'resultchoose'));
 }
Esempio n. 25
0
 public function exportEXData()
 {
     $data = Employee::all();
     $now = date('Y-m-d');
     Excel::create('DatabaseKaryawan_' . $now, function ($excel) use($data) {
         // Set the title
         $excel->setTitle('Indosakti');
         // Chain the setters
         $excel->setCreator('Indosakti')->setCompany('Indosakti');
         // Our first sheet
         $excel->sheet('Sheet_Database', function ($sheet) use($data) {
             $sheet->setWidth('A', 20);
             $sheet->setWidth('B', 20);
             $sheet->setWidth('C', 20);
             $sheet->setWidth('D', 5);
             $sheet->setWidth('E', 5);
             $sheet->setWidth('F', 20);
             $sheet->setWidth('G', 20);
             $sheet->setWidth('H', 5);
             $sheet->setWidth('I', 5);
             $sheet->setWidth('J', 20);
             $sheet->setWidth('K', 20);
             $sheet->setWidth('L', 20);
             $sheet->setWidth('M', 20);
             $sheet->setWidth('N', 30);
             $sheet->setWidth('O', 20);
             $sheet->setWidth('P', 20);
             $sheet->setWidth('Q', 20);
             $sheet->setWidth('R', 20);
             $sheet->setWidth('S', 20);
             $sheet->setWidth('T', 20);
             $sheet->setWidth('U', 30);
             $sheet->loadView('dropmin.data.excel')->with('data', $data);
         });
         // Call them separately
         $excel->setDescription('A demonstration to change the file properties');
     })->download('xls');
 }
Esempio n. 26
0
 /**
  * Generates employee table response
  *
  * @return \Illuminate\View\View
  */
 public function listTable()
 {
     return view('partials.employeeTable', ['employees' => $this->employee->all()]);
 }
Esempio n. 27
0
 /**
  * Detect driver name on ajax request
  * @param Request $request
  * @return static
  */
 public function driver(Request $request)
 {
     $eid = $request->get('eid');
     $driver = Employee::all()->where('eid', $eid)->pluck('name');
     return $driver;
 }
Esempio n. 28
0
 public function getEmployees()
 {
     return Employee::all();
 }
 /**
  * View create detail feature
  * @return [type] [description]
  */
 public function createDetailFeature()
 {
     $featureprojects = FeatureProject::all();
     $statusprojects = StatusProject::all();
     $categoryfeatures = CategoryFeature::all();
     $priorities = Priority::all();
     $employees = Employee::all();
     return view('manageproject.createdetailfeature', compact('featureprojects', 'statusprojects', 'categoryfeatures', 'priorities', 'employees'));
 }
Esempio n. 30
0
 public function rel($id)
 {
     $data = User::find($id);
     $emplo = Employee::all();
     return view('dropmin/user/rel')->with('datas', $data)->with('emplo', $emplo);
 }