title: how can I make when there is new data items in ordering goods can go directly to the tables of goods?
body: <p>good afternoon gan
  Sorry want to ask
  I'm making an application inventory items
  I have a table of data items and goods reception table
  all table data inputted by way of import file excel
  how can I make when there is new data items in ordering goods can go directly to the tables of goods?
  thank you</p>
  
  <p><a href="http://i.stack.imgur.com/giq6m.png" rel="nofollow">this is my controller</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public function actionImport(){
        $modelImport =  new \yii\base\DynamicModel([
          'fileImport'=&gt;'File Import',
        ]);
        $modelImport-&gt;addRule(['fileImport'],'required');
        $modelImport-&gt;addRule(['fileImport'],'file',['extensions'=&gt;'ods,xls,xlsx']);
        if(Yii::$app-&gt;request-&gt;post()){
          $modelImport-&gt;fileImport = \yii\web\UploadedFile::getInstance($modelImport,'fileImport');
          if ($modelImport-&gt;fileImport &amp;&amp; $modelImport-&gt;validate()){
            $inputFileType = \PHPExcel_IOFactory::identify($modelImport-&gt;fileImport-&gt;tempName);
            $objReader = \PHPExcel_IOFactory::createReader($inputFileType);
            $objPHPExcel = $objReader-&gt;load($modelImport-&gt;fileImport-&gt;tempName);
            $sheetData = $objPHPExcel-&gt;getActiveSheet()-&gt;toArray(null,true,true,true);
            $baseRow = 1;
            while(!empty($sheetData[$baseRow]['A'])){
              $model = new PersediaanBarang();
              $model-&gt;rm_code = (string) $sheetData[$baseRow]['A'];
              $model-&gt;quantity = (string) $sheetData[$baseRow]['B'];
  
              $model-&gt;save();
              $baseRow++;
  
            }
            Yii::$app-&gt;getSession()-&gt;setFlash('success','Success');
          }else{
            Yii::$app-&gt;getSession()-&gt;setFlash('error','Error');
          }
          //return $this-&gt;redirect(['barang/index']);
  
        }
  
        return $this-&gt;render('import',[
          'modelImport'=&gt;$modelImport,
        ]);
      }</code></pre>
  </div>
  </div>
  </p>