alert('Verification Code Error!');"; echo ""; exit(); } while (list($key, $value) = each($ruc)) { $ruc[$key]=trim($value); } $ruc['identity']=intval($ruc['identity']); $ruc['issueyear']=intval($ruc['issueyear']); $ruc['issuemonth']=intval($ruc['issuemonth']); $ruc['issuedate']=intval($ruc['issuedate']); $ruc['contactway1']=intval($ruc['contactway1']); $ruc['contactway2']=intval($ruc['contactway2']); $ruc['contactway3']=intval($ruc['contactway3']); $ruc['lang']=intval($ruc['lang']); $sql_check="select * from ruc order by id desc limit 1"; $query_check=mysql_query($sql_check,$conn) or die("error".mysql_error()); $num_check=mysql_num_rows($query_check); $result_check=mysql_fetch_assoc($query_check); $check_flag=0; if($num_check==0){ $check_flag=1; }else{ foreach($result_check as $key=>$value){ if(addslashes($result_check[$key])!=$ruc[$key]&&$key!='id'&&$key!='regdate'&&$key!='insdate'){ $check_flag=1; break; } } } if($check_flag==0){ echo ""; echo ""; exit(); }else{ $filenum=1; $fileflag=0; for($i=1;$i<=$filenum&&$fileflag==0;$i++){ $filename[$i]=""; if($_FILES['documentrequire'.$i]['name']!=""){ $pt=split('\.',$_FILES['documentrequire'.$i]['name']); $ptcount=sizeof($pt)-1; //echo($pt[0]); $pt[$ptcount]=strtolower($pt[$ptcount]); if($pt[$ptcount]!='jpg'&&$pt[$ptcount]!='jpeg'&&$pt[$ptcount]!='gif'&&$pt[$ptcount]!='doc'&&$pt[$ptcount]!='pdf'&&$pt[$ptcount]!='txt'){ $fileflag=1; echo ""; echo ""; break; } $pt2=split('/',$_FILES['documentrequire'.$i]['type']); //echo($pt[0]); if($pt2[0]==''){ $fileflag=1; echo ""; echo ""; break; }else{ $filename[$i]=date('YmdHis')."_".$i.'.'.$pt[$ptcount]; copy($_FILES['documentrequire'.$i]['tmp_name'],"admin/file/ruc".$filename[$i]); if($pt[$ptcount]=='jpg'||$pt[$ptcount]=='jpeg'||$pt[$ptcount]=='gif'){ $src_image="admin/file/ruc".$filename[$i]; $dst_image="admin/file/ruc".$filename[$i]; makethumb($src_image,$dst_image,'620'); } } } } if($fileflag==0){ $sql_add = "insert into ruc (name,title,identity,identityno,issueplace,issueyear,issuemonth,issuedate,companyname_c,companyname_e,companyname_p,companyname_o,businessnature,companyaddress,bareacode,bnumber,mareacode,mnumber,fareacode,fnumber,email,contactway1,contactway2,contactway3,documentrequire1,following,lang,regdate) values('{$ruc['name']}','{$ruc['title']}',{$ruc['identity']},'{$ruc['identityno']}','{$ruc['issueplace']}',{$ruc['issueyear']},{$ruc['issuemonth']},{$ruc['issuedate']},'{$ruc['companyname_c']}','{$ruc['companyname_e']}','{$ruc['companyname_p']}','{$ruc['companyname_o']}','{$ruc['businessnature']}','{$ruc['companyaddress']}','{$ruc['bareacode']}','{$ruc['bnumber']}','{$ruc['mareacode']}','{$ruc['mnumber']}','{$ruc['fareacode']}','{$ruc['fnumber']}','{$ruc['email']}',{$ruc['contactway1']},{$ruc['contactway2']},{$ruc['contactway3']},'{$filename[1]}',0,{$ruc['lang']},now())"; $query_add=mysql_query($sql_add,$conn) or die("error2".mysql_error()); $sql_log = "insert into formlog (formbel) values(1)"; $query_log=mysql_query($sql_log,$conn) or die("error".mysql_error()); ini_set("SMTP","smtp.macau.ctm.net"); $send_email = $ruc['email']; $send_subject = "=?utf-8?B?".base64_encode('Form application alert')."?="; $send_headers = "MIME-Version: 1.0\r\n"; $send_headers .= "Content-type: text/html; charset=utf-8\r\n"; $send_headers .= "From: ".$send_email; //$send_to="lei@microchina.com"; $send_to="mbsc@ipim.gov.mo,fmak@ipim.gov.mo,chan@ipim.gov.mo,twh@ipim.gov.mo"; $send_html="Note:

There is a new application form( Registered User Information - English ) has been submitted, please check it in time!

".date("Y-m-d H:i"); if(mail($send_to, $send_subject, $send_html, $send_headers)) { } else { echo "Email Error!"; } ini_restore("SMTP"); ini_set("SMTP","smtp.macau.ctm.net"); $send_email2 = "mbsc@ipim.gov.mo"; $send_subject2 = "=?utf-8?B?".base64_encode('MBSC Auto-reply')."?="; $send_headers2 = "MIME-Version: 1.0\r\n"; $send_headers2 .= "Content-type: text/html; charset=utf-8\r\n"; $send_headers2 .= "From: ".$send_email; //$send_to2="lei@microchina.com"; $send_to2=$ruc['email']; $send_html2=" Dear Mr./ Ms. ".$ruc['name']."

Thank you for using the service of Macao Business Support Centre (MBSC). Your application (Registered User Information) requested on ".date("Y-m-d H:i")." has already been received and will be processed.

For more information, please do not hesitate to contact our Centre (Tel:+853 28728212, Fax:+853 28727123 or email: mbsc@ipim.gov.mo). "; if(mail($send_to2, $send_subject2, $send_html2, $send_headers2)) { } else { echo "Email Error!"; } ini_restore("SMTP"); echo "


Success!"; echo "Back

"; exit(); } } } ?>
 
 

Registered User Information

(1) Applicant’s name (last, first): *
(2) Business Title: *
(3) Place of issue: *
(4) Issue date: Y M D
(5) Name of company / organisation: *
(5) Chinese (if applicable):
(5) Portuguese (if applicable):
(5) Other languages (if applicable):
(6) Nature of Business (please specify): *
(7) Company address:

(8) Business Phone: - * ( area code-number)
(9) Mobile Phone: - ( if applicable)
(10) Fax: - *
(11) E-mail: *
(12) For enquiries of the above information, please contact my belonging company/organisation by fax e-mail mail.

I hereby certify that the above information is true. Should I make any false declaration, I shall accept any decision of IPIM.

(13) Document require: Business card or copy of the staff card or working certification issued by the belonging enterprise
 (format: jpg , gif , doc , pdf , txt ; less than 2M)

(14) Verification Code:

Note: * = Required field

Additional Information would be required by MBSC if necessary.