Ejemplo n.º 1
0
use kartik\widgets\Alert;
/**
* @var yii\web\View $this
* @var yii\data\ActiveDataProvider $dataProvider
* @var app\models\search\MemberSearch $searchModel
*/
$this->title = Yii::t('app', 'Members');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Polls'), 'url' => ['/poll/index']];
$this->params['breadcrumbs'][] = ['label' => $this->context->getPollDisplay(), 'url' => ['/poll/view', 'id' => $this->context->getPollId()]];
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
foreach (Yii::$app->getSession()->getAllFlashes() as $key => $arr) {
    foreach ($arr as $message) {
        echo AlertBlock::widget(['useSessionFlash' => false, 'type' => AlertBlock::TYPE_ALERT, 'delay' => false, 'alertSettings' => ['warning' => ['type' => Alert::TYPE_DANGER, 'body' => $message]]]);
    }
}
?>

<div class="member-index">
    <div class="page-header">
        <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    </div>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>
    <p>
Ejemplo n.º 2
0
?>
            Ket: <br>
            - Sebelum/sesudah melakukan simulasi, klik kode emiten pada tabel diatas
          </div>
        </div>
      </div>
      <div class="col-md-3">
        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title">Tanggal</h3>
          </div>
          <div class="panel-body">
            <?php 
echo Html::listBox('detemitenDates', $reportDates[1], $detemitenDates, ['class' => 'form-control', 'id' => 'detemitenDates', 'style' => 'height:275px']);
?>
          </div>
        </div>
      </div>
    </div>

    <?php 
if (Yii::$app->request->isAjax) {
    AlertBlock::widget(Yii::$app->params['alertBlockConfig']);
    GrowlLoad::reload($this);
}
?>
</div>
<?php 
$this->registerJs("\n  \$('#detemitenDates').bind('change', function(){\n      changeDate(\$(this).val());\n  });\n\n  function changeDate(date){\n    if(confirm('Apakah Anda yakin mengubah Tanggal ini?')){\n      \$.pjax.reload({\n        url: '" . Url::to(['index']) . "?date='+date,\n        container: '#pjax-report',\n        timeout:0,\n      });\n    }\n    else{\n      \$.pjax.reload({\n        url: '" . Url::to(['index']) . "?date=" . $reportDates[1] . "',\n        container: '#pjax-report',\n      });\n    }\n  }\n\n  simulate(1)\n\n  \$('#dynamicmodel-tipe').on('switchChange.bootstrapSwitch', function(event, state) {\n    tipe = state;\n    simulate(1)\n  });\n\n  \$('#dynamicmodel-harga').bind('change', function(){\n      simulate(0)\n  });\n\n  \$('#dynamicmodel-jml_lot').bind('change', function(){\n      simulate(1)\n  });\n\n  \$('#dynamicmodel-jml_saham').bind('change', function(){\n      simulate(2)\n  });\n\n\n");
$this->registerJs("\n  var tipe = true;\n  var jmlSahamG = 0;\n  var saldoG = 0;\n  var emitenCode = '';\n\n  function setFromGridview(obj){\n      if (typeof last_obj !== 'undefined') {\n        last_obj.removeClass( 'custom-selected' );\n      }\n      obj.parent().parent().toggleClass( 'custom-selected' );\n      last_obj = obj.parent().parent()\n      //obj.find('li:nth-child(2)').html('XXX')\n      jmlSahamG = accounting.unformat(\$('tr.custom-selected > td:nth-child(4)').html())\n      saldoG = accounting.unformat(\$('tr.custom-selected > td:nth-child(5)').html())\n      emitenCode = obj.html()\n      //alert('emitenCode => '+emitenCode)\n      simulate();\n  }\n\n  function simulate(x){\n      harga = accounting.unformat(\$('#dynamicmodel-harga').val());\n      kom_beli = " . $komisi->KOM_BELI . ";\n      kom_jual = " . $komisi->KOM_JUAL . ";\n      komisi = 0;\n      if(tipe){ // BELI\n        komisi = kom_beli;\n      }\n      else{\n        komisi = kom_jual;\n      }\n\n      if(x==1){\n        jml_lot = accounting.unformat(\$('#dynamicmodel-jml_lot').val());\n        //jmlsaham = jmllot * jmllbrsaham dr table lotshare\n        jml_saham = jml_lot * " . $lotshare->JML_LBRSAHAM . ";\n        \$('#dynamicmodel-jml_saham').val( accounting.formatNumber(jml_saham, 2) );\n      }\n      if(x==2){\n        jml_saham = accounting.unformat(\$('#dynamicmodel-jml_saham').val());\n        //jmllot = jmlsaham / jmllbrsaham dr table lotshare\n        jml_lot = jml_saham / " . $lotshare->JML_LBRSAHAM . ";\n        \$('#dynamicmodel-jml_lot').val( accounting.formatNumber(jml_lot, 2) );\n      }\n\n      //Total komisi = harga * jmlsaham * komisi penjualan atau pembelian / 100\n      total_komisi = harga * jml_saham * komisi / 100;\n\n      if(tipe){ // BELI\n        // Pd Simulasi pembelian :\n        // total = (harga * jmlsaham) + total komisi\n  \t\t  // range = (saldo[g] + total) / (jmlsaham[g] + jmlsaham)\n        total_harga = (harga * jml_saham) + total_komisi\n        range = (saldoG + total_harga) / (jmlSahamG + jml_saham)\n      }\n      else{\n        // Pd Simulasi penjualan:\n        // total = (harga * jmlsaham) - total komisi\n  \t\t  // range = (saldo[g] - total) / (jmlsaham[g] - jmlsaham)\n        total_harga = (harga * jml_saham) - total_komisi\n        range = (saldoG - total_harga) / (jmlSahamG - jml_saham)\n      }\n\n      \$('#dynamicmodel-komisi').val( accounting.formatNumber(komisi, 2) );\n      \$('#dynamicmodel-total_komisi').val( accounting.formatNumber(total_komisi, 2) );\n      \$('#dynamicmodel-total_harga').val( accounting.formatNumber(total_harga, 2) );\n      \$('#dynamicmodel-range').val( accounting.formatNumber(range, 2) );\n\n      var simulate_json = {\n        'tipe': tipe,\n        'jml_lot':jml_lot,\n        'harga':harga,\n        'komisi':komisi,\n        'total_komisi':total_komisi,\n        'jml_saham':jml_saham,\n        'range':range,\n        'total_harga':total_harga,\n        'emitenCode':emitenCode,\n      };\n\n\n      \$.ajax({\n        type: 'POST',\n        url: '" . Url::to(['set-session']) . "',\n        data: simulate_json,\n        //contentType: 'application/json; charset=utf-8',\n        dataType: 'json',\n    });\n  }\n", \yii\web\View::POS_HEAD);
Pjax::end();
Ejemplo n.º 3
0
?>

