コード例 #1
0
ファイル: ShortTextWidget.php プロジェクト: jasonhai/onehome
 /**
  * Renders the content of the portlet.
  */
 public function run()
 {
     $shortTextTpl = '<span class="short-text" title="Click to view">%s</span>';
     $fullTextTpl = '<span class="full-text hide">%s</span>';
     Yii::app()->clientScript->registerScript('short-text-widget', "\n\t\t\t\$('body').on('click', '.short-text', function() {\n\t\t\t\t\$(this).hide();\n\t\t\t\t\$(this).siblings('.full-text').removeClass('hide');\n\t\t\t\t\$.get(\$(this).siblings('.short-text-url').val());\n\t\t\t});\n\t\t");
     echo sprintf($shortTextTpl, InputHelper::stripoff($this->text, 4)) . sprintf($fullTextTpl, $this->text) . CHtml::hiddenField('', $this->urlOnCLick, array('class' => 'short-text-url'));
 }
コード例 #2
0
 private function generateForm()
 {
     $this->form = "";
     $this->form .= '<form class="UsersOnlineApplicationsForm" ' . 'name="UsersOnlineApplicationsForm" ' . 'action="' . $this->urlHelper->getThisPage() . '" ' . 'method="post" accept-charset="UTF-8" autocomplete="on">';
     $this->form .= '<table class="UsersOnlineApplicationsFormTable" >';
     $fio = InputHelper::textBox('fio', 'fio', 'fio', 200, true, null);
     $this->form .= InputHelper::createFormRow($fio, true, 'Представьтесь');
     $phone = InputHelper::textBox('phone', 'phone', 'phone', 200, true, null);
     $this->form .= InputHelper::createFormRow($phone, true, 'Контактный номер');
     $message = InputHelper::textarea('message', 'message', 'message', 50000, false, null);
     $this->form .= InputHelper::createFormRow($message, false, 'Дополнительная информация');
     $captcha = InputHelper::textBox("captcha", "captcha", "captcha", 20, true, null);
     $this->form .= InputHelper::createFormRow($captcha, true, getCaptcha(120, 25));
     $this->form .= '</table>';
     $this->form .= '<center>';
     $this->form .= '<input class="UsersOnlineApplicationsFormSubmit" type="submit" name="UsersOnlineApplicationsFormSubmit" value="Перезвоните мне">';
     $this->form .= '</center>';
     $this->form .= '</form>';
 }
コード例 #3
0
ファイル: _property-item.php プロジェクト: jasonhai/onehome
echo (int) $model->view_count;
?>
 views</div>
					<div class="col-xs-7">
						<div class="addthis_native_toolbox" data-title="<?php 
echo CHtml::encode($propName);
?>
"
							 data-url="<?php 
echo $propUrl;
?>
"></div>
					</div>
				</div>
			</div>
			<div class="author">Posted by: 
				<span class="author-image">
					<?php 
echo InputHelper::holderImage($model->rUser->getAvatarUrl(27, 27), 27, 27);
?>
				</span> 
				<a href="<?php 
echo $linkAgent;
?>
"><?php 
echo $sp->first_name . " " . $sp->last_name;
?>
</a></div>
		</div>
	</div>
</div>
 private function generateForm()
 {
     $form = "<div class='TransitionStatusApplicationFormBlock'>";
     $form .= '<form class="TransitionStatusApplicationForm" ' . 'name="TransitionStatusApplicationForm" ' . 'action="' . $this->urlHelper->chengeParams(array($this->applicationId, 'TransitionStatus', $this->endStatus, 'apply')) . '" ' . 'enctype="multipart/form-data" ' . 'method="post" ' . 'accept-charset="UTF-8">';
     $form .= "<div class='TransitionStatusApplicationMessage'>Поясните причину смены статуса</div>";
     $form .= InputHelper::textarea('TransitionStatusApplicationFormComments', 'TransitionStatusApplicationFormComments', 'TransitionStatusApplicationFormComments', 2000, TRUE, '');
     $form .= '<center>';
     $form .= '<input ' . 'class="TransitionStatusApplicationFormButton Yes" ' . 'type="submit" ' . 'name="TransitionStatusApplicationFormSubmit" ' . 'value="Изменить статус">';
     $form .= '<a href="' . $this->urlHelper->chengeParams(array($this->applicationId, 'Show')) . '"><input ' . 'class="TransitionStatusApplicationFormButton No" ' . 'type="button" ' . 'name="TransitionStatusApplicationFormButton" ' . 'value="отменить"></a>';
     $form .= '</center>';
     $form .= "</form>";
     $form .= "</div>";
     return $form;
 }
コード例 #5
0
ファイル: our-services.php プロジェクト: jasonhai/onehome
<?php 
$this->beginWidget('system.web.widgets.CClipWidget', array('id' => 'top-banner'));
?>
<div style="position: relative" class="hidden-xs">
	<div id="service-slider" class="royalSlider heroSlider rsMinW">
		<?php 
foreach (OurService::getMainCategories() as $k => $category) {
    ?>
		<?php 
    if ($category->id == $model->id) {
        $startSlideId = $k;
    }
    ?>
		<div class="rsContent"> 
			<?php 
    echo InputHelper::holderImage($category->getImageUrl(1903, 407), 1903, 407, array('class' => 'rsImg'));
    ?>
			<span class="rsTmb"><?php 
    echo $category->name;
    ?>
</span>
		</div>
		<?php 
}
?>
	</div>
	<div class="service-tab">
		<div class="container"><div class="table-responsive"><!-- content added by js --></div></div>
	</div>
</div>
コード例 #6
0
ファイル: forum.php プロジェクト: jasonhai/onehome
    if ($index % 4 == 0) {
        ?>
	<div class="row">
	<?php 
    }
    ?>

	<div class="col-md-3">
		<div class="item">
			<h4><?php 
    echo $forum['name'];
    ?>
</h4>
			<div style="padding: 10px">
				<p class="image"><?php 
    echo InputHelper::holderImage($forum['image'], 258, 141);
    ?>
</p>
				<p><?php 
    echo $forum['desc'];
    ?>
</p>
			</div>
			<a href="<?php 
    echo $forum['link'];
    ?>
" target="_blank" class="read-more">READ MORE</a>
		</div>
	</div>

	<?php 
