<?php
session_start();
if (!isset($_SESSION['FirstName'])) {
	exit;
}
/*
//trigger email to test script
$to="apicton@tastesystems.com";
$subject="test";
$message="message triggered";
$from = "apicton@apnetworking.com";
$headers = "From:" . $from;
mail($to, $subject, $message, $headers);
*/
include ('includes/db1config.php');
include ('../includes/mysql_connect.php');
$i = 0;

foreach ($_POST['subpage'] as $value) {
    // Execute statement:
     $qry="UPDATE nav_menu SET nav_order = $i WHERE recordkey = $value";
	 //save qry to test log for troubleshooting
	 $query="insert into test_log (field1, field2) values ('update nav_menu','$qry') ";
	// mysql_query($query);
	 mysql_query($qry);
    $i++;
}

?>