<div class="wrap">
    <?php 
NavBar::begin(['brandLabel' => Yii::$app->name, 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]);
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => array_filter([['label' => Yii::t('app', 'Home'), 'url' => ['/main/default/index']], ['label' => Yii::t('app', 'About'), 'url' => ['/main/default/about']], ['label' => Yii::t('app', 'Contact'), 'url' => ['/main/contact/index']], Yii::$app->user->isGuest ? ['label' => Yii::t('app', 'Sign Up'), 'url' => ['/user/default/signup']] : false, Yii::$app->user->isGuest ? ['label' => Yii::t('app', 'Login'), 'url' => ['/user/default/login']] : false, !Yii::$app->user->isGuest ? ['label' => Yii::t('app', 'Admin'), 'items' => [['label' => Yii::t('user', 'Admin'), 'url' => ['/admin/default/index']], ['label' => Yii::t('user', 'User Management'), 'url' => ['/admin/users/index']]]] : false, !Yii::$app->user->isGuest ? ['label' => Yii::t('user', 'Profile'), 'items' => [['label' => Yii::t('user', 'Account'), 'url' => ['/user/account/index']], ['label' => 'Logout (' . Yii::$app->user->identity->username . ')', 'url' => ['/user/default/logout'], 'linkOptions' => ['data-method' => 'post']]]] : false])]);
NavBar::end();
?>

    <div class="container">
        <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>

        <?php 
echo AlertBlock::widget(['useSessionFlash' => true, 'type' => AlertBlock::TYPE_GROWL]);
?>

        <?php 
echo $content;
?>

    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; <?php 
echo Yii::$app->name;
?>
  2011-<?php 
