2 changed files with 215 additions and 27 deletions
@ -1,29 +1,43 @@ |
|||||
tinymce.init({ |
|
||||
selector: '.mce', |
|
||||
height: 200, |
|
||||
theme: 'modern', |
|
||||
menubar: false, |
|
||||
language: 'it', |
|
||||
forced_root_block : '', |
|
||||
force_br_newlines : true, |
|
||||
plugins: [ |
|
||||
'advlist autolink lists link image charmap print preview anchor textcolor', |
|
||||
'searchreplace visualblocks code fullscreen', |
|
||||
'insertdatetime media table contextmenu paste code' |
|
||||
], |
|
||||
toolbar: 'bold italic | alignleft aligncenter alignright alignjustify | link bullist numlist outdent indent | removeformat', |
|
||||
image_advtab: false, |
|
||||
content_css: [ |
|
||||
'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i', |
|
||||
'//www.tinymce.com/css/codepen.min.css' |
|
||||
] |
|
||||
}); |
|
||||
|
|
||||
$( ".datepicker" ).datepicker({ |
|
||||
changeMonth: true, |
|
||||
changeYear: true, |
|
||||
dateFormat: 'dd/mm/yy', |
|
||||
yearRange: new Date().getFullYear()-90 + ':' + new Date().getFullYear(), |
|
||||
maxDate: "+1M", |
|
||||
regional:['it'] |
|
||||
|
$(document).ready( function(){ |
||||
|
|
||||
|
tinymce.init({ |
||||
|
selector: '.mce', |
||||
|
height: 200, |
||||
|
theme: 'modern', |
||||
|
menubar: false, |
||||
|
language: 'it', |
||||
|
forced_root_block : '', |
||||
|
force_br_newlines : true, |
||||
|
plugins: [ |
||||
|
'advlist autolink lists link image charmap print preview anchor textcolor', |
||||
|
'searchreplace visualblocks code fullscreen', |
||||
|
'insertdatetime media table contextmenu paste code' |
||||
|
], |
||||
|
toolbar: 'bold italic | alignleft aligncenter alignright alignjustify | link bullist numlist outdent indent | removeformat', |
||||
|
image_advtab: false, |
||||
|
content_css: [ |
||||
|
'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i', |
||||
|
'//www.tinymce.com/css/codepen.min.css' |
||||
|
] |
||||
|
}); |
||||
|
|
||||
|
$( ".datepicker" ).datepicker({ |
||||
|
changeMonth: true, |
||||
|
changeYear: true, |
||||
|
dateFormat: 'dd/mm/yy', |
||||
|
yearRange: new Date().getFullYear()-90 + ':' + new Date().getFullYear(), |
||||
|
maxDate: "+1M", |
||||
|
regional:['it'] |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
$('.form-mod').on('submit', function(e){ |
||||
|
e.preventDefault(); |
||||
|
var id = $(this).find('.id').val(); |
||||
|
var path = $(this).data('path') + "/" + id.trim(); |
||||
|
window.location = path; |
||||
|
}); |
||||
|
|
||||
|
|
||||
}); |
}); |
||||
|
@ -0,0 +1,174 @@ |
|||||
|
<div class="row"> |
||||
|
<div class="col-12"> |
||||
|
<div class="section-title">Modifica utente</div> |
||||
|
</div> |
||||
|
<div class="col-12"> |
||||
|
|
||||
|
<div class="sheet-box p-4"> |
||||
|
|
||||
|
<?php |
||||
|
if($_POST['go']){ |
||||
|
|
||||
|
$q=mysqli_query($conn, "UPDATE board SET id=".trim($_POST['id']).", |
||||
|
email='".addslashes(trim($_POST['email']))."', last_name='".addslashes(trim($_POST['last_name']))."', |
||||
|
first_name='".addslashes(trim($_POST['first_name']))."', birth_date='".addslashes(trim($_POST['birth_date']))."', |
||||
|
birth_place='".addslashes(trim($_POST['birth_place']))."', register_date='".addslashes(trim($_POST['register_date']))."', |
||||
|
address='".addslashes(trim($_POST['address']))."', zip_code='".addslashes(trim($_POST['zip_code']))."', |
||||
|
city='".addslashes(trim($_POST['city']))."', province='".addslashes(trim($_POST['province']))."', |
||||
|
degree_place='".addslashes(trim($_POST['degree_place']))."', degree_date='".addslashes(trim($_POST['degree_date']))."', |
||||
|
degree='".addslashes(trim($_POST['degree']))."', qualification_date='".addslashes(trim($_POST['qualification_date']))."', |
||||
|
qualification_place='".addslashes(trim($_POST['qualification_place']))."', enabled=".$_POST['enabled'].", |
||||
|
specializations='".addslashes(nl2br($_POST['specializations']))."' |
||||
|
WHERE id=".trim($getQ[3]).""); |
||||
|
|
||||
|
echo '<div class="col-10 text-center mx-auto my-5"> |
||||
|
<p><i class="fa fa-check-circle font-alert p-4"></i></p> |
||||
|
Utente modificato correttamente! |
||||
|
</div>'; |
||||
|
|
||||
|
}else{ |
||||
|
|
||||
|
if($getQ[3]){ |
||||
|
|
||||
|
$q=mysqli_query($conn, "SELECT * FROM board WHERE id = ".trim($getQ[3])); |
||||
|
$r=mysqli_fetch_array($q); |
||||
|
?> |
||||
|
<form method="post"> |
||||
|
<div class="row"> |
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">N° Iscrizione all'Albo</span> |
||||
|
<input type="text" name="id" value="<?= $r['id'];?>"> |
||||
|
</div> |
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Data di iscrizione all'Albo</span> |
||||
|
<input type="text" name="register_date" class="datepicker" value="<?= $r['register_date'];?>"> |
||||
|
</div> |
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Username <span class="font-10">(modificabile solo dall'utente)</span></span> |
||||
|
<input type="text" name="usr" value="<?= $r['usr'];?>" readonly disabled> |
||||
|
</div> |
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Password <span class="font-10">(modificabile solo dall'utente)</span></span> |
||||
|
<input type="text" value="" placeholder="[password nascosta]" readonly disabled> |
||||
|
</div> |
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Email</span> |
||||
|
<input type="text" name="email" value="<?= $r['email'];?>"> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-12"><hr></div> |
||||
|
|
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Cognome</span> |
||||
|
<input type="text" name="last_name" value="<?= $r['last_name'];?>"> |
||||
|
</div> |
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Nome</span> |
||||
|
<input type="text" name="first_name" value="<?= $r['first_name'];?>"> |
||||
|
</div> |
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Data di nascita</span> |
||||
|
<input type="text" name="birth_date" class="datepicker" value="<?= $r['birth_date'];?>"> |
||||
|
</div> |
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Luogo di nascita</span> |
||||
|
<input type="text" name="birth_place" value="<?= $r['birth_place'];?>"> |
||||
|
</div> |
||||
|
<div class="col-9 col-sm-9"> |
||||
|
<span class="font-12">Indirizzo</span> |
||||
|
<input type="text" name="address" value="<?= $r['address'];?>"> |
||||
|
</div> |
||||
|
<div class="col-3 col-sm-3"> |
||||
|
<span class="font-12">C.A.P.</span> |
||||
|
<input type="text" name="zip_code" value="<?= $r['zip_code'];?>"> |
||||
|
</div> |
||||
|
<div class="col-8 col-sm-8"> |
||||
|
<span class="font-12">Comune</span> |
||||
|
<input type="text" name="city" value="<?= $r['city'];?>"> |
||||
|
</div> |
||||
|
<div class="col-4 col-sm-4"> |
||||
|
<span class="font-12">Provincia</span> |
||||
|
<input type="text" name="province" value="<?= $r['province'];?>"> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-12"><hr></div> |
||||
|
|
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Laureato/a a</span> |
||||
|
<input type="text" name="degree_place" value="<?= $r['degree_place'];?>"> |
||||
|
</div> |
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Laureato/a il</span> |
||||
|
<input type="text" name="degree_date" class="datepicker" value="<?= $r['degree_date'];?>"> |
||||
|
</div> |
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Laureato/a in</span> |
||||
|
<input type="text" name="degree" value="<?= $r['degree'];?>"> |
||||
|
</div> |
||||
|
<div class="col-12 col-sm-6"> |
||||
|
<span class="font-12">Abilitato/a nel</span> |
||||
|
<select name="qualification_date"> |
||||
|
<?php for($i=date('Y');$i>=date('Y')-70;$i--){ |
||||
|
echo "<option value=\"$i\" "; |
||||
|
if($r['qualification_date']==$i){echo "selected";} |
||||
|
echo ">$i</option>";} |
||||
|
?> |
||||
|
</select> |
||||
|
</div> |
||||
|
<div class="col-9 col-sm-9"> |
||||
|
<span class="font-12">Abilitato/a presso</span> |
||||
|
<input type="text" name="qualification_place" value="<?= $r['qualification_place'];?>"> |
||||
|
</div> |
||||
|
<div class="col-3 col-sm-3"> |
||||
|
<span class="font-12">Attivazione account</span> |
||||
|
<select name="enabled"> |
||||
|
<option value="1" <?php if($r['enabled']==1){echo "selected";}?>>Account attivo</option> |
||||
|
<option value="0" <?php if($r['enabled']==0){echo "selected";}?>>Account NON attivo</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-12"> |
||||
|
<span class="font-12">Specializzazioni</span> |
||||
|
<textarea cols="40" rows="6" name="specializations"><?= strip_tags($r['specializations']);?></textarea> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-12 text-right"> |
||||
|
<button type="submit" name="go" value="1">Modifica utente</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
|
||||
|
<?php |
||||
|
}else{ |
||||
|
|
||||
|
?> |
||||
|
<form method="post" class="form-mod" data-path="<?= $BASE_URL;?>/sheets/user/mod"> |
||||
|
<div class="col-12 col-sm-6 mx-auto"> |
||||
|
<div class="row"> |
||||
|
<div class="col"> |
||||
|
<span class="font-12">N° Iscrizione all'Albo</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="col"> |
||||
|
<input type="text" class="id" name="id"> |
||||
|
</div> |
||||
|
<div class="col-auto"> |
||||
|
<button type="submit">Modifica</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
|
||||
|
<?php |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
?> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
Loading…
Reference in new issue