public function actioninsertComment()
 {
     $model = new LbComment();
     $item_id = false;
     $lb_comment_description = false;
     if (isset($_POST['item_id']) && $_POST['item_id'] > 0) {
         $item_id = $_POST['item_id'];
     }
     $module_name = false;
     if (isset($_POST['module_name'])) {
         $module_name = $_POST['module_name'];
     }
     $date = date('Y-m-d');
     if (isset($_POST['comment'])) {
         $lb_comment_description = $_POST['comment'];
     }
     $id_comment = $model->addComment($module_name, $lb_comment_description, $item_id, $date, 0);
     if ($id_comment) {
         $customer = AccountProfile::model()->getProfile($id_comment->lb_account_id);
         $response = array();
         $response['success'] = YES;
         $response['account_profile_given_name'] = $customer->account_profile_given_name;
         $response['account_profile_surname'] = $customer->account_profile_surname;
         $response['lb_comment_date'] = $id_comment->lb_comment_date;
         $response['lb_comment_description'] = nl2br($id_comment->lb_comment_description);
         $response['lb_module_name'] = $id_comment->lb_module_name;
         $response['lb_item_module_id'] = $id_comment->lb_item_module_id;
         $response['lb_parent_comment_id'] = $id_comment->lb_parent_comment_id;
         $response['lb_record_primary_key'] = $id_comment->lb_record_primary_key;
         LBApplication::renderPlain($this, array('content' => CJSON::encode($response)));
     }
 }
Beispiel #2
0
 public function authenticate()
 {
     $username = strtolower($this->username);
     $user = Account::model()->find('LOWER(account_email)=?', array($username));
     if ($user === null) {
         $this->errorCode = self::ERROR_USERNAME_INVALID;
     } else {
         if (!$user->validatePassword($this->password)) {
             $this->errorCode = self::ERROR_PASSWORD_INVALID;
         } else {
             $this->_id = $user->account_id;
             // get Profile detail
             //$accountContact = CompanyContact::model()->find('account_id=?', array($user->account_id));
             $accountProfile = AccountProfile::model()->find('account_id = ?', array($user->account_id));
             $accountSubscriptions = AccountSubscription::model()->findSubscriptions($user->account_id);
             // set currently selected subscription default as first on the list
             reset($accountSubscriptions);
             $this->setState('linx_app_selected_subscription', key($accountSubscriptions));
             $this->username = $user->account_email;
             $this->setState('account_email', $user->account_email);
             $this->setState('account_subscriptions', $accountSubscriptions);
             $tz = $user->account_timezone;
             if (trim($tz) == '') {
                 $tz = 'Asia/Singapore';
             }
             $this->setState('timezone', $tz);
             //$this->setState('isMasterAccount', Account::model()->isMasterAccount($user->account_id) ? YES : NO);
             if ($accountProfile === null) {
                 $this->setState('account_contact_surname', '');
                 $this->setState('account_contact_given_name', '');
             } else {
                 $this->setState('account_profile_surname', $accountProfile->account_profile_surname);
                 $this->setState('account_profile_given_name', $accountProfile->account_profile_given_name);
                 $this->setState('account_profile_preferred_display_name', $accountProfile->account_profile_preferred_display_name);
                 $this->setState('account_profile_short_name', $accountProfile->getShortFullName());
             }
             $this->errorCode = self::ERROR_NONE;
         }
     }
     return $this->errorCode == self::ERROR_NONE;
 }
 public function getListUserSub()
 {
     //            include 'SubscriptionController.php';
     //            include 'UsersController.php';
     $arr = array();
     $model = UserSubscription::model()->findAll();
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     } else {
         foreach ($model as $m) {
             $value_arr = array();
             $sub = Subscription::model()->findByPk($m->subscription_id);
             $userName = AccountProfile::model()->getFullName($m->user_id);
             //                        $sub = SubscriptionController::loadModel($m->subscription_id);
             //                        $user = UsersController::loadModel($m->user_id);
             $value_arr['id'] = $m->user_subscription_id;
             $value_arr['user_name'] = $userName;
             $value_arr['subscription'] = $sub->subscription_value . '$/' . $sub->subscription_name;
             $value_arr['date_from'] = $m->date_from;
             $arr[] = $value_arr;
         }
     }
     return $arr;
 }