Ejemplo n.º 4
0
    $preview = false;
}
// autoforward after x seconds to the "home" Url
if (Yii::$app->params['autoforward-after'] && $preview == false) {
    $seconds = Yii::$app->params['autoforward-after'];
    $url = Yii::$app->urlManager->createUrl(['vote/expire', 'voting-expired' => 1]);
    $this->registerMetaTag(['http-equiv' => 'refresh', 'content' => $seconds . '; URL=' . $url]);
}
?>
<div class="voting">
   <div class="page-header">
        <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    </div>
    <?php 
// only display the token-error flash messages as alerts
echo AlertBlock::widget(['useSessionFlash' => true, 'type' => AlertBlock::TYPE_ALERT, 'delay' => false, 'closeButton' => false, 'alertSettings' => ['token-error' => ['type' => Alert::TYPE_DANGER]]]);
if ($show_form === false) {
    ?>
<p><a class="btn btn-primary btn-lg" href="<?php 
    echo Url::home();
    ?>
" role="button">Back to Home</a></p><?php 
} elseif ($show_form === true && isset($model)) {
    echo $this->render('_form', ['model' => $model, 'preview' => $preview]);
}
?>
</div>
Ejemplo n.º 5
0
echo Html::encode($this->title);
?>
</title>
    <?php 
$this->head();
?>
</head>
<body class="y2u-padding">
    <div class="y2u-container">
        <div class="text-center">
            <?php 
echo Html::img($asset->baseUrl . '/img/communityii.png', ['class' => 'y2u-logo']) . Module::PROJECT_PAGE;
?>
        </div>
        <?php 
echo AlertBlock::widget(['delay' => 0]);
?>
        <?php 
$this->beginBody();
?>
        <?php 
echo $content;
?>
        <?php 
$this->endBody();
?>
    </div>
</body>
    </html>
<?php 
$this->endPage();
Ejemplo n.º 6
0
// Populate the attribute array for display.
$attributes = ['question:ntext', 'info:ntext'];
foreach ($model->getOptions()->all() as $index => $option) {
    $no = $index + 1;
    $attributes[] = ['attribute' => "Option {$no}", 'value' => $option->text];
}
?>

<?php 
echo Html::tag('h2', Poll::label(1));
?>

<p>
<?php 
if ($model->isLocked()) {
    echo AlertBlock::widget(['useSessionFlash' => false, 'type' => AlertBlock::TYPE_ALERT, 'delay' => false, 'alertSettings' => ['warning' => ['type' => Alert::TYPE_WARNING, 'body' => Yii::t('app', 'This poll cannot be edited because it has already been accessed by a voter'), 'closeButton' => false]]]);
}
?>
    <?php 
echo Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary' . ($model->isLocked() ? ' disabled' : null)]);
?>
    <?php 
echo Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
    <?php 
echo Html::a(Yii::t('app', 'Preview'), ['//vote/preview', 'id' => $model->id], ['target' => '_blank', 'class' => 'pull-right btn btn-primary']);
?>

</p>

<?php 
Ejemplo n.º 7
0
<?php

use yii\helpers\Html;
use kartik\widgets\AlertBlock;
use kartik\widgets\Alert;
echo AlertBlock::widget(['useSessionFlash' => true, 'type' => AlertBlock::TYPE_ALERT, 'delay' => 0, 'alertSettings' => ['error' => ['id' => 'flash-alerts', 'type' => Alert::TYPE_DANGER, 'icon' => 'fa-warning', 'iconOptions' => ['class' => 'fa'], 'options' => ['style' => 'margin-bottom: 0px;']], 'success' => ['id' => 'flash-alerts', 'type' => Alert::TYPE_SUCCESS, 'icon' => 'fa-thumbs-up', 'iconOptions' => ['class' => 'fa'], 'options' => ['style' => 'margin-bottom: 0px;']], 'info' => ['id' => 'flash-alerts', 'type' => Alert::TYPE_INFO, 'icon' => '', 'options' => ['style' => 'margin-bottom: 0px;']], 'warning' => ['id' => 'flash-alerts', 'type' => Alert::TYPE_WARNING, 'icon' => '', 'options' => ['style' => 'margin-bottom: 0px;']], 'primary' => ['id' => 'flash-alerts', 'type' => Alert::TYPE_PRIMARY, 'icon' => '', 'options' => ['style' => 'margin-bottom: 0px;']], 'default' => ['id' => 'flash-alerts', 'type' => Alert::TYPE_DEFAULT, 'icon' => '', 'options' => ['style' => 'margin-bottom: 0px;']]], 'options' => ['style' => 'font-size: 3em;']]);
$this->registerJs("\$('document').ready(function(){\n        if(\$('.modal').length) {\n            \$('.modal').modal('hide');\n            if(\$('.modal #response').length) {\n                \$('#response').html(\$('.modal #response').children());\n            }\n        }\n        alertClose();\n    });");
Ejemplo n.º 8
0
        echo $this->context->module->id !== \Yii::$app->id ? '<small>Module</small>' : '';
    }
    ?>
            </h1>
        <?php 
}
?>

        <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
    </section>

    <section class="content">
        <?php 
