public function getAllitems(Request $req)
 {
     if ($req->ajax()) {
         $res = [];
         $items = data_recruitment::where('posisi', 'like', $req->src . "%")->paginate(10);
         $out = '';
         if ($items->total() > 0) {
             $no = $items->currentPage() == 1 ? 1 : $items->perPage() * $items->currentPage() - $items->perPage() + 1;
             foreach ($items as $item) {
                 if ($item->status == 1) {
                     $status = "Aktif";
                 } else {
                     $status = "Tidak Aktif";
                 }
                 $out .= '
         <tr class="item_' . $item->id . ' items">
           <td>' . $no . '</td>
           <td>
           <a href="javascript:;" title="' . $item->posisi . '" data-toggle="tooltip" data-placement="bottom">' . $item->posisi . '</a>
             <div style="display:none;" class="tbl-opsi">
               <small>[
                 <a href="' . url('recruitment/detail/' . $item->id) . '">Lihat</a>
                 | <a href="' . url('recruitment/update/' . $item->id) . '">Edit</a>
                 
               ]</small>
             </div>
           </td>
           <td>
           <div>' . \Format::indoDate($item->date_open) . ' s/d ' . \Format::indoDate($item->date_close) . '</div>
                 <small class="text-muted">' . \Format::hari($item->date_open) . ', ' . \Format::jam($item->date_open) . '</small>
           </td>
           <td>' . $item->estimasi_gaji . '</td>           
          
           <td>' . $status . '</td>
         </tr>
       ';
                 $no++;
             }
         } else {
             $out = '
       <tr>
         <td colspan="4">Tidak ditemukan</td>
       </tr>
     ';
         }
         $res['data'] = $out;
         $res['pagin'] = $items->render();
         return json_encode($res);
     }
 }
    public function getLowongan(Request $req)
    {
        $result = [];
        if ($req->ajax()) {
            $result['result'] = true;
            $data = data_recruitment::find($req->id);
            $html = '
		<div class="grid simple">
			<div class="grid-title no-border"></div>
			<div class="grid-body no-border">
				<div class="row">
					<div class="col-sm-10">
						<strong>Posisi</strong>
						<p>' . $data->posisi . '</p>
						<strong>Tanggal Mulai</strong>
						<p>' . $data->date_open . '</p>
						<strong>Tanggal Selesai</strong>
						<p>' . $data->date_close . '</p>
						<strong>Syarat</strong>
						<p>' . $data->syarat . '</p>
						<strong>Estimasi Gaji</strong>
						<p>' . $data->estimasi_gaji . '</p>
						<strong>Job Desc</strong>
						<p>' . $data->jobdesk . '</p>
						<strong>Catatan</strong>
						<p>' . $data->catatan . '</p>
					</div>
				</div>
			</div>
		</div>
		';
            $result['posisi'] = $data->posisi;
            $result['content'] = $html;
            $result['link'] = '<a href="' . url('employment/create?id=' . base64_encode($data->id)) . '" class="btn btn-primary">Apply Job</a>';
        } else {
            $result['result'] = false;
            $result['error'] = 'resteric';
        }
        return json_encode($result);
    }
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     data_recruitment::find($this->req['id'])->update(['posisi' => $this->req['posisi'], 'date_open' => date('Y-m-d', strtotime($this->req['date_open'])), 'date_close' => date('Y-m-d', strtotime($this->req['date_close'])), 'syarat' => $this->req['syarat'], 'jobdesk' => $this->req['job_desk'], 'estimasi_gaji' => $this->req['estimasi_gaji'], 'catatan' => $this->req['catatan'], 'status' => 1]);
     return $this->req;
 }