|
@@ -16,10 +16,61 @@ class UserController extends Controller
|
|
|
}
|
|
|
|
|
|
public function show(User $id){
|
|
|
- return $id->locations;
|
|
|
+ return $id->locations;
|
|
|
}
|
|
|
|
|
|
public function showLast(User $id){
|
|
|
return $id->lastCoordinates;
|
|
|
}
|
|
|
+
|
|
|
+ /*public function vse(){
|
|
|
+ $userse = [];
|
|
|
+ foreach (User::all() as $user){
|
|
|
+ $userse[] = $user;
|
|
|
+ }
|
|
|
+ return $userse;
|
|
|
+ }
|
|
|
+*/
|
|
|
+ public function action() {
|
|
|
+ $users=User::all();
|
|
|
+
|
|
|
+ return view('allpositions',compact('users'));
|
|
|
+ }
|
|
|
+
|
|
|
+ public function date() {
|
|
|
+ //[$id, date];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public function userdata(Request $request) {
|
|
|
+
|
|
|
+ //$dates = DB::table('locations')->find($id);
|
|
|
+ //return view('userdate',compact('dates'));
|
|
|
+ $mysqli = mysqli_connect("geolook", "root", "2701198927", "geolook"); //Здесь свои данные пишем
|
|
|
+ $dates = [];
|
|
|
+ $id= "$request->id";
|
|
|
+ $data= "$request->date%";
|
|
|
+ $zapros = "SELECT * from locations where user_id = '$id' and created_at like '$data'";
|
|
|
+$res = mysqli_query($mysqli, $zapros);
|
|
|
+while($row = mysqli_fetch_object($res)) {
|
|
|
+
|
|
|
+ // $dates[]= $request->date;
|
|
|
+ $dates[] = $row->created_at;
|
|
|
+ $dates[] = $row->lat;
|
|
|
+ $dates[] = $row->lng;
|
|
|
+ $dates[] = $row->id;
|
|
|
+
|
|
|
+ //$dates[] = $request->id;
|
|
|
+ // $dates[] = $_POST["{date}"];
|
|
|
+ //$url='http://geolook/public/user/';
|
|
|
+
|
|
|
+//$dates[] = 'select * from locations where user_id='.$id.' and created_at like '.$date.'%';
|
|
|
+//$dates[] = mysqli_free_result($row);
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+return view('userdate',compact('dates'));
|
|
|
+ }
|
|
|
}
|