Сообщение от danik.js
|
Приведи код в порядок. У тебя там 90% кода дублируется, мешанина полнейшая. Что значит else {} ? Зачем onclick="form.submit()" если дефолтное действие по клику и есть отправка формы? Че за муть пьяного школьника?
|
Не заморачивай мне голову :-)
Я сделал сам всё уже! А код приведу в порядок спасибо сам не знал об этом, при условии того что настраиваю ещё а не оптимизирую!
$total_pages = ceil($total_records / 8);
if($total_records > 8){
$active = '<input class="navigation-button-disabled" type="submit" value="'.$page.'" disabled>';
if($page != 1){$pageOne .= "<input class='navigation-button' type='text' hidden name='page' value='1'><input class='navigation-button-backs' type='submit' value='◄◄' onClick='formone.submit();'>";}else {}
if($page != 1){$pageL .= "<input class='navigation-button' type='text' hidden name='page' value=".($page - 1)."><input class='navigation-button-back' type='submit' value='◄' onClick='formleft.submit();'>";}else {}
if($page - 3 > 0){$pageL .= "<input class='navigation-button' type='submit' name='page' value=".($page - 3).">";}else {}
if($page - 2 > 0){$pageL .= "<input class='navigation-button' type='submit' name='page' value=".($page - 2).">";}else {}
if($page - 1 > 0){$pageL .= "<input class='navigation-button' type='submit' name='page' value=".($page - 1).">";}else {}
if($page + 1 <=$total_pages){$pageR .= "<input class='navigation-button' type='submit' name='page' value=".($page + 1).">";}else {}
if($page + 2 <=$total_pages){$pageR .= "<input class='navigation-button' type='submit' name='page' value=".($page + 2).">";}else {}
if($page + 3 <=$total_pages){$pageR .= "<input class='navigation-button' type='submit' name='page' value=".($page + 3).">";}else {}
if($page != $total_pages){$pagen = "<input class='navigation-button' type='text' hidden name='page' value=".($page + 1)."><input class='navigation-button-next' type='submit' value='►' onClick='formright.submit();'>";}else {}
if($page != $total_pages){$pageOut = "<input class='navigation-button' type='text' hidden name='page' value=".$total_pages."><input class='navigation-button-nexts' type='submit' value='►►' onClick='formout.submit();'>";}else {}
$all_text .= '<div class="navigation-position"><div class="navigation-page">';
$all_text .= '<form class="forma-position" action="" name="formone" method="POST">';
$all_text .= $pageOne;
$all_text .= '</form>';
$all_text .= '<form class="forma-position" action="" name="formleft" method="POST">';
$all_text .= $pageL.$active.$pageR;
$all_text .= '</form>';
$all_text .= '<form class="forma-position" action="" name="formright" method="POST">';
$all_text .= $pagen;
$all_text .= '</form>';
$all_text .= '<form class="forma-position" action="" name="formout" method="POST">';
$all_text .= $pageOut;
$all_text .= '</form>';
$all_text .= '</div></div>';
}else{ }
----------------------------------
теперь почистил, но формы всёравно пришлось использовать 4 иначе кнопки не будут работать!
$total_pages = ceil($total_records / 8);
if($total_records > 8){
$active = '<input class="navigation-button-disabled" type="submit" value="'.$page.'" disabled>';
if($page != 1)$pageOne .= "<input class='navigation-button' type='text' hidden name='page' value='1'><input class='navigation-button-backs' type='submit' value='◄◄'>";
if($page != 1)$pageL .= "<input class='navigation-button' type='text' hidden name='page' value=".($page - 1)."><input class='navigation-button-back' type='submit' value='◄'>";
if($page - 3 > 0)$pageL .= "<input class='navigation-button' type='submit' name='page' value=".($page - 3).">";
if($page - 2 > 0)$pageL .= "<input class='navigation-button' type='submit' name='page' value=".($page - 2).">";
if($page - 1 > 0)$pageL .= "<input class='navigation-button' type='submit' name='page' value=".($page - 1).">";
if($page + 1 <=$total_pages)$pageR .= "<input class='navigation-button' type='submit' name='page' value=".($page + 1).">";
if($page + 2 <=$total_pages)$pageR .= "<input class='navigation-button' type='submit' name='page' value=".($page + 2).">";
if($page + 3 <=$total_pages)$pageR .= "<input class='navigation-button' type='submit' name='page' value=".($page + 3).">";
if($page != $total_pages)$pagen = "<input class='navigation-button' type='text' hidden name='page' value=".($page + 1)."><input class='navigation-button-next' type='submit' value='►'>";
if($page != $total_pages)$pageOut = "<input class='navigation-button' type='text' hidden name='page' value=".$total_pages."><input class='navigation-button-nexts' type='submit' value='►►'>";
$all_text .= '<div class="navigation-position"><div class="navigation-page">';
$all_text .= '<form class="forma-position" action="" method="POST">';
$all_text .= $pageOne;
$all_text .= '</form>';
$all_text .= '<form class="forma-position" action="" method="POST">';
$all_text .= $pageL.$active.$pageR;
$all_text .= '</form>';
$all_text .= '<form class="forma-position" action="" method="POST">';
$all_text .= $pagen;
$all_text .= '</form>';
$all_text .= '<form class="forma-position" action="" method="POST">';
$all_text .= $pageOut;
$all_text .= '</form>';
$all_text .= '</div></div>';
}else{}