Nome; if($_SESSION['lockedFields']['idNo']) $idNo = $data->{'CNPJ-Formatted'}; if($_SESSION['lockedFields']['email']) $email = $data->{'Contatos-email1'}; foreach($minimumFields as $minField){ if($_REQUEST[$minField]=='') $notFilled[]=$minField; } if($_REQUEST['createAccount']!=''){ $fromEmail = 'corretagil-@pinhaotec.com.br'; // check entered data foreach($_REQUEST as $rqKey => $rq){ if(in_array($minimumFields, $rqKey) && $rq==''){ $notFilled[] = $rqKey; }else{ $$rqKey = $rq; } } if($instanceName!='') $runCheckDomainAtStartup = true; if(count($notFilled)>0){ continue; }else{ // create arrays for registration $context['contextName']=$fullName; $context['companyName']=$fullName; $context['baseEmail']=$email; $context['phone']=$phone; $context['address']=$address; $context['postCode']=$postalcode; $context['city']=$city; $context['legalNumber']=$idNo; $legalNumberNumeric = preg_replace("/[^0-9]/", "", $idNo); $context['state']=$state; $context['brokerType']= (strlen($legalNumberNumeric)>11) ? 'j' : 'f'; $person['responsible']=$responsible; $info['whichSoftware']=$whichSoftware; $info['howDoKnow']=$howdoyouknow; $info['referral']=$referral; $instance['instanceName']=$instanceName; if($userInvited){ $instance['susepDBID']=$_SESSION['idCustomer']; $instance['edition']=0; $registration = json_encode(array('context'=>$context, 'instance'=>$instance, 'person'=>$person, 'info'=>$info)); $tmpFilename = md5(time().microtime()); $tmpFile = '/tmp/'.$tmpFilename; file_put_contents($tmpFile, $registration); // call creation scripts $result = file_get_contents('http://192.168.161.140/add.php?fId='.$tmpFilename); // return and display progress ////////$result = 'ok'; $linkAddress=$instanceName; // display confirmation or failure $registrationDatas = array('context'=>$context, 'instance'=>$instance, 'person'=>$person, 'info'=>$info); if($result='ok'){ include('success.html'); }else{ include('failure.php'); // <--- TODO! } }else{ $registrationDatas = array('context'=>$context, 'instance'=>$instance, 'person'=>$person, 'info'=>$info); $to = 'corretagil@pinhaotec.com.br'; $subject = 'Corretagil new request :)'; $message = 'New request for Corretagil:'; foreach($registrationDatas as $registrationDataLabel => $registrationData){ if(is_array($registrationData)){ foreach($registrationData as $registrationDataSub => $registrationDataVal){ $message .= "\n".$registrationDataSub.' -> '.$registrationDataVal; } } } $message .= "\n\nhttp://192.168.161.140/createorupdaterequested.php?json=".urlencode(json_encode($registrationDatas)); $headers = 'From: '.$fromEmail . "\r\n" .'X-Mailer: PHP/' . phpversion()."\r\n" .'Content-Type: text/plain; charset="utf-8"'."\r\n" .'Content-Transfer-Encoding: 8bit'; mail($to, $subject, $message, $headers); $linkAddress=''; unset($_SESSION['data']); include('success.html'); } unset($_SESSION['data']); exit(); } // save }else{ // check if we have data in session and fill variables if(is_object($_SESSION['data'])){ $data = $_SESSION['data']; $fullName = $data->Nome; $_SESSION['lockedFields']['fullName'] = ($fullName!='') ? true : false; $city = $data->Cidade; $state = $data->UF; $idNo = $data->{'CNPJ'}; $_SESSION['lockedFields']['idNo'] = ($idNo!='') ? true : false; $address = $data->Endereço; $postalcode = $data->CEP; $email = ($data->{'Contatos-email1'}!='') ? $data->{'Contatos-email1'} : ''; $_SESSION['lockedFields']['email'] = ($email!='') ? true : false; $phone = ($data->{'Contatos-telephone1'}!='') ? $data->{'Contatos-telephone1'} : ''; $responsible = $data->responsible; $instanceName = $data->instanceName; $howDidKnow = $data->howDidKnow; $indication = $data->indication; $referral = $indication; $_SESSION['idCustomer'] = $data->id; $_SESSION['dataPrefilled']=true; } } ?> Corretágil - Solicite acesso para sua corretora de seguros

Formulário de Cadastro













id="pi-yes"> id="pi-no">



Clique aqui para ler os termos e condições