Beispiel #4
0
if (isset($model->customerContact)) {
    $att = ($model->customerContact->lb_customer_contact_first_name != null ? $model->customerContact->lb_customer_contact_first_name . ' ' : '') . ($model->customerContact->lb_customer_contact_last_name != NULL ? $model->customerContact->lb_customer_contact_last_name : '');
}
$add = "";
if (isset($model->ownerAddress->lb_customer_address_line_1) || isset($model->ownerAddress->lb_customer_address_line_2)) {
    $add = 'Address: ';
}
$subject = "";
if (isset($model->lb_invoice_subject)) {
    $subject = '<tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><b>Subject:</b><br></td>
                    </tr>
                    <tr><td colspan="2">' . nl2br($model->lb_invoice_subject) . '</td></tr>';
}
$create_by = AccountProfile::model()->getFullName(LbCoreEntity::model()->getCoreEntity(LbInvoice::model()->module_name, $model->lb_record_primary_key)->lb_created_by);
$tbl = '<table border="0" style="margin:auto;width:100%;" cellpadding="0" cellspacing="0">
        ' . $html_logo . '
        <tr valign="top">
            <td width="300">
                <span style="font-size:20px;font-weight:bold;">INVOICE</span><br>
                Invoice No: ' . $model->lb_invoice_no . '<br>
                Invoice Date: ' . date('d-M-Y', strtotime($model->lb_invoice_date)) . '<br>
                Due Date: ' . date('d-M-Y', strtotime($model->lb_invoice_due_date)) . '<br>
            </td>
            <td width="400" align="right">
                
                <span style="font-size:16px;font-weight:bold;">' . (isset($model->owner->lb_customer_name) ? $model->owner->lb_customer_name . '. ' : '') . '</span><br>
                ' . (isset($model->owner->lb_customer_registration) ? "Registration No: " . $model->owner->lb_customer_registration . '. ' : '') . '
                ' . (isset($model->owner->lb_customer_website_url) ? "Website: " . $model->owner->lb_customer_website_url . '' : '') . '<br>
                ' . $add . (isset($model->ownerAddress->lb_customer_address_line_1) && $model->ownerAddress->lb_customer_address_line_1 != "" ? $model->ownerAddress->lb_customer_address_line_1 . '. ' : '') . '
Beispiel #5
0
<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'user-subscription-form', 'enableAjaxValidation' => false));
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php 
echo $form->errorSummary($model);
?>

	<div class="control-group">
		<?php 
echo $form->labelEx($model, 'user_id');
?>
                <?php 
echo $form->dropDownList($model, 'user_id', CHtml::listData(AccountProfile::model()->findAll(), 'account_id', function ($loc) {
    return $loc->account_profile_given_name . ", " . $loc->account_profile_surname;
}), array('empty' => '--Select--'));
?>
		<?php 
echo $form->error($model, 'user_id');
?>
	</div>

	<div class="control-group ">
		<?php 
echo $form->labelEx($model, 'subscription_id');
?>
                <?php 
