} elseif ($_GET['s_dir'] == "asc") {
    $sort_direction = "asc";
} else {
    $sort_direction = "desc";
}
if (isset($_GET['s_string'])) {
    if (isset($_COOKIE["fbcity"]) && isset($_COOKIE["fblocType"])) {
        $post = stringSearch($scat, $subcat, $query, 0, 500, $sort_type, $sort_direction, $_COOKIE["fblocType"], $_COOKIE["fbcity"]);
    } else {
        $post = stringSearch($scat, $subcat, $query, 0, 500, $sort_type, $sort_direction, "", "");
    }
} else {
    if (isset($_COOKIE["fbcity"]) && isset($_COOKIE["fblocType"])) {
        $post = searchList($scat, $subcat, 0, 500, $sort_type, $sort_direction, $_COOKIE["fblocType"], $_COOKIE["fbcity"]);
    } else {
        $post = searchList($scat, $subcat, 0, 500, $sort_type, $sort_direction, "", "");
    }
}
$counter = 1;
$rowcount = mysqli_num_rows($post);
if ($rowcount == 0) {
    ?>
					<br /><center><img src='img/search_not_found.png' /><h4>Oops! No one is selling!</h4><strong>Try some other option</strong></center>
				<?php 
}
while ($row = mysqli_fetch_array($post)) {
    ?>
				<div class="media">
					<a class="pull-left" href="product.php?pid=<?php 
    echo $row['Post_id'];
    ?>
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
// Process aksi2
switch ($aksi2) {
    case "search":
        searchList($smarty, $showList);
        break;
    case "reload":
        refreshList($smarty, $showList);
        break;
    case "create":
        $showDetail = true;
        $editDetail = false;
        create_practice($smarty);
        break;
    case "edit":
        $showDetail = true;
        $editDetail = true;
        edit_practice($smarty, trim($_REQUEST['id']));
        break;
    case "delete":
Example #3
0
 switch ($_REQUEST["action"]) {
     case "fetch-list":
         if (isset($_REQUEST['category'])) {
             $guides_list = getlist($_REQUEST['category']);
             printServiceMsg($guides_list);
         } else {
             printServiceMsg(array());
         }
         break;
     case "fetch-category":
         $guides_cat = getCategory();
         printServiceMsg($guides_cat);
         break;
     case "search-list":
         if (isset($_REQUEST['q'])) {
             $api_list = searchList($_REQUEST['q']);
             printServiceMsg($api_list);
         } else {
             printServiceMsg(array());
         }
         break;
     case "create-guide":
         checkServiceSession();
         $status = saveGuide();
         printServiceMsg($status);
         break;
     case "publish-guide":
         checkServiceSession();
         if (isset($_POST['gid'])) {
             $sql = _db()->_updateQ("guides_tbl", array("status" => "published", "approved" => "false", "userid" => $_SESSION['SESS_USER_ID'], "dtoe" => date("Y-m-d H:i:s")), array("id" => $_POST['gid']));
             $res = _dbQuery($sql);