This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1='$(printf '%.0s-' $(seq 1 $COLUMNS))\n\[\e[0;32m\]\u@\h:\[\e[m\]\[\e[36;40m\]\w\[\e[m\]\[\e[1;32m\]\$\[\e[m\] ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: PHP | Create the webgrind dirs | |
file: name=/var/www/webgrind/storage state=directory owner=www-data mode=0700 | |
- name: PHP | Download webgrind package | |
get_url: url=https://github.com/bionoren/webgrind/archive/xdebug23.zip dest=/tmp/webgrind.tar.gz | |
- name: PHP | Extract the webgrind package | |
unarchive: src=/tmp/webgrind.tar.gz dest=/var/www/webgrind copy=no creates=/var/www/webgrind/index.php | |
- name: PHP | Move the webgrind package contents to the webgrind dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if($aposta->aposta_time1 == $jogo->placar_time1 && $aposta->aposta_time2 == $jogo->placar_time2) { | |
$pontos[$aposta->id]['pontos'][] = CategoriaPonto::ACERTO_PLACAR; | |
} else { | |
if($jogo->empatou() && $aposta->aposta_time1 == $aposta->aposta_time2) { | |
$pontos[$aposta->id]['pontos'][] = CategoriaPonto::ACERTO_EMPATE; | |
} else if($aposta->vencedor == $jogo->vencedor) { | |
$pontos[$aposta->id]['pontos'][] = CategoriaPonto::ACERTO_VENCEDOR; | |
if($aposta->aposta_time1 == $jogo->placar_time1 || $aposta->aposta_time2 == $jogo->placar_time2) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<?php echo $form->labelEx($model,'ficha'); ?> | |
<?php echo $form->dropDownList($model,'ficha', | |
CHtml::listData($fichas, 'id', 'name'), | |
array( | |
'ajax' => array( | |
'type'=>'POST', | |
'url'=>CController::createUrl('movimentos/AtivosPorFicha'), | |
'update'=>'#Movimentos_id_servico', | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fichas = Movimentos::model()->PegaFichas(); | |
$servicos = array(); | |
if(isset($_POST['Model'])) { | |
$model->attributes = $_POST['Model']; | |
... | |
} | |
if(isset($model->ficha)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AttributesBackupBehavior extends CActiveRecordBehavior { | |
private $old_attributes; | |
public function afterFind($event) { | |
parent::afterFind($event); | |
foreach($this->owner->attributes as $name => $value) { | |
$this->old_attributes[$name] = $value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getWeeksForMonth($year, $month) { | |
$weeks = array(); | |
$weekday_of_first_day = date('w', strtotime("$year-$month-1")); | |
$last_day_of_first_week = 6 - $weekday_of_first_day + 1; | |
$weeks[] = array("$year-$month-1", "$year-$month-$last_day_of_first_week"); | |
$last_day_of_month = cal_days_in_month(CAL_GREGORIAN, $month, $year); | |
$day = $last_day_of_first_week; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Encrypt | |
{ | |
function Encrypt() | |
{ | |
$this->word = ""; | |
} | |
function bytexor($a,$b,$l) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Os extends CActiveRecord { | |
public function relations() { | |
return array( | |
'cliente' => array(self::BELONGS_TO, 'Cliente', 'id_cliente'), | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $this->widget('zii.widgets.grid.CGridView', array( | |
'columns'=>array( | |
array( | |
'name' => 'pesquisa', | |
'value' => '$data->pesquisa', | |
'header' => 'Termo', | |
), | |
array( | |
'name' => 'data_cadastro', | |
'value' => 'Yii::app()->dateFormatter->formatDatetime(strtotime($data->data_cadastro), "short", "short")', |
OlderNewer