You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

118 lines
2.3 KiB

<?php
class OtherUsers
{
// add webhuddle user
function add_webhuddle_user($first_name, $last_name,$email,$country, $state, $city, $zip, $address)
{
require_once("../Presentation/db_mysql.php");
$wdb = new wdb;
//
// Connect to DB
//
$wdb->connect();
$qryStr="select max(customer_id)+1 as custID from customers";
$rs=$wdb->query($qryStr);
$row = $wdb->fetch_result($rs);
$nextCustID=$row["custID"];
if(!isset($nextCustID))
$nextCustID=1;
$qryStr="insert into customers(customer_id,first_name,last_name,email,creation,has_account,address,city,state,zip,locale_language,locale_country,country,passwordHash,salt) values($nextCustID,'$first_name','$last_name','$email',now(),1,'$address','$city','$state', '$zip','en','US','$country',0,0)";
$rs=$wdb->query($qryStr);
$wdb->disconnect();
if(isset($rs))
return 1;
else
return 0;
}
function delete_webhuddle_user($email)
{
require_once("../Presentation/db_mysql.php");
$wdb = new wdb;
//
// Connect to DB
//
$wdb->connect();
$qryStr="delete from customers where email='$email'";
$rs=$wdb->query($qryStr);
$web->dissconnect();
if(isset($rs))
return 1;
else
return 0;
}
//add book marks user
function add_bookmarks_user($username,$password,$first_name,$last_name,$email)
{
require_once("../bookmarks/db_mysql.php");
$rdate = date('Y-m-d:H:i');
$bmdb = new bmdb;
//
// Connect to DB
//
$bmdb->connect();
$fullName=$first_name . " " . $last_name;
$qryStr="INSERT INTO passwd(user,passwd,name,email,rdate) values('$username',PASSWORD('$password'),'$fullName','$email','$rdate')";
$rs=$bmdb->query($qryStr);
$bmdb->disconnect();
if(isset($rs))
return 1;
else
return 0;
}
function delete_bookmarks_user($username)
{
require_once("../bookmarks/db_mysql.php");
$rdate = date('Y-m-d:H:i');
$bmdb = new bmdb;
//
// Connect to DB
//
$bmdb->connect();
$fullName=$first_name . " " . $last_name;
$qryStr="delete from passwd where user='$username'";
$rs=$bmdb->query($qryStr);
$bmdb->disconnect();
if(isset($rs))
return 1;
else
return 0;
}
}
?>