/** * This is the default 'index' action that is invoked * when an action is not explicitly requested by users. */ public function actionIndex() { // layout halaman index $this->layout = 'index-page'; // one page about $criteriaAbout = new CDbCriteria(array('condition' => "t.key='About'")); $about = Pages::model()->findAll($criteriaAbout); // one page features $criteriaFeatures = new CDbCriteria(array('condition' => "t.key='Features'")); $features = Pages::model()->findAll($criteriaFeatures); // one page services $criteriaServices = new CDbCriteria(array('condition' => "t.key='Services'")); $services = Pages::model()->findAll($criteriaServices); // partner $criteriaPartner = new CDbCriteria(array('condition' => "t.active='1' AND t.category='Partner'")); $partner = Partner::model()->findAll($criteriaPartner); // product $criteriaProduct = new CDbCriteria(array('condition' => "t.active='1' AND t.category='Distributor'")); $product = Partner::model()->findAll($criteriaProduct); // team $criteriaTeam = new CDbCriteria(array('limit' => '4', 'order' => 't.sequence ASC')); $team = Team::model()->findAll($criteriaTeam); // news $criteriaNews = new CDbCriteria(array('limit' => '3')); $news = News::model()->findAll($criteriaNews); // form contact di halaman index $model = new Contacts('search'); $model->unsetAttributes(); if (isset($_GET['Contacts'])) { $model->attributes = $_GET['Contacts']; } $this->render('index', array('about' => $about, 'features' => $features, 'services' => $services, 'partner' => $partner, 'product' => $product, 'team' => $team, 'news' => $news, 'model' => $model)); }
public function get_team_name($position) { $team = Team::model()->findAllByAttributes(array('tournament_id' => $this->id, 'position' => $position)); $team_name = ''; foreach ($team as $t) { $player_name = explode(' ', $t->player->name); $team_name .= $player_name[0] . " " . $player_name[1][0] . "." . " & "; } return rtrim($team_name, ' & '); }
/img/user.jpg" >Arif</option> <option><img src="<?php echo Yii::app()->request->baseUrl; ?> /img/user.jpg" >Yuda</option> <option><img src="<?php echo Yii::app()->request->baseUrl; ?> /img/user.jpg" >Riki</option> </select> --> <select class="select-user" name="payments" style="width:250px;"> <option value="" >select user</option> <?php $user = Project::model()->findByPk($de[id])->worker; foreach (Team::model()->findAll() as $tim) { ?> <option <?php if ($user == $tim[id]) { echo "selected"; } ?> value="<?php echo $tim->id; ?> " data-image="<?php echo Yii::app()->request->baseUrl; ?> /img/icon-team/<?php echo $tim->image; ?>
/** * 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 Team the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Team::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function afterSave() { parent::afterSave(); $this->getUntertitel(); $links = array_unique($this->teamLinks); if (Yii::app()->getModule('event')->team) { foreach ($this->teamEvents as $t) { $t->delete(); } foreach ($links as $key) { $tm = Team::model()->findCachedByKey($key); $tId = $tm->id; $t = new TeamEvent(); $t->attributes = array('event_id' => $this->id, 'team_id' => $tId); $t->save(); } } }
public function actionResultsModal() { if (Yii::app()->request->isPostRequest) { throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.'); } $message = 'fail'; if (isset($_GET['data'])) { $team_1 = $_GET['data']['team_1']; $team_2 = $_GET['data']['team_2']; $player_data = array(); $team = Team::model()->findAllByAttributes(array('challonge_participant_id' => $team_1)); $team1 = ''; foreach ($team as $t) { $player_name = explode(' ', $t->player->name); $team1 .= $player_name[0] . " " . $player_name[1][0] . "." . " / "; $player_data[] = array('name' => $t->player->name, 'id' => $t->player_id); } $team1 = rtrim($team1, ' / '); $team = Team::model()->findAllByAttributes(array('challonge_participant_id' => $team_2)); $team2 = ''; foreach ($team as $t) { $player_name = explode(' ', $t->player->name); $team2 .= $player_name[0] . " " . $player_name[1][0] . "." . " / "; $player_data[] = array('name' => $t->player->name, 'id' => $t->player_id); } $team2 = rtrim($team2, ' / '); $message = 'success'; } echo CJSON::encode(array('status' => $message, 'team_1' => $team1, 'team_2' => $team2, 'team_1_id' => $team_1, 'team_2_id' => $team_2, 'player_data' => $player_data)); }
<?php } else { ?> <?php echo Status::model()->findByPk($de[status])->name; ?> <?php } ?> </td> <td align="center"> <select class="select-user-tambah" name="payments" style="width:250px;display:block"> <option value="0" >ADD</option> <?php $user = Project::model()->findByPk($de[id])->worker; foreach (Team::model()->findAll("position = 2") as $tim) { ?> <?php $filename = Yii::app()->basePath . "/../img/icon-team/{$tim->image}"; // $filename =Yii::app()->getBasePath()."\..\img\icon-team\<?php echo $tim->image"; // echo $filename; if (file_exists($filename)) { ?> <option value="<?php echo $tim->id; ?> " data-image="<?php echo Yii::app()->request->baseUrl; ?> /img/icon-team/<?php
<p style="text-transform:uppercase" class="project-name" > <?php // echo Yii::app()->user->id; $userid = Team::model()->find("username='******'")->id; // $userid; $pd = ProjectDetail::model()->find("worker_id='{$userid}'")->project_id; // echo $pd; echo Project::model()->findByPk($pd)->project_name; ?> </p> </div> <div class="right"> <?php $liststatus = Task::model()->findAll(); $id = Yii::app()->user->id; $idt = Team::model()->find("username = '******'")->id; $idp = Project::model()->find("worker={$idt} and status!=5")->id; $name = Project::model()->find("worker={$idt} and status!=5")->username; $ids = Project::model()->find("worker={$idt} and status!=5")->task; ?> <br> <b style="font-size:20px;display:none;">set by : (<?php echo $name; ?> ) </b> <div class="btn view-project" > <div class="status-work" style="visibility:hidden"> <select project_id="<?php
</td> <?php echo '<td>'; if ($matchGames[$i]->lOCAL === null) { echo CHtml::image(Team::model()->getLogo(), '', array("style" => "width:50px;height:50px;", "class" => "img-polaroid")); } else { echo CHtml::image($matchGames[$i]->lOCAL->getLogo(), '', array("style" => "width:50px;height:50px;", "class" => "img-polaroid")); echo "<br />"; echo $matchGames[$i]->lOCAL->NAME; } echo "</td>"; echo '<td>'; echo '<p class="text-center">'; if ($matchGames[$i]->vISITOR === null) { echo CHtml::image(Team::model()->getLogo(), '', array("style" => "width:50px;height:50px;", "class" => "img-polaroid")); } else { echo CHtml::image($matchGames[$i]->vISITOR->getLogo(), '', array("style" => "width:50px;height:50px;", "class" => "img-polaroid")); echo "<br />"; echo $matchGames[$i]->vISITOR->NAME; echo $form->hiddenField($matchGames[$i], "[{$i}]ID", array('value' => $matchGames[$i]->ID)); echo $form->hiddenField($matchGames[$i], "[{$i}]LOCAL", array('value' => $matchGames[$i]->lOCAL->ID)); echo $form->hiddenField($matchGames[$i], "[{$i}]VISITOR", array('value' => $matchGames[$i]->vISITOR->ID)); echo $form->hiddenField($matchGames[$i], "[{$i}]TOURNAMENT_ID", array('value' => $matchGames[$i]->TOURNAMENT_ID)); echo $form->hiddenField($matchGames[$i], "[{$i}]GROUP"); echo $form->hiddenField($matchGames[$i], "[{$i}]NAME", array('value' => $i + 1)); } echo "</p>"; echo "</td>"; if ($matchGames[$i]->STATUS < 3) { echo "<td>";
<tr> <td class="name"> No</td> <td class="value">Name</td> </tr> <?php $no = 1; foreach (ProjectDetail::model()->findAll("t.project_id = '{$_REQUEST['id']}'") as $key) { ?> <tr> <td class="name"><?php echo $no; ?> </td> <td class="value"><?php echo Team::model()->findByPk($key->worker_id)->name; ?> </td> </tr> <?php $no++; } ?> </table> <?php $project_id = $_REQUEST['id']; $sql = "\n\t\t\tSELECT ph.datetime, ph.project_id, \n\t\t\tpdm.name_file,\n\t\t\tSUBSTRING_INDEX(pdm.name_file,'.',-1) AS ext\n\t\t\tFROM\n\t\t\tproject AS p \n\t\t\tINNER JOIN \n\t\t\tproject_comment_head AS ph ON p.id = ph.project_id\n\t\t\tINNER JOIN\n\t\t\tproject_comment AS pdm\n\t\t\tON pdm.head_project_id = ph.id\n\t\t\tWHERE \n\n\t\t\tpdm.status = 1 \n\t\t\tAND\n\t\t\t\n\t\t\tp.id = {$project_id}\n\t\t\tand\n\t\t\tSUBSTRING_INDEX(pdm.name_file,'.',-1) IN ('jpg','png','gif','PNG','JPG','GIF')\n\t \t"; $str_test = " and ph.phase = 2"; $str_final = " and ph.phase = 3";
</div> <div class="row"> <?php echo $form->labelEx($model, 'conf_password'); ?> <?php echo $form->passwordField($model, 'conf_password', array('size' => 45, 'maxlength' => 45)); ?> <?php echo $form->error($model, 'conf_password'); ?> </div> <h1>Teams</h1> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'team-grid', 'summaryText' => '', 'dataProvider' => Team::model()->search(), 'selectableRows' => 2, 'columns' => array(array('name' => 'title', 'header' => 'Team'), array('class' => 'CCheckBoxColumn', 'header' => 'ist Mitglied')))); ?> <div class="row buttons"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Erstellen' : 'Speichern'); ?> </div> <?php $this->endWidget(); ?> </div><!-- form -->
public function actionVcard($key) { $criteria = new CDbCriteria(); $criteria->compare('t.`key`', $key); // not with('events') because i have a condition and order there if ($model = Team::model()->find($criteria)) { header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Content-type: text/vcard'); $this->renderPartial('vcard', array('model' => $model)); } }
public function get_match_display($full_name = true) { $team = Team::model()->findAllByAttributes(array('tournament_id' => $this->tournament->id, 'challonge_participant_id' => $this->team_1)); $team_name = ''; foreach ($team as $t) { if ($full_name) { $team_name .= $t->player->name . " / "; } else { $player_name = explode(' ', $t->player->name); $team_name .= $player_name[0] . " " . $player_name[1][0] . "." . " / "; } } $team_name = rtrim($team_name, ' / '); $team_name .= ' vs '; $team = Team::model()->findAllByAttributes(array('tournament_id' => $this->tournament->id, 'challonge_participant_id' => $this->team_2)); foreach ($team as $t) { if ($full_name) { $team_name .= $t->player->name . " / "; } else { $player_name = explode(' ', $t->player->name); $team_name .= $player_name[0] . " " . $player_name[1][0] . "." . " / "; } } return rtrim($team_name, ' / '); }
?> <p>Notification not available</p> <?php } ?> </div> </div> <div class="section-account profil"> <div class="title">Profil</div> <?php // echo $id; $model = Team::model()->find("username = '******' "); // echo $id; // echo count($model); if (isset($_REQUEST['Team'])) { $model->scenario = "perbaharui"; $model->attributes = $_REQUEST['Team']; if ($model->save()) { echo " "; // $this->redirect(array('land/account')); } } ?> <div class="wide form"> <?php $form = $this->beginWidget('CActiveForm', array('id' => 'team-form', 'enableAjaxValidation' => false)); ?>
public function afterSave() { parent::afterSave(); $this->getReplacedTemplate(array('controller' => Yii::app()->controller)); $links = array_unique($this->teamLinks); if (Yii::app()->getModule('page')->team) { foreach ($this->teamPages as $t) { $t->delete(); } if ($this->active) { foreach ($links as $key) { $tm = Team::model()->findCachedByKey($key); $tId = $tm->id; $t = new TeamPage(); $t->attributes = array('page_id' => $this->id, 'team_id' => $tId); $t->save(); } } } Yii::log($this->key, 'info', 'Seite gespeichert'); Yii::log($this->text, 'info', 'Seite gespeichert'); }
</div> --> <style type="text/css"> .project-name{ text-transform: uppercase; } </style> <table border="1"> <tr class="head"> <td>No</td> <td >Name</td> <td >Last Login</td> <td align="center">image</td> </tr> <?php $team = Team::model()->findAll(); ?> <?php $no = 1; foreach ($team as $t) { ?> <tr> <td style="width:5%"> <?php echo $no; ?> </td> <td style="width:40%"> <div class="project-name"> <?php echo $t->name;