コード例 #7
0
    function _dealercloud($atts, $content = null)
    {
        $p = InputHelper::get($_REQUEST, 'p');
        $m = InputHelper::get($_REQUEST, 'm');
        $page_id = InputHelper::get($_REQUEST, 'page_id');
        $cat = InputHelper::get($_REQUEST, 'cat');
        $permalink_structure = get_option('permalink_structure');
        if ($permalink_structure == '') {
            $baseUrl = "?page_id=" . $page_id . "&cat=" . $cat . "&p=" . $p . "&m=" . $m . "&";
        } else {
            $baseUrl = "?";
        }
        $ru = $_SERVER['REQUEST_URI'];
        $i1 = strpos($ru, 'action/view_details/');
        if ($i1 !== false) {
            $i1 += 20;
            $i2 = strpos($ru, '/', $i1);
            if ($i2 === false) {
                $_REQUEST['id'] = substr($ru, $i1);
            } else {
                $_REQUEST['id'] = substr($ru, $i1, $i2 - $i1);
            }
            $_REQUEST['action'] = 'view_details';
        }
        $folder = WP_PLUGIN_URL . '/DealerCloud';
        $client = new Client();
        $rest = '<script type="text/javascript" src="' . $folder . '/res/js/jquery-1.3.min.js"></script>
        <script type="text/javascript" src="' . $folder . '/res/js/jquery.corner.js"></script>
        <script type="text/javascript" src="' . $folder . '/res/js/awe.js"></script>';
        $vars = (object) array("make" => InputHelper::get($_REQUEST, "make"), "model" => InputHelper::get($_REQUEST, "model"), "minPrice" => InputHelper::get($_REQUEST, "minPrice"), "maxPrice" => InputHelper::get($_REQUEST, "maxPrice"), "minYear" => InputHelper::get($_REQUEST, "minYear"), "maxYear" => InputHelper::get($_REQUEST, "maxYear"), "keyword" => InputHelper::get($_REQUEST, "keyword"), "stockType" => InputHelper::get($_REQUEST, "stockType"), "feat" => InputHelper::get($_REQUEST, "feat"), "spec" => InputHelper::get($_REQUEST, "spec"), "classCode" => InputHelper::get($_REQUEST, "classCode"), "sortBy" => InputHelper::get($_REQUEST, "sortBy", "make"), "sortType" => InputHelper::get($_REQUEST, "sortType", "asc"), "display" => InputHelper::get($_REQUEST, "disp", "L"), "page" => InputHelper::get($_REQUEST, "page_num", "1"));
        if (InputHelper::get($_REQUEST, 'action') == 'view_details') {
            // Vehicle details page
            $vehicle = $client->getVehicle($_REQUEST["id"]);
            $dealer = $vehicle["dealer"];
            $photos = $vehicle["photos"];
            // CONTACT FORM SUBMIT HANDLER
            $firstName = "";
            $lastName = "";
            $phone = "";
            $email = "";
            $address = "";
            $city = "";
            $state = "";
            $zip = "";
            $message = "";
            if (isset($_POST["submitContact"]) && isset($_POST['g-recaptcha-response'])) {
                $recaptcha = new \ReCaptcha\ReCaptcha(get_option('recaptcha_private_key'));
                $resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
                $firstName = InputHelper::get($_REQUEST, "firstName");
                $lastName = InputHelper::get($_REQUEST, "lastName");
                $phone = InputHelper::get($_REQUEST, "phone");
                $email = InputHelper::get($_REQUEST, "email");
                $address = InputHelper::get($_REQUEST, "address");
                $city = InputHelper::get($_REQUEST, "city");
                $state = InputHelper::get($_REQUEST, "state");
                $zip = InputHelper::get($_REQUEST, "zip");
                $message = InputHelper::get($_REQUEST, "message");
                if ($resp->isSuccess()) {
                    $err = "Error:<br />";
                    if ($firstName == "" || $lastName == "") {
                        $err .= "First and Last name are required<br />";
                    }
                    if ($email == "") {
                        $err .= "Email is required";
                    }
                    if ($err != "Error:<br />") {
                        $sendMessageRes = "<div class='nosentMessage'>{$err}</div";
                    } else {
                        //submit message
                        $retVal = $client->SendMessage(array("veh_id" => $vehicle["id"], "first_name" => $firstName, "last_name" => $lastName, "phone" => $phone, "email" => $email, "address" => $address, "city" => $city, "state" => $state, "zip_code" => $zip, "message" => $message));
                        if ($retVal) {
                            $sendMessageRes = "<div class='sentMessage'>Message sent successfully!</div>";
                        } else {
                            $sendMessageRes = "<div class='nosentMessage'>{$err} Failed to send message!<br />Please try again.</div>";
                            //                            $sendMessageRes = "<div class='nosentMessage'>"$err . $client->error . "</div>";
                        }
                    }
                } else {
                    # set the error code so that we can display it
                    //                    $sendMessageRes = "<div class='nosentMessage'><p>The following error was returned:";
                    //                    foreach ($resp->getErrorCodes() as $code) {
                    //                        $sendMessageRes .= "'<tt>' , $code , '</tt> '";
                    //                    }
                    //                    $sendMessageRes .= "</p></div>";
                    $sendMessageRes = "<div class='nosentMessage'>{$err} reCAPTCHA verification failed!</div>";
                }
            }
            // RECENTLY VIEWED ITEMS ADD COOKIE
            //            $cookieName = "awerecent_" . $vehicle["id"];
            //            setcookie($cookieName, time() . "||" . $vehicle["year"] . " " . $vehicle["make"] . " " . $vehicle["model"], time() + 604800, "/");
            if (isset($sendMessageRes)) {
                $rest .= $sendMessageRes;
            }
            // BEGIN PAGE HTML
            $rest .= '
    <div class="vehicleBackfg" id="vehBack_Round">
        <div class="detailsContainer">
            <div class="detailNavfg" id="vehNav_Round">
                <div class="detailsDealerHeader">';
            // Back to search
            $vars = isset($_SESSION["vars"]) ? $_SESSION["vars"] : null;
            $backUrl = $baseUrl;
            if ($vars != null) {
                $backUrl .= "make=" . $vars->make;
                $backUrl .= "&model=" . $vars->model;
                $backUrl .= "&minYear=" . $vars->minYear;
                $backUrl .= "&maxYear=" . $vars->maxYear;
                $backUrl .= "&minPrice=" . $vars->minPrice;
                $backUrl .= "&maxPrice=" . $vars->maxPrice;
                $backUrl .= "&keyword=" . $vars->keyword;
                $backUrl .= "&sortBy=" . $vars->sortBy;
                $backUrl .= "&sortType=" . $vars->sortType;
                $backUrl .= "&feat=" . $vars->feat;
                $backUrl .= "&spec=" . $vars->spec;
                $backUrl .= "&classCode=" . $vars->classCode;
                $backUrl .= "&disp=" . $vars->display;
                $backUrl .= "&p=" . $vars->page;
            }
            $rest .= '<a href="' . $backUrl . '" class="backSearch">Back to search</a></div>
            </div>
            <div class="detailsHeader">
            <h2>';
            // Title
            if ($vehicle["cmpg"] >= "21") {
                $rest .= "<img src='{$folder}/res/img/leaf1.png' align='absmiddle'>";
            }
            $rest .= $vehicle["year"] . " " . $vehicle["make"] . " " . $vehicle["model"] . " " . $vehicle["trim"];
            $rest .= '<span style="text-transform:none; font-size:16px; line-height:26px;">';
            // Price
            $price = number_format(floatval($vehicle["price"]));
            if ($price != 0) {
                $rest .= "<br />Your Price: <span style=\"font-size:16px; font-weight:bolder; color:#FF0000;\">\$" . $price . "</span>";
            } else {
                $rest .= "[Contact for Price]";
            }
            // Photos
            $rest .= '</span>
               </h2>
            </div>

            <div class="photoDiv">
                <div class="photoRow">
                    <div class="mainPhoto">';
            $firstPhoto = "";
            if (is_array($photos) && count($photos) > 0) {
                $firstPhoto = $photos[0];
            }
            if ($firstPhoto == "") {
                $firstPhoto = $folder . "/res/img/noimage.gif";
            }
            $photoString = $vehicle["year"] . " " . $vehicle["make"] . " " . $vehicle["model"] . " " . $vehicle["trim"] . " / " . $dealer["company"];
            if ($dealer["city"] != "") {
                $photoString .= " / " . $dealer["city"];
            }
            if ($dealer["state"] != "") {
                $photoString .= " / " . $dealer["state"];
            }
            if ($dealer["zip_code"] != "") {
                $photoString .= " / " . $dealer["zip_code"];
            }
            $rest .= '
                <div class="gallery">
                    <img id="mainPhoto" src="' . $firstPhoto . '" class="pborder" border="0" title="Cars for sale / ' . $photoString . '" alt="cars for sale / ' . $photoString . '" width="400">
                </div>
                <div class="photoThumbs">';
            $photosShown = 0;
            if (is_array($photos) && count($photos) > 0) {
                foreach ($photos as $photo) {
                    if ($photosShown++ % 6 == 0) {
                        $rest .= "<br style='clear:both'/>";
                    }
                    $rest .= '<a href="javascript:swapPhoto(\'mainPhoto\', \'' . $photo . '\');"><img src="' . $photo . '" class="pborder2" align="middle" border="0" width="70"></a>';
                }
            }
            // Details
            $rest .= '
                </div>
                <br />
                <div class="clear"></div>
                </div>
                <div class="detailsdiv2" id="details_Round">';
            if ($vehicle["price"] != "") {
                $rest .= '<div class="detailsdiv" style="border-top:none;">Price: &nbsp;';
                if ($price != 0) {
                    $rest .= "\$" . $price;
                } else {
                    $rest .= " [Contact for Price]";
                }
                $rest .= '
                </div>';
            }
            if (array_key_exists("vin", $vehicle) && $vehicle["vin"] != "") {
                $rest .= '<div class="detailsdiv">Vin: &nbsp;' . $vehicle["vin"] . '</div>';
            }
            if (array_key_exists("stock", $vehicle) && $vehicle["stock"] != "") {
                $rest .= '<div class="detailsdiv">Stock #: &nbsp;' . $vehicle["stock"] . '</div>';
            }
            if (array_key_exists("mileage", $vehicle) && $vehicle["mileage"] > 0) {
                $rest .= '<div class="detailsdiv">Mileage: &nbsp;' . number_format(floatval($vehicle["mileage"])) . '</div>';
            }
            if (array_key_exists("exterior_color", $vehicle) && $vehicle["exterior_color"] != "") {
                $rest .= '<div class="detailsdiv">Exterior Color: &nbsp;' . $vehicle["exterior_color"] . '</div>';
            }
            if (array_key_exists("interior_color", $vehicle) && $vehicle["interior_color"] != "") {
                $rest .= '<div class="detailsdiv">Interior Color: &nbsp;' . $vehicle["interior_color"] . '</div>';
            }
            if (array_key_exists("body_door_count", $vehicle) && $vehicle["body_door_count"] > 0) {
                $rest .= '<div class="detailsdiv"># of Doors: &nbsp;' . $vehicle["body_door_count"] . '</div>';
            }
            if (array_key_exists("engine", $vehicle) && $vehicle["engine"] != "") {
                $rest .= '<div class="detailsdiv">Engine: &nbsp;' . $vehicle["engine"] . '</div>';
            }
            if (array_key_exists("trans", $vehicle) && $vehicle["trans"] != "") {
                $rest .= '<div class="detailsdiv">Trans: &nbsp;' . $vehicle["trans"] . '</div>';
            }
            if (array_key_exists("drive", $vehicle) && $vehicle["drive"] != "") {
                $rest .= '<div class="detailsdiv">Drive: &nbsp;' . $vehicle["drive"] . '</div>';
            }
            if (array_key_exists("classification", $vehicle) && $vehicle["classification"] != "") {
                $rest .= '<div class="detailsdiv">Class: &nbsp;' . $vehicle["classification"] . '</div>';
            }
            if (array_key_exists("cmpg", $vehicle) && $vehicle["cmpg"] > 0) {
                $rest .= '<div class="detailsdiv">City / Hwy (mpg): &nbsp;' . $vehicle["cmpg"] . ' / ' . $vehicle["hmpg"] . '</div>';
            }
            // Buttons - Financing and CarFax
            if (true) {
                $rest .= '<br />
                <div class="buttons" id="buttons_Round">
                        <a href="#" style="border:none;">
                            <img src="' . $folder . '/res/img/applyfin.gif" alt="financing" style="border:none;" /></a><br />
                        <a style="border:none;" href="' . $vehicle["carfax"]["report_url"] . '">
                            <img src="' . $vehicle["carfax"]["report_image"] . '" style="border:none;" />
                        </a>';
                if ($vehicle["carfax"]["one_owner"]) {
                    $rest .= '<br /><img src="' . $vehicle["carfax"]["one_owner_image"] . '" />';
                }
                $rest .= '</div>';
            }
            $rest .= '</div>
            </div>';
            // Features
            if (array_key_exists("standard_features", $vehicle) && $vehicle["standard_features"] != "" || array_key_exists("features", $vehicle) && $vehicle["features"] != "") {
                $rest .= '
                <div class="featurestitle">
                    Features / Options
                </div>

                <div class="detailscontainer2">
                    <div style="clear:both" />
                    <div class="standardFeatures">
                        <ul>';
                $features = [];
                if (array_key_exists("features", $vehicle) && $vehicle["features"] != "") {
                    $features = array_merge($features, explode("|", $vehicle["features"]));
                }
                if (array_key_exists("standard_features", $vehicle) && $vehicle["standard_features"] != "") {
                    $features = array_merge($features, explode("|", $vehicle["standard_features"]));
                }
                foreach ($features as $feat) {
                    if ($feat != "") {
                        $features2 = explode(",", $feat);
                        foreach ($features2 as $feat2) {
                            if ($feat2 != "") {
                                $rest .= '<li>' . trim($feat2) . '</li>';
                            }
                        }
                    }
                }
                $rest .= '</ul>
                        </div>
                        <div class="featureClick">
                            Standard equipment and options shown. Some features may not be available.  Contact us for details.
                        </div>
                    </div>
                    <br />';
            }
            // Notes
            if (array_key_exists("comments", $vehicle) && $vehicle["comments"] != "") {
                $rest .= '
                <div class="featurestitle">
                    Notes
                </div>
                <div class="detailscontainer2">
                    <div>' . $vehicle["comments"] . '</div>
                </div>
                <br />';
            }
            // Contact form
            $rest .= '';
            $rest .= '
            <div class="featurestitle">
                Contact Us About This Vehicle
            </div>
            <div class="detailscontainer2">
                <form id="f" name="f" method="post" action="' . $_SERVER["REQUEST_URI"] . '">
                    <div>
                        Questions about this ' . $vehicle["make"] . '?  Please fill out the quick form below.
                    </div>
                    <br />
                    <div class="contactform">
                        <div class="contactformrow">
                            <div class="contactformcell">
                                First Name *
                                <br />
                                <input type="text" name="firstName" value="' . $firstName . '"/>
                            </div>
                            <div class="contactformcell">
                                Last Name *
                                <br />
                                <input type="text" name="lastName" value="' . $lastName . '"/>
                            </div>
                            <br style="clear:both" />
                            <div class="contactformcell">
                                Email *
                                <br />
                                <input type="text" name="email" value="' . $email . '"/>
                            </div>
                            <div class="contactformcell">
                                Phone
                                <br />
                                <input type="text" name="phone" value="' . $phone . '"/>
                            </div>
                        </div>
                    </div>
                    <br style="clear:both" />
                    <div class="contactform">
                            <div class="contactformcell2">
                                Comments
                                <br />
                                <textarea name="message" cols="40" rows="6">' . $message . '</textarea>
                                <br style="clear:both" />
                                <script src="https://www.google.com/recaptcha/api.js"></script>
                                <div class="verification">
                                    Verification *
                                    <br />
                                    <div class="g-recaptcha" data-sitekey="' . get_option('recaptcha_public_key') . '"></div>
                                </div>
                                <br style="clear:both" />
                                <input name="submitContact" type="submit" value="submit" class="submit" />
                            </div>
                    </div>
                </form>
            </div>';
            $rest .= '<div>';
            /* Only show map if this is not a dealix vehicle */
            // Map
            //            if(false && array_key_exists("dealix_vehicle_id", $vehicle) && $vehicle['dealix_vehicle_id'] == 0) {
            //                $map = new PhoogleMap();
            //                /**** Google Maps API Key Needs to be placed here****/
            //                $map->setAPIKey($config->GoogleMapsAPIKey);
            //                ob_start();
            //                $map->printGoogleJS();
            //                $map->addAddress($dealer["address1"] . ", " . $dealer["city"] . ", " . $dealer["state"] . " " . $dealer["zip_code"]);
            //                $map->showMap();
            //                $rest .= ob_get_clean();
            //            }
            $rest .= '</div>
                  </div>
                </div>
              </div>
            </div>';
        } else {
            if (InputHelper::get($_REQUEST, 'action') == 'clear_recent') {
                // Clear recent cookies
                //Killing the cookie:
                $cookie_name = "awerecent_" . $_GET["id"];
                //here we assign a "0" value to the cookie, i.e. disabling the cookie:
                $cookie_value = "";
                //When deleting a cookie you should assure that the expiration date is in the past,
                //to trigger the removal mechanism in your browser.
                $cookie_expire = time() - 60;
                $cookie_domain = "";
                setcookie($cookie_name, $cookie_value, $cookie_expire, "/", $cookie_domain, 0);
                $backUrl = $baseUrl;
                if ($vars != null) {
                    $backUrl .= "make=" . $vars->make;
                    $backUrl .= "&model=" . $vars->model;
                    $backUrl .= "&minYear=" . $vars->minYear;
                    $backUrl .= "&maxYear=" . $vars->maxYear;
                    $backUrl .= "&minPrice=" . $vars->minPrice;
                    $backUrl .= "&maxPrice=" . $vars->maxPrice;
                    $backUrl .= "&keyword=" . $vars->keyword;
                    $backUrl .= "&sortBy=" . $vars->sortBy;
                    $backUrl .= "&sortType=" . $vars->sortType;
                    $backUrl .= "&feat=" . $vars->feat;
                    $backUrl .= "&spec=" . $vars->spec;
                    $backUrl .= "&classCode=" . $vars->classCode;
                    $backUrl .= "&disp=" . $vars->display;
                    $backUrl .= "&p=" . $vars->page;
                }
                header("Location:{$backUrl}");
                exit;
            } else {
                // Main homepage / inventory page / search page
                //set some default values
                if ($vars->sortType != "asc" && $vars->sortType != "desc") {
                    $vars->sortType = "asc";
                }
                if ($vars->page == "" || $vars->page < 1) {
                    $vars->page = 1;
                }
                $_SESSION["vars"] = $vars;
                $pagerSize = 10;
                $pageSize = 10;
                $vehicles = $client->GetVehicles(array("make" => $vars->make, "model" => $vars->model, "min_price" => $vars->minPrice, "max_price" => $vars->maxPrice, "min_year" => $vars->minYear, "max_year" => $vars->maxYear, "keyword" => $vars->keyword, "stock_type" => $vars->stockType, "featured" => $vars->feat, "special" => $vars->spec, "class_code" => $vars->classCode, "page" => $vars->page, "page_size" => $pageSize, "sort_by" => $vars->sortBy, "sort_type" => $vars->sortType));
                // PAGING
                $totalPages = ceil($vehicles["total_count"] / $pageSize);
                $offset = $vars->page % 10;
                if ($offset == 0) {
                    $firstPage = $vars->page - $pagerSize;
                } else {
                    $firstPage = $vars->page - $offset;
                }
                $lastPage = $firstPage + $pagerSize;
                if ($firstPage > $totalPages) {
                    $firstPage = $totalPages;
                }
                if ($lastPage > $totalPages) {
                    $lastPage = $totalPages;
                }
                // RECENTLY VIEWED
                $recent = array();
                foreach ($_COOKIE as $k => $v) {
                    if (substr($k, 0, 10) == 'awerecent_') {
                        $vPart = explode("||", $v);
                        $kPart = explode("_", $k);
                        $id = $kPart[1];
                        if ($vPart[1] != "") {
                            $recent[] = array("time" => $vPart[0], "veh" => $vPart[1], "id" => $id);
                        }
                    }
                }
                foreach ($recent as $key => $row) {
                    $time[$key] = $row['time'];
                    $veh[$key] = $row['veh'];
                    $id[$key] = $row['id'];
                }
                if (count($recent) > 0) {
                    array_multisort($time, SORT_DESC, $recent);
                }
                // SEARCH FORM
                // Makes
                $rest .= '
        <script type="text/javascript">
            var SITE_FOLDER = "' . $folder . '";
        </script>

        <script type="text/javascript" src="' . $folder . '/res/js/make-model.js"></script>
        <form name="frmFilter" action="' . $baseUrl . '" method="post">
        <div>
            <div class="blueRfg" id="search_Round">

        <div class="formdiv">
            <div class="form1">
                <label class="desc">Make</label>
                <select name="make" id="make" style="font-size:16px;width:100%" onChange="getModels();">
                <option value=""></option>';
                //                <option value="">-- Any --</option>';
                $makes = $client->GetMakes();
                foreach ($makes as $m) {
                    $selected = "";
                    if ($vars->make == $m) {
                        $selected = "selected";
                    }
                    $rest .= "<option {$selected} value='{$m}'>{$m}</option>";
                }
                // Models
                $rest .= '
                </select>

                <label class="desc">Model</label>
                <select name="model" id="model" style="font-size:16px;width:100%">';
                //                    <option value="">-- Any --</option>';
                if ($vars->make != "" && $vars->model != "") {
                    $models = $client->GetModels($vars->make);
                    foreach ($models as $m) {
                        $selected = "";
                        if ($vars->model == $m) {
                            $selected = "selected";
                        }
                        $rest .= "<option {$selected} value='{$m}'>{$m}</option>";
                    }
                }
                $rest .= '
                </select>
            </div>

            <div class="form2">
                <label class="desc">Min Price</label>
                <select name="minPrice" style="font-size:16px;width:100%">
                    <option value=""></option>';
                // Min Price
                for ($minp = 0; $minp <= 100000; $minp += 5000) {
                    $selected = "";
                    if ($minp == $vars->minPrice and $minp > 0) {
                        $selected = "selected";
                    }
                    $rest .= "<option {$selected} value='{$minp}'>\${$minp}</option>";
                }
                // Max Price
                $rest .= '
            </select>

            <label class="desc">Max Price</label>
            <select name="maxPrice" style="font-size:16px;width:100%">
                <option value=""></option>';
                for ($maxp = 100000; $maxp > 0; $maxp -= 5000) {
                    $selected = "";
                    if ($maxp == $vars->maxPrice) {
                        $selected = "selected";
                    }
                    $rest .= "<option {$selected} value='{$maxp}'>\${$maxp}</option>";
                }
                // Min Year
                $rest .= '
                </select>
            </div>
            <div class="form3">
                <label class="desc">Min Year</label>
                <select name="minYear" style="font-size:16px;width:98%">
                    <option value=""></option>';
                for ($yearCnt = date("Y") + 1; $yearCnt >= date("Y") - 25; $yearCnt--) {
                    $selected = "";
                    if ($yearCnt == $vars->minYear) {
                        $selected = "selected";
                    }
                    $rest .= "<option {$selected} value='{$yearCnt}'>{$yearCnt}</option>";
                }
                // Max Year
                $rest .= '
                </select>

                <label class="desc">Max Year</label>
                <select name="maxYear" style="font-size:16px;width:98%">
                    <option value=""></option>';
                for ($yearCnt = date("Y") + 1; $yearCnt >= date("Y") - 25; $yearCnt--) {
                    $selected = "";
                    if ($yearCnt == $vars->maxYear) {
                        $selected = "selected";
                    }
                    $rest .= "<option {$selected} value='{$yearCnt}'>{$yearCnt}</option>";
                }
                // Keyword and Submit
                $rest .= '
                </select>
            </div>

            <div class="form4">
                Keyword <input name="keyword" type="text" value="' . $vars->keyword . '" style="font-size:14px;width:74%" /> <input name="submit" type="submit" value="search" class="submit" style="font-size:12px;" />
            </div>

        </div>
    </div>
        </div>
    </form>';
                // TOTAL MATCHES BAR
                if ($vehicles["total_count"] > 0) {
                    $rest .= '
                <div class="infomessage" id="info_Round">
                <span><span style="font-family:Georgia; font-size:16px;">' . $vehicles["total_count"] . '</span> vehicles match your search!</span>
                </div>';
                } else {
                    $rest .= '
                <div class="nocarsinfomessage id="info_Round"">
                    We could not find any matches, please search again.
                </div>';
                }
                // SORT CONTROL
                $rest .= '
            <div class="resultList">
            <div class="sortBy">Sort By:</div>
            <div class="sortLink">
                <div class="sorter">
                    <div style="width:65px;float:left;">' . ($vars->sortBy == "year" ? '<img src="' . $folder . '/res/img/' . $vars->sortType . '.png" alt="Sort" align="absmiddle" style="float:left;padding-top:5px;" /> ' : '') . '<a href="' . $this->getSortingUrl($baseUrl, $vars, 'year') . '">Year</a></div>
                    <div style="width:65px;float:left;">' . ($vars->sortBy == "make" ? '<img src="' . $folder . '/res/img/' . $vars->sortType . '.png" alt="Sort" align="absmiddle" style="float:left;padding-top:5px;" /> ' : '') . '<a href="' . $this->getSortingUrl($baseUrl, $vars, 'make') . '">Make</a></div>
                    <div style="width:68px;float:left;">' . ($vars->sortBy == "model" ? '<img src="' . $folder . '/res/img/' . $vars->sortType . '.png" alt="Sort" align="absmiddle" style="float:left;padding-top:5px;" /> ' : '') . '<a href="' . $this->getSortingUrl($baseUrl, $vars, 'model') . '">Model</a></div>
                    <div style="width:65px;float:left;">' . ($vars->sortBy == "price" ? '<img src="' . $folder . '/res/img/' . $vars->sortType . '.png" alt="Sort" align="absmiddle" style="float:left;padding-top:5px;" /> ' : '') . '<a href="' . $this->getSortingUrl($baseUrl, $vars, 'price') . '">Price</a></div>
                    <div style="width:65px;float:left;">' . ($vars->sortBy == "mileage" ? '<img src="' . $folder . '/res/img/' . $vars->sortType . '.png" alt="Sort" align="absmiddle" style="float:left;padding-top:5px;" /> ' : '') . '<a href="' . $this->getSortingUrl($baseUrl, $vars, 'mileage') . '">Miles</a></div>
                </div>
            </div>

            <div class="viewLink">
                <div class="sorter">';
                // Gallery or List
                if ($vars->display != "G") {
                    $rest .= '<div style="width:105px;float:left;"><a href="' . $this->getDisplayUrl($baseUrl, $vars) . '">Gallery View</a><img src="' . $folder . '/res/img/gallery.png" alt="Gallery" align="absmiddle" style="float:right;padding-top:5px;" /></div>';
                } else {
                    $rest .= '<div style="width:90px;float:left;"><a href="' . $this->getDisplayUrl($baseUrl, $vars) . '">List View</a><img src="' . $folder . '/res/img/list.png" alt="List" align="absmiddle" style="float:right;padding-top:5px;" /></div>';
                }
                $rest .= '
                    </div>
                </div>
            </div>';
                // GALLERY VIEW
                if ($vars->display == "G" && $vehicles["total_count"] > 0) {
                    $pageCols = 3;
                    $rest .= '<div class="vresultsg">';
                    $i = 0;
                    foreach ($vehicles["list"] as $veh) {
                        $rest .= '<div class="glayout">';
                        if (count($veh["photos"]) > 0) {
                            $firstImage = $veh["photos"][0];
                        } else {
                            $firstImage = $folder . "/res/img/noimage3.gif";
                        }
                        $rest .= '
                        <div class="gallery">
                            <a href="' . $this->getSEOUrl($baseUrl, $veh) . '"><img src="' . $firstImage . '" width="85" alt="' . $veh["year"] . " " . $veh["make"] . " " . $veh["model"] . '" /></a>
                        </div>
                        <div  class="makes">
                            <a href="' . $this->getSEOUrl($baseUrl, $veh) . '">' . ($vars->sortBy == "year" ? '<span class="sorthighlight">' : '') . $veh["year"] . ($vars->sortBy == "year" ? '</span>' : '') . ($vars->sortBy == "make" ? '<span class="sorthighlight">' : '') . $veh["make"] . ($vars->sortBy == "make" ? '</span>' : '') . ($vars->sortBy == "model" ? '<span class="sorthighlight">' : '') . $veh["model"] . ($vars->sortBy == "model" ? '</span>' : '') . '
                            </a>
                        </div>
                    </div>';
                        $i++;
                        if ($i % $pageCols == 0) {
                            $rest .= '<br style="clear:both" />';
                        }
                    }
                    $rest .= '</div>';
                    // LIST VIEW
                } else {
                    if ($vars->display == "L" && $vehicles["total_count"] > 0) {
                        $rest .= '
                <div>';
                        $i = 1;
                        foreach ($vehicles["list"] as $veh) {
                            $cssClass = "resultstable" . $i;
                            $rest .= '
                        <div class="' . $cssClass . '">
                            <div class="resultstablerow">
                                <div class="photocell">';
                            if (count($veh["photos"]) > 0) {
                                $firstImage = $veh["photos"][0];
                            } else {
                                $firstImage = $folder . "/res/img/noimage3.gif";
                            }
                            $rest .= '
                          <div class="gallery">
                          <a href="' . $this->getSEOUrl($baseUrl, $veh) . '"><img src="' . $firstImage . '" width="85" style="border:none;" alt="' . $veh["year"] . " " . $veh["make"] . " " . $veh["model"] . ' / ' . $veh["dealer"]["company"] . ' " title="' . $veh["year"] . " " . $veh["make"] . " " . $veh["model"] . ' / ' . $veh["dealer"]["company"] . ' " /></a>
                          </div>
                      </div>
                      <div class="desccell">
                          <div class="descfont">
                              <div class="descfont1">
                                  <a href="' . $this->getSEOUrl($baseUrl, $veh) . '">
                                  ' . $veh["year"] . ' ' . $veh["make"] . ' ' . $veh["model"] . ' ' . $veh["trim"] . '</a>' . ($veh["cmpg"] >= "21" ? '<img src="' . $folder . '/res/img/leaf1.png">' : '') . '
                              </div>
                          </div>
                          <div class="descfont2">';
                            if (number_format(floatval($veh["price"])) != 0) {
                                $rest .= "\$" . number_format(floatval($veh["price"]));
                            } else {
                                $rest .= "<span style='color:#ff0000'>****</span>";
                            }
                            $rest .= ' | ' . number_format(floatval($veh["mileage"])) . ' miles
                          </div>
                          <div class="summ">#' . $veh["stock"] . ($veh["exterior_color"] != "" ? ", " . $veh["exterior_color"] : "") . ($veh["interior_color"] != "" ? " | " . $veh["interior_color"] : "") . ($veh["cmpg"] != "" ? ", " . $veh["cmpg"] . " mpg" : "");
                            $maxLength = 55;
                            $feat = explode("|", (array_key_exists("standard_features", $veh) ? $veh["standard_features"] : '') . "|" . (array_key_exists("features", $veh) ? $veh["features"] : ''));
                            $temp = "";
                            foreach ($feat as $t) {
                                if ($temp != "") {
                                    $temp .= ", ";
                                }
                                $temp .= $t;
                            }
                            $rest .= substr($temp, 0, $maxLength);
                            if (strlen($temp) > $maxLength) {
                                $rest .= " ...";
                            }
                            $rest .= '
                          </div>
                          <div class="moredetails">';
                            //                                    $rest .= '<a href="'.$this->getSEOUrl($baseUrl, $veh).'">View Details</a> | <a href="'.$this->getSEOUrl($baseUrl, $veh).'">More Photos</a>';
                            $rest .= '</div>
                          </div>
                      </div>
                  </div>';
                            if ($i == 1) {
                                $i++;
                            } else {
                                $i = 1;
                            }
                        }
                        $rest .= '</div>';
                    }
                }
                // PAGE NAV
                $rest .= '
                 <br style="clear:both" />
                 <div class="pagination">
                     <ul>';
                if ($firstPage >= 10) {
                    $rest .= '<li><a href="' . $this->getPagingUrl($baseUrl, $vars, $firstPage) . '"><< Prev 10</a></li>';
                }
                for ($i = $firstPage + 1; $i <= $lastPage; $i++) {
                    $rest .= '<li ' . ($i == $vars->page ? 'class="currentpage"' : '') . '><a href="' . $this->getPagingUrl($baseUrl, $vars, $i) . '">' . $i . '</a></li>';
                }
                if ($lastPage != $totalPages) {
                    $rest .= '<li><a href="' . $this->getPagingUrl($baseUrl, $vars, $lastPage + 1) . '">Next 10 >></a></li>';
                }
                $rest .= '
                    </ul>
                 </div>
                 <br />';
                // RECENTLY VIEWED
                if (count($recent) > 0) {
                    $rest .= '
                 <div style="width:100%; text-align:left; margin-right:20px;">
                 Previously Viewed Vehicles...&nbsp;&nbsp;&nbsp;
                 </div>
                 <div class="recentviewfg" id="recent_Round">
                      <div class="recentList">';
                    $count = 0;
                    foreach ($recent as $rec) {
                        $count++;
                        if ($count > 10) {
                            break;
                        }
                        $rest .= '<span class="recentSpan">&#8226; <a href="' . $baseUrl . 'action=view_details&id=' . $rec["id"] . '">' . $rec["veh"] . '</a>
                          </span>
                          (<a href="' . $baseUrl . 'action=clear_recent&id=' . $rec["id"] . '" class="cleared"><span class="cleared">X</span></a>)
                          <br />';
                    }
                    $rest .= '
                        </div>
                    </div>';
                }
            }
        }
        return $rest;
    }
コード例 #8
0
ファイル: _featured-agent.php プロジェクト: jasonhai/onehome
	</ul>
	<!-- Tab panes -->
	<div class="tab-content">
		<div role="tabpanel" class="tab-pane active">
			<a href="<?php 
echo $this->createUrl('agent/index');
?>
" class="btn btn-alpha pull-right" style="margin-top: 10px">View All</a>
			<div class="roundabout-wrap">
				<ul id="featured-agents" class="roundabout-holder">
					<?php 
foreach ($models as $model) {
    ?>
					<li class="roundabout-moveable-item roundabout-in-focus agent-item">
					<a href="<?php 
    echo $this->createUrl('/agent/view', array('slug' => $model->slug));
    ?>
">
						<div class="clearfix">
							<div class="image">
								<?php 
    echo InputHelper::holderImage($model->getAvatarUrl(124, 168), 124, 168);
    ?>
							</div>
							<h4><?php 
    echo $model->first_name . " " . $model->last_name;
    ?>
</h4>
							<p>CEA Reg No: <span class="cea"><?php 
    echo $model->agent_cea;
    ?>
コード例 #9
0
 private static function ListSort()
 {
     $orderBy = UOAManagerPanelSerchArray::getOrderBy();
     $columnData = array();
     $ascdescData = array();
     $columnData[0]['value'] = 'creation';
     $columnData[0]['text'] = 'по дате создания';
     $columnData[1]['value'] = 'changed';
     $columnData[1]['text'] = 'по дате изменения';
     $ascdescData[0]['value'] = 'asc';
     $ascdescData[0]['text'] = 'по возрастанию';
     $ascdescData[1]['value'] = 'desc';
     $ascdescData[1]['text'] = 'по убыванию';
     $out = '<div class="UOAFilterBlockListSort" id="UOAFilterBlockListSort">';
     $out .= 'Сортировать данные: ';
     $out .= InputHelper::select('UOAFilterListSortColumn', 'UOAFilterListSortColumn', $columnData, FALSE, $orderBy['column'], NULL);
     $out .= InputHelper::select('UOAFilterListSortASCDESC', 'UOAFilterListSortASCDESC', $ascdescData, FALSE, $orderBy['asc_desc'], NULL);
     $out .= '</div>';
     return $out;
 }
コード例 #10
0
 protected function beforeValidate()
 {
     $this->house_blk_no = InputHelper::removeScriptTag($this->house_blk_no);
     $this->street_name = InputHelper::removeScriptTag($this->street_name);
     $this->postal_code = InputHelper::removeScriptTag($this->postal_code);
     $this->no_of_bedroom = InputHelper::removeScriptTag($this->no_of_bedroom);
     $this->tenure = InputHelper::removeScriptTag($this->tenure);
     $this->unit_no = InputHelper::removeScriptTag($this->unit_no);
     $this->building_name = InputHelper::removeScriptTag($this->building_name);
     $this->built_in_area = InputHelper::removeScriptTag($this->built_in_area);
     $this->land_area = InputHelper::removeScriptTag($this->land_area);
     return parent::beforeValidate();
 }
コード例 #11
0
ファイル: Account.php プロジェクト: CompuProject/Forsazh62
 private function getSearchUserpanel()
 {
     $out = "";
     $inputHelper = new InputHelper();
     $out .= '<div class="searchUserPanel">';
     $out .= '<form action="UserSearch.php" method="post" name="form" onsubmit="return false;">';
     $out .= "Поиск пользователей<br>";
     $searchTextBox = $inputHelper->paternTextBox("search", "search", "search", 25, false, "Начните вводить login", "[A-Za-z0-9%]{3,25}", false);
     $out .= $searchTextBox;
     $out .= '</form>';
     $out .= '<div id="resSearch" class="UserSearchResult"></div>';
     $out .= '</div>';
     return $out;
 }
コード例 #12
0
 protected function beforeValidate()
 {
     $this->company_name = InputHelper::removeScriptTag($this->company_name);
     $this->attn_to = InputHelper::removeScriptTag($this->attn_to);
     $this->contact_no = InputHelper::removeScriptTag($this->contact_no);
     $this->billing_address = InputHelper::removeScriptTag($this->billing_address);
     $this->postal_code = InputHelper::removeScriptTag($this->postal_code);
     $this->commission_amount = (double) str_replace(",", "", $this->commission_amount);
     $this->commission_amount_gst = (double) str_replace(",", "", $this->commission_amount_gst);
     return parent::beforeValidate();
 }
コード例 #13
0
ファイル: item.php プロジェクト: jasonhai/onehome
<?php 
if ($index % 2 == 0) {
    ?>
<div class="row">
<?php 
}
?>
	
<div class="col-sm-6">
	<div class="prop-item-2">
		<div class="row">
			<div class="image col-md-4">
				<div class="img-box">
					<?php 
echo InputHelper::holderImage($linkImage, 266, 161);
?>
				</div>
				<div class="description">
					<?php 
$urlReturn = "http://" . $_SERVER['HTTP_HOST'] . Yii::app()->request->requestUri;
$link = Yii::app()->createAbsoluteUrl('site/login', array('returnUrl' => $urlReturn));
if (!isset(Yii::app()->user->role_id) || Yii::app()->user->role_id == ROLE_REGISTER_MEMBER) {
    ?>
					<p><a next="<?php 
    echo $link;
    ?>
" href="javascript:void(0);" data-listing-id="<?php 
    echo $data->id;
    ?>
" class="ico-star shortlist">Shortlist</a></p>
コード例 #14
0
<div class="bn-small">
    <div class="slider-ads">
        <?php 
if ($banner) {
    $allImg = '';
    ?>
            <?php 
    foreach ($banner as $item) {
        ?>
                <?php 
        if ($item->link != "") {
            $img = InputHelper::holderImage($item->getImageUrl(265, 365), 265, 365);
            $allImg .= sprintf('<a href="%s" target="_blank">%s</a>', $item->link, $img);
        } else {
            $allImg .= InputHelper::holderImage($item->getImageUrl(265, 365), 265, 365);
        }
        ?>
            <?php 
    }
    ?>
            <?php 
    echo $allImg;
    ?>
		
			<?php 
    Yii::app()->clientScript->registerScript('right-banner', "\r\t\t\t\t\$('.slider-ads').bxSlider({\r\t\t\t\t\tmode: 'fade',\r\t\t\t\t\tauto: true,\r\t\t\t\t\tpager: false,\r\t\t\t\t\tcontrols: false,\r\t\t\t\t\tpause: 15000\r\t\t\t\t});\r\t\t\t");
    ?>
		<?php 
}
?>
    </div>
コード例 #15
0
 public static function SaveFileDocument($mFile, $title, $key, $id_transaction)
 {
     $mFile->transactions_id = $id_transaction;
     $mFile->title = InputHelper::removeScriptTag($title);
     $mFile->order_no = $key;
     $mFile->file_name = CUploadedFile::getInstance($mFile, 'file_name[' . $key . ']');
     if (!is_null($mFile->file_name)) {
         $mFile->file_name = ProTransactionsPropertyDocument::saveFile($mFile, 'file_name', ProTransactionsPropertyDocument::$folderUpload, $key);
     }
     if (!empty($mFile->title)) {
         $mFile->save();
         $response['code'] = true;
         $response['message'] = 'successfully';
     }
 }
コード例 #16
0
ファイル: view.php プロジェクト: jasonhai/onehome
<?php

/* @var $model ProAgent */
/* @var $this AgentController */
$this->breadcrumbs = array('Our Team' => array('index'), $model->name_for_slug);
$phone = substr($model->phone, 0, 4) . ' ' . substr($model->phone, 4, 4);
// add this button
Yii::app()->clientScript->registerScriptFile("//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-56133df5326f44f0", CClientScript::POS_END, array('async' => 'async'));
?>
<div class="agent-detail">
	<div class="row" style="margin-bottom: 30px">
		<div class="col-sm-5">
			<div class="image">
				<?php 
echo InputHelper::holderImage($model->getAvatarUrl(286, 286), 286, 286);
?>
				<div class="listing-count"><strong><?php 
echo $model->listingCount;
?>
</strong><br/>Listings</div>
				<div class="caption">OneHome's Agent</div>
			</div>
		</div>
		<div class="col-sm-7">
			<h3 class="agent-title"><?php 
echo $model->name_for_slug;
?>
</h3>
			<p style="color: #aaa9b7">CEA Reg No: <span class="cea"><?php 
echo $model->agent_cea;
?>
コード例 #17
0
             $link = Yii::app()->createAbsoluteUrl('member/agent/view', array('tenancy' => $mTransactions->id));
             $this->redirect($link);
             // may be redirect to view
         }
     }
 }
 // Dec 01, 2014 xử lý bắt biến post và gọi validate cho các model, tách ra cho dễ nhìn
 public function GetPostAndValidateTenancy($mTransactions)
 {
     $this->GetPostOnly($mTransactions);
     $mTransactions->validate();
     $mTransactions->mPropertyDetail->validate();
     if ($mTransactions->type == ProTransactions::FOR_RENT) {
         // it alway for rent
         if (!empty($mTransactions->mTenatDefault->user_id)) {
             $mTransactions->mTenatDefault->scenario = 'AgentAddTenantExitUid';
         }
         $mTransactions->mTenatDefault->validate();
         Users::validateDefaultTenant($mTransactions->mTenatDefault);
     }
     // chưa xử lý gì phần validate này ProTransactionsPropertyDocument
     ProTransactionsPropertyDocument::validateFile($mTransactions);
     if ($mTransactions->type == ProTransactions::FOR_RENT) {
         ProTransactions::validateLandlordTenant($mTransactions);
     } else {
         // for sale - validate for vendor and purcharser
         ProTransactions::validateVendorPurchaser($mTransactions);
     }
 }
 /**
  * @Author: ANH DUNG Jan 13, 2015
  * @Todo: get attribute from post
  */
 public function GetPostOnly(&$mTransactions)
 {
     $mTransactions->attributes = $_POST['ProTransactions'];
     $mTransactions->mPropertyDetail->attributes = $_POST['ProTransactionsPropertyDetail'];
     $mTransactions->mPropertyDocument = new ProTransactionsPropertyDocument();
     $mTransactions->mPropertyDocument->attributes = $_POST['ProTransactionsPropertyDocument'];
     $mTransactions->mTenatDefault->attributes = isset($_POST['ProTransactionsVendorPurchaserDetail']) ? $_POST['ProTransactionsVendorPurchaserDetail'] : array();
     $mTransactions->mTenatDefault->scanned_employment_pass = CUploadedFile::getInstance($mTransactions->mTenatDefault, 'scanned_employment_pass');
     $mTransactions->mTenatDefault->scanned_passport = CUploadedFile::getInstance($mTransactions->mTenatDefault, 'scanned_passport');
 }
 /**
  * @Author: ANH DUNG Jan 13, 2015
  * @Todo: Handle SaveAsDraft
  */
 public function HandleSaveAsDraft($mTransactions)
 {
     if (isset($_POST['SaveAsDraft']) && $_POST['SaveAsDraft'] == 1) {
         $this->GetPostOnly($mTransactions);
         $this->HandleSaveAsDraftOnlySave($mTransactions);
         $link = Yii::app()->createAbsoluteUrl('member/agent/tenancy', array('status' => STATUS_TENANCY_DRAFT));
         $this->redirect($link);
         // may be redirect to view
     }
 }
 /**
  * @Author: ANH DUNG Jan 13, 2015
  * @Todo: Save Draft Only
  * @Param: $mTransactions
  */
 public function HandleSaveAsDraftOnlySave(&$mTransactions)
 {
     ProTransactions::convertToDbDate($mTransactions);
     $prefix_code = "T" . date('Y') . date('m');
     if (!isset($_GET['update_transactions'])) {
         $mTransactions->transactions_no = MyFormat::getNextId('ProTransactions', $prefix_code, 'transactions_no', ProTransactions::LENGTH_TRANS_NO);
     }
     $mTransactions->status = STATUS_TENANCY_DRAFT;
     $mTransactions->update();
     // update transaction
     // save  mPropertyDetail
     $mTransactions->mPropertyDetail->transactions_id = $mTransactions->id;
     $mTransactions->mPropertyDetail->listing_id = $mTransactions->listing_id;
     $mTransactions->mPropertyDetail->scenario = null;
     $mTransactions->mPropertyDetail->save();
     // save tenant
     if ($mTransactions->type == ProTransactions::FOR_RENT) {
コード例 #18
0
ファイル: banner_bottom.php プロジェクト: jasonhai/onehome
<?php

if ($allBanner) {
    ?>
	<?php 
    $allImg = '';
    if (count($allBanner) > 0 && is_array($allBanner)) {
        foreach ($allBanner as $key => $banner) {
            $i = $key + 1;
            if ($banner->link != "") {
                $img = InputHelper::holderImage($banner->getImageUrl(728, 90), 728, 90);
                $allImg .= sprintf('<a href="%s" target="_blank">%s</a>', $banner->link, $img);
            } else {
                $allImg .= InputHelper::holderImage($banner->getImageUrl(728, 90), 728, 90);
            }
        }
    }
    ?>
    <div class="bn-advers bn-ads-bottom">
		<div id="bn-list-bottom">
			<?php 
    echo $allImg;
    ?>
		</div>
	</div>
	<?php 
    Yii::app()->clientScript->registerScript('bottom-banner', "\r\t\t\$('#bn-list-bottom').bxSlider({\r\t\t\tmode: 'fade',\r\t\t\tauto: true,\r\t\t\tpager: false,\r\t\t\tcontrols: false,\r\t\t\tpause: 15000,\r\t\t\tpreloadImages: 'visible'\r\t\t});\r\t");
    ?>
	
<?php 
}
コード例 #19
0
 /**
  * @return void
  * @throws \Box\TestScribe\Exception\AbortException
  */
 public function pause()
 {
     $this->inputHelper->getInputString('Press enter to continue...');
 }
コード例 #20
0
ファイル: listing_detail.php プロジェクト: jasonhai/onehome
        ?>
                                            </a>
                                        </li> 
                                    <?php 
    }
    ?>
                                    </ul>
                                </div>

                                <a href="#" class="jcarousel-control-prev">&nbsp;</a>
                                <a href="#" class="jcarousel-control-next">&nbsp;</a>
                            </div>

                            <div class="big-photo">
                                <?php 
    echo CHtml::image(InputHelper::holderUrl($img, 633, 390), '', array('id' => 'img_main', 'class' => 'img-responsive'));
    ?>
                            </div>
							<?php 
}
?>
                        </div><!-- box-3 -->

                        <!-- property info -->
                        <div class="box-3">
                            <h2 class="title-2">Property Info</h2>
                            <div class="property-info">
                                <div class="ico-bg">
                                    <h3>Description</h3>
                                    <?php 