echo $form->dropDownList($model, 'subscription_id', CHtml::listData(Subscription::model()->findAll(), 'subscription_id', 'subscription_name'), array('empty' => '--Select--'));
?>
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     // if user is already logged in
     // redirect to dash board
     if (!Yii::app()->user->isGuest) {
         $this->redirect(array('project/index'));
     }
     $model = new Account();
     //$companyModel = new Company();
     //$companyContactModel = new CompanyContact();
     $accountSubscriptionModel = new AccountSubscription();
     $accountProfile = new AccountProfile();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     /**
      * Process form's submission
      * param's name must be in this format, e.g. "Account[account_email]"
      */
     if (isset($_POST['Account'])) {
         $model->attributes = $_POST['Account'];
         $model->account_id = null;
         //$companyModel->attributes = $_POST['Company'];
         //$companyContactModel->attributes = $_POST['CompanyContact'];
         $accountSubscriptionModel->attributes = $_POST['AccountSubscription'];
         $accountProfile->attributes = $_POST['AccountProfile'];
         /**
         			$model->account_company_name = $companyModel->company_name;
         			$model->account_contact_surname = $companyContactModel->contact_surname;
         			$model->account_contact_given_name = $companyContactModel->contact_given_name;
         			$model->account_subscription_package_id = $accountSubscriptionModel->account_subscription_package_id;
         			**/
         // SAVE ACCOUNT
         //$model->account_password = $model->hashPassword($model->account_password);
         $model->account_status = ACCOUNT_STATUS_ACTIVATED;
         // ACCOUNT_STATUS_NOT_ACTIVATED;
         $save_result = '';
         // save user account record to database
         $save_result = $model->save();
         if ($save_result) {
             // create/update subscription record
             $accountSubscriptionModel->account_id = $model->account_id;
             $accountSubscriptionModel->account_subscription_start_date = date('Y-m-d H:i');
             $accountSubscriptionModel->account_subscription_status_id = 1;
             $accountSubscriptionModel->save();
             // create account profile
             $accountProfile->account_id = $model->account_id;
             $accountProfile->account_profile_preferred_display_name = $accountProfile->account_profile_given_name . ' ' . $accountProfile->account_profile_surname;
             $accountProfile->save();
             /**
             				// create company record
             				$companyModel->company_master_account_id = $model->account_id;
             				$companyModel->company_is_master = COMPANY_IS_MASTER;
             			
             				// save company record to database,
             				// if successful, create contact record
             				if ($companyModel->save()) {
             					// create contact record
             					$companyContactModel->contact_email1 = $model->account_email;
             					$companyContactModel->company_id = $companyModel->company_id;
             					$companyContactModel->account_id = $model->account_id;
             					// save contact record to database
             					$companyContactModel->save();
             				}**/
             // notify user through email
             $model->sendSuccessfulSignupEmailNotification();
         }
         // redirect to view
         if ($save_result) {
             //$this->redirect(array('view','id'=>$model->account_id));
             $this->redirect(Yii::app()->baseUrl . '/product/signup-success.php');
         }
     }
     /** 
      * otherwise just show creation form
      */
     $active_subscription_packages = SubscriptionPackage::getActivePackages();
     $active_subscription_package_names = array();
     foreach ($active_subscription_packages as $item) {
         $active_subscription_package_names[$item->subscription_package_id] = $item->subscription_package_name;
     }
     $data = array('model' => $model, 'accountProfileModel' => $accountProfile, 'accountSubscriptionModel' => $accountSubscriptionModel, 'active_subscription_packages' => $active_subscription_package_names);
     LBApplication::render($this, 'create', $data);
     //$this->render('create',);
 }
