/**
  * @return string
  */
 private function _calculateServerInfo()
 {
     $info[] = '<a href="http://craftcms.com/">Craft CMS</a> ' . Craft::t('{version} build {build}', array('version' => CRAFT_VERSION, 'build' => CRAFT_BUILD));
     $info[] = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '';
     $info[] = 'Yii v' . craft()->getYiiVersion();
     $info[] = \CTimestamp::formatDate(craft()->locale->getTimeFormat());
     return implode(' | ', $info);
 }
<?php 
$form = $this->beginWidget('BootActiveForm', array('id' => 'u-journal-formOut', 'type' => 'horizontal', 'enableAjaxValidation' => false));
?>

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

<div class="control-group">
	<?php 
echo $form->labelEx($model, 'input_date', array('class' => 'control-label'));
?>
	<div class="controls">
		<?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'id' => 'g2', 'value' => CTimestamp::formatDate('yyyy-MM-dd', $model->input_date), 'attribute' => 'input_date', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'dd-mm-yy', 'minDate' => '-20', 'maxDate' => '+1M +10D'), 'htmlOptions' => array()));
?>
	</div>
</div>

<?php 
//echo $form->dropDownListRow($model,'yearmonth_periode',array(Yii::app()->settings->get("System", "cCurrentPeriod")=>Yii::app()->settings->get("System", "cCurrentPeriod")));
?>

<?php 
echo $form->dropDownListRow($model, 'var_account', tAccount::cashBankAccount());
echo $form->textFieldRow($model, 'cb_receiver', array('class' => 'span3'));
echo $form->textAreaRow($model, 'remark', array('class' => 'span5', 'rows' => 3));
?>

<?php 
예제 #3
0
<div class="form" style="border: 1px inset #e1e1e1;padding: 2% ">

    <?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'purchases-invoices-form', 'enableAjaxValidation' => false));
?>

    <?php 
echo $form->errorSummary($model1);
?>
    <div class="row-inline">
        <div class="row">
            <?php 
echo $form->labelEx($model1, 'issue_date');
?>
            <?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => 'PurchasesInvoices[issue_date]', 'model' => $model1, 'attribute' => 'issue_date', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'yy-mm-dd'), 'htmlOptions' => array('style' => 'height:20px;', 'value' => CTimestamp::formatDate('Y-m-d'))));
?>

            <?php 
echo $form->error($model1, 'issue_date');
?>
        </div>


    </div>



    <div class="row">
        <?php 
