예제 #1
0
						<th>Insttitucion</th>
						<th>Responsable legal</th>
						<th>Responsable Contacto</th>

					</tr>
				</thead>
				<br>
				<tbody id="bodyt">

				<?php 
if (isset($_SESSION['institucion'])) {
    for ($i = 1; $i < count($_SESSION['institucion']); $i++) {
        $institucion_contraparte = explode('.', $_SESSION['institucion'][$i]);
        $institucion = Instituciones::model()->find('idInstitucion=' . $institucion_contraparte[0]);
        $resp_legal = Responsables::model()->find('idResponsable=' . $institucion_contraparte[1]);
        $resp_cont = Responsables::model()->find('idResponsable=' . $institucion_contraparte[2]);
        echo '<tr id=' . $i . '>';
        echo '<td>' . $institucion->nombreInstitucion . '</td>';
        echo '<td>' . $resp_legal->primerApellidoResponsable . ' ' . $resp_legal->primerNombreResponsable . '</td>';
        echo '<td>' . $resp_cont->primerApellidoResponsable . ' ' . $resp_cont->primerNombreResponsable . '</td>';
        echo '</tr>';
    }
}
?>
					</tbody>
				</table>
			</div>
		</div>
 	</div>

	<a href="#demo3" class="list-group-item opcion" data-toggle="collapse"><h4>Acta de Intención<span class="glyphicon glyphicon-plus-sign pull-right"></span></h4></a>
 /**
  * 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 Responsables the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Responsables::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 public function actionValidacionautocomplete()
 {
     if (isset($_POST['widget'])) {
         $campo_widget = explode(' ', $_POST['widget']);
     }
     //echo $_POST['widget'];
     $criteria = new CDbCriteria();
     $criteria->select = 'idResponsable';
     $criteria->condition = 'CONCAT(CONCAT(primerApellidoResponsable," "),primerNombreResponsable)=:ins OR CONCAT(CONCAT(primerNombreResponsable," "),primerApellidoResponsable)=:ins ';
     $criteria->params = array(':ins' => $_POST['widget']);
     $result = Responsables::model()->findAll($criteria);
     if (count($result) == 1) {
         foreach ($result as $key => $resultado) {
             echo $resultado->idResponsable;
             //	echo " ";
         }
     }
     if (count($result) > 1) {
         echo "varios resultados para el mismo nombre seleccione de la lista autocompletada";
     }
     if (count($result) < 1) {
         echo "El nombre indicado no existe en la base de datos. Agregue un nuevo responsable";
     }
     //echo  "Nombre".	$resul->primerNombreResponsable;
     # code...
     //	foreach ($resul as $key => $resultado) {
     # code...
     //		echo $resultado->primerNombreResponsable;
     //	}
 }