<?php
session_start();
if (!isset($_SESSION['FirstName'])) {
	exit;
}

include ('includes/db1config.php');
include ('../includes/mysql_connect.php');

if (isset($_POST) && !empty($_POST)) {
	if (isset($_POST['social_networks_order']) && !empty($_POST['social_networks_order'])) {
		$i = 1;
		foreach ($_POST['social_networks_order'] as $id) {
			$sql = "UPDATE social_networks
					SET order_sequence = '".$i."'
					WHERE recordkey = '".mysql_real_escape_string($id)."'";
			mysql_query($sql) or die(mysql_error());
			$i++;
		}
		die('1');
	}
}

die('0');
?>