Commit f3f2287d by Palti Sinaga
parents 6d9bdef2 f3b1285e
......@@ -78,8 +78,33 @@ class CustomerController extends Controller
public function updateProfile(Request $request,$id){
$cus = Customer::find($id);
dd("masuk agan",$id);
$dataUs = User::find(Auth::user()->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 @@
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Nama</label>
<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 class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Alamat</label>
<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 class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">No.Telepon</label>
<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 class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Pekerjaan</label>
<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 class="form-group">
<label class="col-sm-2 control-label"> Foto </label>
<div class="col-sm-10">
<<<<<<< HEAD
<input type="file" class="btn btn-success" value="Browse">
=======
<input type="file" value="Browse" name="foto" id="picture" >
>>>>>>> 11593880b2ce26f2e4aa805f4991f03545402bfa
</div>
</div>
<div class="form-group" align="right">
<div class="col-sm-12">
......
......@@ -36,6 +36,7 @@
<li class="user-header">
{{--<img src="{{ Gravatar::get($user->email) }}" class="img-circle" alt="User Image" />--}}
<p>
<img src="img/{{ Auth::user()->foto }}" class="img-circle" alt="User Image" />
{{ Auth::user()->name }}
<small>{{ trans('adminlte_lang::message.login') }} </small>
</p>
......
......@@ -1112,7 +1112,7 @@ img {
height: auto;
}
.img-circle {
border-radius: 50%;
border-radius: 30%;
}
hr {
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