backend/controllers/TransaksiController.php
/**
     * Deletes an existing Transaksi model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     * @throws NotFoundHttpException if the model cannot be found
     */
Deletes an existing Transaksi model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed
@throws NotFoundHttpException if the model cannot be found
Deletes an existing Transaksi model . If deletion is successful the browser will be redirected to the ' index ' page . @param integer $id @return mixed @throws NotFoundHttpException if the model cannot be found
public function actionDelete($id)
    {
       $model = $this->findModel($id);
       $mobil= Mobil::find()->where(['id_mobil'=>$model->id_mobil])->one();  
       $mobil->status=1; 
       $mobil->save(false);
       $model->delete();
        return $this->redirect(['index']);
    }
public function actionDelete ( $ id ) { $ model = $ this -> findModel ( $ id ) ; $ mobil = Mobil :: find ( ) -> where ( [ 'id_mobil' => $ model -> id_mobil ] ) -> one ( ) ; $ mobil -> status = 1 ; $ mobil -> save ( false ) ; $ model -> delete ( ) ; return $ this -> redirect ( [ 'index' ] ) ; }
Deletes an existing Transaksi model.
Deletes an existing Transaksi model .