return '0'; } } if (isset($_REQUEST['new_company_add']) == '1') { extract($_POST); $comp_name_exist = checkcomp($reg_compname); if (count($comp_name_exist) > 0) { $result = 'exist'; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "../tax_form/" . $_FILES["file"]["name"]); $tax_file_name = $_FILES["file"]["name"]; $sql = "INSERT INTO sohorepro_company SET\n comp_contact_name = '" . $reg_contactname . "',\n comp_contact_email = '" . $reg_contactmail . "',\n comp_name = '" . $reg_compname . "', \n cust_id = '" . $reg_cus_id . "',\n comp_contact_phone = '" . $reg_contphone1 . "',\n comp_contact_fax = '" . $reg_busifax . "',\n comp_business_address1 = '" . $address1 . "',\n comp_business_address2 = '" . $address2 . "',\n comp_business_address3 = '" . $address3 . "', \n comp_room = '" . $reg_busiroom . "',\n comp_suite = '" . $reg_busisuite . "',\n comp_floor = '" . $reg_busifloor . "',\n comp_city = '" . $reg_busicity . "',\n comp_state = '" . $reg_busistate . "',\n comp_zipcode = '" . $reg_busizip . "',\n comp_zipcode_ext = '" . $reg_busizip_ext . "',\n comp_phone1 = '" . $reg_phone1 . "',\n comp_phone2 = '" . $reg_phone2 . "',\n comp_phone3 = '" . $reg_phone3 . "',\n comp_phone4 = '" . $reg_phone4 . "',\n tax_form_resale = '" . $tax_file_name . "',\n tax_exe = '" . $reg_tax . "',\n cus_type = '2' "; $result = mysql_query($sql); //Insert the Primari Billing address for New Company Start $comp_id = mysql_insert_id(); $shipp_state_id = StateId($reg_busistate); $shipp_sql = "INSERT INTO sohorepro_address SET\n comp_id = '" . $comp_id . "',\n company_name = '" . $reg_compname . "',\n contact_name = '" . $reg_contactname . "',\n address_1 = '" . $address1 . "',\n address_2 = '" . $address2 . "',\n address_3 = '" . $address3 . "', \n city = '" . $reg_busicity . "',\n state = '" . $shipp_state_id . "',\n zip = '" . $reg_busizip . "',\n zip_ext = '" . $reg_busizip_ext . "',\n phone = '" . $reg_contphone1 . "',\n attention_to = '" . $reg_contactname . "',\n type = '1',\n prop = '0'"; $inserted_val = mysql_query($shipp_sql); $sql_user = "******" . $reg_contactmail . "',\n cus_pass = '******',\n cus_compname = '" . $comp_id . "', \n cus_contact_name = '" . $reg_contactname . "',\n cus_contact_email = '" . $reg_contactmail . "',\n cus_contact_phone = '" . $reg_contphone1 . "',\n cus_manager = '1',\n cus_status = '1' "; mysql_query($sql_user); //Insert the Primari Billing address for New Company End $message = '<html>'; $message .= '<head>'; $message .= '<title></title>'; $message .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'; $message .= '</head>'; $message .= '<body>'; $message .= '<table width="550" border="0" cellspacing="0" cellpadding="0">'; $message .= '<tr bgcolor="#ff7e00">'; $message .= '<td width="10" height="10" align="left" valign="top"></td>'; $message .= '<td height="10" align="left" valign="top"></td>';
$adb_address_3 = str_replace("and", "&", $_POST['adb_address_3']); $query = "UPDATE sohorepro_address\n\t\t\tSET address_3 = '" . $adb_address_3 . "' WHERE id = '" . $id . "' "; mysql_query($query); echo $adb_address_3; } if (isset($_POST['adb_city']) && $_POST['adb_city'] != '') { $id = $_POST['id']; $adb_city = $_POST['adb_city']; $query = "UPDATE sohorepro_address\n\t\t\tSET city = '" . $adb_city . "' WHERE id = '" . $id . "'"; mysql_query($query); echo $adb_city; } if (isset($_POST['adb_state_val']) && $_POST['adb_state_val'] != '') { $id = $_POST['id']; $state = $_POST['adb_state_val']; $state_value = StateId($state); $query = "UPDATE sohorepro_address\n\t\t\tSET state = '" . $state_value . "' WHERE id = '" . $id . "'"; mysql_query($query); echo $state; } if (isset($_POST['adb_zip']) && $_POST['adb_zip'] != '') { $id = $_POST['id']; $adb_zip = $_POST['adb_zip']; $query = "UPDATE sohorepro_address\n\t\t\tSET zip = '" . $adb_zip . "' WHERE id = '" . $id . "'"; mysql_query($query); echo $adb_zip; } if (isset($_POST['adb_phone']) && $_POST['adb_phone'] != '') { $id = $_POST['id']; $phone = $_POST['adb_phone']; $query = "UPDATE sohorepro_address\n\t\t\tSET phone = '" . $phone . "' WHERE id = '" . $id . "'";
$headers = 'From: "SohoRepro" <*****@*****.**>' . "\r\n"; $headers .= "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $mail_id = $reg_contactmail; $result_mail = mail($mail_id, $subject, $message, $headers); if ($result_mail) { header("Location:success.php"); } } else { move_uploaded_file($_FILES["file"]["tmp_name"], "tax_form/" . $_FILES["file"]["name"]); $tax_file_name = $_FILES["file"]["name"]; $sql = "INSERT INTO sohorepro_company SET \r\r\n comp_contact_name = '" . $reg_contactname . "',\r\r\n comp_contact_email = '" . $reg_contactmail . "',\r\r\n comp_name = '" . $reg_compname . "', \r\r\n comp_contact_phone = '" . $reg_contphone1 . "',\r\r\n comp_contact_fax = '" . $reg_busifax . "',\r\r\n comp_business_address1 = '" . $address1 . "',\r\r\n comp_business_address2 = '" . $address2 . "',\r\r\n comp_room = '" . $reg_busiroom . "',\r\r\n comp_suite = '" . $reg_busisuite . "',\r\r\n comp_floor = '" . $reg_busifloor . "',\r\r\n comp_city = '" . $reg_busicity . "',\r\r\n comp_state = '" . $state . "',\r\r\n comp_zipcode = '" . $reg_busizip . "',\r\r\n comp_phone1 = '" . $reg_phone1 . "',\r\r\n comp_phone2 = '" . $reg_phone2 . "',\r\r\n comp_phone3 = '" . $reg_phone3 . "',\r\r\n comp_phone4 = '" . $reg_phone4 . "',\r\r\n tax_form_resale = '" . $tax_file_name . "', \r\r\n tax_exe = '" . $reg_tax . "' "; $result = mysql_query($sql); //Insert the Primari Billing address for New Company Start $comp_id = mysql_insert_id(); $shipp_state_id = StateId($state); $shipp_sql = "INSERT INTO sohorepro_address SET \r\r\n comp_id = '" . $comp_id . "',\r\r\n company_name = '" . $reg_compname . "',\r\r\n contact_name = '" . $reg_contactname . "', \r\r\n address_1 = '" . $address1 . "',\r\r\n address_2 = '" . $address2 . "',\r\r\n address_3 = '" . $reg_busiroom . ' ' . $reg_busisuite . ' ' . $reg_busifloor . "', \r\r\n city = '" . $reg_busicity . "',\r\r\n state = '" . $shipp_state_id . "',\r\r\n zip = '" . $reg_busizip . "',\r\r\n phone = '" . $reg_contphone1 . "',\r\r\n attention_to = '" . $reg_contactname . "',\r\r\n type = '1',\r\r\n prop = '0'"; mysql_query($shipp_sql); //Insert the Primari Billing address for New Company End $message = '<html>'; $message .= '<head>'; $message .= '<title></title>'; $message .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'; $message .= '</head>'; $message .= '<body>'; $message .= '<table width="550" border="0" cellspacing="0" cellpadding="0">'; $message .= '<tr bgcolor="#ff7e00">'; $message .= '<td width="10" height="10" align="left" valign="top"></td>'; $message .= '<td height="10" align="left" valign="top"></td>'; $message .= '<td width="10" height="10" align="left" valign="top"></td>'; $message .= '</tr>';