Display(); function regulament() { $page = new Page(); if($_SESSION[en]) { $page -> header_tabel('Terms and conditions for subscription',NULL,NULL,NULL); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; } else { $page -> header_tabel('Termeni si conditii de inscriere',NULL,NULL,NULL); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; } $page -> footer_tabel(NULL); } function newuser() { $clasa= new Page(); require('mysql.inc.php'); $s_user="SELECT * FROM clienti WHERE username=\"$_SESSION[username]\"";// or die(mysql_error().'
'.__FILE__.':'.__LINE__)"; $q_user=mysql_query($s_user) or die($s_user.'
'.mysql_error().'
'.__FILE__.':'.__LINE__); $user = mysql_fetch_array($q_user); //echo '
'; //echo ''; // echo ''; //echo ''; // echo '
'; if($_SESSION[en]) { if (!$user[username]) { $titlu='Subscription form'; } else { $titlu=$user[nume].' account modification'; } } else { if (!$user[username]) { $titlu='Formular inscriere'; } else { $titlu='Modificare informatii cont '.$user[nume]; } } $clasa-> header_tabel($titlu,NULL,NULL,NULL); // echo '
'; echo '
'; echo ''; if($user[username]) { echo ''; echo ''; } else { echo ''; echo ''; echo ''; echo ''; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if($_SESSION[en]) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } echo '
username*
'; if($_SESSION[en]) { echo 'password*'; } else { echo 'parola*'; } echo '
'; if($_SESSION[en]) { echo 'password confirm*'; } else { echo 'confirmati parola*'; } echo '
'; if($_SESSION[en]) { echo 'company name*'; } else { echo 'nume firma*'; } echo '
'; if($_SESSION[en]) { echo 'address*'; } else { echo 'adresa*'; } echo '
'; if($_SESSION[en]) { echo 'delivery address
(leave this field blank
if the address is
the same as above)'; } else { echo 'adresa de livrare
(lasati campul gol
daca este aceeasi
cu adresa
dumneavoastra)'; } echo '
'; if($_SESSION[en]) { echo 'Unique id number
(CUI)*'; } else { echo 'CUI*'; } echo '
'; if($_SESSION[en]) { echo 'Registration nr*'; } else { echo 'Nr inregistrare*'; } echo '
'; if($_SESSION[en]) { echo 'IBAN (no blanks)*'; } else { echo 'IBAN* (fara spatii)'; } echo '
'; if($_SESSION[en]) { echo 'bank*'; } else { echo 'banca*'; } echo '
'; if($_SESSION[en]) { echo 'contact person*'; } else { echo 'persoana de contact*'; } echo '
tel*
fax
e-mail*
web
'; if($_SESSION[en]) { echo 'prefered language*'; } else { echo 'limba preferata*'; } echo ''; $s_limba="SELECT * FROM limba ORDER BY denumire DESC"; $q_limba=mysql_query($s_limba) or die($s_limba.'
'.mysql_error().'
'.__FILE__.':'.__LINE__); $lang=''; echo $lang; echo '

- Fields with * are required !'; echo '
- The e-mail address must be valid !'; echo '
Your personal details are confidential, and will be used only to communicate with you. This information will not be shared to any other person or company.
- Campurile marcate cu * sunt obligatorii !'; echo '
- Adresa de email trebuie sa fie valida si direct accesibila Dvs. !'; echo '
Informatiile Dvs. sunt strict confidentiale, vor fi folosite numai in scopul comunicarii cu Dvs. si nu vor fi transmise catre nici un alt tert
'; //echo '
'; $clasa-> footer_tabel(NULL); echo ''; mysql_close(); } function checkuser() { $clasa=new Page(); if($_POST[user]) { $username=$_POST[user]; } else { $username=$_SESSION[username]; } $e=0; $p=0; if(!$_SESSION[username]) { if($_SESSION[en]) { $titlu='Client subscription:'; } else { $titlu='Inscriere client:'; } } else { if($_SESSION[en]) { $titlu='Account details modification:'; } else { $titlu='Modificare informatii client:'; } } $clasa->header_tabel($titlu,NULL,NULL,NULL); if(!$_SESSION[username]) { if ($username) { require ('mysql.inc.php'); $q_usr ="SELECT username FROM clienti WHERE username=\"$username\"" or die(mysql_error()); $rez_usr=mysql_query($q_usr) or die($q_usr.'
'.mysql_error().'
'.__FILE__.':'.__LINE__); if($row_usr=mysql_fetch_assoc($rez_usr)) { if($row_usr[username]==$username) { $e++; if($_SESSION[en]) { echo '
'.$e.'. '.$username.' is allready registered, please choose another'; } else { echo '
'.$e.'. '.$username.' este deja inregistrat, ne pare rau'; } mysql_close(); } else { for($i=0; $i < (strlen($username)); $i++) { if($username{$i}==' ') { $e++; if($_SESSION[en]) { echo '
'.$e.'. '.$username.' can not contain blanks'; } else { echo '
'.$e.'. '.$username.' nu poate sa contina spatii'; } } } } } } else { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter an username'; } else { echo '
'.$e.'. Nu ati scris nimic la username'; } } for($i=0;$i<=strlen($username);$i++) { if($username{$i}=="'") { $e++; if($_SESSION[en]) { echo '
'.$e.'. '.$username.' can not contain "\'"'; } else { echo '
'.$e.'. '.$username.' nu poate sa contina "\'"'; } } } if($_POST[pass1]) { if(strcmp($_POST[pass1], $_POST[pass2])) { $e++; if($_SESSION[en]) { echo '
'.$e.'. Password confirmation does not match'; } else { echo '
'.$e.'. Nu ati introdus corect noua parola in casutele "parola: si "confirmati parola"'; } } else { $parola=md5($_POST[pass2]); } } else { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter any password'; } else { echo '
'.$e.'. Nu ati introdus parola in casuta "parola"'; } } } if($_SESSION[username]) { if($_POST[pass1] or $_POST[pass2]) { if(strcmp($_POST[pass1], $_POST[pass2])) { $e++; if($_SESSION[en]) { echo '
'.$e.'. Password confirmation does not match'; } else { echo '
'.$e.'. Nu ati introdus corect noua parola in casutele "parola: si "confirmati parola"'; } } else { $parola=md5($_POST[pass2]); } } else { $parola=$_POST[pass]; } } if(!$_POST[nume]) { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter the company\'s name'; } else { echo '
'.$e.'. Nu ati completat numele companiei'; } } if(!$_POST[adresa]) { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter the address'; } else { echo '
'.$e.'. Nu ati completat adresa'; } } if($_POST[cui]) { $r=$_POST[cui]{0}; if(strcasecmp($r, "r") == 0) { if(!ctype_digit(substr($_POST[cui],1,19))) { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter correctly the Unique id number (CUI)'; } else { echo '
'.$e.'. Nu ati introdus corect CUI'; } } } else { if(!ctype_digit($_POST[cui])) { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter correctly the Unique id number (CUI)'; } else { echo '
'.$e.'. Nu ati introdus corect CUI'; } } } } else { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter correctly the Unique id number (CUI)'; } else { echo '
'.$e.'. Nu ati introdus corect CUI'; } } if(!$_POST[nr_inreg]) { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter the registration number'; } else { echo '
'.$e.'. Nu ati introdus numarul de inregistrare'; } } if($_POST[iban]) { if(strlen($_POST[iban]) < 24) { $e++; if($_SESSION[en]) { echo '
'.$e.'. IBAN must have exactly 24 characters'; } else { echo '
'.$e.'. Contul IBAN trebuie sa aiba 24 de caractere'; } } else { if(!ctype_alnum($_POST[iban])) { $e++; if($_SESSION[en]) { echo '
'.$e.'. IBAN can contain only letters and digits'; } else { echo '
'.$e.'. IBAN trebuie sa contina NUMAI litere si cifre'; } } } if(!$_POST[banca]) { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter the Bank\'s name'; } else { echo '
'.$e.'. Nu ati completat numele Bancii'; } } } else { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter the IBAN'; } else { echo '
'.$e.'. Nu ati introdus contul IBAN'; } } /* if($_POST[banca] and !$_POST[iban]) { $e++; echo '
'.$e.'. Nu ati completat Contul IBAN'; } */ if(!$_POST[pers_cnt]) { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter the name of the contact person'; } else { echo '
'.$e.'. Nu ati completat numele persoanei de contact'; } } if($_POST[tel]) { if(!ctype_digit($_POST[tel])) { $e++; if($_SESSION[en]) { echo '
.'.$e.'. The phone number must contain only digits'; } else { echo '
.'.$e.'. Numarul de telefon trebuie sa contina numai cifre'; } } } else { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter the phone number'; } else { echo '
'.$e.'. Nu ati introdus numarul de telefon'; } } if(!ctype_digit($_POST[fax])) { $e++; if($_SESSION[en]) { echo '
'.$e.'. The fax number must contain only digits'; } else { echo '
'.$e.'. Numarul de fax trebuie sa contina numai cifre'; } } if(!$_POST[email]) { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not enter the e-mail adress'; } else { echo '
'.$e.'. Nu ati completat adresa de email'; } } else { for($i=0; $i<=strlen($_POST[email]); $i++) { if($_POST[email]{$i}==" ") { $e++; if($_SESSION[en]) { echo '
'.$e.'. The e-mail adress can not contain blanks'; } else { echo '
'.$e.'. Adresa de mail nu poate sa contina spatii'; } } if($_POST[email]{$i}=="'") { $e++; if($_SESSION[en]) { echo '
'.$e.'. The e-mail adress can not contain the character \''; } else { echo '
'.$e.'. Adresa de mail nu poate sa contina caracterul "\'"'; } } } $cuvmail=explode("@",$_POST[email]); $nrcuv=count($cuvmail); if($nrcuv==1) //nu are nici un @ in adresa { $e++; if($_SESSION[en]) { echo '
'.$e.'. Invalid e-mail adress, there is no @ in the adress'; } else { echo '
'.$e.'. Adresa de email invalida, nu are nici un @ in adresa'; } } elseif($nrcuv==2) //are un @ in adresa { //echo '
before @ scrie: ',$cuvmail[0]; if($cuvmail[0]=="") { $e++; if($_SESSION[en]) { echo '
'.$e.'. You did not write anything before @'; } else { echo '
'.$e.'. Nu ati scris nimic inainte de @'; } } //echo '
dupa @ scrie: ',$cuvmail[1]; $dupaarond=explode(".",$cuvmail[1]); $cuvdupaarond=count($dupaarond); if($cuvdupaarond==1) { $e++; if($_SESSION[en]) { echo '
'.$e.'. There are no dots in the e-mail adress'; } else { echo '
'.$e.'. Nu aveti nici un punct in adresa de mail'; } } if($dupaarond[0]{0}=="") { $e++; if($_SESSION[en]) { echo '
'.$e.'.There is nothing between @ and .'; } else { echo '
'.$e.'. Nu ati scris nimic intre @ si .'; } } if(strlen($dupaarond[1])<= 1) { $e++; if($_SESSION[en]) { echo '
'.$e.'. There is nothing after "."'; } else { echo '
'.$e.'. Nu ati scris nimic dupa "."'; } } } else { $e++; if($_SESSION[en]) { echo '
'.$e.'. To many @ in the e-mail adress '.($nrcuv-1).''; } else { echo '
'.$e.'. Prea multe @ in adresa de mail '.($nrcuv-1).''; } } } if(!$e) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if($_POST[adresa_livrare]) { echo ''; echo ''; echo ''; echo ''; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if($_POST[fax]!="") { echo ''; echo ''; echo ''; echo ''; } echo ''; echo ''; echo ''; echo ''; if($_POST[web]) { echo ''; echo ''; echo ''; echo ''; } echo ''; echo ''; echo ''; echo ''; if($_SESSION[username]) { if($_SESSION[en]) { $action="The information above is correct, modify my account"; } else { $action="Date corecte, modifica cont"; } } else { if($_SESSION[en]) { $action="The information above is correct, I subscribe"; } else { $action="Date corecte, ma inscriu"; } } echo ' '; if(!$_SESSION[username]) { echo ''; echo ''; echo ''; } else { echo ''; echo ''; echo ''; } echo '
username:'.$username.'
'; if($_SESSION[en]) { echo 'name:'; } else { echo 'nume:'; } echo ''.$_POST[nume].'
'; if($_SESSION[en]) { echo 'address:'; } else { echo 'adresa:'; } echo ''.$_POST[adresa].'
'; if($_SESSION[en]) { echo 'delivery address:'; } else { echo 'adresa de livrare:'; } echo ''.$_POST[adresa_livrare].'
'; if($_SESSION[en]) { echo 'Unique id number(CUI):'; } else { echo 'CUI:'; } echo''.$_POST[cui].'
'; if($_SESSION[en]) { echo 'Registration nr:'; } else { echo 'Nr inregistrare:'; } echo ''.$_POST[nr_inreg].'
'; if($_SESSION[en]) { echo 'IBAN:'; } else { echo 'IBAN:'; } echo ''.$_POST[iban].'
'; if($_SESSION[en]) { echo 'bank:'; } else { echo 'banca:'; } echo ''.$_POST[banca].'
'; if($_SESSION[en]) { echo 'contact person:'; } else { echo 'persoana de contact:'; } echo ''.$_POST[pers_cnt].'
tel: '.$_POST[tel].'
fax:'.$_POST[fax].'
e-mail:'.$_POST[email].'
web:'.$_POST[web].'
'; if($_SESSION[en]) { echo 'language:'; } else { echo 'limba:'; } echo ''.$_POST[lang].'
'; } else { if($_SESSION[en]) { echo '

Click BACK to review'; } else { echo '

Apasati butonul BACK al Browserului
Dumneavostra pentru a rectifica
'; } } $clasa->footer_tabel(NULL); } function adduser() { require('mysql.inc.php'); $pass=mysql_escape_string($_POST[pass]); $nume=mysql_escape_string($_POST[nume]); $adresa=mysql_escape_string($_POST[adresa]); $adresa_livrare=mysql_escape_string($_POST[adresa_livrare]); $cui=mysql_escape_string($_POST[cui]); $nr_inreg=mysql_escape_string($_POST[nr_inreg]); $iban=mysql_escape_string($_POST[iban]); $banca=mysql_escape_string($_POST[banca]); $pers_cnt=mysql_escape_string($_POST[pers_cnt]); $web=mysql_escape_string($_POST[web]); $cod=md5($_POST[email]); if(!$_SESSION[username]) { $ip = getenv("REMOTE_ADDR"); $ins_usr="INSERT INTO clienti (username, password, nume, adresa, adresa_livrare, cui, nr_inreg, iban, banca, pers_contact, tel, fax, email, web, data_inregistrarii, ip, cod, lang) VALUES ('".$_POST[user]."', '$pass', '$nume', '$adresa', '$adresa_livrare', '$cui', '$nr_inreg', '$iban', '$banca', '$pers_cnt', '".$_POST[tel]."', '".$_POST[fax]."', '".$_POST[email]."', '".$web."', NOW(), '".$ip."', '".$cod."', '".$_POST[lang]."')"; if(!$_SESSION[introdus]) { if(mysql_query($ins_usr)) { $_SESSION[introdus]=1; if($_SESSION[en]) { echo '

Your subscription was succesfull !
The Comapany "'.$_POST[nume].'" was added to our database !
You will receive an e-mail at the time of your account activation !
Thank you !'; echo '

Finish
'; } else { echo '

Inregistrare efectuata cu succes !
Firma "'.$_POST[nume].'" a fost introdusa cu succes in baza de date !
Veti fi notificat prin e-mail la momentul activarii contului !
Va multumim !'; echo '

Finalizare
'; } //email($_POST[user]); } else { die($ins_usr.'
'.mysql_error().'
'.__FILE__.':'.__LINE__); } } else { if($_SESSION[en]) { echo '

You allready subscribed with this information !'; } else { echo '

V-ati mai inregistrat odata cu aceste date !'; } echo '

OK
'; } } else { $u_usr="UPDATE clienti SET password= '".$pass."', nume= '".$nume."', adresa= '".$adresa."', adresa_livrare= '".$adresa_livrare."', cui= '".$cui."', nr_inreg= '".$nr_inreg."', iban= '".$iban."', banca= '".$banca."', pers_contact= '".$pers_cnt."', tel= '".$_POST[tel]."', fax= '".$_POST[fax]."', email= '".$_POST[email]."', web= '".$web."', lang= '".$_POST[lang]."' WHERE username='".$_SESSION[username]."'"; if(mysql_query($u_usr)) { if($_SESSION[en]) { echo '

The account ',$_SESSION[username],' was succesfully updated'; echo '

Finish
'; } else { echo '

Contul ',$_SESSION[username],' a fost actualizat'; echo '

Finalizare
'; } } else { die($u_usr.'
'.mysql_error().'
'.__FILE__.':'.__LINE__); } } mysql_close(); } //phpinfo(); /* if($_GET[chkmail]) { checkmail($_GET[chkmail],$_GET[chkmailusr]); die(); } */ if(!$_SESSION[username] and !$_GET[action]) { regulament(); } elseif($_SESSION[username] and !$_GET[action]) { newuser(); } else { switch ($_GET[action]) { case(accept): newuser(); break; case (chkuser): checkuser(); break; case (mod_date): adduser(); break; case (regulament): regulament(); break; } } $homepage -> DisplayFooter(); ?>