include_once("php_includes/db_conx.php"); require("php_includes/function.php"); $search = $_POST['search']; $type = $_POST['type']; if ($_POST['cat'] != "") { $cat = $_POST['cat']; }else{ $cat = $_GET['cat']; } if($type == "" AND $search !=""){ $case = 1; } if($type != "" AND $search ==""){ $case = 2; } if($type != "" AND $search !=""){ $case = 3; } switch ($case) { case 1: $sql = "SELECT clc_doc.* FROM clc_doc INNER JOIN clc_cat_relationships ON clc_doc.id = clc_cat_relationships.doc_id where clc_cat_relationships.cat_id = $cat and (clc_doc.doc_title LIKE '%$search%' or clc_doc.keyword LIKE '%$search%' or clc_doc.doc_description LIKE '%$search%') ORDER BY clc_doc.year DESC" ; $docResult = $db_conx->query($sql); if($docResult->num_rows > 0 ) { while($row = $docResult->fetch_assoc()){ $doc[] = $row; } } break; case 2: $sql = "SELECT clc_doc.* FROM clc_doc INNER JOIN clc_cat_relationships ON clc_doc.id = clc_cat_relationships.doc_id where clc_cat_relationships.cat_id = $cat and doc_type = $type ORDER BY clc_doc.year DESC"; $docResult = $db_conx->query($sql); if($docResult->num_rows > 0 ) { while($row = $docResult->fetch_assoc()){ $doc[] = $row; } } break; case 3: $sql = "SELECT clc_doc.* FROM clc_doc INNER JOIN clc_cat_relationships ON clc_doc.id = clc_cat_relationships.doc_id where clc_cat_relationships.cat_id = $cat and (clc_doc.doc_title LIKE '%$search%' or clc_doc.keyword LIKE '%$search%' or clc_doc.doc_description LIKE '%$search%') and doc_type = $type ORDER BY clc_doc.year DESC"; $docResult = $db_conx->query($sql); if($docResult->num_rows > 0 ) { while($row = $docResult->fetch_assoc()){ $doc[] = $row; } } break; default: $sql = "SELECT clc_doc.* FROM clc_doc INNER JOIN clc_cat_relationships ON clc_doc.id = clc_cat_relationships.doc_id where clc_cat_relationships.cat_id = $cat ORDER BY clc_doc.year DESC"; $docResult = $db_conx->query($sql); if($docResult->num_rows > 0 ) { while($row = $docResult->fetch_assoc()){ $doc[] = $row; } } } ?>
Categories > if ($cat == 1) { echo "Community Development";}; if ($cat == 2) { echo "Country Case (EP)";}; if ($cat == 3) { echo "Country Case (LLL)";}; if ($cat == 4) { echo "Country Case (NQF)";}; if ($cat == 5) { echo "Country Report";}; if ($cat == 6) { echo "Curriculum";}; if ($cat == 7) { echo "ESD";}; if ($cat == 8) { echo "Gender";}; if ($cat == 9) { echo "Guidelines";}; if ($cat == 10) { echo "ICT ";}; if ($cat == 11) { echo "Life Skills and TVET";}; if ($cat == 12) { echo "Lifelong Learning";}; if ($cat == 13) { echo "Literacy";}; if ($cat == 20) { echo "Management/Financing";}; if ($cat == 14) { echo "Monitoring & Evaluation";}; if ($cat == 15) { echo "Others";}; if ($cat == 16) { echo "Policy/Governance";}; if ($cat == 17) { echo "Qualification";}; if ($cat == 19) { echo "Training Materials";}; ?>
0 results found. ( if($type == 1) {echo "Publications";}; if($type == 2) {echo "Documents";}; if($type == 3) {echo "Presentations";}; if($type == "4") {echo "Others";}; if($type == "") {echo "All Types";}; ?>)
The search document was not found in database. Please try again!