Example #1
0
 public function stampaImacDaParametroXedit($token, $param)
 {
     if ($param == 'protocollo') {
         $query = "SELECT im.nProtocollo,im.ticket,im.matUtente,im.stato,dip.cognome,dip.nome AS nome,im.tipoRichiesta,tipo.nome AS descrizione,im.pathFile,im.note,im.dataApertura \n                        FROM imac AS im JOIN dipendenti AS dip ON im.matUtente=dip.matricola JOIN tipo_richiesta AS tipo ON im.tipoRichiesta=tipo.id  WHERE im.nProtocollo='" . $token . "' ORDER BY im.nProtocollo DESC";
     } else {
         if ($param == 'ticket') {
             $query = "SELECT im.nProtocollo,im.ticket,im.matUtente,im.stato,dip.cognome,dip.nome AS nome,im.tipoRichiesta,tipo.nome AS descrizione,im.pathFile,im.note,im.dataApertura\n                        FROM imac AS im JOIN dipendenti AS dip ON im.matUtente=dip.matricola JOIN tipo_richiesta AS tipo ON im.tipoRichiesta=tipo.id WHERE im.ticket='" . $token . "' ORDER BY im.nProtocollo DESC";
         } else {
             if ($param == 'matricola') {
                 $query = "SELECT im.nProtocollo,im.ticket,im.matUtente,im.stato,dip.cognome,dip.nome AS nome,im.tipoRichiesta,tipo.nome AS descrizione,im.pathFile,im.note,im.dataApertura\n                        FROM imac AS im JOIN dipendenti AS dip ON im.matUtente=dip.matricola JOIN tipo_richiesta AS tipo ON im.tipoRichiesta=tipo.id WHERE im.matUtente='" . $token . "' ORDER BY im.nProtocollo DESC";
             }
         }
     }
     if (!($res = $this->DBconn->query($query))) {
         echo $this->DBconn->error;
     } else {
         if ($res->num_rows >= 1) {
             $option = new TIPO();
             echo "<div id='imacListEdit' class='table-responsive'>\n                          <table class='table'>\n                             <thead>\n                                 <tr>\n                                 <th>PROTOCOLLO</th><th>TICKET</th><th>MATRICOLA</th><th>COGNOME,NOME</th><th>STATO</th><th>TIPO</th><th>NOTE</th><th>FILE</th><th>New File</th><th>DATA</th><th>EDIT</th><th>DEL</th>\n                                 </tr>\n                             </thead>\n                             <tbody>";
             while ($row = $res->fetch_assoc()) {
                 echo "<tr>";
                 echo "<td><span class='NPROTOCOLLO' id='nProtocollo'>" . $row['nProtocollo'] . "</span></td>";
                 echo "<td><input type='text' class='TICKET numero' id='ticket' value='" . $row['ticket'] . "'></td>";
                 echo "<td><input type='text' class='MATRICOLA' id='matricola' value='" . $row['matUtente'] . "'></td>";
                 echo "<td><input type='text' class='COGNOME,NOME' id='cognome_nome' value='" . $row['cognome'] . "," . $row['nome'] . "'></td>";
                 echo "<td>";
                 $this->stampaStatoCombo($row['stato']);
                 echo "</td>";
                 //echo "<td><span class='STATO' id='stato'>".$row['stato']."</span></td>";
                 echo "<td>";
                 $option->stampaSelectedComboType($row['tipoRichiesta']);
                 echo "</td>";
                 //echo "<td><span class='TIPO' id='tipo'>".$row['descrizione']."</span></td>";
                 echo "<td><input type='text' class='' id='note' value='" . $row['note'] . "'></td>";
                 if ($row['pathFile'] != '') {
                     echo "<td><button class='PATHFILE btn btn-sm btn-info' id='" . $row['nProtocollo'] . "'>--></button>";
                 } else {
                     echo "<td><button class='noFILE btn btn-sm btn-danger disabled'>X</button></td>";
                 }
                 echo "<td><button class='addPATHFILE btn btn-sm btn-info' id='addNewFile'>ADD new file</button><span class='nascosto newFileUppato'></span></td>";
                 //echo "<td><a class='PATHFILE' id='pathfile' href='#".$row['pathFile']."'>".$row['pathFile']."</a></td>";
                 //
                 echo "<td><input type='text' id='FETCHdata' class='DATA' value='" . $row['dataApertura'] . "'></td>";
                 echo "<td><button id='EDITimac' class='btn btn-sm btn-success IMAC-CD'>V</button></td>";
                 echo "<td><button id='DELimac' class='btn btn-sm btn-danger IMAC-CD'>X</button></td>";
                 echo "</tr>";
             }
             echo "</tbody>\n                          </table>\n                          </div>";
             stampaHintDiv();
         } else {
             echo "<span class='alert alert-danger'>Nessun risultato per il filtro impostato!</span>";
         }
     }
 }