echo $form->labelEx($model1, 'supplier_id');
예제 #4
0
 /**
  * action for update
  * 
  * @param mixed $id
  */
 public function actionUpdate($id = null)
 {
     Yii::import('application.modules.portfolio.widgets.PhotoPortfolio.PhotoPortfolioWidget');
     $news = $this->loadModel($this->_modelclass, $id);
     $post = isset($news->post) ? $news->post : new Posting();
     if ($post->scenario == 'insert') {
         $this->setPostType($post);
         if (empty($news->publication_date)) {
             $news->publication_date = CTimestamp::formatDate('Y-m-d H:i:s');
         }
     }
     $portfolio = isset($news->post->portfolio) ? $news->post->portfolio : new Portfolio();
     $portfolio->gallery_type = 1;
     if (!empty($_POST[$this->_modelclass])) {
         $post->attributes = $_POST['Posting'];
         //set attributes
         $news->attributes = $_POST[$this->_modelclass];
         $posttitle = $post->title;
         //save name of posting to buffer
         $portfolioWidget = new PhotoPortfolioWidget();
         $galleries = $portfolioWidget->validatePortfolio($_POST);
         if (!empty($galleries)) {
             $portfolio = $galleries[0];
         }
         $post->validate();
         $news->validate();
         $success = !$post->hasErrors() && !$news->hasErrors() && is_object($portfolio) && !$portfolio->hasErrors();
         if ($success && isset($post->tags)) {
             //search for deleted tags
             foreach ($post->tags as $tag) {
                 if (!in_array($tag->tag_id, $post->postedTags)) {
                     $post->deletedTags[] = $tag;
                 }
             }
         }
         $strMessage = ($post->isNewRecord ? Yii::t('main', 'New article was created successfully') : Yii::t('main', 'Article was saved successfully')) . ' (' . Yii::t('main', 'Title') . ': ' . $posttitle . ')';
         if ($success) {
             $transaction = Yii::app()->db->beginTransaction();
             if ($success = $portfolio->savePortfolio()) {
                 $post->gallery_id = $portfolio->gallery_id;
                 if ($success = $post->save()) {
                     $news->post_id = $post->post_id;
                     if ($success = $news->save()) {
                         //if exists deleted tags - process its
                         foreach ($post->deletedTags as $tag) {
                             $countDeleted = Tagpost::model()->deleteAll('tag_id = :tag_id AND post_id = :post_id', array(':tag_id' => $tag->tag_id, ':post_id' => $post->post_id));
                             if (!($success = $countDeleted > 0)) {
                                 break;
                             }
                         }
                         foreach ($post->postedTags as $tag) {
                             $exists = Tagpost::model()->exists('tag_id = :tag_id AND post_id = :post_id', array(':tag_id' => $tag, ':post_id' => $post->post_id));
                             if (!$exists) {
                                 $tagpost = new Tagpost();
                                 $tagpost->tag_id = $tag;
                                 $tagpost->post_id = $post->post_id;
                                 $tagpost->save();
                             }
                         }
                     }
                 }
             }
             if ($success) {
                 $transaction->commit();
                 $resultMode = $success ? 'success' : 'error';
                 Yii::app()->user->setFlash($resultMode, $strMessage);
                 //show flash message
                 $this->redirect($this->createUrl('index'));
             } else {
                 $transaction->rollback();
             }
         }
     }
     $this->render('application.modules.news.views.default.form', array('news' => $news, 'post' => $post, 'portfolio' => $portfolio));
 }
예제 #5
0
 public function rules()
 {
     // NOTE: you should only define rules for those attributes that
     // will receive user inputs.
     return array(array('created_date', 'default', 'value' => CTimestamp::formatDate('Y-m-d H:i:s')), array('post_type', 'default', 'value' => self::POST_TYPE_UNKNOWN), array('gallery_id', 'default', 'value' => 4), array('title, post_type, created_date, gallery_id', 'required'), array('post_type, is_active', 'numerical', 'integerOnly' => true), array('title', 'length', 'max' => 255), array('gallery_id', 'length', 'max' => 11), array('post_id,title, description, tagList', 'safe'), array('post_id, title, description, post_type, created_date, is_active, gallery_id', 'safe', 'on' => 'search'));
 }
예제 #6
0
 /**
  * Automatically handles TimeAgo for UTC
  *
  * @param  mxied  $date   Likely a string in date format (of some kind)
  * @param  string $format The format we want to FORCE the dts to be formatted to
  *                        If this isn't supplied, we'll pull it from Cii::getConfig()
  * @return CHtml:tag span element
  */
 public static function timeago($date, $format = NULL)
 {
     Yii::app()->controller->widget('vendor.yiqing-95.YiiTimeAgo.timeago.JTimeAgo', array('selector' => ' .timeago', 'useLocale' => false, 'settings' => array('refreshMillis' => 60000, 'allowFuture' => true, 'strings' => array('prefixAgo' => null, 'prefixFromNow' => null, 'suffixAgo' => "ago", 'suffixFromNow' => "from now", 'seconds' => "less than a minute", 'minute' => "about a minute", 'minutes' => "%d minutes", 'hour' => "about an hour", 'hours' => "about %d hours", 'day' => "a day", 'days' => "%d days", 'month' => "about a month", 'months' => "%d months", 'year' => "about a year", 'years' => "%d years", 'wordSeparator' => " ", 'numbers' => array()))));
     return CHtml::tag('span', array('class' => "timeago", 'style' => 'text-decoration:none; cursor: default', 'rel' => 'tooltip', 'data-original-title' => Cii::formatDate($date, $format), 'title' => CTimestamp::formatDate('c', $date)), Cii::formatDate($date, $format));
 }
