View file www/obv/all.php

File size: 1.1Kb
<?php
 $st_r = $cgf_ind_obv;

 if (is_file($cms.'obv/base.txt')) $post = @file($cms.'obv/base.txt'); else echo 'Ошибка';

 $count_post = count($post);

 if (empty($_POST['fapages'])) {
    $pages = 1;
 }  else {
    $pages = (int) $_POST['fapages'];
 }

 $j = ($count_post-1)-(($pages-1)*$st_r);
 $i = $j-$st_r;
 for(; $i<$j && $j>=0; $j--)
 {
 $fn = explode("|",$post[$j]);

 echo '
  <a href="/?page=obv_info&obv_id='.$j.'"><div class="mess1">'.$fn[0].'</div></a>
  <div class="mess2">'.substr($fn[1],0,250).'...</div>
   <br />


     ';


 }
			$all = ceil($count_post/$st_r);
			 echo '<table><tr>';
			 for ($i=1;$i<=$all;$i++)
			 {
			     if ($pages==$i) {
			        echo '<td><b class="knopka">'.$i.'</b></td>';
			     }
			     else
			     {
			        echo '<td>
			        <form name="" action="" method="post">
                    <input type="submit" class="knopka" value="'.$i.'">
                    <input name="fapages" type="hidden" value="'.$i.'">
                    </form>
			        </td>';
			     }
             }
             echo '</tr></table>';
?>