echo \kartik\widgets\AlertBlock::widget(['useSessionFlash' => true, 'type' => AlertBlock::TYPE_GROWL, 'delay' => 10]);
?>
        <?php 
if ($box) {
    ?>
        <div class="box box-danger">
            <div class="box-body">
        <?php 
}
?>
            <?php 
echo $content;
?>
        <?php 
if ($box) {
    ?>
Ejemplo n.º 9
0
                    <a class="left carousel-control" href="#w5" data-slide="prev">
                        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                    </a>
                    <a class="right carousel-control" href="#w5" data-slide="next">
                        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                    </a>
                </div>
            </div>
        <?php 
    }
    ?>

    <?php 
}
//    $data['questions'] = null;
echo \kartik\widgets\AlertBlock::widget(['type' => \kartik\widgets\AlertBlock::TYPE_ALERT, 'useSessionFlash' => true]);
if (!is_null($data['questions'])) {
    $answersData = $data['questions']->answers;
    if (!empty($answersData)) {
        ?>
            <div class="vote-home" id="vote">
                <h4><?php 
        echo $data['questions']->questions;
        ?>
</h4>
                <?php 
        echo $this->render('_poll', ['answersData' => $answersData, 'questions' => $data['questions'], 'answerPoll' => $data['answerPoll'], 'alertMessage' => '']);
        ?>
                    <?php 
        //                        $answers = ArrayHelper::map($answersData, 'id', 'answer');
        //                        Pjax::begin();
Ejemplo n.º 10
0
                             <h4>' . ucfirst($vm) . '</h4> 
                         </div>
                 </div>
                 <div class="row">
                     <div class="col-md-4">' . $buttonsGraphLog . '</div>
                     <div class="col-md-4 text-center">' . $buttonsMenu . '</div>
                     <div class="col-md-4 text-right">' . $status . ' </div>
                 </div>
             </div>
             <div id="graph' . $vm . '" class="panel-body collapse">
             ' . $imgEth . '
             </div>
             ' . $actionMenu . '
         </div>';
 Pjax::begin(['id' => 'pjax-' . $vm]);
 echo AlertBlock::widget(['type' => AlertBlock::TYPE_ALERT, 'useSessionFlash' => true, 'delay' => false]);
 echo $result;
 Pjax::end(['id' => 'pjax-' . $vm]);
 Modal::begin(['id' => 'modalGraphEth' . $vm, 'size' => Modal::SIZE_LARGE, 'header' => '<h3>Bandwidth ' . ucfirst($vm) . '</h3>', 'toggleButton' => false]);
 echo '<div id="modalGraphEthContent' . $vm . '"></div>';
 Modal::end();
 $this->registerJs('$(document).ready(function(){
         $("#graph' . $vm . '").on("hide.bs.collapse", function(){
             $("#btnGraph' . $vm . '").html(\'<span class="glyphicon glyphicon-collapse-down"></span>  ' . Icon::show('area-chart') . '\');
         });
         $("#graph' . $vm . '").on("show.bs.collapse", function(){
             $("#btnGraph' . $vm . '").html(\'<span class="glyphicon glyphicon-collapse-up"></span>  ' . Icon::show('area-chart') . '\');
         });
         
         $("#logs' . $vm . '").on("hide.bs.collapse", function(){
             $("#btnLogs' . $vm . '").html(\'<span class="glyphicon glyphicon-collapse-down"></span>  ' . Icon::show('files-o') . '\');
Ejemplo n.º 11
0
 public function init()
 {
     $this->useSessionFlash = true;
     $this->type = AlertBlock::TYPE_GROWL;
     parent::init();
 }