Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Bingoformulieren maken</title>
- <style type="text/css">
- * {
- font-family: 'Arial';
- font-size: 13px;
- }
- h1 {
- font-size: 200%;
- font-weight: bold;
- }
- table.form tr td {
- text-align: center;
- vertical-align:middle;
- border-width: 0 1px 1px 0;
- border-style: solid;
- border-color: #000;
- margin: 0;
- padding: 3px;
- width: 4cm;
- height: 1cm;
- }
- td.main {
- text-align: left;
- vertical-align: top;
- border-width: 0;
- }
- a {
- color: #00f;
- }
- </style>
- <script type="text/javascript">
- var noTexts = 5;
- function addText() {
- var i;
- var texts = Array();
- var greek = Array();
- for (i=1;i<=noTexts;i++) {
- texts[i] = document.getElementById('text-'+i).value;
- greek[i] = document.getElementById('greek-'+i).checked;
- }
- noTexts++;
- document.getElementById("texts").innerHTML += '<tr><td>'+noTexts+'. </td><td><input type="text" name="text-'+noTexts+'" id="text-'+noTexts+'" tabindex="'+noTexts+'"/></td><td><input type="checkbox" name="greek-'+noTexts+'" id="greek-'+noTexts+'"/></td></tr>';
- }
- function addTexts() {
- var n;
- var i = document.getElementById('newTexts').value;
- for (n=0;n<i;n++) {
- addText();
- }
- }
- function checkForm() {
- var width = document.getElementById('width').value;
- var height = document.getElementById('height').value;
- var i;
- var noUsedTexts = 0;
- for (i=1;i<=noTexts;i++) {
- if (document.getElementById('text-'+i).value!='') {
- noUsedTexts++;
- }
- }
- if (noUsedTexts < width*height) {
- alert('Het aantal ingevulde teksten moet groter zijn dan het aantal velden van een formulier.');
- return false;
- }
- return true;
- }
- </script>
- </head>
- <body>
- <?php
- if (!isset($_POST['send'])) {
- ?>
- <h1>Bingoformulieren maken</h1>
- Welkom! Op deze website kunt u uw eigen bingoformulieren maken.<br>
- <ol>
- <li>Voeg mogelijke velden in (voeg velden toe met de knop onder de tekstjes)</li>
- <li>Kies de hoogte en breedte van de formulieren en geef het aantal formulieren op</li>
- <li>Met de knop "Maak formulieren" kunt u de formulieren laten genereren</li>
- </ol>
- Veel plezier en succes!<br><br>
- <a href="http://camilstaps.nl">Camil Staps</a><br>
- Bugs kunt u melden bij <a href="mailto:info@camilstaps.nl">info@camilstaps.nl</a>. Alvast bedankt!<br><br/>
- <table><tr>
- <td class="main">
- <form onsubmit="return checkForm();" action="index.php" method="post">
- <b>Teksten in de velden</b>
- <table id="texts">
- <tr><th>#</th><th>Tekst</th><th>Grieks</th></tr>
- <tr><td>1. </td><td><input type="text" name="text-1" id="text-1" tabindex="1"/></td><td><input type="checkbox" name="greek-1" id="greek-1"/></td></tr>
- <tr><td>2. </td><td><input type="text" name="text-2" id="text-2" tabindex="2"/></td><td><input type="checkbox" name="greek-2" id="greek-2"/></td></tr>
- <tr><td>3. </td><td><input type="text" name="text-3" id="text-3" tabindex="3"/></td><td><input type="checkbox" name="greek-3" id="greek-3"/></td></tr>
- <tr><td>4. </td><td><input type="text" name="text-4" id="text-4" tabindex="4"/></td><td><input type="checkbox" name="greek-4" id="greek-4"/></td></tr>
- <tr><td>5. </td><td><input type="text" name="text-5" id="text-5" tabindex="5"/></td><td><input type="checkbox" name="greek-5" id="greek-5"/></td></tr>
- </table>
- <br/>
- Voeg velden toe: <input type="text" maxlength="2" style="width:40px;" value="1" id="newTexts"/> <button onclick="addTexts();" type="button">Ga</button><br/><br/>
- <b>Andere instellingen</b>
- <table>
- <tr><td>Breedte formulier: </td><td><input type="text" maxlength="2" style="width:40px;" name="width" id="width" value="5"/></td></tr>
- <tr><td>Hoogte formulier: </td><td><input type="text" maxlength="2" style="width:40px;" name="height" id="height" value="5"/></td></tr>
- <tr><td>Aantal formulieren: </td><td><input type="text" maxlength="3" style="width:40px;" name="count" id="count" value="30"/></td></tr>
- </table>
- <br/>
- <input type="submit" value="Maak formulieren" name="send"/>
- </form>
- </td>
- <td class="main" style="padding-left:100px;">
- Als u de optie 'Grieks' gebruikt, geldt de volgende omzetting:<br/>
- <ul style="list-style-type:none;padding-left:10px;">
- <li>a = alfa</li>
- <li>b = beta</li>
- <li>c = chi</li>
- <li>d = delta</li>
- <li>e = epsilon</li>
- <li>f = phi</li>
- <li>g = gamma</li>
- <li>h = eta</li>
- <li>i = iota</li>
- <li>j = phi</li>
- <li>k = kappa</li>
- <li>l = labda</li>
- <li>m = mu</li>
- <li>n = nu</li>
- <li>o = omikron</li>
- <li>p = pi</li>
- <li>q = theta</li>
- <li>r = rho</li>
- <li>s = sigma</li>
- <li>t = tau</li>
- <li>u = upsilon</li>
- <li>v = eind-sigma (voor aan het eind van een woord)</li>
- <li>w = omega</li>
- <li>x = xi</li>
- <li>y = psi</li>
- <li>z = zeta</li>
- </ul>
- </td>
- </tr></table>
- <?php
- } else {
- $p = $_POST;
- $c = 0;
- $noUsedTexts = 0;
- while (isset($p['text-'.($c+1)])) {
- $c++;
- if ($p['text-'.$c]!='') {
- $noUsedTexts++;
- if (!isset($p['greek-'.$c])) {
- $texts[] = $p['text-'.$c];
- } else {
- $next = $p['text-'.$c];
- $next=str_replace('a','---01,',$next);
- $next=str_replace('b','---02,',$next);
- $next=str_replace('c','---03,',$next);
- $next=str_replace('d','---04,',$next);
- $next=str_replace('e','---05,',$next);
- $next=str_replace('f','---06,',$next);
- $next=str_replace('g','---07,',$next);
- $next=str_replace('h','---08,',$next);
- $next=str_replace('i','---09,',$next);
- $next=str_replace('j','---10,',$next);
- $next=str_replace('k','---11,',$next);
- $next=str_replace('l','---12,',$next);
- $next=str_replace('m','---13,',$next);
- $next=str_replace('n','---14,',$next);
- $next=str_replace('o','---15,',$next);
- $next=str_replace('p','---16,',$next);
- $next=str_replace('q','---17,',$next);
- $next=str_replace('r','---18,',$next);
- $next=str_replace('s','---19,',$next);
- $next=str_replace('t','---20,',$next);
- $next=str_replace('u','---21,',$next);
- $next=str_replace('v','---22,',$next);
- $next=str_replace('w','---23,',$next);
- $next=str_replace('x','---24,',$next);
- $next=str_replace('y','---25,',$next);
- $next=str_replace('z','---26,',$next);
- $next=str_replace('A','+++01,',$next);
- $next=str_replace('B','+++02,',$next);
- $next=str_replace('C','+++03,',$next);
- $next=str_replace('D','+++04,',$next);
- $next=str_replace('E','+++05,',$next);
- $next=str_replace('F','+++06,',$next);
- $next=str_replace('G','+++07,',$next);
- $next=str_replace('H','+++08,',$next);
- $next=str_replace('I','+++09,',$next);
- $next=str_replace('J','+++10,',$next);
- $next=str_replace('K','+++11,',$next);
- $next=str_replace('L','+++12,',$next);
- $next=str_replace('M','+++13,',$next);
- $next=str_replace('N','+++14,',$next);
- $next=str_replace('O','+++15,',$next);
- $next=str_replace('P','+++16,',$next);
- $next=str_replace('Q','+++17,',$next);
- $next=str_replace('R','+++18,',$next);
- $next=str_replace('S','+++19,',$next);
- $next=str_replace('T','+++20,',$next);
- $next=str_replace('U','+++21,',$next);
- $next=str_replace('V','+++22,',$next);
- $next=str_replace('W','+++23,',$next);
- $next=str_replace('X','+++24,',$next);
- $next=str_replace('Y','+++25,',$next);
- $next=str_replace('Z','+++26,',$next);
- $next=str_replace('---01,','α',$next);
- $next=str_replace('---02,','β',$next);
- $next=str_replace('---03,','χ',$next);
- $next=str_replace('---04,','δ',$next);
- $next=str_replace('---05,','ε',$next);
- $next=str_replace('---06,','φ',$next);
- $next=str_replace('---07,','γ',$next);
- $next=str_replace('---08,','η',$next);
- $next=str_replace('---09,','ι',$next);
- $next=str_replace('---10,','φ',$next);
- $next=str_replace('---11,','κ',$next);
- $next=str_replace('---12,','λ',$next);
- $next=str_replace('---13,','μ',$next);
- $next=str_replace('---14,','ν',$next);
- $next=str_replace('---15,','ο',$next);
- $next=str_replace('---16,','π',$next);
- $next=str_replace('---17,','θ',$next);
- $next=str_replace('---18,','ρ',$next);
- $next=str_replace('---19,','σ',$next);
- $next=str_replace('---20,','τ',$next);
- $next=str_replace('---21,','υ',$next);
- $next=str_replace('---22,','ϛ',$next);
- $next=str_replace('---23,','ω',$next);
- $next=str_replace('---24,','ξ',$next);
- $next=str_replace('---25,','ψ',$next);
- $next=str_replace('---26,','ζ',$next);
- $next=str_replace('+++01,','Α',$next);
- $next=str_replace('+++02,','Β',$next);
- $next=str_replace('+++03,','Χ',$next);
- $next=str_replace('+++04,','Δ',$next);
- $next=str_replace('+++05,','Ε',$next);
- $next=str_replace('+++06,','Φ',$next);
- $next=str_replace('+++07,','Γ',$next);
- $next=str_replace('+++08,','Η',$next);
- $next=str_replace('+++09,','Ι',$next);
- $next=str_replace('+++10,','Φ',$next);
- $next=str_replace('+++11,','Κ',$next);
- $next=str_replace('+++12,','Λ',$next);
- $next=str_replace('+++13,','Μ',$next);
- $next=str_replace('+++14,','Ν',$next);
- $next=str_replace('+++15,','Ο',$next);
- $next=str_replace('+++16,','Π',$next);
- $next=str_replace('+++17,','Θ',$next);
- $next=str_replace('+++18,','Ρ',$next);
- $next=str_replace('+++19,','Σ',$next);
- $next=str_replace('+++20,','Τ',$next);
- $next=str_replace('+++21,','Υ',$next);
- $next=str_replace('+++22,','Ϛ',$next);
- $next=str_replace('+++23,','Ω',$next);
- $next=str_replace('+++24,','Ξ',$next);
- $next=str_replace('+++25,','Ψ',$next);
- $next=str_replace('+++26,','Ζ',$next);
- $texts[] = $next;
- }
- }
- }
- #echo $noUsedTexts;
- $width = $p['width'];
- $height = $p['height'];
- $total = $width*$height;
- $count = $p['count'];
- for ($i=0;$i<$count;$i++) {
- $chosen = array();
- for ($n=0;$n<$total;$n++) {
- do {
- $no = rand(1,$noUsedTexts);
- } while (in_array($no,$chosen));
- $chosen[] = $no;
- }
- echo '<table class="form" style="border-style:solid;border-width:1px 0 0 1px;" cellspacing="0" cellpadding="0">';
- for ($h=0;$h<$height;$h++) {
- echo '<tr>';
- for ($w=0;$w<$width;$w++) {
- echo '<td>'.$texts[$chosen[$h*$width+$w]-1].'</td>';
- }
- echo '</tr>';
- }
- echo '<tr><td colspan="'.$width.'" style="font-size:80%;height:auto;">Bingoformulieren gemaakt door Camil Staps. <a href="http://camilstaps.nl">www.camilstaps.nl</a></td></tr></table><br/><br/>';
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement