<div class="col-md-6 col-md-offset-3"> <h2>We connect idealists with opportunities for action.</h2> <div class="panel panel-default"> <div class="panel-body"> <h4 class="text-center"><?php echo Html::encode("What are you looking for?"); ?> </h4> <div class="organization-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'search_type')->dropDownList(Lookup::items('SearchType'))->label(false); ?> <?php echo $form->field($model, 'search_keyword', ['inputOptions' => ['class' => 'form-control', 'placeholder' => 'Name or Keyword or interest']])->textInput(['maxlength' => true])->label(false); ?> <?php echo $form->field($model, 'search_location', ['inputOptions' => ['class' => 'form-control', 'placeholder' => 'Where?']])->textInput(['maxlength' => true])->label(false); ?> <div class="form-group text-center"> <?php echo Html::submitButton('Search', ['class' => 'btn btn-success']); ?> </div>
?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'description')->textarea(['rows' => 6]); ?> <?php echo $form->field($model, 'org_type')->dropDownList(Lookup::items('OrganizationType')); ?> <?php echo $form->field($model, 'work_domain')->dropDownList(Lookup::items('WorkDomain')); ?> <?php echo $form->field($model, 'website')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'found_date')->widget(DatePicker::classname(), ['pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]); ?> <?php echo $form->field($model, 'imageFile')->fileInput(); ?> <div class="form-group">
?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'content')->textarea(['rows' => 6]); ?> <?php echo $form->field($model, 'tags')->textarea(['rows' => 6]); ?> <?php echo $form->field($model, 'status')->dropDownList(Lookup::items('PostStatus')); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? ' 新 增 ' : '修 改', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>
*/ $this->title = Yii::t('app', 'Posts'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="post-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a(Yii::t('app', 'Create {modelClass}', ['modelClass' => 'Post']), ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'category_id', 'title', ['attribute' => 'type', 'value' => function ($data) { return Lookup::item("{{post}}type", $data->type); }, 'filter' => Lookup::items("{{post}}type")], 'published_at:date', 'views', 'likes', 'comment_count', ['attribute' => 'status', 'value' => function ($data) { return Lookup::item("{{post}}status", $data->status); }, 'filter' => Lookup::items("{{post}}status")], ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>
echo isset($model->thumbnail) && !empty($model->thumbnail) ? $model->thumbnail : "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOTMiIGhlaWdodD0iMTkzIj48cmVjdCB3aWR0aD0iMTkzIiBoZWlnaHQ9IjE5MyIgZmlsbD0iI2VlZSI+PC9yZWN0Pjx0ZXh0IHRleHQtYW5jaG9yPSJtaWRkbGUiIHg9Ijk2IiB5PSI5NiIgc3R5bGU9ImZpbGw6I2FhYTtmb250LXdlaWdodDpib2xkO2ZvbnQtc2l6ZToxOHB4O2ZvbnQtZmFtaWx5OkFyaWFsLEhlbHZldGljYSxzYW5zLXNlcmlmO2RvbWluYW50LWJhc2VsaW5lOmNlbnRyYWwiPnRodW1ibmFpbDwvdGV4dD48L3N2Zz4="; ?> " class="img-rounded" style="max-width:194px;max-height:194px;"> <input class="ke-input-text" type="text" id="url" value="" readonly="readonly" /> <input type="button" id="uploadButton" value="<?php echo Yii::t('app', 'Upload'); ?> " /> <?php echo Html::activeHiddenInput($model, 'thumbnail'); ?> </div> </div> <div class="panel panel-default"> <div class="panel-body"> <?php echo $form->field($model, 'status')->dropDownList(Lookup::items("{{post}}status")); ?> <?php $model->isNewRecord ? $model->published_at = date("Y-m-d H:i:s") : ($model->published_at = date("Y-m-d H:i:s", $model->published_at)); ?> <?php echo $form->field($model, 'published_at')->textInput(['maxlength' => 255]); ?> <button id="set-it-now" type="button" class="btn btn-default form-control"><?php echo Yii::t('app', 'Set It Now'); ?> </button> </div> </div> <div class="panel panel-default"> <div class="panel-body">
<div class="panel-body"> <?php echo $form->field($model, 'job_type')->checkboxList(Lookup::items('JobType'), ['separator' => '<br>']); ?> <div class="form-group"> <?php echo Html::submitButton('Filter', ['class' => 'btn btn-success margin-left-1 pull-right']); ?> </div> </div> </div> <div class="panel panel-default"> <div class="panel-body"> <?php echo $form->field($model, 'work_domain')->checkboxList(Lookup::items('WorkDomain'), ['separator' => '<br>']); ?> <div class="form-group"> <?php echo Html::submitButton('Filter', ['class' => 'btn btn-success margin-left-1 pull-right']); ?> </div> </div> </div> <?php ActiveForm::end(); ?> </div> </div>
use kartik\tabs\TabsX; /* @var $this yii\web\View */ /* @var $model app\models\Organization */ $this->title = $model->name; $this->params['breadcrumbs'][] = ['label' => 'Organizations', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="organization-view col-md-9 col-md-offset-1-half"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo DetailView::widget(['model' => $model, 'condensed' => true, 'hover' => true, 'mode' => DetailView::MODE_VIEW, 'hAlign' => DetailView::ALIGN_LEFT, 'vAlign' => DetailView::ALIGN_TOP, 'panel' => ['heading' => 'Organization details', 'type' => DetailView::TYPE_INFO], 'buttons1' => '{update}', 'buttons2' => '{reset} {save}', 'attributes' => ['name', 'description', ['attribute' => 'org_type', 'value' => Lookup::item('OrganizationType', $model->org_type), 'type' => DetailView::INPUT_DROPDOWN_LIST, 'items' => Lookup::items('OrganizationType')], ['attribute' => 'work_domain', 'value' => Lookup::item('WorkDomain', $model->work_domain), 'type' => DetailView::INPUT_DROPDOWN_LIST, 'items' => Lookup::items('WorkDomain')], 'website', ['attribute' => 'found_date', 'type' => DetailView::INPUT_DATE, 'widgetOptions' => ['pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]]]]); ?> <br/> <?php echo DetailView::widget(['model' => $workModel, 'condensed' => true, 'hover' => true, 'mode' => DetailView::MODE_VIEW, 'hAlign' => DetailView::ALIGN_LEFT, 'vAlign' => DetailView::ALIGN_TOP, 'panel' => ['heading' => 'Work details', 'type' => DetailView::TYPE_INFO], 'buttons1' => '{update}', 'buttons2' => '{reset} {save}', 'attributes' => ['vision', 'mission', 'who', 'what', 'why', 'how', 'short_term_goals', 'long_term_goals']]); ?> <br/> <h2>Locations</h2> <?php echo DetailView::widget(['model' => $addressModel, 'condensed' => true, 'hover' => true, 'mode' => DetailView::MODE_VIEW, 'hAlign' => DetailView::ALIGN_LEFT, 'vAlign' => DetailView::ALIGN_TOP, 'hideIfEmpty' => true, 'panel' => ['heading' => 'Add new location', 'type' => DetailView::TYPE_INFO], 'buttons1' => '{update}', 'updateOptions' => ['label' => '<span class="glyphicon glyphicon-plus"></span>'], 'buttons2' => '{reset} {save}', 'attributes' => ['address1', 'address2', 'landmark', 'city', 'state', 'country', 'pincode']]); ?> <?php $i = 1; foreach ($addressDataProvider->models as $address) {
/** * Updates an existing Route model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUpdate($id) { $rootPath = Yii::$app->params['route_img_dir']; $model = $this->findModel($id); $model->start_time = date("Y-m-d H:i", $model->start_time); $model->end_time = date("Y-m-d H:i", $model->end_time); $old_img = $model->img; $status = Lookup::items("RouteStatus"); if ($model->load(Yii::$app->request->post())) { $image = UploadedFile::getInstance($model, 'img'); if ($image) { $ext = $image->getExtension(); $randName = time() . rand(1000, 9999) . "." . $ext; $path = abs(crc32($randName) % 500); $rootPath = $rootPath . "img/"; if (!file_exists($rootPath)) { mkdir($rootPath, 0777, true); } $image->saveAs($rootPath . $randName); $model->img = $rootPath . $randName; //删除图片 unset($old_img); } else { $model->img = $old_img; } if ($model->save()) { return $this->redirect(['view', 'id' => $model->id, 'status' => $status]); } } else { return $this->render('update', ['model' => $model, 'status' => $status]); } }