Exemplo n.º 1
0
$listData = ArrayHelper::map($grade_level, 'id', 'name');
$listData2 = ArrayHelper::map($school_year, 'id', 'sy');
$listData3 = ArrayHelper::map($section, 'id', 'section_name');
$listData4 = ArrayHelper::map($status, 'id', 'status');
$state = false;
$avatar = Yii::$app->request->baseUrl . Yii::$app->params['avatar'];
!$model->isNewRecord ? !empty($model->student->students_profile_image) ? $img = Yii::$app->request->baseUrl . '/uploads/students/' . $model->student->students_profile_image : ($img = $avatar) : '';
!$model->isNewRecord ? !empty(trim($model->student->middle_name)) ? $middle = ucfirst(substr($model->student->middle_name, 0, 1)) . '.' : ($middle = '') : '';
!$model->isNewRecord ? $this->title = implode(' ', [$model->student->first_name, $middle, $model->student->last_name]) : 'New';
$model->isNewRecord ? $this->title = 'New' : ($this->title = implode(' ', [$model->student->first_name, $middle, $model->student->last_name]));
$form = ActiveForm::begin();
?>
<div class="ui three column stackable grid">
    <div class="four wide rounded column">
        <?php 
echo Card::render($options = ['imageContent' => !$model->isNewRecord ? !empty($model->student->students_profile_image) ? ['/file', 'id' => $model->student->students_profile_image] : Yii::$app->request->baseUrl . Yii::$app->params['avatar'] : Yii::$app->request->baseUrl . Yii::$app->params['avatar'], 'labelContent' => !$model->isNewRecord ? implode(' ', ['ID#', '<strong>', $student->id, '</strong>']) : '&nbsp;', 'labelFor' => 'Student ID', 'labelOptions' => '', 'headerContent' => !$model->isNewRecord ? DataHelper::name($model->student->first_name, $model->student->middle_name, $model->student->last_name) : '&nbsp;', 'headerOptions' => '', 'metaContent' => !$model->isNewRecord ? implode('', ['\'', $model->student->nickname, '\'']) : '&nbsp;', 'metaOptions' => '', 'leftFloatedContent' => !$model->isNewRecord ? DataHelper::gradeLevel($model->student->grade_level_id) : '&nbsp;', 'leftFloatedFor' => 'Grade Level', 'leftFloatedOptions' => '', 'rightFloatedContent' => '', 'rightFloatedOptions' => !$model->isNewRecord ? $model->student->sped === 0 ? '' : 'hidden' : 'hidden']);
?>
    </div>
    <div class="nine wide rounded column">
        <div class="ui segment">
        <?php 
echo !$model->isNewRecord ? Html::tag('label', implode('', [implode('-', array_map('ucfirst', explode('-', Yii::$app->controller->id))), '# ', $model->id]), ['class' => 'ui fluid big label']) : '';
?>
            <br>
            <br>
            <?php 
