Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL | E_STRICT);
- // Добавлять сообщения обо всех ошибках, кроме E_NOTICE
- //error_reporting(E_ALL & ~E_NOTICE);
- ini_set('display_errors', TRUE);
- ini_set('display_startup_errors', TRUE);
- header('Content-type: text/html; charset=UTF-8');
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Виклот скрипт</title>
- <style>
- .container { width: 1000px; margin: 0 auto; }
- .container .col_left { float: left; width: 283px; background: white; font-size: 20px;}
- .container .col_center { float: left; width: 283px; background: white; font-size: 20px;}
- .container .col_right { float: left; width: 283px; background: white; font-size: 20px;}
- .clear { clear: both; }
- </style>
- </head>
- <body>
- <?php
- $g5 = microtime(true);
- $writefile = 0;
- $titlechange = 0;
- $k1 = "";
- $k2 = "";
- $k3 = "";
- $titlelot = "";
- if (isset($_POST['text']) && isset($_POST['titlelot'])) {
- $text = htmlspecialchars(strip_tags(trim($_POST['text'])));
- $titlelot = htmlspecialchars(strip_tags(trim($_POST['titlelot'])));
- $AllArr = explode("\n", $text); // разбиваем на массив
- $CountAllArr = count($AllArr); // считаем
- //echo "Строк: $CountAllArr";
- for ($i = 0; $i < $CountAllArr; $i++) {
- $AllArr[$i] = preg_replace("/^[0-9]{1,}(\s|\t)/ism", "", $AllArr[$i]);
- $AllArr[$i] = trim($AllArr[$i]);
- $AllArr[$i] = preg_replace("/\s/ism", " - ", $AllArr[$i]);
- }
- //echo "<pre>";
- //var_dump($AllArr);
- //echo "</pre>";
- $CountAllArr3 = ceil($CountAllArr/3);
- echo "CountAllArr3 = $CountAllArr3<br>";
- for ($i1 = 0; $i1 < $CountAllArr3; $i1++) {
- $k1 .= "$AllArr[$i1]<br>";
- }
- $twoFin = $CountAllArr3+$CountAllArr3;
- for ($i1 = $CountAllArr3; $i1 < $twoFin; $i1++) {
- $k2 .= "$AllArr[$i1]<br>";
- }
- //$threeStart = $twoFin+1;
- for ($i1 = $twoFin; $i1 < $CountAllArr; $i1++) {
- $k3 .= "$AllArr[$i1]<br>";
- }
- //echo "k1 = $k1";
- }
- /*
- <table border="0" width="850" cellspacing="0" cellpadding="0">
- <tr>
- <td>
- <table align="center" border="0" width="100%" cellspacing="0" cellpadding="0">
- <tr>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- */
- //$g6 = microtime(true);
- //$timescript = $g6 - $g5; echo $timescript; // время всех фраз
- ?>
- <h2 align="center"><?php echo "$titlelot"; ?></h2>
- <div class="container">
- <div class="col_left"><?php echo "$k1"; ?></div>
- <div class="col_center"><?php echo "$k2"; ?></div>
- <div class="col_right"><?php echo "$k3"; ?></div>
- <div class="clear"></div>
- </div>
- <form action="lotnn2.php" method="POST">
- Введите тираж и название лотереи:<br>
- <input type="text" name="titlelot" value="" size="40" /><br><br>
- Введите данные билетов:<br>
- <textarea type="text" name="text" COLS="41" ROWS="10"></TEXTAREA></br>
- <button type="submit" name="add">Пуск!</button>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement