public function actionDelete() { if (Yii::$app->request->post()) { $id_reg = Html::encode($_POST["id_reg"]); if ((int) $id_reg) { if (Registro::deleteAll("id_reg=:id_reg", [":id_reg" => $id_reg])) { echo " Alumno con Id = {$id_reg} eliminado con exito"; echo "<meta http-equiv='refresh' content='3; " . Url::toRoute("index/mostrar") . "'>"; } else { echo "Ha ocurrido un error al eliminar el registro"; echo "<meta http-equiv='refresh' content='3; " . Url::toRoute("index/mostrar") . "'>"; } } else { echo "Ha ocurrido un error al eliminar el registro"; echo "<meta http-equiv='refresh' content='3; " . Url::toRoute("index/mostrar") . "'>"; } } else { return $this->redirect(["index/mostrar"]); } }