if ($model->isNewRecord) {
    ?>

            <?php 
} else {
Exemplo n.º 2
0
use yii\helpers\ArrayHelper;
use kartik\select2\Select2;
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
$avatar = Yii::$app->request->baseUrl . Yii::$app->params['avatar'];
!$model->isNewRecord ? !empty($model->student->students_profile_image) ? $img = Yii::$app->request->baseUrl . '/file?id=' . $model->student->students_profile_image : ($img = $avatar) : '';
$card_url = json_encode(Yii::$app->request->baseUrl . '/site/card?data=');
?>

<?php 
$form = ActiveForm::begin();
?>
<div class="ui three column stackable grid">
    <div class="four wide rounded column">
        <?php 
echo Card::render($options = ['imageContent' => !$model->isNewRecord ? $img : $avatar, 'labelContent' => !$model->isNewRecord ? implode(' ', ['ID#', '<strong>', $model->student->id, '</strong>']) : '&nbsp;', 'labelFor' => 'Enrollee ID', 'labelOptions' => '', 'headerContent' => !$model->isNewRecord ? implode(' ', [$model->student->first_name, $model->student->middle_name, $model->student->last_name]) : '&nbsp;', 'headerOptions' => '', 'metaContent' => !$model->isNewRecord ? implode('', ['\'', $model->student->nickname, '\'']) : '&nbsp', 'metaOptions' => '', 'leftFloatedContent' => !$model->isNewRecord ? DataHelper::gradeLevel($model->student->grade_level_id) : '&nbsp;', 'leftFloatedFor' => 'Grade Level', 'leftFloatedOptions' => '', 'rightFloatedContent' => '', 'rightFloatedOptions' => !$model->isNewRecord ? $model->student->sped === 0 ? '' : 'hidden' : 'hidden']);
?>
    </div>
    <div class="nine wide rounded column">
        <div class="ui segment">
            <?php 
echo !$model->isNewRecord ? Html::tag('label', implode('', [implode('-', array_map('ucfirst', explode('-', Yii::$app->controller->id))), '# ', $model->id, '<br><br>']), ['class' => 'ui fluid big label']) : '';
?>
            <div class="ui two column stackable grid">
                <div class="eight wide column">
                    <?php 
echo $form->field($model, 'transaction', ['inputTemplate' => '<div style="margin-top: 0;"><label style="padding: 0; color: #555; font-weight: 600;">Card</label><div class="pull-right">{input}</div></div>'])->checkbox($options = ['class' => 'js-switch', 'data-switchery' => true, 'value' => $model->isNewRecord ? 1 : $model->transaction])->label(false);
?>
                </div>
            </div>
            <div class="ui two column stackable grid">
Exemplo n.º 3
0
use app\models\Options;
use app\models\DataHelper;
/* @var $tris yii\web\View */
/* @var $model app\models\GradeOneForm */
/* @var $form yii\widgets\ActiveForm */
$this->title = DataHelper::name($models[0]->enrolled->student->first_name, $models[0]->enrolled->student->middle_name, $models[0]->enrolled->student->last_name);
$avatar = Yii::$app->request->baseUrl . Yii::$app->params['avatar'];
?>
<br>
<?php 
$form = ActiveForm::begin();
?>
<div class="ui three column stackable grid">
    <div class="four wide rounded column">
        <?php 
echo Card::render($options = ['imageContent' => !empty($models[0]->enrolled->student->students_profile_image) ? Yii::$app->request->baseUrl . '/file?id=' . $models[0]->enrolled->student->students_profile_image : $avatar, 'labelContent' => implode(' ', ['ID#', $models[0]->enrolled->student->id]), 'labelFor' => 'ID', 'labelOptions' => '', 'headerContent' => DataHelper::name($models[0]->enrolled->student->first_name, $models[0]->enrolled->student->middle_name, $models[0]->enrolled->student->last_name), 'headerOptions' => '', 'metaContent' => '&nbsp', 'metaOptions' => '', 'leftFloatedContent' => 'Grade 1', 'leftFloatedFor' => 'Grade Level', 'leftFloatedOptions' => '', 'rightFloatedContent' => '', 'rightFloatedOptions' => !$models[0]->enrolled->student->sped === 0 ? '<div class="ui star rating" data-max-rating="1"><div class="icon active" style="font-size:  16px;"></div></div>' : 'hidden']);
?>
    </div>
    <div class="nine wide rounded column">
        <div class="column">
            <div class="ui segment">
                <table class="ui celled striped small table">
                    <thead>
                        <tr>
                            <th>&nbsp;</th>
                            <th>First</th>
                            <th>Second</th>
                            <th>Third</th>
                            <th>Fourth</th>
                        </tr>
                    </thead>
Exemplo n.º 4
0
$sy_list = ArrayHelper::map($school_year, 'id', 'sy');
$teacher_list = ArrayHelper::map($teacher, 'id', 'last_name');
$grade_level_list = ArrayHelper::map($grade_level, 'id', 'name');
$section_list = ArrayHelper::map($section, 'id', 'section_name');
$subject_list = ArrayHelper::map($subject, 'id', 'subject_name');
$card_url = json_encode(Yii::$app->request->baseUrl . '/site/tcard?data=');
$this->title = 'New';
?>
<br>
<?php 
$form = ActiveForm::begin(['class' => 'ui loading form']);
?>
<div class="ui three column stackable grid">
    <div class="four wide rounded column">
        <?php 
echo Card::render($options = ['imageContent' => !$model->isNewRecord ? !empty($model->teacher->profile_image) ? ['/file', 'id' => $model->teacher->profile_image] : Yii::$app->params['avatar'] : Yii::$app->request->baseUrl . Yii::$app->params['avatar'], 'labelContent' => !$model->isNewRecord ? implode(' ', ['ID#', '<strong>', $model->teacher->id, '</strong>']) : '&nbsp;', 'labelFor' => 'Teacher ID', 'labelOptions' => '', 'headerContent' => !$model->isNewRecord ? DataHelper::name($model->teacher->first_name, $model->teacher->middle_name, $model->teacher->last_name) : '&nbsp;', 'headerOptions' => '', 'metaContent' => !$model->isNewRecord ? implode('', ['\'', $model->teacher->username, '\'']) : '&nbsp', 'metaOptions' => '', 'leftFloatedContent' => !$model->isNewRecord ? implode('', [DataHelper::gradeLevel($model->grade_level_id), '<p style="color: rgba(0,0,0,.4);"><span style="font-size: 11px;">', DataHelper::schoolYear($model->sy_id), '</span><br/>Adviser', '</p>']) : '&nbsp;', 'leftFloatedFor' => '', 'leftFloatedOptions' => '', 'rightFloatedContent' => '', 'rightFloatedOptions' => 'hidden']);
?>
    </div>
    <div class="nine wide rounded column">
        <div class="ui segment">
            <?php 
echo !$model->isNewRecord ? Html::tag('label', implode('', [implode('-', array_map('ucfirst', explode('-', Yii::$app->controller->id))), '# ', $model->id]), ['class' => 'ui fluid big label']) : '';
?>
            <br><br>
            <div class="row">
                <div class="col-lg-4 col-md-4 col-sm-12">
                    <?php 
echo $form->field($model, 'sy_id', ['inputTemplate' => '<label>School Year</label>{input}'])->dropDownList(ArrayHelper::map(SchoolYear::find()->orderBy(['id' => SORT_DESC])->all(), 'id', 'sy'), ['class' => 'form-control pva-form-control'])->label(false);
?>
                </div>
            </div>