Example #2
0
            echo "<td><button id='FETCHadd' class='btn btn-sm btn-success IMAC-CD'>ADD</button></td>";
            echo "<td><button id='FETCHdel' class='btn btn-sm btn-warning IMAC-CD'>DEL</button></td>";
            echo "</tr>";
        }
        echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td><button class='btn btn-sm btn-danger' id='clearFiles'>Clear All</button></td></tr>";
        echo "</tbody></table></div>";
        stampaHintDiv();
    } else {
        echo "Nessun file presente nella directory temporanea";
    }
}
if (isset($_POST['manualInsert'])) {
    require_once "db.php";
    require_once "excelFunctions.php";
    require_once "CLASS_type.php";
    $option = new TIPO();
    echo "<div id='imacManualList' class='table-responsive'>\n                          <table class='table'>\n                             <thead>\n                                 <tr>\n                                 <th>FILE</th><th>MATRICOLA</th><th>COGNOME,NOME</th><th>TICKET</th><th>TIPO</th><th>NOTE</th><th>DATA</th><th>PROT.IMAC</th><th>+</th><th>-</th>\n                                 </tr>\n                             </thead>\n                             <tbody>";
    echo "<tr id='blankManualRow' class='nascosto'>";
    echo "<td id='MANUALupFile' class='MANUALupFileClass'><button class='btn btn-sm btn-info'>Upload</button></td>";
    echo "<td><input type='text' id='FETCHmatUtente' class='defwidth' value=''></td>";
    echo "<td><input type='text' id='FETCHcognomeNome' value=''></td>";
    echo "<td><input type='text' id='FETCHticket' value='' class='defwidth numero'></td>";
    echo "<td>";
    echo $option->stampaComboType();
    echo "</td>";
    echo "<td><input type='text' id='FETCHnote' value=''></td>";
    echo "<td><input type='text' id='FETCHdata_Manual' class='defwidth' value=''></td>";
    echo "<td><span id='FETCHprotImac' class='defwidth DataManual'></span></td>";
    echo "<td><button id='MANUALadd' class='btn btn-sm btn-success IMAC-CD'>ADD</button></td>";
    echo "<td><button id='MANUALdel' class='btn btn-sm btn-warning IMAC-CD'>DEL</button></td>";
    echo "</tr>";
Example #3
0
    $tipo = new TIPO();
    $newNome = sanitizeInput($_POST['nome']);
    $id = $_POST['id'];
    $tipo->id = $id;
    $tipo->nome = $newNome;
    if (!$tipo->aggiornaType()) {
        echoResponse('no', "Errore aggiornamento record, contatta un admin");
    } else {
        echoResponse('yes', "Record Aggiornato");
    }
}
//script del tipologia
if (isset($_POST['deleteType'])) {
    require_once "CLASS_type.php";
    require_once "CLASS_imac.php";
    $tipologia = new TIPO();
    $imac = new IMAC();
    $tipologia->getTypeById($_POST['id']);
    $imac->tipoRichiesta = $_POST['id'];
    if ($imac->getAmountImacByToken('tipo') == 0) {
        $tipologia->cancellaType();
        echoResponse('yes', "Cancellata tipologia " . $tipologia->nome);
    } else {
        echoResponse('no', "La tipologia non può essere cancellato perchè sono presenti IMAC associate a lei");
    }
}
/**********************************
 *        USER  management ADD    *
 **********************************/
if (isset($_POST['addUser'])) {
    require_once "CLASS_user.php";