예제 #7
0
		 <?php 
    echo CTimestamp::formatDate('d.m.Y H:i', $quote->createdTime);
    ?>
		 <br /><br />
	<?php 
}
?>
	
	<?php 
echo CHtml::activeLabelEx($quote, 'approvedTime');
?>
<br />
	<?php 
echo CHtml::checkBox('Quote[approvedTime]', $quote->approvedTime);
?>
		 <?php 
if ($quote->approvedTime) {
    ?>
		 (<?php 
    echo CTimestamp::formatDate('d.m.Y H:i', $quote->approvedTime);
    ?>
)
		 <?php 
}
?>
	<br /><br />
	</p>

	<?php 
echo CHtml::submitButton($create ? 'Add' : 'Update', array('class' => 'button'));
echo CHtml::endForm();
예제 #8
0
<?php 
$form = $this->beginWidget('BootActiveForm', array('id' => 'allocation-form', 'enableAjaxValidation' => false, 'type' => 'horizontal'));
?>

	
	<?php 
echo $form->errorSummary($model);
?>
	
	<div class="control-group">
		<?php 
echo $form->labelEx($model, 'periode_date', array('class' => 'control-label'));
?>
		<div class="controls">
			<?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'value' => CTimestamp::formatDate('yyyy-MM-dd', $model->periode_date), 'attribute' => 'periode_date', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'yymm'), 'htmlOptions' => array()));
?>
		</div>
	</div>

	<?php 
echo $form->dropDownListRow($model, 'report_id', tAccountReport::accountReportList());
?>
	
	<div class="form-actions">
	<?php 
echo CHtml::htmlButton('<i class="icon-print"></i> Report', array('class' => 'btn', 'type' => 'submit'));
?>
	</div>
	
<?php 
예제 #9
0
//echo $form->errorSummary($model);
?>

<?php 
echo $form->dropDownListRow($model, 'account_no_id', tAccount::item());
?>

<?php 
echo $form->labelEx($model, 'begindate');
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'value' => CTimestamp::formatDate('yyyy-MM-dd', $model->begindate), 'attribute' => 'begindate', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'dd-mm-yy'), 'htmlOptions' => array('style' => 'height:24px;')));
echo $form->error($model, 'begindate');
?>

<?php 
echo $form->labelEx($model, 'enddate');
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'value' => CTimestamp::formatDate('yyyy-MM-dd', $model->enddate), 'attribute' => 'enddate', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'dd-mm-yy'), 'htmlOptions' => array('style' => 'height:24px;')));
?>

<?php 
echo $form->labelEx($model, 'type_report_id');
echo $form->dropDownList($model, 'type_report_id', array('1' => 'Summary Style', '2' => 'Detail Style'));
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton('<i class="icon-ok"></i> Report', array('class' => 'btn', 'type' => 'submit'));
?>
</div>

<?php 
$this->endWidget();
예제 #10
0
    <hr>
<div class="row">	
    
    	<div class="col-xs-3">
	    <?php 
echo $form->textFieldGroup($model, 'telefono_local', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5'))));
?>
	</div>
      	<div class="col-xs-3">
            <?php 
echo $form->textFieldGroup($model, 'celular', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5'))));
?>
        </div>
        <div class="col-xs-3">		
	    <?php 
echo $form->textFieldGroup($model, 'fecha_registro', array('widgetOptions' => array('options' => array('format' => 'yyyy-mm-dd'), 'htmlOptions' => array('value' => CTimestamp::formatDate('d-m-Y'), 'readonly' => 'readonly', 'class' => 'span5'))));
?>
	
        </div>
</div>
    <hr>
<div class="row">	
    <div class="col-xs-3">
	<?php 
echo $form->textFieldGroup($model, 'observaciones_personal', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5', 'maxlength' => 150))));
?>
    </div>
     <div class="col-xs-3">
	<?php 
echo $form->textFieldGroup($model, 'direccion', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5', 'maxlength' => 150))));
?>