当前位置: 首页>>代码示例>>PHP>>正文


PHP Prefs::date2word方法代码示例

本文整理汇总了PHP中Prefs::date2word方法的典型用法代码示例。如果您正苦于以下问题:PHP Prefs::date2word方法的具体用法?PHP Prefs::date2word怎么用?PHP Prefs::date2word使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Prefs的用法示例。


在下文中一共展示了Prefs::date2word方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 * @version 1.0 beta
 * @copyright (C)2013 Craft-Soft.ru.  Все права защищены.
 * @link http://craft-soft.ru/
 * @license http://creativecommons.org/licenses/by-nc-sa/4.0/deed.ru  «Attribution-NonCommercial-ShareAlike»
 */
$page = 'История банов';
$this->pageTitle = Yii::app()->name . ' - ' . $page . ' - Детали бана из истории ' . $model->player_nick;
$this->breadcrumbs = array($page => array('index'), $model->player_nick);
if ($geo) {
    Yii::app()->clientScript->registerScriptFile('//api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU', CClientScript::POS_END);
    Yii::app()->clientScript->registerScript('yandexmap', "\n\t\tymaps.ready(inityamaps);\n\t\tfunction inityamaps () {\n\t\t\tvar myMap = new ymaps.Map('map', {\n\t\t\t\tcenter: [{$geo['lat']}, {$geo['lng']}],\n\t\t\t\tzoom: {$geo['zoom']},\n\t\t\t\tbehaviors: ['default', 'scrollZoom']\n\t\t\t});\n\t\t}\n\t", CClientScript::POS_END);
}
if ($model->ban_length == '-1') {
    $length = 'Разбанен';
} else {
    $length = Prefs::date2word($model->ban_length) . ' (Истек)';
}
?>

<h2>Подробности истории бана <i><?php 
echo CHtml::encode($model->player_nick);
?>
</i></h2>
<div style="float: right">
	<?php 
if (Webadmins::checkAccess('bans_edit', $model->admin_nick)) {
    echo CHtml::link('<i class="icon-edit"></i>', $this->createUrl('/bans/update', array('id' => $model->bhid)), array('rel' => 'tooltip', 'title' => 'Редактировать'));
}
?>
	&nbsp;
	<?php 
开发者ID:DmitriyS,项目名称:CS-Bans,代码行数:31,代码来源:view.php

示例2: actionBandetail

 /**
  * Вывод данных о бане в модальке
  */
 public function actionBandetail()
 {
     if (is_numeric($_POST['bid'])) {
         $model = Bans::model()->with('admin')->findByPk($_POST['bid']);
         if ($model === null) {
             Yii::app()->end('alert("Ошибка!")');
         }
         $js = "\$('#bandetail-nick').html('" . CHtml::encode($model->player_nick) . "');";
         $js .= "\$('#bandetail-steam').html('" . $model->player_id . "');";
         //$js .= "$('#bandetail-steamcommynity').html('" . Prefs::steam_convert($model->player_id, true) . "');";
         $js .= "\$('#bandetail-ip').html('" . (Webadmins::checkAccess('ip_view') ? $model->player_ip : 'Cкрыт') . "');";
         //$js .= "$('#bandetail-type').html('" . Prefs::getBanType($model->ban_type) . "');";
         $js .= "\$('#bandetail-datetime').html('" . date('d.m.y - H:i:s', $model->ban_created) . "');";
         $js .= "\$('#bandetail-expired').html('" . ($model->ban_length == '-1' ? 'Разбанен' : Prefs::date2word($model->ban_length) . ($model->expired == 1 ? ' (истек)' : '')) . "');";
         $js .= "\$('#bandetail-map').html('" . $model->map_name . "');";
         $js .= "\$('#bandetail-reason').html('" . CHtml::encode($model->ban_reason) . "');";
         $js .= "\$('#bandetail-admin').html('" . CHtml::encode($model->admin_nick) . "');";
         $js .= "\$('#bandetail-server').html('" . CHtml::encode($model->server_name) . "');";
         //$js .= "$('#bandetail-kicks').html('" . $model->ban_kicks . "');";
         $js .= "\$('#loading').hide();";
         $js .= "\$('#viewban').attr({'href': '" . Yii::app()->urlManager->createUrl('/bans/view', array('id' => $_POST['bid'])) . "'});";
         $js .= "\$('#BanDetail').modal('show');";
         echo $js;
     }
     Yii::app()->end();
 }
开发者ID:DmitriyS,项目名称:CS-Bans,代码行数:29,代码来源:BansController.php

示例3: array

 * @version 1.0 beta
 * @copyright (C)2013 Craft-Soft.ru.  Все права защищены.
 * @link http://craft-soft.ru/
 * @license http://creativecommons.org/licenses/by-nc-sa/4.0/deed.ru  «Attribution-NonCommercial-ShareAlike»
 */
$page = 'Банлист';
$this->pageTitle = Yii::app()->name . ' - ' . $page . ' - Детали бана ' . $model->player_nick;
$this->breadcrumbs = array($page => array('index'), $model->player_nick);
if ($geo) {
    Yii::app()->clientScript->registerScriptFile('//api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU', CClientScript::POS_END);
    Yii::app()->clientScript->registerScript('yandexmap', "\n\t\tymaps.ready(inityamaps);\n\t\tfunction inityamaps () {\n\t\t\tvar myMap = new ymaps.Map('map', {center: [{$geo['lat']}, {$geo['lng']}], zoom: 10});\n\t\t}\n\t", CClientScript::POS_END);
}
if ($model->ban_length == '-1') {
    $length = 'Разбанен';
} else {
    $length = Prefs::date2word($model->ban_length);
    if ($model->unbanned) {
        $length .= '(Истек)';
    } elseif (Yii::app()->hasModule('billing')) {
        $length .= CHtml::link('Купить разбан', array('/billing/unban', 'id' => $model->primaryKey), array('class' => 'btn btn-mini btn-success pull-right'));
    }
}
?>