Beispiel #7
0
            $label .= ' <i class="icon-ok"></i>';
        }
        $linx_app_menu_subscription_items[] = array('label' => $label, 'url' => array('/site/subscription', 'id' => $sub_id), 'visible' => !Yii::app()->user->isGuest);
    }
    $linx_app_menu_subscription_items[] = '---';
    $linx_app_menu_subscription_items[] = array('label' => '<i class="icon-plus"></i> ' . Yii::t('lang', 'Add Subscription'), 'url' => array('/accountSubscription/create'), 'visible' => $onwSubcrip);
    $linx_app_menu_subscription_items[] = array('label' => '<i class="icon-plus"></i> ' . Yii::t('lang', 'Manager Subscription'), 'url' => array('/accountSubscription/admin'), 'visible' => $onwSubcrip);
}
if (isset($_SESSION['sess_lang']) && $_SESSION['sess_lang'] == 'vi') {
    $select_vn = ' <i class="icon-ok"></i>';
    $select_en = "";
} else {
    $select_en = ' <i class="icon-ok"></i>';
    $select_vn = "";
}
$ulr_img = CHtml::image(AccountProfile::model()->getProfilePhotoURL(Yii::app()->user->id), '', array('height' => 30, 'width' => 30, 'style' => "margin-right: 5px; height: 30px; border-radius:15px; width: 30px; "));
$this->widget('bootstrap.widgets.TbNavbar', array('brand' => false, 'collapse' => true, 'items' => array(array('class' => 'bootstrap.widgets.TbMenu', 'items' => array()), array('class' => 'bootstrap.widgets.TbMenu', 'encodeLabel' => false, 'htmlOptions' => array('class' => 'pull-right'), 'items' => array(array('label' => $ulr_img . Yii::t('lang', isset(Yii::app()->user->account_profile_short_name) ? Yii::app()->user->account_profile_short_name : 'Actions'), 'url' => '#', 'items' => array(array('label' => '<span>Company</span>', 'url' => '#', 'items' => $linx_app_menu_subscription_items, 'visible' => !Yii::app()->user->isGuest), array('label' => Yii::t('lang', 'Configuration'), 'url' => array('/' . LBApplication::getCurrentlySelectedSubscription() . '/configuration'), 'visible' => $onwSubcrip), array('label' => Yii::t('lang', 'My Account'), 'url' => array('/account/view/' . Yii::app()->user->id), 'visible' => !Yii::app()->user->isGuest), array('label' => Yii::t('lang', 'My Team'), 'url' => array('/' . LBApplication::getCurrentlySelectedSubscription() . '/team'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Language', 'url' => '#', 'items' => array(array('label' => 'English' . $select_en, 'url' => array('/site/languares', 'typelang' => 'en')), array('label' => 'Tiếng việt' . $select_vn, 'url' => array('/site/languares', 'typelang' => 'vi')))), array('label' => Yii::t('lang', 'Contact'), 'url' => array('/site/contact')), array('label' => Yii::t('lang', 'Logout') . '(' . Yii::app()->user->name . ')', 'url' => array('/' . LBApplication::getCurrentlySelectedSubscription() . '/logout'), 'visible' => !Yii::app()->user->isGuest)), 'visible' => !Yii::app()->user->isGuest), array('label' => "<i class=\"icon-user\"></i> " . Yii::t('lang', 'Login'), 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest)))), 'htmlOptions' => array('class' => 'navbar')));
?>
    </div>
		
	
	<?php 
echo $content;
?>

	<div id="footer">
		Copyright &copy; <?php 
echo date('Y');
?>
, LinxBooks. All Rights Reserved.  LinxHQ Pte Ltd<br/>
	</div><!-- footer -->
<?php

/* @var $this AccountController */
/* @var $model Account */
?>

<h3><?php 
echo CHtml::link('View Account ' . AccountProfile::model()->getShortFullName($model->account_id), array('account/view', 'id' => $model->account_id));
?>
</h3>

<div class="form">

<?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'account-form', 'enableAjaxValidation' => false));
?>

<fieldset>
	<?php 
echo $form->errorSummary($model);
?>
	
	<?php 
echo $form->passwordFieldRow($model, 'account_current_password', array('size' => 60, 'maxlength' => 255, 'name' => 'Account[account_password]') + (isset($_GET['ajax']) ? $iframe_input_style : array()));
?>
	<?php 
echo $form->passwordFieldRow($model, 'account_new_password', array('size' => 60, 'maxlength' => 255) + (isset($_GET['ajax']) ? $iframe_input_style : array()));
?>
	<?php 
echo $form->passwordFieldRow($model, 'account_new_password_retype', array('size' => 60, 'maxlength' => 255) + (isset($_GET['ajax']) ? $iframe_input_style : array()));
?>
 /**
  * Return an json datasource of team members 
  * [{value: 1, text: "text1"}, {value: 2, text: "text2"}, ...]
  */
 public function actionDropdownSource()
 {
     if (isset($_GET['account_id'])) {
         // if current user is not part of this master account team, don't load
         $master_account_id = $_GET['account_id'];
         if (!AccountTeamMember::model()->isValidMember($master_account_id, Yii::app()->user->id) && Yii::app()->user->id != $master_account_id) {
             return '';
         }
         $account_team_members = AccountTeamMember::model()->getTeamMembers($master_account_id, true);
         $dd_array = array();
         foreach ($account_team_members as $m) {
             // skip deactivated member
             //if ($m->is_active == AccountTeamMember::ACCOUNT_TEAM_MEMBER_IS_DEACTIVATED)
             //	continue;
             $name = AccountProfile::model()->getShortFullName($m->member_account_id);
             $name = mb_check_encoding($name, 'UTF-8') ? $name : utf8_encode($name);
             $dd_array[] = array('value' => $m->member_account->account_id, 'text' => $name);
         }
         // add master account name
         // because getTeamMemebrs only return team member, not master account.
         $master_name = AccountProfile::model()->getShortFullName($master_account_id);
         //$master_name = mb_check_encoding($master_name, 'UTF-8') ? $master_name : utf8_encode($master_name);
         $dd_array[] = array('value' => $master_account_id, 'text' => $master_name);
         echo CJSON::encode($dd_array);
     }
 }
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$create_by = AccountProfile::model()->getFullName(Yii::app()->user->id);
//echo date('d', strtotime(date('Y-m-d')));
$date_now = date_format(date_create('01-' . $date), 'Y-m-d');
$month_default = date('m', strtotime($date_now));
$year_default = date('Y', strtotime($date_now));
//echo LbEmployeePayment::model()->getPaidByEmployee(12,$month_default,$year_default);
$this->Widget('bootstrap.widgets.TbGridView', array('id' => 'lb_expenses_gridview', 'dataProvider' => $model, 'template' => "{items}\n{pager}\n{summary}", 'columns' => array(array('header' => Yii::t('lang', 'Name'), 'type' => 'raw', 'value' => 'LBApplication::workspaceLink($data->employee_name,$data->getViewURLNormalized("update",array("id"=>$data->lb_record_primary_key)))', 'htmlOptions' => array('width' => '130')), array('header' => Yii::t('lang', 'Salary'), 'type' => 'raw', 'value' => 'number_format(LbEmployeeSalary::model()->totalSalaryEmployee($data->lb_record_primary_key)-LbEmployeeBenefits::model()->caculatorBenefitByEmployee($data->lb_record_primary_key),2)', 'htmlOptions' => array('width' => '130')), array('header' => Yii::t('lang', 'Pay'), 'type' => 'raw', 'value' => 'number_format(LbEmployeeSalary::model()->totalSalaryEmployee($data->lb_record_primary_key)-LbEmployeeBenefits::model()->caculatorBenefitByEmployee($data->lb_record_primary_key)-LbEmployeePayment::model()->getPaidByEmployee($data->lb_record_primary_key,' . $month_default . ',' . $year_default . '),2)', 'htmlOptions' => array('width' => '130')), array('header' => Yii::t('lang', 'Paid'), 'type' => 'raw', 'value' => 'CHtml::textField("paid_".$data->lb_record_primary_key,"",array("style"=>"width:80","onchange"=>"addData($data->lb_record_primary_key)"))', 'htmlOptions' => array('width' => '80')), array('header' => Yii::t('lang', 'Note'), 'type' => 'raw', 'value' => 'CHtml::textArea("note_".$data->lb_record_primary_key,"",array("onchange"=>"addData($data->lb_record_primary_key)"))', 'htmlOptions' => array('width' => '130')), array('header' => Yii::t('lang', 'Created By'), 'type' => 'raw', 'value' => "'" . $create_by . "'", 'htmlOptions' => array('width' => '130')))));
echo '<br/>';
Beispiel #11
0
<?php

/* @var $this AccountTeamMemberController */
/* @var $model AccountTeamMember */
?>

<h3>Update Team Member <?php 
echo AccountProfile::model()->getShortFullName($model->member_account_id);
?>
</h3>

<?php 
echo $this->renderPartial('_form', array('model' => $model));
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return AccountProfile the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = AccountProfile::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Beispiel #13
0
    $module_anme = $_REQUEST['model_name'];
}
echo '<a  onclick="_form_comment()">Comment</a>';
echo '<div id ="show_form_comment" hidden="true">';
echo '<textarea type="text" style="width:56%;height:100px" id="pv_comment"></textarea>
    <div id="">
    <input type="submit" id="yt0" value="Save" onclick = saveComment(' . $id_item . ',"' . $module_anme . '",' . $date . ');> <input type="submit" id="yt0" value="Cancel" name="yt0" onclick="cancelComment();">
    <br />';
echo '</div></div>';
echo '<div id ="show_comment">';
if (isset($_REQUEST['model_name'])) {
    $model = LbComment::model()->getComment($module_anme, $id_item, 0);
    if (count($model) > 0) {
        foreach ($model as $data) {
            echo '<div id="comment-root' . $data->lb_record_primary_key . '" class="comment" style="width: 58%;">';
            $customer = AccountProfile::model()->getProfile($data->lb_account_id);
            echo '<div style = " padding:20px" id="comment-content-container' . $data->lb_record_primary_key . '">';
            echo '<div id="comment-content' . $data->lb_record_primary_key . '" style="display: table">';
            echo '<b>' . $customer->account_profile_given_name . ' ' . $customer->account_profile_surname . '</b>:   ';
            echo '<span id="description' . $data->lb_record_primary_key . '">' . nl2br($data->lb_comment_description) . '</span>';
            echo '<br />';
            echo '</div>' . '</div>';
            echo '<div class="footer-container" style="padding-left: 20px">';
            echo '<span id="fotter' . $data->lb_record_primary_key . '">Posted on ' . $data->lb_comment_date . '</span>';
            echo '<div style="float: right">';
            if ($data->lb_account_id == Yii::app()->user->id) {
                echo '<a href="#" onclick = EditComment(' . $data->lb_record_primary_key . ') > Edit</a> &nbsp';
                echo '<a href="#" onclick = deleteComment(' . $data->lb_record_primary_key . ')>Delete</a>';
            }
            echo '</div>';
            echo '</div>';
 /**
  * 
  * @param AccountInvitation $model
  * @return boolean
  */
 public function createAccountInvitation($model)
 {
     // foreach email create one separate invitation record
     $emails = explode(',', $model->account_invitation_to_email);
     foreach ($emails as $invite) {
         $inviteModel = new AccountInvitation();
         $inviteModel->account_invitation_to_email = trim($invite);
         $inviteModel->account_invitation_master_id = Yii::app()->user->id;
         $inviteModel->account_invitation_date = date('Y-m-d H:i');
         $inviteModel->account_invitation_status = 0;
         $inviteModel->account_invitation_rand_key = AccountInvitation::generateInvitationKey();
         $inviteModel->account_invitation_project = $model->account_invitation_project;
         $inviteModel->account_invitation_type = $model->account_invitation_type;
         $inviteModel->account_invitation_subscription_id = $model->account_invitation_subscription_id;
         $result_return = $inviteModel->save();
         if ($result_return) {
             // send email
             $message = new YiiMailMessage();
             $sender_name = AccountProfile::model()->getShortFullName(Yii::app()->user->id);
             // if this invitee already has an account with LinxCircle
             // use a different invitation template
             $tempAccount = Account::model()->getAccountByEmail(trim($invite));
             if ($tempAccount != null) {
                 $message->view = "invitationEmailExistingAccount";
                 $subject = $sender_name . ' invited you to join a team on ' . Yii::app()->name;
             } else {
                 $message->view = "invitationEmail";
                 $subject = $sender_name . ' invites you to join ' . Yii::app()->name;
             }
             //userModel is passed to the view
             $message->setBody(array('invitation_accept_url' => AccountInvitation::generateInvitationURL($inviteModel->account_invitation_id, $inviteModel->account_invitation_rand_key), 'invitation_message' => $model->account_invitation_message), 'text/html');
             $message->setSubject($subject);
             //$message->setBody($body, 'text/html');
             //$message->addTo($model->account_invitation_to_email);
             $message->addTo($invite);
             $message->setFrom('*****@*****.**');
             Yii::app()->mail->send($message);
         }
     }
     return true;
 }
Beispiel #15
0
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$pv_no = LbPaymentVoucher::model()->createPVno();
$pv_date = date('d-m-Y');
$pv_title = false;
$lb_pv_description = false;
$creditBy = AccountProfile::model()->getFullName(Yii::app()->user->id);
if (isset($_REQUEST['id'])) {
    $modelPV = LbPaymentVoucher::model()->findByPk($_REQUEST['id']);
    $pv_no = $modelPV['lb_payment_voucher_no'];
    $pv_date = DateTime::createFromFormat('Y-m-d', $modelPV['lb_pv_date'])->format('d-m-Y');
    $pv_title = $modelPV['lb_pv_title'];
    $pv_create_by = $modelPV['lb_pv_create_by'];
    $lb_pv_description = $modelPV['lb_pv_description'];
    $creditBy = AccountProfile::model()->getFullName($modelPV['lb_pv_create_by']);
}
echo '<span>Fields with * are required.</span><br /><br />';
echo '<div class = "_form_pv">';
echo '<table>';
echo '<tr><td >' . Yii::t('lang', 'PV No*') . ':</td>' . '<td style="padding-left:10px;padding-right:200px"><input id = "pv_no" type = "text" value="' . $pv_no . '" /></td>';
echo '<td>' . Yii::t('lang', 'Date') . ':</td>' . '<td style="padding-left:10px;"><input type="text" id="pv_date" name="LbExpenses[lb_expenses_date]" value="' . $pv_date . '"><span style="display: none" id="LbExpenses_lb_expenses_date_em_" class="help-inline error"></span></td>' . '</tr>';
echo '<tr><td >' . Yii::t('lang', 'Title') . ':</td>' . '<td style="padding-left:10px;padding-right:200px"><input id="pv_title" type = "text" value="' . $pv_title . '" /></td>' . '<td>' . Yii::t('Create ', 'Create By') . ':</td>' . '<td style="padding-left:10px;"><input type = "text" value="' . $creditBy . '" /></td>' . '</tr>';
echo '<tr><td >' . Yii::t('lang', 'Description') . ':</td>' . '<td style="padding-left:10px;padding-right:200px"><textarea id="pv_description" type = "text" >' . $lb_pv_description . '</textarea></td>' . '</tr>';
echo '</table>';
echo '</div>';
?>
<script language="javascript">
 $(document).ready(function(){
        var from_date = $("#pv_date").datepicker({
            format: 'dd-mm-yyyy'
Beispiel #16
0
 /**
  * the List API
  */
 public static function apiList()
 {
     if (isset($_GET['list_type'])) {
         $list_type = $_GET['list_type'];
         switch ($list_type) {
             case 'get_profile_by_account_id':
                 $results = array();
                 if (isset($_GET['account_id'])) {
                     $profile = AccountProfile::model()->getProfile($_GET['account_id']);
                     if ($profile != null) {
                         $results[] = $profile;
                     }
                 }
                 // end if isset account_id
                 return $results;
                 break;
                 // end case get_profile_by_account_id
             // end case get_profile_by_account_id
             default:
                 break;
         }
         // end switch for list_type
     }
     // end if for list_type
 }
Beispiel #17
0
$add = "";
$modelCustomer = LbCustomer::model()->find('lb_record_primary_key=' . $model->lb_pv_company_id);
$modelAddress = LbCustomerAddress::model()->find('lb_record_primary_key = ' . $model->lb_pv_company_address_id);
if (isset($modelAddress->lb_customer_address_line_1) || isset($modelAddress->lb_customer_address_line_2)) {
    $add = 'Address: ';
}
$tblPV = '<table border="0" style="margin:auto;width:100%;" cellpadding="0" cellspacing="0">
        ' . $html_logo . '
        <tr valign="top">
            <td width="300">
                <span style="font-size:20px;font-weight:bold;">PAYMENT VOUCHER</span><br>
                Payment Voucher No: ' . $model->lb_payment_voucher_no . '<br>
                Payment Voucher Date: ' . date('d-M-Y', strtotime($model->lb_pv_date)) . '<br>
                Title : ' . $model->lb_pv_title . '<br />
                Description : ' . $model->lb_pv_description . '<br />
                Create By : ' . AccountProfile::model()->getFullName($model->lb_pv_create_by) . '<br />
                
            </td>
            <td width="400" align="right">
                <span style="font-size:16px;font-weight:bold;">' . (isset($modelCustomer->lb_customer_name) && $modelCustomer->lb_customer_name != "" ? $modelCustomer->lb_customer_name . '. ' : '') . '</span><br>
                ' . (isset($modelCustomer->lb_customer_registration) && $modelCustomer->lb_customer_registration != "" ? "Registration No: " . $modelCustomer->lb_customer_registration . "." : '') . '
                ' . (isset($modelCustomer->lb_customer_website_url) ? "Website: " . $modelCustomer->lb_customer_website_url : '') . '<br>
                ' . $add . (isset($modelAddress->lb_customer_address_line_1) && $modelAddress->lb_customer_address_line_1 != "" ? $modelAddress->lb_customer_address_line_1 . '. ' : '') . '
                        ' . (isset($modelAddress->lb_customer_address_line_2) && $modelAddress->lb_customer_address_line_2 != "" ? $modelAddress->lb_customer_address_line_2 . '. ' : '') . '
                        ' . (isset($modelAddress->lb_customer_address_city) && $modelAddress->lb_customer_address_city != "" ? $modelAddress->lb_customer_address_city . '. ' : '') . '
                        ' . (isset($modelAddress->lb_customer_address_state) && $modelAddress->lb_customer_address_state != "" ? $modelAddress->lb_customer_address_state . '. ' : '') . '
                        ' . (isset($modelAddress->lb_customer_address_country) ? $modelAddress->lb_customer_address_country . '&nbsp;&nbsp;' : '') . '
                        ' . (isset($modelAddress->lb_customer_address_postal_code) ? $modelAddress->lb_customer_address_postal_code : '') . '<br>
               ' . (isset($modelAddress->lb_customer_address_phone_1) ? "Phone: " . $modelAddress->lb_customer_address_phone_1 . "&nbsp;" : '') . '
               ' . (isset($modelAddress->lb_customer_address_fax) ? "Fax: " . $modelAddress->lb_customer_address_fax : '') . '<br>
               ' . (isset($modelAddress->lb_customer_address_email) ? "Email: " . $modelAddress->lb_customer_address_email : '') . '