Beispiel #1
0
 /**
  * Pay salary
  * Created by smartrahat Date: 2016.01.15 Time: 05:10 PM
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function pay(Request $request)
 {
     if (Input::get('due')) {
         $request['type'] = 1;
         $request['total'] = 0;
     } elseif (Input::get('advance')) {
         $request['type'] = 2;
     }
     //dd($request->all());
     $request['month'] = $request['month'] . ' ' . $request['year'];
     Salary::create($request->all());
     Session::flash('success_message', 'Paid Successfully');
     return redirect('salary');
 }
Beispiel #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('salary')->delete();
     Salary::create(['user_id' => '1', 'month_id' => '1', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '1', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '1', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '1', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '1', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '1', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '1', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '1', 'value' => '20000']);
     Salary::create(['user_id' => '1', 'month_id' => '2', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '2', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '2', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '2', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '2', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '2', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '2', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '2', 'value' => '20000']);
     Salary::create(['user_id' => '1', 'month_id' => '3', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '3', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '3', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '3', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '3', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '3', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '3', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '3', 'value' => '20000']);
     Salary::create(['user_id' => '1', 'month_id' => '4', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '4', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '4', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '4', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '4', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '4', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '4', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '4', 'value' => '20000']);
     Salary::create(['user_id' => '1', 'month_id' => '5', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '5', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '5', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '5', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '5', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '5', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '5', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '5', 'value' => '20000']);
     Salary::create(['user_id' => '1', 'month_id' => '6', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '6', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '6', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '6', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '6', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '6', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '6', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '6', 'value' => '20000']);
     Salary::create(['user_id' => '1', 'month_id' => '7', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '7', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '7', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '7', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '7', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '7', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '7', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '7', 'value' => '20000']);
     Salary::create(['user_id' => '1', 'month_id' => '8', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '8', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '8', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '8', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '8', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '8', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '8', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '8', 'value' => '20000']);
     Salary::create(['user_id' => '1', 'month_id' => '9', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '9', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '9', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '9', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '9', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '9', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '9', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '9', 'value' => '20000']);
     Salary::create(['user_id' => '1', 'month_id' => '10', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '10', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '10', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '10', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '10', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '10', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '10', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '10', 'value' => '20000']);
     Salary::create(['user_id' => '1', 'month_id' => '11', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '11', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '11', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '11', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '11', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '11', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '11', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '11', 'value' => '20000']);
     Salary::create(['user_id' => '1', 'month_id' => '12', 'value' => '50000']);
     Salary::create(['user_id' => '2', 'month_id' => '12', 'value' => '30000']);
     Salary::create(['user_id' => '3', 'month_id' => '12', 'value' => '30000']);
     Salary::create(['user_id' => '4', 'month_id' => '12', 'value' => '20000']);
     Salary::create(['user_id' => '5', 'month_id' => '12', 'value' => '20000']);
     Salary::create(['user_id' => '6', 'month_id' => '12', 'value' => '20000']);
     Salary::create(['user_id' => '7', 'month_id' => '12', 'value' => '20000']);
     Salary::create(['user_id' => '8', 'month_id' => '12', 'value' => '20000']);
 }