Browse Source

default phase_id value

pull/3/head
Muhammad Sulaiman Yusuf 2 years ago committed by Gitea
parent
commit
e1a91a2d3c
  1. 13
      app/Http/Controllers/ProjectController.php

13
app/Http/Controllers/ProjectController.php

@ -47,6 +47,9 @@ class ProjectController extends Controller
$data['created_by'] = $this->currentName;
if(empty($data['phase_id']))
$data['phase_id'] = 1;
$result = Project::create($data);
if(!$result)
@ -260,8 +263,9 @@ class ProjectController extends Controller
->first();
if($d->area_kerja != ''){
$d->geolocation = $this->httpReq($d->area_kerja);
$d->geolocation = [];
} else {
$d->geolocation = '';
$d->geolocation = [];
}
}
@ -376,10 +380,12 @@ class ProjectController extends Controller
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, str_replace("ADDR", $search, API_GEOLOCATION));
// SSL important
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_STDERR, fopen('php://stderr', 'w'));
$info = curl_getinfo($ch);
$output = curl_exec($ch);
curl_close($ch);
@ -388,3 +394,4 @@ class ProjectController extends Controller
}
}

Loading…
Cancel
Save