Have no idea what I am doing wrong here.

I've got a working search function for any property search that we may use to look custom fields. I wish to order the search engine results by cost asc and desc utilizing a dropdown filter towards the top of the search engine results.

I've got a search.php into which i've placed this code:

    <?php include (TEMPLATEPATH . '/search-query.php'); ?>
<form name="formorder" method="post">
    <select name="resultsorder" onChange="formorder.submit();">
        <option>Order Results By</option>
        <option value="Price High-Low" <?php echo ($resultsorder == 'Price High-Low')? 'selected="selected"':''; ?>>Price Low-High</option>
        <option value="Price High-Low" <?php echo ($resultsorder == 'Price High-Low')? 'selected="selected"':''; ?>>Price High-Low</option>
        <option value="a-z" <?php echo ($resultsorder == 'a-z')? 'selected="selected"':''; ?>>a-z</option>

    </select>
    </form>

    And I have a search-query.php containing this code:

    <?php if($resultsorder) {
    //get value from order dropdown on search results page
    $resultsorder = $resultsorder;
    } else {
    $resultsorder = get_option('wp_searchorder');}

    switch ($resultsorder) {
    case "Price High-Low":
        $metakey = 'price';
        $order = 'DESC';
        $orderby = 'meta_value_num';
        break;
    case "Price Low-High":
        $metakey = 'price';
        $order = 'ASC';
        $orderby = 'meta_value_num';
        break;
    case "a-z":
        $metakey = 'address';
        $order = 'ASC';
        $orderby = 'meta_value';
        break;}


    if (!empty($_ids) && !$alllistings) {

    $wpq = array ('post_type' => 'listing', 'meta_key' => $metakey, 'orderby' =>       $orderby, 'order' => $order, 'post__in' => $_ids,  'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => 9999 );

    } elseif (empty($_ids) && !$alllistings) {

    // $_ids array is empty because search got no results
    // $_ids array will be empty if page is an "All Listings" page. Don't run this code if is All Listings because All Listings will show all listings. This code will display "no results found"
$wpq = array ('post_type' =>'listing', 'meta_key' => $metakey, 'orderby' => $orderby, 'order' => $order, 'post__in' => array('0'),'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => 9999);
    } elseif ($alllistings) {
    // This is an All Listings page, so show all results
$wpq = array ('post_type' =>'listing', 'paged' => $paged, 'meta_key' => $metakey, 'orderby' => $orderby, 'order' => $order, 'post_status' => 'publish', 'posts_per_page' => 9999);
    }

    $listing = new WP_Query($wpq);?>

Unsure what I am doing wrong.