Ejemplo n.º 1
0
    <p class="help-block">Fields with <span class="required">*</span> are required.</p>

    <?php 
echo $form->errorSummary($model);
?>
    <table>
        <tr>
            <div class="row">
                <div class="col-md-3 col-sm-6">
                    <div class="span2"><?php 
echo $form->labelEx($model, 'paper', array('class' => 'inline-labels'));
?>
</div>
                    <div class="span3"><?php 
echo $form->dropDownList($model, 'paper', CHtml::listData(PaperType::model()->findAll(), 'id', 'name'));
?>
</div>    
                </div>
            </div>
        </tr>
        <tr>
            <div class="row">
                <div class="col-md-3 col-sm-6">
                    <div class="span2"><?php 
echo $form->labelEx($model, 'fileType', array('class' => 'inline-labels'));
?>
</div>
                    <div class="span3"><?php 
echo $form->dropDownList($model, 'fileType', CHtml::listData(FileType::model()->findAll(), 'id', 'name'), array('prompt' => '---', 'ajax' => array('type' => 'POST', 'id' => 'drop_selection', 'url' => CController::createUrl('dynamicrows2'), 'update' => '#details', 'data' => array('selection' => 'js:this.value'))));
?>
Ejemplo n.º 2
0
<?php

/* @var $this LabelController */
/* @var $data Label */
?>

<?php 
$this->widget('application.extensions.print.printWidget', array('cssFile' => 'print.css', 'printedElement' => '#view', 'htmlOptions' => array('style' => 'padding:20px')));
?>

<div id="view">

    <?php 
$paper = PaperType::model()->findByAttributes(array('id' => $labelParams['paper']));
$paperWidth = $paper['width'];
if (trim($labelParams['fileType']) != '') {
    $fileType = $labelParams['fileType'];
    $filetypeRow = FileType::model()->findByAttributes(array('id' => $fileType));
} else {
    $filetypeRow['label_width'] = 400;
    $filetypeRow['label_height'] = 100;
}
$label_width = (int) $filetypeRow['label_width'] . 'px';
$label_height = (int) $filetypeRow['label_height'] . 'px';
$paper = $labelParams['paper'];
$numColumns = floor($paperWidth / $filetypeRow['label_width']);
$connection = Yii::app()->db;
if (trim($labelParams['depts']) == '') {
    $sql = "select CODE,TITLE from fopen";
} else {
    $deptRow = Dept::model()->find('id=:id', array(':id' => $labelParams['depts']));
 /**
  * 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 PaperType the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = PaperType::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }