Commit f3b1285e by Juliper

profile completee

parent 3e7254b7
...@@ -78,8 +78,33 @@ class CustomerController extends Controller ...@@ -78,8 +78,33 @@ class CustomerController extends Controller
public function updateProfile(Request $request,$id){ public function updateProfile(Request $request,$id){
$cus = Customer::find($id); $cus = Customer::find($id);
$dataUs = User::find(Auth::user()->id);
dd("masuk agan",$id); if($request['nama']==""){
$cus->nama = $cus->nama;
$dataUs->name = $dataUs->name;
}else{
$cus->nama = $request['nama'];
$dataUs->name=$request['nama'];
}
$cus->alamat = $request['alamat'];
$cus->pekerjaan = $request['pekerjaan'];
$cus->noTelepon = $request['noTelepon'];
if($request->file('foto')==null){
$dataUs->foto = $dataUs->foto;
}else{
$file = $request->file('foto');
$fileName = $file->getClientOriginalName();
$request->file('foto')->move("img/",$fileName);
$dataUs->foto = $fileName;
}
$cus->update();
$dataUs->update();
//dd("masuk agan",$id,$cus,Auth::user()->id);
return redirect('customerProfile');
} }
} }
...@@ -10,36 +10,32 @@ ...@@ -10,36 +10,32 @@
<div class="form-group"> <div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Nama</label> <label for="inputEmail3" class="col-sm-2 control-label">Nama</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control" id="inputEmail3" value="{{$data->nama}}"> <input type="text" name="nama" class="form-control" id="inputEmail3" value="{{$data->nama}}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Alamat</label> <label for="inputPassword3" class="col-sm-2 control-label">Alamat</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control" id="inputPassword3" value="{{$data->alamat}}"> <input type="text" name="alamat" class="form-control" id="inputPassword3" value="{{$data->alamat}}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">No.Telepon</label> <label for="inputPassword3" class="col-sm-2 control-label">No.Telepon</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control" id="inputPassword3" value="{{$data->noTelepon}}"> <input type="text" name="noTelepon" class="form-control" id="inputPassword3" value="{{$data->noTelepon}}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Pekerjaan</label> <label for="inputPassword3" class="col-sm-2 control-label">Pekerjaan</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control" id="inputPassword3" value="{{$data->pekerjaan}}"> <input type="text" name="pekerjaan" class="form-control" id="inputPassword3" value="{{$data->pekerjaan}}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label"> Foto </label> <label class="col-sm-2 control-label"> Foto </label>
<div class="col-sm-10"> <div class="col-sm-10">
<<<<<<< HEAD
<input type="file" class="btn btn-success" value="Browse">
=======
<input type="file" value="Browse" name="foto" id="picture" > <input type="file" value="Browse" name="foto" id="picture" >
>>>>>>> 11593880b2ce26f2e4aa805f4991f03545402bfa
</div>
</div> </div>
<div class="form-group" align="right"> <div class="form-group" align="right">
<div class="col-sm-12"> <div class="col-sm-12">
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<li class="user-header"> <li class="user-header">
{{--<img src="{{ Gravatar::get($user->email) }}" class="img-circle" alt="User Image" />--}} {{--<img src="{{ Gravatar::get($user->email) }}" class="img-circle" alt="User Image" />--}}
<p> <p>
<img src="img/{{ Auth::user()->foto }}" class="img-circle" alt="User Image" />
{{ Auth::user()->name }} {{ Auth::user()->name }}
<small>{{ trans('adminlte_lang::message.login') }} </small> <small>{{ trans('adminlte_lang::message.login') }} </small>
</p> </p>
......
...@@ -1112,7 +1112,7 @@ img { ...@@ -1112,7 +1112,7 @@ img {
height: auto; height: auto;
} }
.img-circle { .img-circle {
border-radius: 50%; border-radius: 30%;
} }
hr { hr {
margin-top: 20px; margin-top: 20px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment