Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form>
- <input placeholder="Search the area" class="input-large search-query" type="text" id="key">
- <input type="radio" name="b_selected" class="radio" value="1" > Today
- <input type="radio" name="b_selected" class="radio" value="2" > Tomorrow<br>
- <div class="result"><div class="loading"></div></div>
- </form>
- include('config.php');
- $count= 0;
- if(isset($_POST["b_selected"]))
- { $b_selected = $_POST['b_selected']; }
- $key = $_POST['key'];
- $b_selected = $_POST['b_selected'];
- $key = addslashes($key);
- $sql = mysql_query("select * from account WHERE b_today='1' and title LIKE '%$key%' ") or die(mysql_error());
- While($row = mysql_fetch_array($sql)) {
- $count++;
- $id= $row['id'];
- $title=$row['title'];
- if($count<= 10){
- /*quick search*/
- $(document).ready( function() {
- $(".result").hide();
- $("#key").keyup( function(event){
- var key = $("#key").val();
- if( key != 0){
- $.ajax({
- type: "POST",
- data:{ key: key },
- url:"quicksearch.php",
- success: function(response) {
- $(".result").slideDown().html(response);
- }
- })
- }else{
- $(".result").slideUp();
- $(".result").val("");
- }
- })
- })
- /* Search for work plan for today or Tomorrow*/
- $(document).ready(function(){
- $('input[type="radio"]').click(function(){
- var b_selected = $(this).val();
- $.ajax({
- url:"quicksearch.php",
- method:"POST",
- data:{b_selected:b_selected},
- success:function(data){
- $('#result').html(data);
- }
- });
- });
- });
Add Comment
Please, Sign In to add comment