Example #1
0
<?php

/* @var $this SeguimientoComercialCorporativoController */
/* @var $model SeguimientoComercialCorporativo */
/* @var $form CActiveForm */
?>

<div class="form">

<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'seguimiento-comercial-corporativo-form', 'enableAjaxValidation' => false));
$elId = $_GET['id'];
$elAlumno = ProspectosCorporativos::model()->findByPk("{$elId}");
?>

<div class="row">
	<div class="span2"></div>
	<div class="span8">
		<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $elAlumno, 'attributes' => array('nombre', 'nit_cc', 'email', array('name' => 'Lugar de Origen', 'value' => $elAlumno->lugarOrigen->lugar, ''))));
?>
	</div>
	<div class="span2"></div>
</div>

	<p class="note">Campos con <span class="required">*</span> son requeridos.</p>

	<?php 
echo $form->errorSummary($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 ProspectosCorporativos the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = ProspectosCorporativos::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #3
0
}
?>

<h1><?php 
echo $titulo;
?>
</h1>

<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'seguimiento-comercial-corporativo-grid', 'dataProvider' => $model->search(), 'afterAjaxUpdate' => 'reinstallDatePickerSeguimiento', 'filter' => $model, 'columns' => array(array('header' => 'ID.', 'name' => 'id', 'value' => '$data->id', 'htmlOptions' => array('width' => '20')), array('header' => 'Fecha de acción', 'name' => 'fecha_seguimiento', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('language' => 'es', 'model' => $model, 'attribute' => 'fecha_seguimiento', 'options' => array('showAnim' => 'fold', 'language' => 'es', 'dateFormat' => 'dd-mm-yy', 'changeMonth' => true, 'changeYear' => true, 'yearRange' => '2014:2025'), 'htmlOptions' => array('id' => 'datepicker_for_fecha_seguimiento', 'style' => 'height:20px;width:80px;'), 'defaultOptions' => array('showOn' => 'focus', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true), 'value' => 'Yii::app()->dateformatter->format("dd-MM-yyyy",$data[\'fecha_seguimiento\']);', 'htmlOptions' => array('width' => '80')), array('header' => 'Corporativo', 'name' => 'corporativo_id', 'filter' => CHtml::listData(ProspectosCorporativos::model()->findAll(), 'id', 'nombre'), 'value' => '$data->corporativo->nombre', 'htmlOptions' => array('width' => '220')), array('header' => 'Tema', 'name' => 'tema_id', 'filter' => CHtml::listData(TemaSeguimiento::model()->findAll(), 'id', 'tema'), 'value' => '$data[\'tema\'][\'tema\']'), array('header' => 'Observaciones', 'name' => 'comentario', 'value' => '$data->comentario'), 'usuario_id', 'ultimo_seguimiento', array('class' => 'CButtonColumn'))));
?>

<?php 
Yii::app()->clientScript->registerScript('re-install-date-picker', "\n\tfunction reinstallDatePickerSeguimiento(id, data) {\n\t        //use the same parameters that you had set in your widget else the datepicker will be refreshed by default\n\t    \$('#datepicker_for_fecha_seguimiento').datepicker(jQuery.extend({showMonthAfterYear:false},jQuery.datepicker.regional['es'],{'dateFormat':'dd-mm-yy'}));\n\t    //\$('#datepicker_for_fecha_seguimiento').datepicker(\$.datepicker.regional[ 'es' ]);\n\t  //\$('#datepicker_for_fecha_seguimiento').datepicker({dateFormat: 'dd-mm-yy'});\n\t}\n\t");
?>

<script>
    $(document).ready(function()
    {
        $('body').on('dblclick', '#seguimiento-comercial-corporativo-grid tbody tr', function(event)
        {
            var
                rowNum = $(this).index(),
                keys = $('#seguimiento-comercial-corporativo-grid > div.keys > span'),
                rowId = keys.eq(rowNum).text();