Sunt nou in php si va rog sa aveti rabdare si intelegere. Am pornit de unusl singur in aceasta aventura de la un simplu echo acum 3 saptamani iar codul care-l voi prezenta este cu siguranta unul brut si nefinisat.
Am o cautare cu 4 checkbox-uri (in1, in2, in3, in4) care merge la prima pagina, dar la urmatoarele pagini ale cautarii afiseaza rezultatele cautarii fara selectia checkbox pentru ca isi pierd valoarea
Formul este de forma:
Cod: Selectaţi tot
<form name="cauta" action="cautare-avansata2.php" method="get">
Caută: <input type="text" name="cauta" value=""> </td></tr>
<input type="checkbox" name="in1" value="iddoc" id="iddoc"> <label for="obiect">Tip document</label><br>
<input type="checkbox" name="in2" value="inst" id="inst"> <label for="inst">Instanţa</label><br>
<input type="checkbox" name="in3" value="materia" id="materia"> <label for="materia">Materie</label><br>
<input type="checkbox" name="in4" value="obiect" id="obiect"> <label for="obiect">Obiect</label><br>
</form>
iar cautare-avansata2.php este:
Cod: Selectaţi tot
<?php
require_once 'adm/cnx.php';
// --------------- Cautarea simpla ------------------------------------
$lc = 2; // min caractere la cautare
$rowsperpage = 20; // linii pe pagina
// preia bifele
if(!isset($_GET['in1'])) $_GET['in1'] = '';
if(!isset($_GET['in2'])) $_GET['in2'] = '';
if(!isset($_GET['in3'])) $_GET['in3'] = '';
if(!isset($_GET['in4'])) $_GET['in4'] = '';
$in1 = $_GET['in1'];
$in2 = $_GET['in2'];
$in3 = $_GET['in3'];
$in4 = $_GET['in4'];
$c = $_GET['cauta'];
echo "\r\n in1:".$in1; echo "\r\n in2:".$in2; echo "\r\n in3:".$in3; echo "\r\n in4:".$in4;
echo " -- cauta: ".$c;
if($c == '') {
$c = '';
$linii = 0;
$paginationCtrls = '';
$lista = '';
$alertagol = "<p class=\"alertext\"><span class=\"alertbox\">Introduceţi un cuvânt pentru a putea căuta în baza de date.</span></p>
<p class=\"alertext\"><span class=\"alertbox\">Apasă <a href=\"cauta.php\">AICI</a> pentru a te întoarce la căutare.</span></p>";
} elseif(strlen($c) < $lc) {
$c = $_GET['cauta'];
$linii = 0;
$paginationCtrls = '';
$lista = '';
$alertamic = " <p class=\"alertext\"><span class=\"alertbox\">Cuvântul trebuie să conţină cel puţin ".$lc." caractere.</span></p>
<p class=\"alertext\"><span class=\"alertbox\">Apasă <a href=\"cautare-avansata.php\">AICI</a> pentru a te întoarce la căutare.</span></p>";
} else {
//----------------- calculare nr linii in functie de cerere --------------------
if(($in1 != 'iddoc') && ($in2 != 'inst') && ($in3 != 'materia') && ($in4 != 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id
WHERE `titlu` LIKE "%'.$c.'%"
OR `inst` LIKE "%'.$c.'%"
OR `materia` LIKE "%'.$c.'%"
OR `obiect` LIKE "%'.$c.'%"
OR `tipdoc` LIKE "%'.$c.'%"';
// cand o singura conditie este selectata --------------------------------------------
} elseif(($in1 == 'iddoc') && ($in2 != 'inst') && ($in3 != 'materia') && ($in4 != 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%"';
} elseif(($in1 != 'iddoc') && ($in2 == 'inst') && ($in3 != 'materia') && ($in4 != 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `inst` LIKE "%'.$c.'%" ';
} elseif(($in1 != 'iddoc') && ($in2 != 'inst') && ($in3 == 'materia') && ($in4 != 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `materia` LIKE "%'.$c.'%"';
} elseif(($in1 != 'iddoc') && ($in2 != 'inst') && ($in3 != 'materia') && ($in4 == 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `obiect` LIKE "%'.$c.'%"';
// cand 2 conditii sunt selectatre ---------------------------------------------------
} elseif(($in1 == 'iddoc') && ($in2 == 'inst') && ($in3 != 'materia') && ($in4 != 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `inst` LIKE "%'.$c.'%"';
} elseif(($in1 == 'iddoc') && ($in2 != 'inst') && ($in3 == 'materia') && ($in4 != 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%"';
} elseif(($in1 == 'iddoc') && ($in2 != 'inst') && ($in3 != 'materia') && ($in4 == 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%"';
} elseif(($in1 != 'iddoc') && ($in2 == 'inst') && ($in3 == 'materia') && ($in4 != 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `inst` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%"';
} elseif(($in1 != 'iddoc') && ($in2 == 'inst') && ($in3 != 'materia') && ($in4 == 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `inst` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%"';
} elseif(($in1 != 'iddoc') && ($in2 != 'inst') && ($in3 == 'materia') && ($in4 == 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `materia` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%"';
// cand 3 conditii sunt selectate -------------------------------------------------------
} elseif(($in1 == 'iddoc') && ($in2 == 'inst') && ($in3 == 'materia') && ($in4 != 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `inst` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%"';
} elseif(($in1 == 'iddoc') && ($in2 == 'inst') && ($in3 != 'materia') && ($in4 == 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `inst` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%"';
} elseif(($in1 != 'iddoc') && ($in2 == 'inst') && ($in3 == 'materia') && ($in4 == 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `inst` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%"';
} elseif(($in1 == 'iddoc') && ($in2 != 'inst') && ($in3 == 'materia') && ($in4 == 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `inst` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%"';
} elseif(($in1 == 'iddoc') && ($in2 == 'inst') && ($in3 == 'materia') && ($in4 == 'obiect')) {
$cerere = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `inst` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%"';
}
$nrezultat = mysqli_query($conn, $cerere);
$linii = mysqli_num_rows($nrezultat);
$addlink = '?cauta='.$c.'&'.$in1.'&'.$in2.'&'.$in3.'&'.$in4;
$numrows = $linii;
$totalpages = ceil($numrows / $rowsperpage);
if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
$currentpage = (int) $_GET['currentpage'];
} else {
$currentpage = 1;
}
if ($currentpage > $totalpages) {
$currentpage = $totalpages;
}
if ($currentpage < 1) {
$currentpage = 1;
}
$offset = ($currentpage - 1) * $rowsperpage;
//--------------- extragere cerere ----------------------------------------
if(($in1 != 'iddoc') && ($in2 != 'inst') && ($in3 != 'materia') && ($in4 != 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id
WHERE `titlu` LIKE "%'.$c.'%"
OR `inst` LIKE "%'.$c.'%"
OR `materia` LIKE "%'.$c.'%"
OR `obiect` LIKE "%'.$c.'%"
OR `tipdoc` LIKE "%'.$c.'%"
ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = '';
// cand o singura conditie este selectata --------------------------------------------
} elseif(($in1 == 'iddoc') && ($in2 != 'inst') && ($in3 != 'materia') && ($in4 != 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Tip document';
} elseif(($in1 != 'iddoc') && ($in2 == 'inst') && ($in3 != 'materia') && ($in4 != 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `inst` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Instanţa';
} elseif(($in1 != 'iddoc') && ($in2 != 'inst') && ($in3 == 'materia') && ($in4 != 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `materia` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Materia';
} elseif(($in1 != 'iddoc') && ($in2 != 'inst') && ($in3 != 'materia') && ($in4 == 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `obiect` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Obiect';
// cand 2 conditii sunt selectatre ---------------------------------------------------
} elseif(($in1 == 'iddoc') && ($in2 == 'inst') && ($in3 != 'materia') && ($in4 != 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `inst` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Tip document, Instanţa';
} elseif(($in1 == 'iddoc') && ($in2 != 'inst') && ($in3 == 'materia') && ($in4 != 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Tip document, Materia';
} elseif(($in1 == 'iddoc') && ($in2 != 'inst') && ($in3 != 'materia') && ($in4 == 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Tip document, Obiect';
} elseif(($in1 != 'iddoc') && ($in2 == 'inst') && ($in3 == 'materia') && ($in4 != 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `inst` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Instanţa, Materia';
} elseif(($in1 != 'iddoc') && ($in2 == 'inst') && ($in3 != 'materia') && ($in4 == 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `inst` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Instanţa, Obiect';
} elseif(($in1 != 'iddoc') && ($in2 != 'inst') && ($in3 == 'materia') && ($in4 == 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `materia` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Materia, Obiect';
// cand 3 conditii sunt slectate -------------------------------------------------------
} elseif(($in1 == 'iddoc') && ($in2 == 'inst') && ($in3 == 'materia') && ($in4 != 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `inst` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Tip document, Instanţa, Materia';
} elseif(($in1 == 'iddoc') && ($in2 == 'inst') && ($in3 != 'materia') && ($in4 == 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `inst` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Tip document, Instanţa, Obiect';
} elseif(($in1 != 'iddoc') && ($in2 == 'inst') && ($in3 == 'materia') && ($in4 == 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `inst` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Instanţa, Materia, Obiect';
} elseif(($in1 == 'iddoc') && ($in2 != 'inst') && ($in3 == 'materia') && ($in4 == 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `inst` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Tip document, Materia, Obiect';
} elseif(($in1 == 'iddoc') && ($in2 == 'inst') && ($in3 == 'materia') && ($in4 == 'obiect')) {
$cerereSQL = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id WHERE `tipdoc` LIKE "%'.$c.'%" AND `inst` LIKE "%'.$c.'%" AND `materia` LIKE "%'.$c.'%" AND `obiect` LIKE "%'.$c.'%" ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
$in = 'Tip document, Instanţa, Materia, Obiect';
}
$innew = $in;
$rezultat = mysqli_query($conn, $cerereSQL);
//$linii = mysqli_num_rows($rezultat);
//print_r($rezultat);
if (mysqli_num_rows($rezultat) > 0) {
//$sql = 'SELECT jurisp.*, tipdocument.tipdoc, tipdocument.id as idd FROM jurisp INNER JOIN tipdocument ON jurisp.iddoc = tipdocument.id
// WHERE `titlu` LIKE "%'.$c.'%"
// OR `inst` LIKE "%'.$c.'%"
// OR `materia` LIKE "%'.$c.'%"
// OR `obiect` LIKE "%'.$c.'%"
// OR `tipdoc` LIKE "%'.$c.'%"
// ORDER BY jurisp.id DESC LIMIT '.$offset.', '.$rowsperpage;
//$result = mysqli_query($conn, $sql);
$lista = '';
$lista .= '<table cellSpacing=1 cellPadding=3 width="100%" border=1>';
$lista .= '<tr class="captabel">';
$lista .= '<td><strong>Nr şi data</strong></td>';
$lista .= '<td><strong>Titlu</strong></td>';
$lista .= '<td><strong>Instanţa</strong></td>';
$lista .= '<td><strong>Materia</strong></td>';
$lista .= '<td><strong>Obiect</strong></td>';
$lista .= '<td><strong>Tip document</strong></td>';
$lista .= '<td><strong>Document</strong></td>';
$lista .= '</tr>';
while($list = mysqli_fetch_array($rezultat, MYSQLI_ASSOC)){
$lista .= '<tr>';
$lista .= '<td>' . $list["nrdata"]. '</td>';
$lista .= '<td>' . $list["titlu"]. '</td>';
$lista .= '<td>' . $list["inst"]. '</td>';
$lista .= '<td>' . $list["materia"]. '</td>';
$lista .= '<td>' . $list["obiect"]. '</td>';
$lista .= '<td>' . $list["tipdoc"]. '</td>';
$lista .= '<td><a href=' . $list["doc"]. '>' . 'Vezi document'.'</a></td>';
$lista .= '</tr>';
$global_c = $c;
}
$lista .= '</table>';
echo " // in1:".$in1; echo "\r\n in2:".$in2; echo "\r\n in3:".$in3; echo "\r\n in4:".$in4;
echo "-- cauta: ".$c;
$range = 4;
$decizii = "Numărul total al deciziilor: <b><font color='red'>$numrows</font></b>";
$pageof = "Pagina <b>$currentpage</b> din <b>$totalpages</b> - de la cel mai nou la cel mai vechi";
$paginationCtrls = '';
if ($currentpage > 1) {
$paginationCtrls .= " <a href='{$_SERVER['PHP_SELF']}$addlink¤tpage=1'>Primele</a> ";
$prevpage = $currentpage - 1;
$paginationCtrls .= " <a href='{$_SERVER['PHP_SELF']}$addlink¤tpage=$prevpage'><</a> ";
}
for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) {
if (($x > 0) && ($x <= $totalpages)) {
if ($x == $currentpage) {
$paginationCtrls .= "<font color=\"red\"> [<b>$x</b>] </font>";
} else {
$paginationCtrls .= " <a href='{$_SERVER['PHP_SELF']}$addlink¤tpage=$x'>$x</a> ";
}
}
}
if ($currentpage != $totalpages) {
$nextpage = $currentpage + 1;
$paginationCtrls .= " <a href='{$_SERVER['PHP_SELF']}$addlink¤tpage=$nextpage'>></a> ";
$paginationCtrls .= " <a href='{$_SERVER['PHP_SELF']}$addlink¤tpage=$totalpages'>Ultimele</a> ";
}
?>
<?php
} else {
$c = $_GET['cauta'];
$paginationCtrls = '';
$lista = '';
$alertanimic = "<p class=\"alertext\"><span class=\"alertbox\">Nu au fost găsite rezultate pentru: <font color=\"black\"><b><i>".$c."</i></b></font> în <font color=\"black\">".$in."<font></span></p>
<p class=\"alertext\"><span class=\"alertbox\">Apasaţi <a href=\"cautare-avansata.php\">AICI</a> pentru a vă întoarce<span></p>";
}
}
$conn->close();
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="ro">
<link rel="stylesheet" type="text/css" href="adm/style.css">
</style>
</head>
<body>
<strong><div style="text-align: center;">CĂUTARE JURISPRUDENŢĂ</strong></div>
<br/>
<?php
if ($c == '') {
echo $alertagol;
} elseif(strlen($c) < $lc) {
echo $alertamic;
} else {
if ($lista != '') {
echo "S-au găsit <strong><font color=\"red\">". $linii."</font></strong> rezultate pentru <font color=\"red\"><b>".$c."</b></font> în <font color=\"red\"><b>".$innew."</font><br><br>";
?>
<p style="text-align: center;"><?php echo $pageof; ?></p>
<table cellSpacing=1 cellPadding=3 width="100%">
<tr>
<td style="width: 15%"><form action="cautare-avansata.php" method="post"><input type="submit" value="Înapoi"></form></td>
<td id="pagination_controls" style="width: 70%; text-align: center";><?php echo $paginationCtrls; ?></td>
<td style="width: 15%"> </td>
</tr>
</table>
<?php echo $lista;
} else {
echo $alertanimic;
?><form action="cautare-avansata.php" method="post"><input type="submit" value="Înapoi"></form>
<?php
}
}
?>
</body>
<?php include_once("footer.php"); ?>
banuiesc ca problema este in linkul de la paginare unde nu se regaseste si optiunea checkbox. Este vorba de variabila $addlink
De 3 zile neintrerupte ma tot zbat si nu reusesc. Am uitat sa mentionez ca nu stiu inca sa lucrez cu clase si obiecte. Deocamdata este prea mult pentru mine. Nici sa folosesc programe de dezvoltare php. Folosesc simplul Notepad++
Imi cer scuze pentru codul haotic dar poate unul din voi mai experimentat ma poate ajuta.
Multumesc!