<?php

if(count($_POST)>0){
	$user = new PersonData();
	$user->is_company = isset($_POST["is_company"])?1:0;
	$user->rut = $_POST["rut"];
	$user->name = $_POST["name"];
	$user->lastname = $_POST["lastname"];
	$user->address1 = $_POST["address1"];

  $user->giro_id= $_POST["giro_id"]!=""?$_POST["giro_id"]:"NULL";
    $user->city_id= $_POST["city_id"]!=""?$_POST["city_id"]:"NULL";
      $user->comun_id= $_POST["comun_id"]!=""?$_POST["comun_id"]:"NULL";

	$user->email1 = $_POST["email1"];
	$user->phone1 = $_POST["phone1"];
	$user->phone2 = $_POST["phone2"];
	$user->contact = $_POST["contact"];
	$user->website = $_POST["website"];
	$user->add_provider();

print "<script>window.location='index.php?view=providers';</script>";


}


?>