Guest User

Untitled

a guest
Aug 2nd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.25 KB | None | 0 0
  1. <?php
  2.  
  3.     class DBmanager {
  4.         private $conn;
  5.         private $db = "oci:dbname=localhost/XE";
  6.         function __construct() {
  7.             $db_username = "hr";
  8.             $db_password = "hr";
  9.             try {
  10.                 $this->conn = new PDO($this->db,$db_username,$db_password);
  11.             } catch(PDOException $e){
  12.                 echo ($e->getMessage());
  13.             }
  14.         }
  15.        
  16.         function vasarlo_regisztral($nev, $cim, $telefon, $e_mail, $szul_dat, $jelszo, $kell_hirlevel) {
  17.             $reg_ideje=date('Y/m/d');
  18.             $reg="INSERT INTO Vasarlok(va_id, nev, cim, telefon, e_mail, egyenleg, reg_ideje, torzsvasarlo, szul_datum, jelszo, kell_hirlevel)
  19.                     VALUES(va_id.nextval, '$nev', '$cim', '$telefon', '$e_mail',
  20.                     '0', to_date('$reg_ideje','yyyy/mm/dd'), '0', to_date('$szul_dat','yyyy/mm/dd'), '$jelszo', '$kell_hirlevel');";
  21.             print $reg;
  22.                 try {
  23.                     $val=$this->conn->exec($reg);
  24.         }       catch(PDOException $e){
  25.                 echo ($e->getMessage());
  26.             }
  27.         }
  28.        
  29.        
  30.         function termek_felvesz($nev, $kategoria, $ar, $leiras, $kep){
  31.        
  32.         }
  33.        
  34.         /*function termek_torol ($t_id) {
  35.             $torol="DELETE FROM Termek WHERE t_id = '$t_id';";
  36.            
  37.             $term_torol=oci_parse($conn, $torol);
  38.             oci_execute($term_torol);  
  39.         }*/
  40.    
  41.     }
  42.     /*Jelszó titkosító*/
  43.     function crypto($p){
  44.         $pass = crypt($p);
  45.         return md5($pass);
  46.  
  47.     }
  48.  
  49. ?>
Add Comment
Please, Sign In to add comment