/**
  * Add a new user to the database. This user is just able to give and receive referrals.
  *
  * @return int
  */
 function update_member()
 {
     global $Conf, $order, $User;
     // Process and store payment information
     $privateKey = decrypt_data($this->ID, true);
     // Return the stored encrypted key
     if (!$privateKey) {
         // No key exists create a new one.
         $privateKey = genPrivateKey();
         //Generate a private key - This will made into a static value after generating it once
     }
     $data = array('status' => $this->ccStatus, 'details' => $this->ccDetails, 'error' => $this->ccError, 'tcode' => $this->ccTCode, 'name' => $order->name, 'ccType' => $order->cardtype, 'ccNum' => $order->cardnumber, 'MM' => $order->cardexpmonth, 'YY' => $order->cardexpyear, 'ccCODE' => $order->cvmvalue);
     $data = encrypt(serialize($data), $privateKey);
     //Catches the ciphertext from the encrypt function
     // Convert the string value users enter and update it to and numeric string, autoid
     $state = $User->get_province_by_name(strtoupper($order->state));
     $tA = $Conf["data"]->UserTable;
     myDBC::new_andWhere();
     myDBC::andWhere("{$tA}.AutoID = '{$this->ID}'");
     $fields = array("`shipAddr1`" => "'{$order->address1}'", "`shipCity`" => "'{$order->city}'", "`shipState`" => "'{$state->autoid}'", "`shipZip`" => "'{$order->zip}'", "`cc`" => "'{$data}'", "`level`" => "'member'", "`is_enabled`" => "'yes'", "`date_added`" => "NOW()", "`paymentType`" => "'Credit Card'");
     capture_cc($this->ID, '', $privateKey);
     myDBC::update_Record($tA, $fields, myDBC::get_andWhere(), " LIMIT 1");
 }
 /**
  * Update the login time when a user is validated. - DEPRECIATED
  *
  * @param int $user_id
  */
 private static function touchLoginTime($user_id)
 {
     global $Conf;
     $tA = $Conf["data"]->UserTable;
     myDBC::new_andWhere();
     myDBC::andWhere("`AutoID` = '{$user_id}'");
     $fields = array("`last_login`" => "NOW()");
     myDBC::update_Record($tA, $fields, myDBC::get_andWhere(), " LIMIT 1");
 }
 /**
  * Take all items and save information in database Orders table.
  *
  * @return int
  */
 function save_cart()
 {
     global $Conf;
     myDBC::new_andWhere();
     myDBC::andWhere("`AutoID` = '{$this->UID}'");
     $fields = array("`CartID`" => "'{$this->CartID}'");
     return myDBC::update_Record($Conf["data"]->UserTable, $fields, myDBC::get_andWhere());
 }