".$l_sql); // get number of records to display $l_recs_dealers = mysqli_num_rows($rs_dlr); } // check to see if we need to locate us dealers else if($p_postal != "") { // initialize sql fields $l_sql_fields = ("*"); // initialize sql tables $l_sql_tables = ("zipcodes"); // initialize sql where expression $l_sql_where_exp = ("(1)"); $l_sql_where_exp .= (" AND (zip = '".$p_postal."')"); $l_sql_where = ("WHERE (".$l_sql_where_exp.")"); // initialize sql order $l_sql_order = (" ORDER BY zip ASC"); // construct sql to retrieve the requested records $l_sql = ("SELECT ".$l_sql_fields." FROM ".$l_sql_tables." ".$l_sql_where." ".$l_sql_order); // retrieve the requested records $rs_zip = mysqli_query($g_db_connection, $l_sql); // get number of records to display $l_recs = mysqli_num_rows($rs_zip); // process the retrieved records if($r_zip = mysqli_fetch_array($rs_zip)) { // retrieve the record data $zip_latitude = stripslashes($r_zip["latitude"]); $zip_longitude = stripslashes($r_zip["longitude"]); // calculate zip codes within a range of 20 miles $l_range = postal_range(20, $zip_latitude, $zip_longitude); // initialize sql fields $l_sql_fields = ("dealers_find.*, zipcodes.latitude, zipcodes.longitude"); // initialize sql tables $l_sql_tables = ("dealers_find, zipcodes"); // initialize sql where expression $l_sql_where_exp = (""); $l_sql_where_exp .= ("((zipcodes.latitude BETWEEN '".$l_range["min_latitude"]."' AND '".$l_range["max_latitude"]."') AND (zipcodes.longitude BETWEEN '".$l_range["min_longitude"]."' AND '".$l_range["max_longitude"]."'))"); $l_sql_where_exp .= (" AND (zipcodes.zip = dealers_find.postal) AND (dealers_find.status = 'active')"); $l_sql_where = ("WHERE (".$l_sql_where_exp.")"); // initialize sql order $l_sql_order = (" ORDER BY dealers_find.organization ASC"); // construct sql to retrieve the requested records $l_sql = ("SELECT ".$l_sql_fields." FROM ".$l_sql_tables." ".$l_sql_where." ".$l_sql_order); // retrieve the requested records $rs_dlr = mysqli_query($g_db_connection, $l_sql); // get number of records to display $l_recs_dealers = mysqli_num_rows($rs_dlr); } } // check to see if we need to locate all dealers else { // initialize sql fields $l_sql_fields = ("dealers_find.*"); // initialize sql tables $l_sql_tables = ("dealers_find"); // initialize sql where expression $l_sql_where_exp = ("(1)"); $l_sql_where_exp .= (" AND (dealers_find.status = 'active')"); $l_sql_where = ("WHERE (".$l_sql_where_exp.")"); // initialize sql order $l_sql_order = (" ORDER BY dealers_find.organization ASC"); // construct sql to retrieve the requested records $l_sql = ("SELECT ".$l_sql_fields." FROM ".$l_sql_tables." ".$l_sql_where." ".$l_sql_order); // retrieve the requested records $rs_dlr = mysqli_query($g_db_connection, $l_sql); // get number of records to display $l_recs_dealers = mysqli_num_rows($rs_dlr); } } // initialize page variables $l_page_size = (6); $l_pages = ceil($l_recs_dealers / $l_page_size); ?>
To find an authorized C'est Papier Dealer nearest to you,
please enter your zip code:
Go »
0) { ?>

,
phone:
 
We're Sorry! No dealers were found within 20 miles of the Zip Code you provided. Click here to request the location of the dealer nearest you.