示例#1
0
                case UPLOAD_ERR_PARTIAL:
                    $post['_formError'] = "The file was only partially uploaded.";
                    break;
                case UPLOAD_ERR_NO_FILE:
                    $post['_formError'] = "No file was uploaded.";
                    break;
                default:
                    $post['_formError'] = "A strange internal error has occured.  Please contact the Exponent Developers.";
                    break;
            }
            pathos_sessions_set("last_POST", $post);
            header("Location: " . $_SERVER['HTTP_REFERER']);
            exit("");
        }
    }
    $listing = listing::update($_POST, $listing);
    $listing->location_data = serialize($loc);
    if ($file != null) {
        $listing->file_id = $db->insertObject($file, 'file');
    } else {
        if (!isset($listing->id)) {
            $listing->file_id = 0;
        }
    }
    if (isset($listing->id)) {
        $db->updateObject($listing, "listing");
    } else {
        $db->insertObject($listing, "listing");
    }
    pathos_flow_redirect();
} else {
示例#2
0
 public function searchlisting()
 {
     $json = Input::get('data.country_id');
     $agent_id = Input::get('data.agent_id');
     $meta_key = Input::get('data.meta_key');
     $meta_value = Input::get('data.meta_value');
     $values = explode(',', $json);
     if (empty($agent_id) || is_null($agent_id)) {
         return 'agent_ID should be blank';
     }
     if (!empty($meta_key) && !is_null($meta_key)) {
         $searchmap['listing_details.meta_key'] = $meta_key;
     }
     if (!empty($meta_value) && !is_null($meta_value)) {
         $searchmap['listing_details.meta_value'] = $meta_value;
     }
     //if above array $searchmap is empty then it return all agents
     $price = listing::join('listing_details', 'post_id', '=', 'id')->where('listing.post_author', '=', $agent_id)->where($searchmap)->whereIn('cat_id', $values)->get();
     $jsonVariable["TotalRecords"] = count($price);
     $jsonVariable["DATA"] = $price;
     return Response::json($jsonVariable);
 }
示例#3
0
 public function phone_hits($id)
 {
     $today = date("Y-m-d H:i:s");
     $fiveday = date("Y-m-d H:i:s", strtotime('-30 days'));
     $tenday = date("Y-m-d H:i:s", strtotime('-60 days'));
     $fifday = date("Y-m-d H:i:s", strtotime('-90 days'));
     $twentyday = date("Y-m-d H:i:s", strtotime('-120 days'));
     $tfiveday = date("Y-m-d H:i:s", strtotime('-150 days'));
     $thurtyday = date("Y-m-d H:i:s", strtotime('-175 days'));
     $thurtyfiveday = date("Y-m-d H:i:s", strtotime('-200 days'));
     //$jsonVariable;
     $thdays = listing::join('listing_details', 'post_id', '=', 'id')->where('listing.post_author', '=', $id)->where('listing_details.meta_key', '=', 'phone_hits')->where('listing_details.meta_value', '>=', $fiveday)->where('listing_details.meta_value', '<=', $today)->get(array('meta_key AS value'))->count();
     $sixdays = listing::join('listing_details', 'post_id', '=', 'id')->where('listing.post_author', '=', $id)->where('listing_details.meta_key', '=', 'phone_hits')->where('listing_details.meta_value', '>=', $tenday)->where('listing_details.meta_value', '<=', $fiveday)->get(array('meta_key AS value'))->count();
     $nindays = listing::join('listing_details', 'post_id', '=', 'id')->where('listing.post_author', '=', $id)->where('listing_details.meta_key', '=', 'phone_hits')->where('listing_details.meta_value', '>=', $fifday)->where('listing_details.meta_value', '<=', $tenday)->get(array('meta_key AS value'))->count();
     $twedays = listing::join('listing_details', 'post_id', '=', 'id')->where('listing.post_author', '=', $id)->where('listing_details.meta_key', '=', 'phone_hits')->where('listing_details.meta_value', '>=', $twentyday)->where('listing_details.meta_value', '<=', $fifday)->get(array('meta_key AS value'))->count();
     $fifdays = listing::join('listing_details', 'post_id', '=', 'id')->where('listing.post_author', '=', $id)->where('listing_details.meta_key', '=', 'phone_hits')->where('listing_details.meta_value', '>=', $tfiveday)->where('listing_details.meta_value', '<=', $twentyday)->get(array('meta_key AS value'))->count();
     $sevdays = listing::join('listing_details', 'post_id', '=', 'id')->where('listing.post_author', '=', $id)->where('listing_details.meta_key', '=', 'phone_hits')->where('listing_details.meta_value', '>=', $thurtyday)->where('listing_details.meta_value', '<=', $tfiveday)->get(array('meta_key AS value'))->count();
     $twdays = listing::join('listing_details', 'post_id', '=', 'id')->where('listing.post_author', '=', $id)->where('listing_details.meta_key', '=', 'phone_hits')->where('listing_details.meta_value', '>=', $thurtyfiveday)->where('listing_details.meta_value', '<=', $thurtyday)->get(array('meta_key AS value'))->count();
     $one = $thdays['value'];
     $two = $sixdays['value'];
     $three = $nindays['value'];
     $four = $twedays['value'];
     $five = $fifdays['value'];
     $six = $sevdays['value'];
     $seven = $twdays['value'];
     if (empty($one)) {
         $one = '0';
     }
     if (empty($two)) {
         $two = '0';
     }
     if (empty($three)) {
         $three = '0';
     }
     if (empty($four)) {
         $four = '0';
     }
     if (empty($five)) {
         $five = '0';
     }
     if (empty($six)) {
         $six = '0';
     }
     if (empty($seven)) {
         $seven = '0';
     }
     $phone_hits = "{ y: '7 days', a: " . $one . " },{ y: '14 days', a: " . $two . " },{ y: '21 days', a: " . $three . " },{ y: '28 days', a: " . $four . " },{ y: '35 days', a: " . $five . " },{ y: '42 days', a: " . $six . " },{ y: '49 days', a: " . $seven . " }";
     $phone_hitsData['phone_hits'] = $phone_hits;
     return $phone_hitsData;
 }
示例#4
0
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: edit_listing.php,v 1.2 2005/02/19 16:53:35 filetreefrog Exp $
##################################################
if (!defined("PATHOS")) {
    exit("");
}
$listing = null;
if (isset($_GET['id'])) {
    $listing = $db->selectObject("listing", "id=" . $_GET['id']);
    if ($listing != null) {
        $loc = unserialize($listing->location_data);
    }
}
if (pathos_permissions_check("manage", $loc)) {
    $config = $db->selectObject('listingmodule_config', "location_data='" . serialize($loc) . "'");
    if ($config == null) {
        //do nothing here yes.
    }
    $form = listing::form($listing);
    $form->location($loc);
    $form->meta("action", "save_listing");
    $template = new template("listingmodule", "_form_editlisting", $loc);
    $template->assign("is_edit", isset($listing->id) ? 1 : 0);
    $template->assign("form_html", $form->toHTML());
    $template->output();
} else {
    echo SITE_403_HTML;
}