Пример #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     //assign all jobs to test user
     $user = \App\User::where('username', '=', 'Tester')->first();
     $settings = array('draw' => 15000, 'paper_type' => 1);
     $job = new \App\Job();
     $job->site_id = 2;
     $job->type = "press";
     $job->user_id = $user->id;
     $job->pub_id = 1;
     $job->run_id = 1;
     $job->equipment_id = 1;
     $job->tied_to_id = 0;
     $job->recurrence_id = 0;
     $job->product_date = date("Y-m-d");
     $job->request_date = date("Y-m-d");
     $job->start = date("Y-m-d", strtotime("-1 day")) . ' 11:30:00';
     $job->end = date("Y-m-d", strtotime("-1 day")) . ' 13:30:00';
     $job->source = "seeder";
     $job->settings = $settings;
     $job->save();
     \App\Job::create(['site_id' => 2, 'type' => "press", "user_id" => $user->id, "pub_id" => 1, "run_id" => 2, "equipment_id" => 1, "tied_to_id" => 0, "recurrence_id" => 0, "product_date" => date("Y-m-d", strtotime("+1 day")), "request_date" => date("Y-m-d", strtotime("+1 day")), "start" => date("Y-m-d") . ' 10:45:00', "end" => date("Y-m-d") . ' 12:00:00', "source" => "seeder", 'settings' => $settings]);
     \App\Job::create(['site_id' => 3, 'type' => "press", "user_id" => $user->id, "pub_id" => 2, "run_id" => 3, "equipment_id" => 1, "tied_to_id" => 0, "recurrence_id" => 0, "product_date" => date("Y-m-d", strtotime("+2 days")), "request_date" => date("Y-m-d", strtotime("+2 days")), "start" => date("Y-m-d", strtotime("+1 day")) . ' 15:15:00', "end" => date("Y-m-d", strtotime("+1 day")) . ' 16:30:00', "source" => "seeder", 'settings' => $settings]);
 }
Пример #2
0
 /**
  * Execute the job.
  */
 public function handle()
 {
     $job = new \App\Job();
     $job->title = $this->title;
     $job->description = $this->description;
     $job->save();
     $this->event->fire(new JobWasPostedEvent());
     return $this;
 }
Пример #3
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(JobRequest $request)
 {
     $job = new \App\Job();
     $job->fill($request->all());
     // mass assignment
     $job->save();
     // SALVA NO BD
     return back()->with('success', 'Job incluido com sucesso!');
 }
Пример #4
0
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 30) as $index) {
         App\Job::create(['name' => $faker->name(), 'description' => $faker->paragraph(5)]);
     }
 }
Пример #5
0
 private function makeJob($jobFields = [])
 {
     $job = array_merge(['name' => $this->fake->name(), 'description' => $this->fake->paragraph(5)], $jobFields);
     while ($this->times--) {
         App\Job::create($job);
     }
 }
 public function run()
 {
     $faker = Faker::create();
     $skillId = App\Skill::lists('id')->toArray();
     $jobId = App\Job::lists('id')->toArray();
     foreach (range(1, 30) as $index) {
         \DB::table('job_skill')->insert(['job_id' => $faker->randomElement($skillId), 'skill_id' => $faker->randomElement($jobId)]);
     }
 }
Пример #7
0
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
// Route::get('/', function () {
// 	  $topics = App\Topic::all()->sortBy('name');
//     return view('pages.home', ['template' => 'wide', 'topics' => $topics]);
// });
Route::get('/', 'PageController@getHome');
Route::post('contact', 'PageController@postContact');
Route::get('topic/{slug}', 'TopicController@getTopic');
Route::controller('topic', 'TopicController');
Route::controller('page', 'PageController');
Route::get('login', 'UserController@getLogin');
Route::get('jobs', function () {
    $jobs = App\Job::getJobs();
    return view('pages.jobs-live', ['jobs' => $jobs, 'template' => 'wide']);
});
// Route::get('login', function(){
//     return view('users.login');
// });
Route::group(['prefix' => 'api'], function () {
    Route::get('resource/search/{q}', function ($q, $page = null) {
        // $q = Input::get('query');
        $search = App\Resource::search($q, ['name' => 10, 'representation' => 7, 'description' => 6, 'content' => 5])->paginate(10);
        return $search;
        $r = \Response::json($search);
        return $r;
    });
    Route::get('test', function () {
        return 'testing';
Пример #8
0
                <div>
                    <?php 
$users = App\User::where('id', $job->freelancer_info_id)->get()->first();
$picture = $users['id'] . '.jpg';
?>
                    @if (file_exists(public_path('/upload/'.$picture)))
                    <img src="{{url('/upload/'.$picture)}}" class="img-circle" style="height: 200px; width: 200px;">
                    @else
                    <img src="{{url('/assets/pictures/profile-default-icon.png')}}" class="img-circle" style="height: 200px; width: 200px;">
                    @endif
                </div>
                <br>
                <div>
                    <?php 
$user = App\User::where('id', $job->freelancer_info_id)->get()->first();
$joblist = App\Job::where('freelancer_info_id', $user['id'])->get()->first();
$accJob = App\AcceptedJob::where('job_id', $joblist['id'])->get()->first();
if ($accJob['rating'] > 0) {
    for ($i = 0; $i < $accJob['rating']; $i++) {
        echo '<i class="fa fa-star-o fa-2x" style="color: orange;"></i>';
    }
} else {
    echo 'Not rated yet';
}
?>
                </div>
                <br>
                <div>
                    <a href="{{url('/job/'.$job->id)}}" class="btn btn-default" style="background-color: #F26151; color: white; height: 35px;">
                        <div class="col-md-1">
                            <i class="fa fa-check" aria-hidden="true"></i> <strong>Hire</strong>
Пример #9
0
					<?php 
$job = App\Job::where('id', $a_accepted_job->job_id)->get()->first();
$freelancer = App\User::where('id', $job['freelancer_info_id'])->get()->first();
echo $freelancer['name'];
?>
				</td>
				<td>
					<?php 
$seeker = App\User::where('id', $a_accepted_job->seeker_id)->get()->first();
echo $seeker['name'];
?>
				</td>
				<td>{{ $a_accepted_job->job_id }}</td>
				<td>
					<?php 
$jobName = App\Job::where('id', $a_accepted_job->job_id)->get()->first();
echo $jobName['judul'];
?>
				</td>
				<td> 
					<?php 
$time = $a_accepted_job->waktu_mulai;
$arrayTime = explode(' ', $time, 2);
echo $arrayTime[0];
?>
 
				</td> 
				<td> 
					<?php 
echo $arrayTime[1];
?>
Пример #10
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     App\Job::create(['title' => str_random(10), 'description' => str_random(1000), 'local' => 'São Paulo / SP', 'title' => str_random(10), 'remote' => 'no', 'type' => 3, 'company_id' => 1]);
 }
Пример #11
0
function getJobId($id)
{
    $job = App\Job::where('id', $id)->get()->first();
    //ambil baris pertama dari tabel Job
    return $job['id'];
}