<?php 
	require_once("../includes/clase_sesion.php");
	$sesion=new sesion();
	require_once("../includes/funciones_generales.php");
	if(!comprobar_sesion()){
		echo "ses_cad";
		exit();
	}
	require_once('../includes/MySQL.php');
	$academia = new Servidor_Base_Datos(AC_CONN_HOST,AC_CONN_USER,AC_CONN_PASS,AC_CONN_DB."".$sesion->get('anio'));
	foreach ($_POST['listItem'] as $position => $item) :
		$sql= "UPDATE aca_asignaturas SET pri_asi = '".($position)."' WHERE cod_asi = '".$item."'";
		$academia->instruccion($sql);
	endforeach;
	$academia->cerrar();
?>