Browse Source

add delete and list find

develop
Carmine De Rosa 7 years ago
parent
commit
a6fc1bfcad
  1. 10
      ADMIN/menu.php
  2. BIN
      ADMIN/scss/.sass-cache/5f6f3d8bbc78e509b8bcbf2e29b4b5dd60c52f16/admin.scssc
  3. 24
      ADMIN/scss/admin.scss
  4. 153
      ADMIN/sheets/user/del.php
  5. 105
      ADMIN/sheets/user/list.php
  6. 1
      albo.php
  7. 23
      css/admin.css
  8. 74
      css/styles.css
  9. BIN
      scss/.sass-cache/bdcb2ec4843708bc0e130897363854e74056ec3e/fonts.scssc
  10. BIN
      scss/.sass-cache/bdcb2ec4843708bc0e130897363854e74056ec3e/forms.scssc
  11. BIN
      scss/.sass-cache/bdcb2ec4843708bc0e130897363854e74056ec3e/global.scssc
  12. 3
      scss/fonts.scss
  13. 8
      scss/forms.scss
  14. 42
      scss/global.scss

10
ADMIN/menu.php

@ -2,12 +2,12 @@
<div id="menuLeft" class="col-12 col-md-2 p-2">
<div class="dropdown <?= $getQ[1]=="user" ? "active":"" ?>">
<div class="title">Gestione utenti</div>
<div class="title">Gestione iscritti</div>
<ul class="items">
<li><a href="<?= $BASE_URL ?>/sheets/user/add">Aggiungi utente </a></li>
<li><a href="<?= $BASE_URL ?>/sheets/user/mod">Modifica utente </a></li>
<li><a href="<?= $BASE_URL ?>/sheets/user/del">Elimina utente </a></li>
<li><a href="<?= $BASE_URL ?>/sheets/user/list">Elenco utenti </a></li>
<li><a href="<?= $BASE_URL ?>/sheets/user/list">Elenco iscritti </a></li>
<li><a href="<?= $BASE_URL ?>/sheets/user/add">Aggiungi iscritto </a></li>
<li><a href="<?= $BASE_URL ?>/sheets/user/mod">Modifica iscritto </a></li>
<li><a href="<?= $BASE_URL ?>/sheets/user/del">Elimina iscritto </a></li>
</ul>
</div>

BIN
ADMIN/scss/.sass-cache/5f6f3d8bbc78e509b8bcbf2e29b4b5dd60c52f16/admin.scssc

Binary file not shown.

24
ADMIN/scss/admin.scss

