daily pastebin goal
36%
SHARE
TWEET

_Form

Masyar_Syauqi Dec 22nd, 2015 (edited) 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
  2. <link href="vendor/kartik-v/bootstrap-tabs-x/css/bootstrap-tabs-x.min.css" media="all" rel="stylesheet" type="text/css" />
  3. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  4. <script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.js"></script>
  5. <script src="vendor/kartik-v/bootstrap-tabs-x/js/bootstrap-tabs-x.min.js" type="text/javascript"></script>
  6. <?php
  7.  
  8. use yii\helpers\Html;
  9. use yii\widgets\ActiveForm;
  10. use wbraganca\dynamicform\DynamicFormWidget;
  11. use backend\models\Model;
  12. use kartik\tabs\TabsX;
  13.  
  14. /* @var $this yii\web\View */
  15. /* @var $model app\models\Karyawan */
  16. /* @var $form yii\widgets\ActiveForm */
  17. ?>
  18. <div class="karyawan-form">
  19.  
  20.     <?php $form = ActiveForm::begin(['id' => 'dynamic-form']); ?>
  21.     <div class="row">
  22.        
  23.             <?= $form->field($model, 'nik')->textInput(['maxlength'=>10,'style'=>'width:100px']) ?>
  24.    
  25.      
  26.             <?= $form->field($model, 'nama')->textInput(['maxlength'=>35,'style'=>'width:150px']) ?>
  27.      
  28.    
  29.             <?= $form->field($model, 'alamat')->textInput(['maxlength'=>255,'style'=>'width:250px']) ?>
  30.    
  31.     </div>
  32.    
  33.     <legend>Kelengkapan Data</legend>
  34. <!-- tabs -->
  35. <div class="tabs-x align-center tabs-above tab-bordered">
  36.     <ul class="nav nav-tabs">
  37.         <li class="active"><a href="#one2" data-toggle="tab">Keluarga</a></li>
  38.         <li><a href="#two2" data-toggle="tab">Pendidikan</a></li>
  39.     </ul>
  40.     <div class="tab-content">
  41.         <div class="tab-pane active" id="one2">
  42.        
  43.  
  44.    
  45.     <div class="panel-body">
  46.              <?php DynamicFormWidget::begin([
  47.                 'widgetContainer' => 'dynamicform_wrapper', // required: only alphanumeric characters plus "_" [A-Za-z0-9_]
  48.                 'widgetBody' => '.container-items', // required: css class selector
  49.                 'widgetItem' => '.item', // required: css class
  50.                 'limit' => 8, // the maximum times, an element can be cloned (default 999)
  51.                 'min' => 1, // 0 or 1 (default 1)
  52.                 'insertButton' => '.add-item', // css class
  53.                 'deleteButton' => '.remove-item', // css class
  54.                 'model' => $modelsKeluarga[0],
  55.                 'formId' => 'dynamic-form',
  56.                 'formFields' => [
  57.                     'tingkat',
  58.                     'nama_sekolah',
  59.                 ],
  60.             ]); ?>
  61.  
  62.             <div class="container-items"><!-- widgetContainer -->
  63.             <?php foreach ($modelsKeluarga as $i => $modelKeluarga): ?>
  64.                 <div class="item panel panel-default"><!-- widgetBody -->
  65.                     <div class="panel-heading">
  66.                         <h3 class="panel-title pull-left">Data Keluarga1</h3>
  67.                         <div class="pull-right">
  68.                             <button type="button" class="add-item btn btn-success btn-xs"><i class="glyphicon glyphicon-plus"></i></button>
  69.                             <button type="button" class="remove-item btn btn-danger btn-xs"><i class="glyphicon glyphicon-minus"></i></button>
  70.                         </div>
  71.                         <div class="clearfix"></div>
  72.                     </div>
  73.                     <div class="panel-body">
  74.                         <?php
  75.                             // necessary for update action.
  76.                             if (! $modelKeluarga->isNewRecord) {
  77.                                 echo Html::activeHiddenInput($modelKeluarga, "[{$i}]id_keluarga");
  78.                             }
  79.                         ?>
  80.                         <?= $form->field($modelKeluarga, "[{$i}]nama")->textInput(['maxlength' => true]) ?>
  81.                         <div class="row">
  82.                             <div class="col-sm-6">
  83.                                 <?= $form->field($modelKeluarga, "[{$i}]hubungan_kel")->textInput(['maxlength' => true]) ?>
  84.                             </div>
  85.                            
  86.                     </div>
  87.                 </div>
  88.             <?php endforeach; ?>
  89.             </div>
  90.             <?php DynamicFormWidget::end(); ?>
  91.         </div>
  92.     </div>
  93.     </div>
  94.         <div class="tab-pane" id="two2">
  95.         <?= $this->render('_form_pen', [
  96.         'modelsPendidikan' => $modelsPendidikan,
  97.         ]) ?>
  98.        
  99.         </div>
  100.     </div>
  101. </div>
  102.  
  103.     <div class="form-group">
  104.         <?= Html::submitButton($modelKeluarga->isNewRecord ? 'Create' : 'Update', ['class' => 'btn btn-primary']) ?>
  105.     </div>
  106.  
  107.     <?php ActiveForm::end(); ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top