-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPublikum.php
More file actions
48 lines (39 loc) · 1.58 KB
/
Publikum.php
File metadata and controls
48 lines (39 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
include 'Tilkobling.php';
/**
*
*/
require_once ('Person.php');
class Publikum extends Person
{
private $bilettType;
private $publikumPersonId;
function getBilettType(){return $this->bilettType;}
function getPublikumPersonId(){return $this->publikumPersonId;}
function setBilettType($bilettType){ $this->bilettType = $bilettType;}
function setPublikumPersonId($publikumPersonId){$this->publikumPersonId=$publikumPersonId;}
function __construct($navn=null,$etternavn=null,$adresse=null,$postNum=null,$postSted=null,$telefon=null,$ØvelsId=null,$bilettType=null)
{
parent::__construct($navn,$etternavn,$adresse,$postNum,$postSted,$telefon,$ØvelsId);
$this->bilettType = $bilettType;
}
function settInnData($navn,$etternavn,$adresse,$postnr,$poststed,$telefon,$ØvelsId,$bilettType){
global $db;
$foresporring = "Insert into Person (Fornavn,Etternavn,Adresse,";
$foresporring .= "PostNum,Poststed,Telefonnr,ØvelsesId)";
$foresporring .= "Values ('$navn','$etternavn','$adresse',";
$foresporring .= "'$postnr','$poststed','$telefon','$ØvelsId');";
if ($db->query($foresporring) === TRUE) {
$this->publikumPersonId= $db->insert_id;
$foresporring2="Insert into Publikum (BillettType, PersonId) Values('$bilettType','$this->publikumPersonId');";
if($db->query($foresporring2) === TRUE){
echo "<p class='velykket'>Takk for at du meldt deg på! Din registering er motatt. </p>";
}
}
elseif (mysqli_affected_rows($db)==0)
{
echo "Feil i registrering!";
}
}
}
?>