<h2>Подробности бана <i><?php 
echo CHtml::encode($model->player_nick);
?>
</i></h2>
<div style="float: right">
	<?php 
if (Webadmins::checkAccess('bans_edit', $model->admin_nick)) {
开发者ID:BroneKot,项目名称:CS-Bans,代码行数:31,代码来源:view.php

示例4: foreach

        foreach ($info['playersinfo'] as $player) {
            ?>
						<tr class="context-menu-one" id="<?php 
            echo CHtml::encode($player['name']);
            ?>
">
							<td><?php 
            echo CHtml::encode($player['name']);
            ?>
</td>
							<td style="text-align: center"><?php 
            echo CHtml::encode($player['score']);
            ?>
</td>
							<td style="text-align: center"><?php 
            echo function_exists('query_live') ? $player['time'] : Prefs::date2word(intval($player['time']), FALSE, TRUE);
            ?>
</td>
						</tr>
					<?php 
        }
        ?>
				</tbody>
			</table>
			<?php 
    } else {
        ?>
			<div class="alert alert-error">Нет игроков</div>
			<?php 
    }
    ?>
开发者ID:BroneKot,项目名称:CS-Bans,代码行数:31,代码来源:view.php

示例5: getLengthString

 /**
  * 
  * @return string
  */
 public function getLengthString()
 {
     if ($this->ban_length == '-1') {
         return 'Разбанен';
     }
     return Prefs::date2word($this->ban_length, true) . ($this->getUnbanned() == 1 ? ' (истек)' : '');
 }
开发者ID:urichalex,项目名称:CS-Bans,代码行数:11,代码来源:Bans.php

示例6: actionServerdetail

 /**
  * Вывод инфы о сервере в модальке
  * @throws CHttpException
  */
 public function actionServerdetail()
 {
     $model = Serverinfo::model()->findByPk($_POST['sid']);
     $info = $model->getInfo();
     $players = "";
     if (empty($info['playersinfo']) || !is_array($info['playersinfo'])) {
         $players .= "<table class=\"items table table-bordered table-condensed\">";
         $players .= "<tr class=\"odd\"><td width=\"100%\" style=\"text-align:center\">Нет игроков</td></tr></table>";
     } else {
         $players .= "<table class=\"items table table-bordered table-condensed\">";
         $players .= "<tr class=\"odd\">";
         $players .= "<td width=\"70%\"><b>Ник</b></td>";
         $players .= "<td><b>Счёт</b></td>";
         $players .= "<td><b>Время</b></td>";
         foreach ($info['playersinfo'] as $player_key => $player) {
             $players .= "<tr class=\"odd\">";
             $players .= "<td width=\"70%\">" . CHtml::encode($player['name']) . "</td>";
             $players .= "<td style=\"text-align:center\">" . intval($player['score'], ENT_QUOTES) . "</td>";
             $players .= "<td>" . (function_exists('query_live') ? $player['time'] : Prefs::date2word(intval($player['time']), FALSE, TRUE)) . "</td>";
             $players .= "</tr>";
         }
         $players .= "</table>";
     }
     $js = "\$('#server-name').html('" . CJavaScript::quote($info['name']) . "');";
     $js .= "\$('#serverlink').html('" . CJavaScript::quote($info['name']) . "').attr({'href': '" . Yii::app()->createUrl('serverinfo/view', array('id' => $model->id)) . "'});";
     $js .= "\$('#server-address').html('" . CJavaScript::quote($model->address) . "');";
     $js .= "\$('#steam-connect').attr({'href': 'steam://connect/" . CJavaScript::quote($model->address) . "'});";
     $js .= "\$('#hlws-add').attr({'href': 'hlsw://" . CJavaScript::quote($model->address) . "'});";
     $js .= "\$('#server-map').html('" . CJavaScript::quote($info['map']) . "');";
     $js .= "\$('#server-players').html('" . $info['players'] . '/' . $info['playersmax'] . "');";
     $js .= "\$('#serverinfo-players').html('" . CJavaScript::quote($players) . "');";
     $js .= "\$('#server-mapimage').html('" . CJavaScript::quote($info['mapimg']) . "');";
     $js .= "\$('#loading').hide();";
     $js .= "\$('#ServerDetail').modal('show');";
     Yii::app()->end($js);
 }
开发者ID:urichalex,项目名称:CS-Bans,代码行数:40,代码来源:ServerinfoController.php

示例7: foreach

foreach ($bans->getData() as $ban) {
    ?>
                    <tr>
                        <td>
                            <?php 
    echo CHtml::encode($ban->player_nick);
    ?>
                        </td>
                        <td>
                            <?php 
    echo Yii::app()->format->formatDateTime($ban->ban_created);
    ?>
                        </td>
                        <td>
                            <?php 
    echo Prefs::date2word($ban->ban_length);
    ?>
                        </td>
                    </tr>
                    <?php 
}
?>
                </tbody>
            </table>
        </div>
	</div>

	<?php 
// Информация с серверов собирается аяксом. Функция написана выше
?>
    
开发者ID:urichalex,项目名称:CS-Bans,代码行数:30,代码来源:index.php


注:本文中的Prefs::date2word方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。