<a data-fancybox-type="iframe" href="<?php echo Yii::app()->createAbsoluteUrl('ajax/agentAddTenant', array('transactions_id' => $mTransactions->id, "from_transactions" => 1, 'listing_id' => isset($_GET['listing_id']) ? $_GET['listing_id'] : '', "add_property" => $mTransactions->add_property)); ?> " class="btn-1 f-right TenantDetails">Add More Tenant</a> </div> </div><!-- end <div class="box_tenant_detail"> --> <div class="tenant_reload"> <?php if (count($mTransactions->rTenantAddMore)) { ?> <?php foreach ($mTransactions->rTenantAddMore as $key => $item) { ?> <?php ProTransactionsVendorPurchaserDetail::OverideModel($item); ?> <?php include '_box_sub_tenant_details_view.php'; ?> <?php } ?> <?php } ?> </div> </div> <!-- end box-5 --> <!--<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;
public static function GetSomeInfoRecord($mTransactions, $add_property) { $mTransactions->add_property = $add_property; $mTransactions->type = isset($_GET['type']) ? $_GET['type'] : ProTransactions::FOR_RENT; $mTransactions->listing_autocompelte = ''; if (isset($_GET['listing_id']) && $_GET['listing_id']) { $mTransactions->listing_id = $_GET['listing_id']; $mTransactions->listing_autocompelte = $mTransactions->listing ? $mTransactions->listing->property_name_or_address : ''; } $mTransactions->mPropertyDetail = $mTransactions->rPropertyDetail ? $mTransactions->rPropertyDetail : new ProTransactionsPropertyDetail(); $mTransactions->aModelPropertyDocument = count($mTransactions->rPropertyDocument) ? $mTransactions->rPropertyDocument : ProTransactionsPropertyDocument::getDefaultArrayForCreate($mTransactions->type); $mTransactions->mTenatDefault = $mTransactions->rTenantDefault ? $mTransactions->rTenantDefault : new ProTransactionsVendorPurchaserDetail(); ProTransactionsVendorPurchaserDetail::OverideModel($mTransactions->mTenatDefault); $mTransactions->mLandlord = new ProTransactionsVendorPurchaserDetail(); $mTransactions->mTenant = new ProTransactionsVendorPurchaserDetail(); $mTransactions->mVendor = new ProTransactionsVendorPurchaserDetail(); $mTransactions->mPurchaser = new ProTransactionsVendorPurchaserDetail(); $mTransactions->mBillTo = new ProTransactionsBillTo(); $mTransactions->mPropertyDetail->scenario = 'CreateTransactionTenancyOnly'; $mTransactions->mTenatDefault->scenario = 'AgentAddTenantFromTenancy'; $mTransactions->scenario = 'CreateTransactionForRentRecordTenancy_new'; // for rent //CreateTransactionForRentRecordTenancy ProTransactions::copyFromListingToTransaction($mTransactions); ProTransactions::convertToUserDate($mTransactions); // Feb 02, 2015 , fix for update transaction $cAction = Yii::app()->controller->action->id; if ($cAction == 'update' && ProTransactions::IsTenancyTransaction($mTransactions)) { $mTransactions->mBillTo = $mTransactions->rBillTo ? $mTransactions->rBillTo : new ProTransactionsBillTo(); $mTransactions->mBillTo->scenario = 'CreateVendorPurchaser'; } // Feb 02, 2015 , fix for update transaction }
} } public function actionTenantFormView() { try { $model = $this->loadModelVendorPurchaserDetail($_POST['id']); $model->pass_expiry_date = MyFormat::dateConverYmdToDmy($model->pass_expiry_date); $this->render('CreateTransaction/TenantFormView', array('model' => $model)); } catch (Exception $exc) { throw new CHttpException(404, $exc->getMessage()); } } public function actionAgentAddPurchaser() { try { $model = new ProTransactionsVendorPurchaserDetail('AgentAddVendor'); $model->transactions_id = $_GET['transactions_id']; if (isset($_POST['ProTransactionsVendorPurchaserDetail'])) { $model->attributes = $_POST['ProTransactionsVendorPurchaserDetail']; $model->validate();
{ $this->pageTitle = "Engage Us - " . Yii::app()->params['title']; $this->layout = 'application.views.layouts.layout_user'; $this->render('Engageus'); } /** * @Author: ANH DUNG Nov 28, 2014 * @Todo: On the Salesperson’s list of tenancy page, * there is a new button called “ Record existing tenancy ” for * creating a tenancy that does not require creating a transaction before it: * @param: $add_property: 1: ADD_EXISTING, 2: ADD_UNLISTED */ public function actionRecord_existing_tenancy($add_property) { /** 1. get thông tin user login * 2. createnew tạo mới 1 transaction với status tạm =0, sau đó get thông tin liên quan * 3. get thông tin của listing đưa vào model của $mTransactionsPropertyDetail * 4. get thông tin của 3: Landlord, 4: Tenant Purchaser’s Details */ MyFormat::validateUserAccess(ROLE_AGENT); $this->pageTitle = "Record existing tenancy - " . Yii::app()->params['title']; try { $mUser = Users::model()->findByPk(Yii::app()->user->id); $type = ProTransactions::FOR_RENT; $listing_id = 0; if (isset($_GET['listing_id'])) { $listing_id = $_GET['listing_id']; } // handle create new if (!isset($_GET['id'])) { $mTransactions = ProTransactions::CreateNewRecordTransaction($type, $listing_id);