Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : SettingMetadata | ||
리턴 | SettingMetadata | the static model class |
/** * 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 the ID of the model to be loaded */ public function loadModel($id) { $model = Logo::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function run() { if ($this->_oper == 'show_logo') { $criteria = new CDbCriteria(); $criteria->condition = 'logo_id=1'; $logo = Logo::model()->find($criteria); echo '<img src="http://' . $_SERVER['HTTP_HOST'] . Yii::app()->request->baseUrl . '/uploads/multimidia/logo/1/' . $logo->logo_path . '">'; } if ($this->_controller != 'site') { if ($this->_oper == 'show_js') { switch ($this->_controller) { case $this->_controller == 'negociosavenda' && $this->_action == 'view': echo '<script type="text/javascript" src="' . Yii::app()->request->baseUrl . '/js/abas.js"></script>'; break; } } elseif ($this->_oper == 'show_css') { switch ($this->_controller) { case 'quemsomos': echo '<link rel="stylesheet" type="text/css" href="' . Yii::app()->request->baseUrl . '/css/quem-somos.css" charset="utf-8" />'; break; /*case 'negociosavenda': echo '<link rel="stylesheet" type="text/css" href="'.Yii::app()->request->baseUrl.'/css/scroll-twitter.css" charset="utf-8" />'; break;*/ } } elseif ($this->_oper == 'change_id_body') { switch ($this->_controller) { case $this->_controller == 'quemsomos' && ($this->_action == 'index' || $this->_action == 'operacaosunbelt'): echo 'sobre-sunbelt'; break; case $this->_controller == 'quemsomos' && $this->_action == 'equipefranqueados': echo 'sobre-equipe-franqueados'; break; case $this->_controller == 'paginas' && ($this->_id_pagina == 56 || $this->_id_pagina == 58): echo 'sobre-sunbelt'; break; case $this->_controller == 'paginas' && $this->_id_pagina == 57: echo 'sobre-equipe-franqueados'; break; } } } }
.date_table{ border:none; } </style> <div class="atnd_Con" style="padding-left:20px; padding-top:30px;"> <?php if (isset($_REQUEST['id'])) { ?> <table width="100%" border="0" cellspacing="0" cellpadding="0" > <tr> <td class="first"> <?php $logo = Logo::model()->findAll(); ?> <?php if ($logo != NULL) { //echo $logo[0]->photo_file_name; //Yii::app()->runController('Configurations/displayLogoImage/id/'.$logo[0]->primaryKey); echo '<img src="uploadedfiles/school_logo/' . $logo[0]->photo_file_name . '" alt="' . $logo[0]->photo_file_name . '" class="imgbrder" width="100%" />'; } ?> </td> <td align="center" valign="middle" class="first"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="listbxtop_hdng first" style="text-align:center;"></td> </tr>
public function actionRemove() { $posts_1 = Logo::model()->findByAttributes(array('id' => $_REQUEST['id'])); $logo_path = 'uploadedfiles/school_logo/' . $posts_1->photo_file_name; if (file_exists($logo_path)) { unlink($logo_path); } $posts_1->delete(); $this->redirect(array('create')); }
<?php /* @var $this BiobankController */ /* @var $model Biobank */ try { $logo = isset($model->activeLogo) && $model->activeLogo != null && $model->activeLogo != "" ? Logo::model()->findByPk(new MongoId($model->activeLogo)) : null; } catch (Exception $ex) { $logo = null; Yii::app()->user->setFlash('error', 'An error occured with logo, unable to display it'); } ?> <div class="logoHeader"> <h1>View Biobank #<?php echo $model->id; ?> </h1> <div class="logo"> <?php if ($logo != null) { echo $logo->toHtml(); } ?> </div> </div> <?php $attributes_oblig = array('identifier', 'name', 'collection_name', 'collection_id', 'biobank_class', 'diagnosis_available', array('name' => 'address', 'value' => nl2br($model->getAddress()), 'type' => 'raw')); $attributes_facult = array('website'); $attributes_qualite = array('cert_ISO9001', 'cert_NFS96900', 'cert_autres', 'observations'); $attributes_diagnostic = array('A00-B99', 'C00-D48', 'D50-D89', 'E00-E90', 'F00-G99', 'H00-H59', 'H60-H95', 'I00-I99', 'J00-J99', 'K00-K93', 'L00-L99', 'M00-M99', 'N00-N99', 'O00-O99', 'P00-P96', 'Q00-Q99', 'R00-Z99'); $attributes_samples = array('sampling_disease_group', 'sampling_disease_group_code', 'keywords_MeSH');
/** * each biobank have 2 pages * @param type $pdf * @param type $model * @return type */ public static function getPage($pdf, $model) { $pdf->AddPage(); $pdf->Bookmark($model->name, 0, 0, '', 'B', array(0, 64, 128)); $pdf->SetAutoPageBreak(TRUE, 10); //marge inferieure $pdf->Ln(4); $pdf->SetFont('timesB', '', 11); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(0, 0, $model->name, 0, false, 'L', 0, '', 0, false, 'T', 'M'); $pdf->Ln(4); $pdf->SetFont('times', '', 12); $pdf->Cell(0, 0, 'Identifiant BRIF : ' . $model->identifier, 0, false, 'L', 0, '', 0, false, 'T', 'M'); $logo = isset($model->activeLogo) && $model->activeLogo != null && $model->activeLogo != "" ? Logo::model()->findByPk(new MongoId($model->activeLogo)) : null; if ($logo != null) { $pdf->Image($logo->toSimpleImage(), '', 16, 25, 10, '', '', '', true, 300, 'R'); } $pdf->Ln(6); //affichage du cadre Coordinateur : addresse //color gold //espace vide d une ligne $pdf->Cell(0, 0, '', 0, 1, '', 0, '', 4); $pdf->SetFillColor(255, 215, 0); $pdf->SetFont('helvetica', 'B', 12); $pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))); $pdf->RoundedRect($x = 10, $y = 35, $w = 190, $h = 30, $r = 3.5, $round_corner = '1111', $style = 'DF'); //color red to text $pdf->SetTextColor(205, 0, 0); $pdf->MultiCell(90, 5, 'Coordinateur:', 0, 'L', 1, 0, '', '', false); $pdf->MultiCell(90, 5, 'Adresse:', 0, 'L', 1, 1, '', '', false); //color black text $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('helvetica', '', 10); $pdf->MultiCell(90, 2, $model->getShortContactInv() . "\n" . $model->getPhoneContact() . "\n" . $model->getEmailContact(), 0, 'L', 1, 0, '', ''); $website = isset($model->website) ? $model->website : ''; $pdf->MultiCell(90, 2, $model->getAddress() . "\n" . $website, 0, 'L', 1, 1, '', ''); $pdf->Ln(7); //add each paragraph with title $pdf = BiobanksPDFExporter::addParagraph($pdf, 'Présentation : ', isset($model->presentation) ? $model->presentation : ''); $pdf = BiobanksPDFExporter::addParagraph($pdf, 'Thématiques : ', isset($model->thematiques) ? $model->thematiques : ''); $pdf = BiobanksPDFExporter::addParagraph($pdf, 'Projets de recherche : ', isset($model->projetRecherche) ? $model->projetRecherche : ''); $pdf = BiobanksPDFExporter::addParagraph($pdf, 'Publications : ', isset($model->publications) ? $model->publications : ''); $pdf = BiobanksPDFExporter::addParagraph($pdf, 'Réseaux : ', isset($model->reseaux) ? $model->reseaux : ''); $pdf = BiobanksPDFExporter::addParagraph($pdf, 'Qualité : ', isset($model->qualite) ? $model->qualite : ''); return $pdf; }
<script type="text/javascript"> function clearText(field) { if (field.defaultValue == field.value) field.value = ''; else if (field.value == '') field.value = field.defaultValue; } </script> </head> <body> <div class="loginimg"></div> <div class="loginboxWrapper"> <div class="loginbox"> <!--<div class="sample_logo"></div>--> <div class="sample_logo"> <?php $img = Logo::model()->findAll(); if (count($img) != 0) { foreach ($img as $img_1) { //echo '<img class="imgbrder" src="'.$this->createUrl('Configurations/DisplaySavedImage&id='.$img_1->primaryKey).'" alt="'.$img_1->photo_file_name.'" width="200" />'; } } ?> </div> <?php $form = $this->beginWidget('CActiveForm', array('id' => 'login-content', 'enableClientValidation' => true, 'clientOptions' => array('validateOnSubmit' => true))); ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%" height="15"><p> <?php echo $form->textField($model, 'username', array('class' => 'text-input', 'onblur' => 'clearText(this)', 'onfocus' => 'clearText(this)', 'value' => 'Username'));
/** * * get the logo object for this biobank, null if not setted * @return Logo */ public function getLogo() { $result = null; if (isset($this->vitrine) && isset($this->vitrine['logo'])) { $result = Logo::model()->findByPk(new MongoId($this->vitrine['logo'])); } return $result; }