Exemplo n.º 1
0
            DBtoAR::$valori = $_POST['ID'];
            DBtoAR::$tabella = 'index';
            DBtoAR::delete();
            break;
        default:
            DBtoAR::$colonne = array('id', 'word');
            DBtoAR::$valori = array($_POST['ID'], $_POST['text']);
            DBtoAR::$tabella = 'index';
            DBtoAR::update();
            break;
    }
}
DBtoAR::$colonne = array('ID', 'word');
DBtoAR::$dove = '';
DBtoAR::$valori = '';
DBtoAR::$tabella = 'index';
$index = DBtoAR::select();
echo '
<div align="center">
<table border="1" width="540">
       <tr>
           <td width="40" align="center" valign="middle">ID</td>
           <td width="200" align="center">Parola</td>
           <td width="300" align="center" valign="middle">
		       <form action="Indici.php" method="post" name="Add">
    		         <input type="input" value="" name="text" />
                     <input name="ACT" type="submit" value="Aggiungi" />
               </form>
           </td>
       </tr>
';
Exemplo n.º 2
0
function RandIndex()
{
    global $var;
    if ($var['idx']['gon']) {
        DBtoAR::$colonne = array('ID', 'word');
        DBtoAR::$dove = '';
        DBtoAR::$valori = '';
        DBtoAR::$tabella = 'index';
        $var['idx']['data'] = DBtoAR::select();
        $var['idx']['randK'] = range(0, $var['idx']['data']['num'] - 1);
        shuffle($var['idx']['randK']);
        $var['idx']['gon'] = false;
    }
    if ($var['idx']['data']['num'] == 0) {
        echo 'no data';
    } else {
        echo $var['idx']['data']['word'][$var['idx']['randK'][$var['idx']['round']]];
        $var['idx']['round']++;
        if ($var['idx']['round'] == $var['idx']['data']['num']) {
            $var['idx']['round'] = 0;
        }
    }
}