echo $model->listing_description;
コード例 #21
0
ファイル: _agent-item.php プロジェクト: jasonhai/onehome
$phone = substr($data->phone, 0, 4) . ' ' . substr($data->phone, 4, 4);
if ($index % 4 == 0) {
    ?>
<div class="row">
<?php 
}
?>

<div class="col-md-3 col-sm-6">
	<div class="agent-thumb">
		<div class="image">
			<a href="<?php 
echo $link;
?>
"><?php 
echo InputHelper::holderImage($data->getAvatarUrl(278, 199), 278, 199);
?>
</a>
			<div class="listing-count"><strong><?php 
echo $data->listingCount;
?>
</strong><br/>Listings</div>
			<div class="caption">OneHome's Agent</div>
		</div>

		<div class="desc">
			<div class="row">
				<div class="col-xs-6">
					<h3><a href="<?php 
echo $link;
?>
コード例 #22
0
ファイル: _item_view.php プロジェクト: jasonhai/onehome
<?php

/* Author : Pham Duy Toan 
 * Email :ghostkissboy12@gmail.com and open the template in the editor.
 */
?>
<div class="item-releated">
    <div class="img">
        <?php 
$imgDefautl = Listing::getDefaultImgListing($data->id, 'image');
echo InputHelper::holderImage($data->getDefaultImageUrl(120, 96), 120, 96);
$check = '';
if ($data->releated) {
    if ($data->releated->listing_releated == $data->id) {
        $check = 'checked';
    }
}
?>
              
    </div>
    <div class="clear"></div>
    <input type="checkbox" class="checkphoto-releated" name="releated[<?php 