@ -11,8 +11,32 @@
.sheet-box{
border: 1px solid $green;
background: white;
min-height: calc(100vh - 170px);
}
.admin-list-item{
width: 100%;
padding: 5px;
position: relative;
transition: .4s;
&:hover{
/* opacity: .7; */
}
.right{
position: absolute;
right: 5px;
top: 0;
}
}
@media only screen and ( min-width: 768px ) {
#MainContent{

153
ADMIN/sheets/user/del.php

@ -0,0 +1,153 @@
<div class="row">
<div class="col-12">
<div class="section-title">Elimina utente</div>
</div>
<div class="col-12">
<div class="sheet-box p-4">
<?php
if($_POST['go']){
$q=mysqli_query($conn, "DELETE FROM board 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 eliminato correttamente!
</div>';
}else{
if($getQ[3]){
$q=mysqli_query($conn, "SELECT * FROM board WHERE id = ".trim($getQ[3]));
if(mysqli_num_rows($q)==0){
echo '<div class="col-10 text-center mx-auto my-5">
<p><i class="fa fa-exclamation-triangle font-alert p-4"></i></p>
<p>ATENZIONE: Utente non trovato!</p>
<p><a href="'.$BASE_URL.'/sheets/user/del" class="button">Torna indietro</a></p>
</div>';
}else{
$r=mysqli_fetch_array($q);
?>
<form method="post">
<div class="row">
<div class="col-12 col-sm-6">
<span class="font-12 text-grey">N° Iscrizione all'Albo</span>
<p><?= $r['id'];?></p>
</div>
<div class="col-12 col-sm-6">
<span class="font-12 text-grey">Data di iscrizione all'Albo</span>
<p><?= $r['register_date'];?></p>
</div>
<div class="col-12 col-sm-6">
<span class="font-12 text-grey">Email</span>
<p><?= $r['email'];?></p>
</div>
<div class="col-12"><hr></div>
<div class="col-12 col-sm-6">
<span class="font-12 text-grey">Cognome</span>
<p><?= $r['last_name'];?></p>
</div>
<div class="col-12 col-sm-6">
<span class="font-12 text-grey">Nome</span>
<p><?= $r['first_name'];?></p>
</div>
<div class="col-12 col-sm-6">
<span class="font-12 text-grey">Data di nascita</span>
<p><?= $r['birth_date'];?></p>
</div>
<div class="col-12 col-sm-6">
<span class="font-12 text-grey">Luogo di nascita</span>
<p><?= $r['birth_place'];?></p>
</div>
<div class="col-9 col-sm-9">
<span class="font-12 text-grey">Indirizzo</span>
<p><?= $r['address'];?></p>
</div>
<div class="col-3 col-sm-3">
<span class="font-12 text-grey">C.A.P.</span>
<p><?= $r['zip_code'];?></p>
</div>
<div class="col-8 col-sm-8">
<span class="font-12 text-grey">Comune</span>
<p><?= $r['city'];?></p>
</div>
<div class="col-4 col-sm-4">
<span class="font-12 text-grey">Provincia</span>
<p><?= $r['province'];?></p>
</div>
<div class="col-12"><hr></div>
<div class="col-12 col-sm-6">
<span class="font-12 text-grey">Laureato/a a</span>
<p><?= $r['degree_place'];?></p>
</div>
<div class="col-12 col-sm-6">
<span class="font-12 text-grey">Laureato/a il</span>
<p><?= $r['degree_date'];?></p>
</div>
<div class="col-12 col-sm-6">
<span class="font-12 text-grey">Laureato/a in</span>
<p><?= $r['degree'];?></p>
</div>
<div class="col-12 col-sm-6">
<span class="font-12 text-grey">Abilitato/a nel</span>
<p><?= $r['qualification_date'];?></p>
</div>
<div class="col-9 col-sm-9">
<span class="font-12 text-grey">Abilitato/a presso</span>
<p><?= $r['qualification_place'];?></p>
</div>
<div class="col-12">
<span class="font-12 text-grey">Specializzazioni</span>
<p><?= strip_tags($r['specializations']);?></p>
</div>
<div class="col-12 text-right">
<button type="submit" name="go" value="1">Conferma eliminazione</button>
</div>
</div>
</form>
<?php
}
}else{
?>
<form method="post" class="form-mod" data-path="<?= $BASE_URL;?>/sheets/user/del">
<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">Elimina</button>
</div>
</div>
</div>
</form>
<?php
}
}
?>
</div>
</div>
</div>

105
ADMIN/sheets/user/list.php

@ -0,0 +1,105 @@
<?php
$initial = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$qTotal = mysqli_query($conn, "SELECT COUNT(id) FROM board");
$rTotal = mysqli_fetch_array($qTotal);
?>
<div class="row">
<div class="col-12">
<div class="section-title">Elenco utenti</div>
</div>
<div class="col-12">
<div class="sheet-box p-4">
<div class="col-12 col-sm-8 my-2 mx-auto pages">
<?php
for($i=0;$i<count($initial);$i++){
echo "<a class=\"font-12 ";
if($initial[$i]==$initialSelected){echo "selected";}
echo "\" href=\"$BASE_URL/sheets/user/list/init/".$initial[$i]."\">".strtoupper($initial[$i])."</a>";
}
?>
</div>
<div class="col-12 col-sm-8 col-md-6 my-4 mx-auto text-center">
<form method="post" action="<?php echo $BASE_URL;?>/sheets/user/list/find">
<div class="row font-14 font-bold">
<div class="col mx-auto mr-0">
<input type="text" name="q" class="input">
</div>
<div class="col-auto mx-auto ml-0">
<button type="submit"><i class="fa fa-search"></i> Cerca </button>
</div>
</div>
</form>
</div>
<div class="col-12 my-5 mx-auto ">
<?php
$query="";
if($getQ[3]=="init"){
$query="WHERE last_name LIKE '".$getQ[4]."%'";
$q = mysqli_query($conn, "SELECT * FROM board $query ORDER BY last_name");
}
if($getQ[3]=="find"){
$keys = explode(' ',addslashes($_POST['q']));
if(count($keys)>1){
$query="WHERE (";
foreach($keys as $k=>$value){
if($k>0){$query .= " OR";}
$query .= " first_name LIKE '%$value%' ";
}
$query .= " OR first_name LIKE '%".addslashes($_POST['q'])."%' OR last_name LIKE '%".addslashes($_POST['q'])."%') AND (";
foreach($keys as $k=>$value){
if($k>0){$query .= " OR";}
$query .= " last_name LIKE '%$value%' ";
}
$query .= ") ";
}else{
$query="WHERE first_name LIKE '%".$keys[0]."%' OR last_name LIKE '%".$keys[0]."%'";
}
$q = mysqli_query($conn, "SELECT * FROM board $query ORDER BY last_name");
}
$cnt=0;
while($r = mysqli_fetch_array($q)){
$cnt++;
$bg = ($cnt%2) ? "bg-light-grey" : "bg-white";
echo "<div class=\"admin-list-item $bg\">
<span>".$r['last_name']." ".$r['first_name']."</span>
<div class=\"right\">
<a href=\"$BASE_URL/sheets/user/mod/".$r['id']."\" class=\"button button-small\"><i class=\"fa fa-edit\"></i> Modifica</a>
<a href=\"$BASE_URL/sheets/user/del/".$r['id']."\" class=\"button button-small\"><i class=\"fa fa-trash\"></i> Elimina</a>
</div></div>";
}
?>
</div>
</div>
</div>

1
albo.php

@ -7,6 +7,7 @@ $qTotal = mysqli_query($conn, "SELECT COUNT(id) FROM board");
$rUpdate = mysqli_fetch_array($qUpdate);
$rTotal = mysqli_fetch_array($qTotal);
?>

23
css/admin.css

@ -122,15 +122,34 @@
.sheet-box {
border: 1px solid #4e984a;
background: white;
min-height: calc(100vh - 170px);
}
@media only screen and (min-width: 768px) {
/* line 18, admin.scss */
.admin-list-item {
width: 100%;
padding: 5px;
position: relative;
transition: .4s;
}
/* line 24, admin.scss */
.admin-list-item:hover {
/* opacity: .7; */
}
/* line 28, admin.scss */
.admin-list-item .right {
position: absolute;
right: 5px;
top: 0;
}
@media only screen and (min-width: 768px) {
/* line 42, admin.scss */
#MainContent {
margin-top: 120px;
}
/* line 21, admin.scss */
/* line 45, admin.scss */
#menuLeft {
min-height: calc(100vh - 120px);
}

74
css/styles.css

@ -14273,6 +14273,11 @@ a.text-dark:hover, a.text-dark:focus {
color: #aa0000;
}
/* line 49, fonts.scss */
.text-grey {
color: #aaa;
}
/* line 1, global.scss */
body {
font-family: 'Roboto';
@ -14389,6 +14394,21 @@ a:hover {
}
/* line 106, global.scss */
.bg-grey {
background: #aaa;
}
/* line 109, global.scss */
.bg-light-grey {
background: #d1efb5;
}
/* line 112, global.scss */
.bg-white {
background: white;
}
/* line 116, global.scss */
#MainContent {
position: relative;
margin-top: 40px;
@ -14397,7 +14417,7 @@ a:hover {
overflow: hidden;
}
/* line 114, global.scss */
/* line 124, global.scss */
#map {
width: 100%;
border-radius: 3px;
@ -14405,33 +14425,6 @@ a:hover {
padding: 10px;
}
/*
.ui-datepicker-header{
.ui-datepicker-prev,
.ui-datepicker-next{
background: none;
margin: 4px 0 !important;
border: none !important;
&.ui-state-hover{
margin: 4px 0 !important;
border: none !important;
background: none;
top: 2px;
}
}
.ui-datepicker-next{
.ui-icon{
&.ui-icon-circle-triangle-e{
&:after{
content: '\f101';
font-family: 'FontAwesome';
}
}
}
}
}*/
/* line 2, forms.scss */
.button,
input,
@ -14521,12 +14514,17 @@ input[type=submit]:hover,
button:hover {
opacity: .7;
color: white;
/*
background-color: $grey;
*/
}
/* line 62, forms.scss */
.button.button-small,
input[type=button].button-small,
input[type=submit].button-small,
button.button-small {
padding: 3px 20px;
line-height: unset;
}
/* line 68, forms.scss */
/* line 70, forms.scss */
select {
appearance: none;
-moz-appearance: none;
@ -14538,12 +14536,12 @@ select {
padding-right: 30px;
}
/* line 80, forms.scss */
/* line 82, forms.scss */
input[type="radio"],
input[type="checkbox"] {
display: none;
}
/* line 84, forms.scss */
/* line 86, forms.scss */
input[type="radio"] + label::before,
input[type="checkbox"] + label::before {
content: "";
@ -14559,7 +14557,7 @@ input[type="checkbox"] + label::before {
line-height: 14px;
border-radius: 2px;
}
/* line 100, forms.scss */
/* line 102, forms.scss */
input[type="radio"]:checked + label::before,
input[type="checkbox"]:checked + label::before {
font-family: 'FontAwesome';
@ -14568,16 +14566,16 @@ input[type="checkbox"]:checked + label::before {
color: #4e984a;
}
/* line 110, forms.scss */
/* line 112, forms.scss */
input[type="radio"] + label::before {
border-radius: 16px;
}
/* line 118, forms.scss */
/* line 120, forms.scss */
form {
width: 100%;
}
/* line 121, forms.scss */
/* line 123, forms.scss */
form#login-form, form#adv-form {
display: none;
}

BIN
scss/.sass-cache/bdcb2ec4843708bc0e130897363854e74056ec3e/fonts.scssc

Binary file not shown.

BIN
scss/.sass-cache/bdcb2ec4843708bc0e130897363854e74056ec3e/forms.scssc

Binary file not shown.

BIN
scss/.sass-cache/bdcb2ec4843708bc0e130897363854e74056ec3e/global.scssc

Binary file not shown.

3
scss/fonts.scss

@ -46,3 +46,6 @@
.text-red{
color: $red;
}
.text-grey{
color: $grey;
}

8
scss/forms.scss

@ -57,9 +57,11 @@ button{
&:hover{
opacity: .7;
color: white;
/*
background-color: $grey;
*/
}
&.button-small{
padding: 3px 20px;
line-height: unset;
}
}

42
scss/global.scss

@ -103,6 +103,16 @@ a{
.bg-grey{
background: $grey;
}
.bg-light-grey{
background: $light-grey;
}
.bg-white{
background: white;
}
#MainContent{
position: relative;
margin-top: 40px;
@ -118,35 +128,3 @@ a{
padding: 10px;
}
/*
.ui-datepicker-header{
.ui-datepicker-prev,
.ui-datepicker-next{
background: none;
margin: 4px 0 !important;
border: none !important;
&.ui-state-hover{
margin: 4px 0 !important;
border: none !important;
background: none;
top: 2px;
}
}
.ui-datepicker-next{
.ui-icon{
&.ui-icon-circle-triangle-e{
&:after{
content: '\f101';
font-family: 'FontAwesome';
}
}
}
}
}*/

Loading…
Cancel
Save