Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter("gform_confirmation", "idx_redirect", 10, 4);
- function idx_redirect($confirmation, $form, $lead, $ajax){
- $search_url = save_user_search($lead);
- if($form["id"] == "6")
- {
- $confirmation = array("redirect" => $search_url);
- }
- return $confirmation;
- }
- function save_user_search ($formData) {
- $idx_area = add_area($formData[54]);
- $idx_type = add_propType($formData[55]);
- $idx_redirect = "http://www.homesforsale.alphainvestments-ct.com/idx/10601/userSaveSearch.php?stp=advanced&idxID=064&pt=sfr&showField=cityField&lp=1000&hp=";
- $idx_redirect .= $formData[44];
- $idx_redirect .= "&ba=0&srt=DESC&start=0&per=25";
- $idx_redirect .= $idx_area;
- $idx_redirect .= $idx_type;
- $idx_redirect .= "&cid10601&savedResultsLink=y";
- return $idx_redirect;
- }
- function add_area ($area) {
- $idxArea = ( explode (",",$area));
- foreach ($idxArea as $value)
- {
- $value = "aw_area[]=" . $value;
- return $value;
- }
- if ($idxArea[0] == 0)
- {
- $idxArea[0] = "&" . $idxArea[0];
- }
- return implode("&",$idxArea);
- }
- function add_propType ($property) {
- $propType = array($propType);
- $formProp = array("foreclosure", "short sale", "probate", "fixer upper", "condo", "waterfront", "equestrian", "turn key");
- $idxProp = array("%22bank+owned%22+%22proof+of+funds%22+%22homepath%22+%22hud+home%22+%22hud+property%22+%22hud+owned%22+%22foreclosure%22+%22pre-qual%22+%22prequal%22+%22freddie%22+%22fannie%22+%22pre-approval%22", "%22bank+approval%22+%22shortsale+approval%22+%22short+sale+approval%22+%22lender+approval%22+%22lien+holder+approval%22+%22third+party+approval%22+%223rd+party+approval%22", "%22probate%22+%22estate+property%22");
- $idxType = str_ireplace($formProp, $idxProp, $propType);
- if ($idxType["id"] == 0)
- {
- $idxType[0] = "&kw_remarksConcat=" . $idxType[0];
- }
- return implode("+",$idxType);
- }
Advertisement
Add Comment
Please, Sign In to add comment