mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-05 02:34:38 +02:00
REMOVE CSRF (annoying when refresh page) when open edit customer page, add upload photo when edit Customer
This commit is contained in:
parent
db8affce1f
commit
51811bd753
4 changed files with 102 additions and 13 deletions
|
@ -1,6 +1,6 @@
|
|||
{include file="sections/header.tpl"}
|
||||
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/edit-post">
|
||||
<form class="form-horizontal" enctype="multipart/form-data" method="post" role="form" action="{$_url}customers/edit-post">
|
||||
<input type="hidden" name="csrf_token" value="{$csrf_token}">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
@ -8,7 +8,21 @@
|
|||
class="panel panel-{if $d['status']=='Active'}primary{else}danger{/if} panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Edit Contact')}</div>
|
||||
<div class="panel-body">
|
||||
<center>
|
||||
<img src="{$UPLOAD_PATH}{$d['photo']}.thumb.jpg" width="200"
|
||||
onerror="this.src='{$UPLOAD_PATH}/user.default.jpg'" class="img-circle img-responsive"
|
||||
alt="Foto" onclick="return deletePhoto({$d['id']})">
|
||||
</center><br>
|
||||
<input type="hidden" name="id" value="{$d['id']}">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 col-xs-12 control-label">{Lang::T('Photo')}</label>
|
||||
<div class="col-md-6 col-xs-8">
|
||||
<input type="file" class="form-control" name="photo">
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-4">
|
||||
<label class=""><input type="checkbox" checked name="faceDetect" value="yes"> Facedetect</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">{Lang::T('Username')}</label>
|
||||
<div class="col-md-9">
|
||||
|
@ -121,7 +135,8 @@
|
|||
<div class="panel-heading">PPPOE</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">{Lang::T('Username')} <span class="label label-danger" id="warning_username"></span></label>
|
||||
<label class="col-md-3 control-label">{Lang::T('Username')} <span class="label label-danger"
|
||||
id="warning_username"></span></label>
|
||||
<div class="col-md-9">
|
||||
<input type="username" class="form-control" id="pppoe_username" name="pppoe_username"
|
||||
onkeyup="checkUsername(this, {$d['id']})" value="{$d['pppoe_username']}">
|
||||
|
@ -137,7 +152,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">Remote IP <span class="label label-danger" id="warning_ip"></span></label>
|
||||
<label class="col-md-3 control-label">Remote IP <span class="label label-danger"
|
||||
id="warning_ip"></span></label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" id="pppoe_ip" name="pppoe_ip"
|
||||
onkeyup="checkIP(this, {$d['id']})" value="{$d['pppoe_ip']}">
|
||||
|
@ -227,7 +243,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<center>
|
||||
<button class="btn btn-primary" onclick="return confirm('Continue the Customer Data change process?')" type="submit">
|
||||
<button class="btn btn-primary" onclick="return confirm('Continue the Customer Data change process?')"
|
||||
type="submit">
|
||||
{Lang::T('Save Changes')}
|
||||
</button>
|
||||
<br><a href="{$_url}customers/list" class="btn btn-link">{Lang::T('Cancel')}</a>
|
||||
|
@ -311,4 +328,14 @@
|
|||
</script>
|
||||
{/literal}
|
||||
|
||||
{include file="sections/footer.tpl"}
|
||||
<script>
|
||||
function deletePhoto(id) {
|
||||
if (confirm('Delete photo?')) {
|
||||
if (confirm('Are you sure to delete photo?')) {
|
||||
window.location.href = '{$_url}customers/edit/'+id+'/deletePhoto'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{include file="sections/footer.tpl"}
|
|
@ -5,7 +5,8 @@
|
|||
<div class="box box-{if $d['status']=='Active'}primary{else}danger{/if}">
|
||||
<div class="box-body box-profile">
|
||||
<img class="profile-user-img img-responsive img-circle"
|
||||
src="https://robohash.org/{$d['id']}?set=set3&size=100x100&bgset=bg1"
|
||||
onclick="window.location.href = '{$UPLOAD_PATH}{$d['photo']}'"
|
||||
src="{$UPLOAD_PATH}{$d['photo']}.thumb.jpg"
|
||||
onerror="this.src='{$UPLOAD_PATH}/user.default.jpg'" alt="avatar">
|
||||
<h3 class="profile-username text-center">{$d['fullname']}</h3>
|
||||
<ul class="list-group list-group-unbordered">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue