<?php
include("../conexion.php");

$data  = explode("-",$_POST['id']);

$campo = $data[0]; // nombre del campo
$id    = $data[1]; // id del registro
$value = $_POST['value']; // valor por el cual reemplazar

$grado = array(
"1A"=>"1A",
"1B"=>"1B",
"1C"=>"1C",
"2A"=>"2A",
"2B"=>"2B",
"2C"=>"2C",
"3A"=>"3A",
"3B"=>"3B",
"3C"=>"3C",
"4A"=>"4A",
"4B"=>"4B",
"4C"=>"4C",
"5A"=>"5A",
"5B"=>"5B",
"5C"=>"5C",
"6A"=>"6A",
"6B"=>"6B",
"6C"=>"6C"

);

// sql para actualizar el registro

$query = mysql_query("UPDATE alumnos SET ".$campo." = '".$value."'
WHERE id_usuario = '".$id."'");

echo ($campo == 'id_pais') ? $grado[$value] : $value;
?>