Advertisement
Guest User

Untitled

a guest
May 29th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.99 KB | None | 0 0
  1. <?php
  2.     if (isset($_POST['addUser']))
  3.     {
  4.         //Da completare
  5.     }
  6.    
  7.     if (isset($_POST['removeUser']))
  8.     {
  9.         if (isset($_POST['lstUtenti']))
  10.         {
  11.             $que = ('delete from "Utenti" where email=\''.$_POST['lstUtenti'].'\'');
  12.             echo $que;
  13.             $res = pg_query ($que);
  14.             if (!$res){
  15.                 echo "query no!";
  16.                 break;
  17.             }
  18.             header("location:index.php?pag=big_admin_user_frame");
  19.         }
  20.     }
  21.    
  22.     if (isset($_POST['modifyUser']))
  23.     {
  24.         //Da completare
  25.     }
  26. ?>
  27. <form name="formLogin_Password" method="post" action="index.php?pag=big_admin_user_frame" class="form_null">
  28.       <table class="tablecont">
  29.        <tr>
  30.         <td class="topbox">
  31.          AMMINISTRAZIONE UTENTI
  32.         </td>
  33.        </tr>
  34.        <tr>
  35.         <td class="centerbox" valign="top">
  36.          <table class="tablecont2" align="center">
  37.       <tr>
  38.        <td class="centerboxback_middle" align="center" colspan="3">
  39.        <br>
  40.        <?php
  41.         $conn = pg_connect("host=127.0.0.1 dbname=Sito user=tia password=mattiaroot19872009");
  42.         if (!$conn) {
  43.             echo ('Connessione fallita! <br />');
  44.             break;
  45.         }
  46.         $que = 'select * from "Utenti" order by cognome';
  47.         $utenti = pg_query ($que);
  48.        
  49.         $row = pg_num_rows($utenti);
  50.         $ind = 0;
  51.         echo ('<select name="lstUtenti" size="15">');
  52.         while ($ind<$row)
  53.         {
  54.             $result = pg_fetch_assoc($utenti, $ind);
  55.             echo ('<option value="'.$result['email'].'">'.$result['cognome'].' '.$result['nome'].' '.$result['email'].'</option>');
  56.             $ind = $ind + 1;
  57.         }  
  58.         echo ('</select>')
  59.        ?>
  60.       </td>
  61.      </tr>
  62.      <tr>
  63.      <td align="right">
  64.         <input type="submit" value="Aggiungi Utente" name="addUser">
  65.      </td>
  66.      <td align="center">
  67.         <input type="submit" value="Rimuovi Utente" name="removeUser">
  68.      </td>
  69.      <td align="left">
  70.         <input type="submit" value="Modifica Utente" name="modifyUser">
  71.      </td>
  72.      </tr>
  73.         </table>
  74.        </td>
  75.       </tr>
  76.       <tr>
  77.        <td class="bottombox">
  78.        </td>
  79.        <td>
  80.        </td>   
  81.       </tr>
  82.      </table>
  83. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement