| Server IP : 188.114.96.2 / Your IP : 104.23.197.231 Web Server : Apache/2.4.59 (Debian) System : Linux EDL-STRETCH 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64 User : edlftp ( 1002) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/nicolasj/www/sms.formationlangues.be/application/views/admin/ |
Upload File : |
<?php echo form_open(base_url() . 'profile/save' , array('id'=>'profileForm','class' => 'form-horizontal form-groups-bordered validate', 'onsubmit'=>'profiles.save();return false;'));?>
<input type="hidden" name="user_id" value="0"/>
<div class="form-group">
<label class="col-sm-3 control-label"><?php echo get_phrase('email');?> <span class="text-danger">*</span></label>
<div class="col-sm-5">
<input type="text" class="form-control" name="email" value="" data-validate="required">
</div>
</div>
<div class="form-group">
<label for="field-2" class="col-sm-3 control-label"><?php echo get_phrase('password');?></label>
<div class="col-sm-5">
<input type="password" class="form-control" name="password" value="">
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('first_name');?> <span class="text-danger">*</span></label>
<div class="col-sm-5">
<input type="text" class="form-control" name="first_name" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>" value="" autofocus>
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('last_name');?> <span class="text-danger">*</span></label>
<div class="col-sm-5">
<input type="text" class="form-control" name="last_name" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>" value="" autofocus>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"><?php echo get_phrase('photo'); ?></label>
<div class="col-sm-5">
<div class="photo">
<img src="" style="height:100px;width:100px;"/>
<input type="file" class="hidden" id="<?php $photoFile=uniqid('f'); echo $photoFile; ?>" onchange="profiles.uploadPhoto();" name="photo_file" data-hash=""/>
<input type="hidden" name="photo_file_hash" value=""/>
<div><a class="btn btn-default" onclick="document.querySelector('#<?php echo $photoFile; ?>').click();"><?php echo get_phrase('update'); ?></a></div>
</div>
</div>
</div>
<div class="form-group">
<label for="field-2" class="col-sm-3 control-label"><?php echo get_phrase('phone');?> <span class="text-danger">*</span></label>
<div class="col-sm-5">
<input type="text" class="form-control" name="phone" value="" >
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-5">
<a class="btn btn-info" onclick="profiles.save();"><?php echo get_phrase('save_profile');?></a>
</div>
</div>
</form>
<script type="text/javascript">
if (typeof(profiles)=='undefined'){
var profiles={'config':{}};
}
Object.assign(profiles,{
'reset':function (){
var _this=this, timestamp=(new Date()).getTime();
if (typeof(_this.config.tabsList)!='undefined'){
$('#'+_this.config.tabsList+' li.edit .edit').addClass('hidden');
$('#'+_this.config.tabsList+' li.edit .add').removeClass('hidden');
}
_NS.DOM.enable('#profileForm .disabled');
_this.updatePhoto();
_NS.resetFields('#profileForm');
document.querySelector('#profileForm input[name="photo_file"]').dataset['hash']='photo_file_hash_'+timestamp;
document.querySelector('#profileForm input[name="photo_file_hash"]').value=timestamp;
}
,'updatePhoto':function(data){
var base=document.querySelector('base').href;
document.querySelector('#profileForm .photo img').src=((data!=null)?(base+'uploads/'+data.folder+'/'+data.name):'assets/images/admin.png');
}
,'uploadPhoto':function(){
_NS.upload(document.querySelector('#<?php echo $photoFile; ?>'),profiles.updatePhoto);
}
,'edit': function (ID){
var _this=this;
_NS.runRequest('POST','<?php echo NS_BASE_URL; ?>profile/edit','user_id='+ID,{
'success':function(reply){
var dateParts=[],newDate={};
_NS.fillFields('#profileForm',reply.data);
_this.updatePhoto(reply.data.photo);
_NS.DOM.disable('#profileForm input[name="email"]');
_NS.DOM.disable('#profileForm input[name="datepicker_dob"]');
<?php if ($this->userInfo['role']!='admin'){ ?>
_NS.DOM.disable('#profileForm select[name="is_paid"]');
<?php } ?>
if (typeof(_this.config.tabsList)!='undefined'){
$('#'+_this.config.tabsList+' li.edit .add').addClass('hidden');
$('#'+_this.config.tabsList+' li.edit .edit').removeClass('hidden');
document.querySelectorAll('#'+_this.config.tabsList+' a')[1].click();
}
}
},1);
}
, 'save': function () {
var _this=this,params=_NS.getFormData('#profileForm');
_NS.post('<?php echo base_url(); ?>profile/save',params,{
'success':function(reply){
window.location.reload();
//document.querySelectorAll('ul.nav-tabs a')[0].click();
}
},1);
}
});
<?php
switch($this->userInfo['role']){
case 'admin':
echo 'profiles.edit('.$this->userInfo['user_id'].');';
break;
}
?>
</script>