Exemplo n.º 1
0
?>
		<?php 
echo $form->error($model, 'pdf_en');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'pdf_th');
?>
<br/>
		<?php 
if (!$model->isNewRecord) {
    echo $model->pdf_th . " ";
    if ($model->pdf_th) {
        echo cHtml::link('view', '../../uploads/documents/' . $model->pdf_th);
    }
}
?>
<br />
		<?php 
echo $form->fileField($model, 'pdf_th', array('style' => 'border: none;box-shadow:none'));
?>
		<?php 
echo $form->error($model, 'pdf_th');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'last_update');
Exemplo n.º 2
0
<br />
		<?php 
echo $form->fileField($model, 'pdf_en', array('style' => 'border: none;box-shadow:none'));
?>
		<?php 
echo $form->error($model, 'pdf_en');
?>
	</div>

	<div class="row"><br/>
                <label>อัพโหลดไฟล์ pdf<br/>(ภาษาไทย)</label><br/>
		<?php 
if (!$model->isNewRecord) {
    echo $model->pdf_th . " ";
    if ($model->pdf_th) {
        echo cHtml::link('ดูไฟล์ต้นฉบับ', '../../uploads/news/pdf/' . $model->pdf_th);
    }
}
?>
<br />
		<?php 
echo $form->fileField($model, 'pdf_th', array('style' => 'border: none;box-shadow:none'));
?>
		<?php 
echo $form->error($model, 'pdf_th');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'create_date');
Exemplo n.º 3
0
		<?php echo $form->error($model,'vdo_link'); ?>
	</div>      
        
        <div class="row buttons"><br/>         
	</div>

        <div class="row"><br/>
                <label>อัพโหลดไฟล์ pdf<br/>(ภาษาอังกฤษ)</label><br/>
                <?php if(!$model->isNewRecord) {echo $model->pdf_en." "; if($model->pdf_en) {echo cHtml::link('ดูไฟล์ต้นฉบับ', '../../uploads/news/pdf/'.$model->pdf_en);} }?><br />
		<?php echo $form->fileField($model,'pdf_en',array('style'=>'border: none;box-shadow:none')); ?>
		<?php echo $form->error($model,'pdf_en'); ?>
	</div>

	<div class="row"><br/>
                <label>อัพโหลดไฟล์ pdf<br/>(ภาษาไทย)</label><br/>
		<?php if(!$model->isNewRecord) {echo $model->pdf_th." "; if($model->pdf_th) {echo cHtml::link('ดูไฟล์ต้นฉบับ', '../../uploads/news/pdf/'.$model->pdf_th);} }?><br />
		<?php echo $form->fileField($model,'pdf_th',array('style'=>'border: none;box-shadow:none')); ?>
		<?php echo $form->error($model,'pdf_th'); ?>
	</div>
        
	<div class="row">
		<?php echo $form->labelEx($model,'create_date'); ?>
                <?php list($year,$month,$day) = explode('-',$model->create_date);
                      $crate_date = $day.'/'.$month.'/'.$year;
                      $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                        'model' => $model,
                        'attribute' => 'create_date',
                        'language'=>'th',

                        'options'=>array(
                                    'showAnim'=>'fold',
Exemplo n.º 4
0
 public function renderDataCellContent($row, $data)
 {
     $isModel = $data instanceof CModel;
     if ($isModel) {
         $widgetClass = 'EditableField';
         $attribute = empty($this->editable['attribute']) ? $this->name : $this->editable['attribute'];
         $options = array('model' => $data, 'attribute' => $attribute);
         //if value defined in column config --> we should evaluate it
         //and pass to widget via `text` option: set flag `passText` = true
         $passText = !empty($this->value);
     } else {
         $widgetClass = 'Editable';
         $options = array('pk' => $data[$this->grid->dataProvider->keyField], 'name' => empty($this->editable['name']) ? $this->name : $this->editable['name']);
         $passText = true;
         //if autotext will be applied, do not pass `text` option (pass `value` instead)
         if (empty($this->value) && Editable::isAutotext($this->editable, isset($this->editable['type']) ? $this->editable['type'] : '')) {
             $options['value'] = $data[$this->name];
             $passText = false;
         }
     }
     //for live update
     $options['liveTarget'] = $this->grid->id;
     $options = CMap::mergeArray($this->editable, $options);
     //get text for element
     $ctext = CHtml::value($data, $attribute);
     //if value defined for column --> use it as element text
     if ($passText) {
         ob_start();
         parent::renderDataCellContent($row, $data);
         $text = ob_get_clean();
         $ctext = $text;
         $options['text'] = $text;
         $options['encode'] = false;
     }
     //apply may be a string expression, see https://github.com/vitalets/x-editable-yii/issues/33
     if (isset($options['apply']) && is_string($options['apply'])) {
         $options['apply'] = $this->evaluateExpression($options['apply'], array('data' => $data, 'row' => $row));
     }
     //evaluate htmlOptions inside editable config as they can depend on $data
     //see https://github.com/vitalets/x-editable-yii/issues/40
     if (isset($options['htmlOptions']) && is_array($options['htmlOptions'])) {
         foreach ($options['htmlOptions'] as $k => $v) {
             if (is_string($v) && (strpos($v, '$data') !== false || strpos($v, '$row') !== false)) {
                 $options['htmlOptions'][$k] = $this->evaluateExpression($v, array('data' => $data, 'row' => $row));
             }
         }
     }
     $this->grid->controller->widget($widgetClass, $options);
     //Added to support creating models on the fly
     //$ctext = CHtml::value($data, $attribute);
     $mClass = empty($this->modelName) ? get_class($data) : $this->modelName;
     if (empty($this->parentModel)) {
         echo cHtml::openTag('input', array('type' => 'hidden', 'class' => "optvalinput{$attribute}", 'id' => "{$mClass}_{$row}_{$attribute}", 'name' => "{$mClass}[{$row}][{$attribute}]", 'value' => $ctext));
     } else {
         echo cHtml::openTag('input', array('type' => 'hidden', 'class' => "optvalinput{$attribute}", 'id' => "{$this->parentModel[1]}_{$this->parentModel[0]}_{$mClass}_{$row}_{$attribute}", 'name' => "{$this->parentModel[1]}[{$this->parentModel[0]}][{$mClass}][{$row}][{$attribute}]", 'value' => $ctext));
     }
     echo cHtml::closeTag('input');
 }
Exemplo n.º 5
0
?>
		<?php 
echo $form->error($model, 'pdf_en');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'pdf_th');
?>
<br/>
		<?php 
if (!$model->isNewRecord) {
    echo $model->pdf_th . " ";
    if ($model->pdf_th) {
        echo cHtml::link('view', '../../uploads/student_services/' . $model->pdf_th);
    }
}
?>
<br />
		<?php 
echo $form->fileField($model, 'pdf_th', array('style' => 'border: none;box-shadow:none'));
?>
		<?php 
echo $form->error($model, 'pdf_th');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'last_update');
Exemplo n.º 6
0
echo $form->fileField($model, 'pdf_en', array('style' => 'border: none;box-shadow:none'));
?>
		<?php 
echo $form->error($model, 'pdf_en');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'pdf_th');
?>
		<?php 
if (!$model->isNewRecord) {
    echo $model->pdf_th . " ";
    if ($model->pdf_th) {
        echo cHtml::link('view', '../../uploads/pdf/' . $model->pdf_th);
    }
}
?>
<br />
		<?php 
echo $form->fileField($model, 'pdf_th', array('style' => 'border: none;box-shadow:none'));
?>
		<?php 
echo $form->error($model, 'pdf_th');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'images');