echo $data->id;
?>
]" value="<?php 
echo $data->id;
?>
" <?php 
echo $check;
?>
 />
コード例 #23
0
ファイル: _agent_detail.php プロジェクト: jasonhai/onehome
        </div>          
     </div>

     <div class="<?php 
echo $colWidth;
?>
 clearfix form-group agent-right-<?php 
echo $position;
?>
">
		<?php 
if ($position == "bottom") {
    ?>
		<div class="pull-left" style="margin-right: 5px;">
			 <img class="agent_company_logo" src="<?php 
    echo InputHelper::holderUrl($srcCompany, 86, 75);
    ?>
">
		</div>
		<?php 
}
?>
		<div classs="company" id="company-<?php 
echo $position;
?>
">
			  <b><?php 
echo $company;
?>
</b> <br />
			  CEA License No: <?php 
コード例 #24
0
ファイル: banner_top.php プロジェクト: jasonhai/onehome
<?php

/* @var $banner Banner */
if ($banner) {
    ?>
	<?php 
    Yii::app()->clientScript->registerScript('top-banner', "\r\t\t\$('#bn-list').bxSlider({\r\t\t\tmode: 'fade',\r\t\t\tauto: true,\r\t\t\tpager: false,\r\t\t\tcontrols: false,\r\t\t\tpause: 3000,\r\t\t\tpreloadImages: 'visible'\r\t\t});\r\t");
    $Allbanner = Banners::getAdsBannerByType(TOP);
    $allImg = '';
    if (count($Allbanner) > 0 && is_array($Allbanner)) {
        foreach ($Allbanner as $key => $banner) {
            $i = $key + 1;
            $img = InputHelper::holderImage($banner->getImageUrl2(728, 90), 728, 90);
            $allImg .= sprintf('<a href="%s" target="_blank">%s</a>', $banner->link, $img);
        }
    }
    ?>
    <div class="bn-advers">	
		<div id="bn-list"><?php 
    echo $allImg;
    ?>
</div>         
    </div>
 <?php 
}
コード例 #25
0
ファイル: list_item.php プロジェクト: jasonhai/onehome
// add this button
Yii::app()->clientScript->registerScriptFile("//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-56133df5326f44f0", CClientScript::POS_END, array('async' => 'async'));
// fontawesome
Yii::app()->clientScript->registerCssFile("https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css");
if ($index % 2 == 0) {
    ?>
<div class="grid">
<?php 
}
?>
    <?php 
