{ $sql = "INSERT INTO " . $this->table . " (id_asignatura,id_grado,intensidad) VALUES (" . $this->field . "," . $this->id . ",0)"; $stmt = DB::execute($sql); } public function delete($id) { $sql = "DELETE FROM " . $this->table . " WHERE id = " . $this->id . " LIMIT 1"; $stmt = DB::execute($sql); } } $st = new Master(); if ($_GET['op'] == 'upd') { $st->setTable($_GET['table']); $st->setField($_GET['field']); $st->setValue($_GET['value']); $st->setId($_GET['id']); $st->update(); if ($_GET['table'] == 'submenu' && $_GET['field'] == 'id_menu') { $st->setTable('permiso'); $st->updatePermiso(); } } if ($_GET['op'] == 'updChk') { $value = 0; $st->setTable($_GET['table']); $st->setField($_GET['field']); if ($_GET['value'] == 'true') { $value = 1; } $st->setValue($value); $st->setId($_GET['id']);