<?php

$con_id = $_GET['con_id'];

$representative  = mysql_escape_string($_POST['representative']);
$company_name  = mysql_escape_string($_POST['company_name']);
$abn = mysql_escape_string($_POST['abn']);
$street = mysql_escape_string($_POST['street']);
$suburb = mysql_escape_string($_POST['suburb']);
$postcode = mysql_escape_string($_POST['postcode']);
$state = mysql_escape_string($_POST['state']);
$phone = mysql_escape_string($_POST['phone']);
$mobile = mysql_escape_string($_POST['mobile']);
$email = mysql_escape_string($_POST['email']);
$licence_number = mysql_escape_string($_POST['licence_number']);

$con = mysql_connect('localhost', 'root', 'Boom95z') or die(mysql_error());
mysql_select_db('orion9', $con);

mysql_query("update contractors set representative='" . $representative . "' where con_id=" . $con_id, $con);
mysql_query("update contractors set company_name='" . $company_name . "' where con_id=" . $con_id, $con);
mysql_query("update contractors set abn='" . $abn . "' where con_id=" . $con_id, $con);
mysql_query("update contractors set street='" . $street . "' where con_id=" . $con_id, $con);
mysql_query("update contractors set suburb='" . $suburb . "' where con_id=" . $con_id, $con);
mysql_query("update contractors set postcode='" . $postcode . "' where con_id=" . $con_id, $con);
mysql_query("update contractors set state='" . $state . "' where con_id=" . $con_id, $con);
mysql_query("update contractors set phone='" . $phone . "' where con_id=" . $con_id, $con);
mysql_query("update contractors set mobile='" . $mobile . "' where con_id=" . $con_id, $con);
mysql_query("update contractors set email='" . $email . "' where con_id=" . $con_id, $con);
mysql_query("update contractors set licence_number='" . $licence_number . "' where con_id=" . $con_id, $con);
mysql_query("update contractors set last_self_update = now() where con_id=" . $con_id, $con);

mysql_close($con);
header('Location:contractor-details.php');

?>