$cmsFormater = new CmsFormatter();
$linkImage = $data->getDefaultImageUrl(120, 96);
?>
    <div class="item">
        <div class="image">
            <div class="img-box">
				<?php 
echo InputHelper::holderImage($linkImage, 120, 96);
?>
			</div>
			
            <?php 
$urlReturn = "http://" . $_SERVER['HTTP_HOST'] . Yii::app()->request->requestUri;
$link = Yii::app()->createAbsoluteUrl('site/login', array('returnUrl' => $urlReturn));
if (!isset(Yii::app()->user->role_id) || Yii::app()->user->role_id == ROLE_REGISTER_MEMBER) {
    ?>
            <p><a next="<?php 
    echo $link;
    ?>
コード例 #26
0
ファイル: banner_middle.php プロジェクト: jasonhai/onehome
<?php

if ($banner) {
    $allImg = '';
    ?>
<div class="bn-advers-2 banner_middle_fix">
	<?php 
    foreach ($banner as $item) {
        ?>
		<?php 
        if ($item->link != "") {
            $img = InputHelper::holderImage($item->getImageUrl(263, 220), 263, 220);
            $allImg .= sprintf('<a href="%s" target="_blank">%s</a>', $item->link, $img);
        } else {
            $allImg .= InputHelper::holderImage($banner->getImageUrl(263, 220), 263, 220);
        }
        ?>
	<?php 
    }
    ?>
	<?php 
    echo $allImg;
    ?>
	<?php 
    Yii::app()->clientScript->registerScript('middle-banner', "\n\t\t\$('.banner_middle_fix').bxSlider({\n\t\t\tmode: 'fade',\n\t\t\tauto: true,\n\t\t\tpager: false,\n\t\t\tcontrols: false,\n\t\t\tpause: 15000\n\t\t}); \n\t");
    ?>
</div>
<?php 
}
コード例 #27
0
ファイル: banner_top_home.php プロジェクト: jasonhai/onehome
<?php

if ($banner) {
    ?>
    <div id="banner-slider">
        <?php 
    foreach ($banner as $item) {
        $allImg = "";
        if ($item->link != "") {
            $img = InputHelper::holderImage($item->getSlideshowImageUrl(1519, 350), 1519, 350);
            $allImg .= sprintf('<a href="%s" target="_blank">%s</a>', $item->link, $img);
        } else {
            $allImg .= InputHelper::holderImage($item->getSlideshowImageUrl(1519, 350), 1519, 350);
        }
        echo $allImg;
    }
    ?>
    </div>
	<?php 
    Yii::app()->clientScript->registerScript('homepage-banner', "\r\t\t\$('#banner-slider').bxSlider({ \r\t\t\tpager: true,\r\t\t\tcontrols: false,\r\t\t\tauto: true,\r\t\t\tmode: 'fade',\r\t\t\tpause: 10000,\r\t\t\tpreloadImages: 'visible'\r\t\t});\r\t");
}