* Have full access to all articles
* Receive our Newsletters
require('php/auth.inc');
require('php/send_email.inc');
$retpag = $_GET['rp'];
$er = 0;
$msg = '';
if (!empty($_POST['Submit_new']) || !empty($_POST['Submit_update'])) {
if (!empty($_POST['usr1']) && !empty($_POST['parola']) && !empty($_POST['fname']) && !empty($_POST['lname'])) {
if (!empty($_POST['Submit_new'])) {
// -------------------------------------------
$query = 'SELECT COUNT(id) FROM membrii WHERE usr="'.$_POST['usr1'].'"';
$result = mysql_query($query) or die(mysql_error());
if (mysql_result($result,0) == '1') {
$er = 1;
$msg = 'User already exist !
Click here to recover your password.';
} else {
$opt = 1;
// -------------------------------------------
$query = 'INSERT INTO membrii(usr,parola,fname,lname,bdate,gender,tara,oras,company,title,industry,start_date) VALUES("'.$_POST['usr1'].'","'.$_POST['parola'].'","'.$_POST['fname'].'","'.$_POST['lname'].'",';
$sdate = date('Y/m/d');
if (($_POST['fyear'] <> '0') && ($_POST['fmonth'] <> '0') && ($_POST['fday'] <> '0')) {
$query=$query.'"'.$_POST['fyear'].'/'.$_POST['fmonth'].'/'.$_POST['fday'].'"';
} else {
$query=$query.'NULL';
}
$query=$query.',"'.$_POST['gender'].'","'.$_POST['country'].'","'.$_POST['city'].'","'.$_POST['company'].'","'.$_POST['title'].'","'.$_POST['industry'].'","'.$sdate.'")';
if (!(@ mysql_query ($query))) {
showerror( );
} else {
send_conf_email($_POST['usr1']);
$msg = '
Confirmation email has been sent to: '.$_POST['usr1'].'
'; $msg .='Return to The Diplomat Bucharest initial page
'; $_SESSION['aut'] = 1; $_SESSION['uname']= $_POST['usr1']; } } } else { $opt = 2; $query = 'UPDATE membrii SET parola = "'.$_POST['parola'].'",fname = "'.$_POST['fname'].'",lname="'.$_POST['lname'].'",gender="'.$_POST['gender'].'",tara="'.$_POST['country'].'",oras="'.$_POST['city'].'",company="'.$_POST['company'].'",title="'.$_POST['title'].'",industry="'.$_POST['industry'].'"'; if (($_POST['fyear'] <> '0') && ($_POST['fmonth'] <> '0') && ($_POST['fday'] <> '0')) { $query=$query.',bdate="'.$_POST['fyear'].'/'.$_POST['fmonth'].'/'.$_POST['fday'].'"'; } $query=$query.' WHERE id="'.$_POST['p_id'].'"'; if (!(@ mysql_query ($query))) { showerror( ); } else { $msg = 'Your profile has been updated !'; } } } else { $er = 1; $msg = 'Please fill all the required fields'; } } else { $opt=0; if ($_SESSION['aut'] == '1') { $query = 'SELECT * FROM membrii WHERE usr="'.$_SESSION['uname'].'"'; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $pid=$row['id']; $user=$row['usr']; $parola=$row['parola']; $fname=$row['fname']; $lname=$row['lname']; $zi=intval(substr($row['bdate'],-2)); $luna=intval(substr($row['bdate'],5,2)); $an=substr($row['bdate'],0,4); $gender=$row['gender']; $city=$row['oras']; $country=$row['tara']; $company=$row['company']; $title=$row['title']; $industry=$row['industry']; $h2 = '
|
|||||||||||||||||
|