<?php namespace myresto\controllers;use Yii;use yii\web\Controller;use myresto\models\ImportModifier;use myresto\models\SyncConfig;class ImportModifierController extends Controller{public function actionIndex(){$model=new ImportModifier();$tipe_tabel=$model::$tipe_tabel;$conn=SyncConfig::getConnection();$config=SyncConfig::find()->where(['type_con'=>'resto'])->one();$access_token=$config->api_key;if(isset($_POST['jenis_sinkron'])){$jenis_sinkron=$_POST['jenis_sinkron'];}else{$jenis_sinkron='';}$idHeaderLog=$_POST['idHeaderLog'];$result=$model->ambilData("import",$tipe_tabel);if($result!=NULL){$response=$model->kirimData($result,$access_token);$simpan=$model->simpanStatus($response,$tipe_tabel,$idHeaderLog,0,$jenis_sinkron);$echo=$simpan;}else{$echo="mod";}return $echo;}}