Adding changes from production server. Pls, stop making changes live. Hrmpf.
This commit is contained in:
1 parent
243008cff5
commit
ca1fcc8173
58 files changed
+4581
-203
No files matched your search
+548
-114
@@ -1,137 +1,571 @@
|
||||
table
|
||||
{
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
background-color: white;
|
||||
color: black;
|
||||
font: 10pt verdana, arial;
|
||||
margin-bottom: 25%; /* %, px, em, ex ? */
|
||||
}
|
||||
@import 'css/reset.css';
|
||||
@import 'css/rebuild.css';
|
||||
@import 'css/wp-css';
|
||||
|
||||
tr.subhead
|
||||
{
|
||||
background-color: #cccccc;
|
||||
}
|
||||
|
||||
th
|
||||
{
|
||||
padding: 0 3%;
|
||||
}
|
||||
/**
|
||||
* Structure
|
||||
*/
|
||||
|
||||
th.alt
|
||||
{
|
||||
background-color: black;
|
||||
color: white;
|
||||
padding: 3% 3% 2%;
|
||||
}
|
||||
/* Layout */
|
||||
/*#wrapper */
|
||||
#header .site-title,
|
||||
#header #menu ul ul,
|
||||
#main {
|
||||
width:1000px;
|
||||
margin:auto;
|
||||
position:relative;
|
||||
}
|
||||
#main {
|
||||
margin-top:-20px;
|
||||
}
|
||||
#content {
|
||||
float:left;
|
||||
margin:50px 0;
|
||||
width:1000px;
|
||||
background: #ffffff;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
td
|
||||
{
|
||||
padding: 0 3%;
|
||||
}
|
||||
.page-medlemmer .column,
|
||||
.home .column {
|
||||
width:400px;
|
||||
margin:0;
|
||||
padding:50px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
tr.alt
|
||||
{
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
.hentry,
|
||||
#program {
|
||||
margin:0;
|
||||
width: 518px;
|
||||
overflow:hidden;
|
||||
background:#ffffff;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
h1
|
||||
{
|
||||
font: 24pt verdana, arial;
|
||||
margin: 0;
|
||||
}
|
||||
.single .hentry {
|
||||
float:left;
|
||||
width: 500px;
|
||||
margin:50px;
|
||||
}
|
||||
|
||||
h2
|
||||
{
|
||||
font: 18pt verdana, arial;
|
||||
margin: 0;
|
||||
}
|
||||
.page-medlemmer .hentry {
|
||||
width:1000px;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
h3
|
||||
{
|
||||
font: 12pt verdana, arial;
|
||||
margin: 0;
|
||||
}
|
||||
.page-medlemmer .hentry h1 {
|
||||
margin:40px 50px 0;
|
||||
}
|
||||
|
||||
th a
|
||||
{
|
||||
color: #00008b;
|
||||
font: 8pt verdana, arial;
|
||||
}
|
||||
#primary.sidebar,#secondary.sidebar {
|
||||
width:300px;
|
||||
float:left;
|
||||
padding:30px 50px;
|
||||
}
|
||||
* html #primary {
|
||||
left: 20px;
|
||||
position: relative;
|
||||
}
|
||||
.program-teaser {
|
||||
width:1000px;
|
||||
margin:auto;
|
||||
}
|
||||
/* end layout */
|
||||
|
||||
a
|
||||
{
|
||||
color: #00008b;
|
||||
text-decoration: none;
|
||||
}
|
||||
/* Header */
|
||||
body.dns {
|
||||
background:#efefef;
|
||||
}
|
||||
/*body.dns */
|
||||
#header {
|
||||
background:#191919 url('img/header-210x.png') repeat-x bottom;
|
||||
}
|
||||
#header {
|
||||
height:155px;
|
||||
margin-bottom:10px;
|
||||
overflow:hidden;
|
||||
position:relative;
|
||||
}
|
||||
.site-title {
|
||||
z-index:999
|
||||
}
|
||||
.site-title a {
|
||||
background: url('img/bannerindex-400.png') no-repeat -20px 0;
|
||||
display:block;
|
||||
height:63px;
|
||||
margin-top:20px;
|
||||
text-indent:-9999px;
|
||||
width:400px;
|
||||
}
|
||||
#menu {
|
||||
position:absolute;
|
||||
bottom:35px;
|
||||
width:100%;
|
||||
/* padding-left:23%;*/
|
||||
}
|
||||
#menu > ul {
|
||||
width:960px;
|
||||
margin:auto;
|
||||
}
|
||||
#menu ul,#menu li {
|
||||
list-style-type:none;
|
||||
}
|
||||
#menu li{
|
||||
float:left;
|
||||
margin-right:10px;
|
||||
}
|
||||
#menu li a{
|
||||
display:block;
|
||||
height:22px;
|
||||
padding:5px 13px 3px;
|
||||
text-decoration:none;
|
||||
color: #f5f5f5;
|
||||
}
|
||||
#menu ul div {
|
||||
bottom:-25px;
|
||||
left:0;
|
||||
position:absolute;
|
||||
margin:0;
|
||||
width:100%;
|
||||
border-top:none;
|
||||
}
|
||||
#menu ul ul li a {
|
||||
padding-top:1px;
|
||||
color:#222222;
|
||||
}
|
||||
|
||||
a:hover
|
||||
{
|
||||
color: #00008b;
|
||||
text-decoration: underline;
|
||||
}
|
||||
#menu > ul > li {
|
||||
-moz-border-radius-topleft:8px;
|
||||
-moz-border-radius-topright:8px;
|
||||
-webkit-border-top-left-radius:8px;
|
||||
}
|
||||
|
||||
div.outer
|
||||
{
|
||||
width: 90%;
|
||||
margin: 15%;
|
||||
}
|
||||
#menu li div {
|
||||
display:none;
|
||||
height:25px;
|
||||
}
|
||||
#menu li.current div {
|
||||
display:block;
|
||||
}
|
||||
#menu li:hover div {
|
||||
display:block;
|
||||
background:url('img/gradient-200x.png') repeat-x 0 -204px;
|
||||
z-index:9;
|
||||
}
|
||||
|
||||
table.viewmenu td
|
||||
{
|
||||
background-color: #006699;
|
||||
color: white;
|
||||
padding: 0 5%;
|
||||
}
|
||||
#menu li#forside-meny,
|
||||
#menu li#forside-meny div {
|
||||
background:yellow;
|
||||
}
|
||||
|
||||
table.viewmenu td.end
|
||||
{
|
||||
padding: 0;
|
||||
}
|
||||
#menu li#program-meny,
|
||||
#menu li#program-meny div {
|
||||
background:#945FB9;
|
||||
}
|
||||
#menu li#informasjon-meny,
|
||||
#menu li#informasjon-meny div {
|
||||
background:#D83E00;
|
||||
}
|
||||
#menu li#medlem-meny,
|
||||
#menu li#medlem-meny div {
|
||||
background:#094f71;
|
||||
}
|
||||
#menu li#forum-meny,
|
||||
#menu li#forum-meny div {
|
||||
background:#187105;
|
||||
}
|
||||
#menu li#inside-meny,
|
||||
#menu li#inside-meny div {
|
||||
background: #9D2F2F;
|
||||
}
|
||||
#menu li#kontakt-meny,
|
||||
#menu li#kontakt-meny div {
|
||||
background: #444444;
|
||||
}
|
||||
|
||||
table.viewmenu a
|
||||
{
|
||||
color: white;
|
||||
font: 8pt verdana, arial;
|
||||
}
|
||||
#header .aapningstider {
|
||||
font-size:12px;
|
||||
left:50%;
|
||||
margin-left:366px;
|
||||
overflow:hidden;
|
||||
position:absolute;
|
||||
top:10px;
|
||||
width:134px;
|
||||
}
|
||||
|
||||
table.viewmenu a:hover
|
||||
{
|
||||
color: white;
|
||||
font: 8pt verdana, arial;
|
||||
}
|
||||
/* Header slutt */
|
||||
|
||||
a.tinylink
|
||||
{
|
||||
color: #00008b;
|
||||
font: 8pt verdana, arial;
|
||||
text-decoration: underline;
|
||||
}
|
||||
/* Hoveddel */
|
||||
|
||||
a.link
|
||||
{
|
||||
color: #00008b;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.join a {
|
||||
background:transparent url(img/sirkel.png) repeat scroll -30px -24px;
|
||||
color:#2D6372;
|
||||
display:block;
|
||||
font-family:Georgia,serif;
|
||||
font-size:34px;
|
||||
font-style:italic;
|
||||
height:129px;
|
||||
left:-40px;
|
||||
line-height:1;
|
||||
padding-left:30px;
|
||||
padding-top:50px;
|
||||
position:absolute;
|
||||
top:-40px;
|
||||
width:148px;
|
||||
}
|
||||
|
||||
div.buffer
|
||||
{
|
||||
padding-top: 7%;
|
||||
padding-bottom: 17%;
|
||||
}
|
||||
.home .hentry {
|
||||
width:100%;
|
||||
padding:0;
|
||||
margin:0 0 40px;
|
||||
border:none;
|
||||
}
|
||||
|
||||
.small
|
||||
{
|
||||
font: 8pt verdana, arial;
|
||||
}
|
||||
.info h3 {
|
||||
margin:0 0 -3px 0;
|
||||
}
|
||||
|
||||
table td
|
||||
{
|
||||
padding-right: 20%;
|
||||
}
|
||||
.info ul {
|
||||
background:#B8E2ED none repeat scroll 0 0;
|
||||
list-style-type:none;
|
||||
margin:0 0 3em;
|
||||
padding-bottom:10px;
|
||||
}
|
||||
.info ul li {
|
||||
padding:10px;
|
||||
}
|
||||
.info ul li.alt {
|
||||
background:transparent url(img/transparent-list-bottom.png) repeat scroll center bottom;
|
||||
left:-10px;
|
||||
padding:10px 20px 12px;
|
||||
position:relative;
|
||||
width:380px;
|
||||
}
|
||||
.single .info ul li.alt {
|
||||
width:280px;
|
||||
}
|
||||
.info ul .term {
|
||||
float:left;
|
||||
font-weight:bold;
|
||||
}
|
||||
.home .info ul .term {
|
||||
width:50px;
|
||||
}
|
||||
.home .info ul .definition {
|
||||
padding-left:50px;
|
||||
}
|
||||
.single .info ul .term {
|
||||
width:60px;
|
||||
}
|
||||
.single .info ul .definition {
|
||||
padding-left:60px;
|
||||
}
|
||||
|
||||
table td.nopad
|
||||
{
|
||||
padding-right: 5%;
|
||||
}
|
||||
|
||||
.home #nyheter img {
|
||||
width:93px;
|
||||
height:133px;
|
||||
float:left;
|
||||
margin-right:20px;
|
||||
}
|
||||
|
||||
.hentry, .sidebar,#program {
|
||||
margin-top:15px;
|
||||
}
|
||||
.entry-meta {
|
||||
margin: -12px 0 12px;
|
||||
}
|
||||
.vedlegg {
|
||||
float:right;
|
||||
margin:0 0 3px 10px;
|
||||
max-width:300px;
|
||||
}
|
||||
.caption {
|
||||
color:#333333;
|
||||
font-size:14px;
|
||||
line-height:1;
|
||||
margin-bottom:2em;
|
||||
text-align:center;
|
||||
}
|
||||
#vedlegg-2 .caption {
|
||||
margin-bottom:0.5em;
|
||||
}
|
||||
|
||||
#campaign1, #campaign2 {
|
||||
width:400px;
|
||||
height:160px;
|
||||
background:black;
|
||||
margin: 40px 0;
|
||||
}
|
||||
|
||||
#internal-ad-single-bottom {
|
||||
width:500px;
|
||||
height:150px;
|
||||
background:black;
|
||||
margin-bottom:30px;
|
||||
}
|
||||
|
||||
#external-ad-single-bottom {
|
||||
width:500px;
|
||||
height:300px;
|
||||
background:black;
|
||||
}
|
||||
|
||||
/* Hoveddel slutt */
|
||||
|
||||
/* Sidebar */
|
||||
.sidebar ul {
|
||||
list-style-type:none;
|
||||
margin-left:0;
|
||||
}
|
||||
.sidebar .widget {
|
||||
margin-bottom:30px;
|
||||
}
|
||||
|
||||
.events.widget li.event {
|
||||
margin:0 0 40px;
|
||||
}
|
||||
|
||||
/* Sidebar slutt */
|
||||
|
||||
/* Footer */
|
||||
|
||||
#footer {
|
||||
background-color:black;
|
||||
clear:both;
|
||||
padding-top:20px;
|
||||
overflow:auto;
|
||||
}
|
||||
.program {
|
||||
margin:auto;
|
||||
overflow:auto;
|
||||
width:1000px;
|
||||
}
|
||||
.program-teaser .hentry {
|
||||
float:left;
|
||||
height:207px;
|
||||
margin:10px;
|
||||
padding:16px;
|
||||
position:relative;
|
||||
width:150px;
|
||||
}
|
||||
.program-teaser .hentry.program-1,
|
||||
.program-teaser .hentry.program-6 {
|
||||
margin-left:0;
|
||||
}
|
||||
.program-teaser .hentry.program-5,
|
||||
.program-teaser .hentry.program-10 {
|
||||
margin-right:0;
|
||||
}
|
||||
.program-teaser .entry-title {
|
||||
font-size:22px;
|
||||
}
|
||||
.program-teaser .hentry img {
|
||||
display:block;
|
||||
margin:auto;
|
||||
width:150px;
|
||||
height:150px;
|
||||
position:absolute;
|
||||
bottom:16px;
|
||||
}
|
||||
|
||||
#footer .credits {
|
||||
clear:both;
|
||||
float:right;
|
||||
margin-right:10px;
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
/* Footer slutt */
|
||||
|
||||
/**
|
||||
* Typography
|
||||
*/
|
||||
body, input, textarea {
|
||||
font: 14px Helvetica,Arial,sans-serif;
|
||||
line-height:1.5em;
|
||||
color:#333333;
|
||||
}
|
||||
th,#menu,.entry-meta,.sidebar {
|
||||
font-family:"Helvetica neue",Helvetica,Tahoma,Verdana,Arial,sans-serif;
|
||||
}
|
||||
.info ul {
|
||||
font-family:"Century Gothic","Avant Garde","Avant Garde Gothic",sans-serif;
|
||||
}
|
||||
|
||||
p, ul, ol, dd, pre {
|
||||
margin-bottom:1.5em;
|
||||
}
|
||||
pre, code {
|
||||
font:14px Monaco, monospace;
|
||||
line-height:1.3;
|
||||
}
|
||||
a,a:visited {
|
||||
text-decoration:none;
|
||||
color: #888;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
abbr {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: Helvetica,Arial,sans-serif;
|
||||
font-style:normal;
|
||||
color: black;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
h2,h3,h4,h5,h6 {
|
||||
font-family: Georgia, serif;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
h1,h2,h3,h4,h5,h6,
|
||||
.entry-title a {
|
||||
clear:none;
|
||||
/*color:#b8e2ed;*/
|
||||
color:#9dcbdb;
|
||||
margin-bottom:0.5em;
|
||||
text-decoration:none;
|
||||
line-height:1;
|
||||
}
|
||||
|
||||
.entry-title {
|
||||
font-size: 34px;
|
||||
}
|
||||
.entry-title a:hover {
|
||||
border-bottom: 1px solid #888;
|
||||
}
|
||||
h1 {
|
||||
font-size:34px;
|
||||
}
|
||||
h2 {
|
||||
font-size:25px;
|
||||
}
|
||||
h3 {
|
||||
font-size:23px;
|
||||
}
|
||||
h4 {
|
||||
font-size:20px;
|
||||
}
|
||||
h5 {
|
||||
font-size:18px;
|
||||
}
|
||||
h6 {
|
||||
font-size:16px;
|
||||
}
|
||||
.home h3 {
|
||||
font-size:28px;
|
||||
}
|
||||
.home .entry-title,
|
||||
.home .entry-title a {
|
||||
font-size:18px;
|
||||
color:#d83e00;
|
||||
}
|
||||
|
||||
.entry-meta {
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
#nyheter {
|
||||
font-size:15px;
|
||||
}
|
||||
|
||||
/*.sidebar h3 {
|
||||
margin-bottom:0.1em;
|
||||
font-size:14px;
|
||||
}*/
|
||||
.sidebar {
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
/* Lists */
|
||||
.entry-content ul,
|
||||
.entry-content ol {
|
||||
padding:0;
|
||||
}
|
||||
.entry-content ul ul,
|
||||
.entry-content ol ol,
|
||||
.entry-content ul ol,
|
||||
.entry-content ol ul {
|
||||
padding-left:20px;
|
||||
}
|
||||
.entry-content ul {
|
||||
list-style: circle inside;
|
||||
}
|
||||
.entry-content ul ul {
|
||||
list-style: disc inside;
|
||||
}
|
||||
.entry-content ul ul ul {
|
||||
list-style: square inside;
|
||||
}
|
||||
.entry-content ul ul ul ul {
|
||||
list-style: circle inside;
|
||||
}
|
||||
.entry-content ul ul ul ul ul {
|
||||
list-style: disc inside;
|
||||
}
|
||||
.entry-content ul ul ul ul ul ul {
|
||||
list-style: square inside;
|
||||
}
|
||||
.entry-content ol {
|
||||
list-style: decimal inside;
|
||||
}
|
||||
.entry-content ol ol {
|
||||
list-style: upper-roman inside;
|
||||
}
|
||||
.entry-content ol ol ol {
|
||||
list-style: lower-roman inside;
|
||||
}
|
||||
.entry-content ol ol ol ol {
|
||||
list-style: decimal inside;
|
||||
}
|
||||
.entry-content ol ol ol ol ol {
|
||||
list-style: upper-roman inside;
|
||||
}
|
||||
.entry-content ol ol ol ol ol ol {
|
||||
list-style: lower-roman inside;
|
||||
}
|
||||
|
||||
/* Quotes */
|
||||
.entry-content blockquote {
|
||||
margin: 1em 2em;
|
||||
font-style:italic;
|
||||
background:#eeeeee;
|
||||
margin:1em 2em;
|
||||
padding:1px 19px;
|
||||
}
|
||||
.entry-content blockquote blockquote {
|
||||
border:1px solid #000000;
|
||||
}
|
||||
.entry-content cite {
|
||||
font-style:italic;
|
||||
}
|
||||
|
||||
/* Images */
|
||||
img {
|
||||
max-width:100%;
|
||||
}
|
||||
.entry-content img {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
.entry-content img.alignright {
|
||||
margin: 0 0 10px 10px;
|
||||
}
|
||||
.entry-content img.alignleft {
|
||||
margin: 0 10px 10px 0;
|
||||
}
|
||||
|
||||
/******************************
|
||||
* Styles for inividual pages *
|
||||
*****************************/
|
||||
h2.jobb {
|
||||
background:#eeeeee;
|
||||
margin-top:0.5em;
|
||||
padding:10px 10px 5px;
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
|
||||
class MemberCard {
|
||||
protected static $PDO;
|
||||
const DATETIME_FORMAT = "Y-m-d H:i:s";
|
||||
|
||||
private $id;
|
||||
private $userId;
|
||||
private $ordered;
|
||||
private $produced;
|
||||
private $delivered;
|
||||
private $active;
|
||||
|
||||
private $new;
|
||||
private $updated;
|
||||
private $delete;
|
||||
|
||||
function __construct() {
|
||||
// connect to DB
|
||||
if (!isset(self::$PDO)) {
|
||||
$dsn = getDSN("PDO");
|
||||
if (is_null($dsn)) {
|
||||
throw new Exception("No DSN");
|
||||
}
|
||||
try {
|
||||
self::$PDO = new PDO($dsn["dsn"], $dsn["username"], $dsn["password"]);
|
||||
self::$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (Exception $e) {
|
||||
throw new Exception("Database connection error: ". getDSN());
|
||||
}
|
||||
}
|
||||
|
||||
$this->selectStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM din_membercard WHERE id=?");
|
||||
$this->findByUserIdStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM din_membercard WHERE userId=?");
|
||||
$this->insertStmt = self::$PDO->prepare(
|
||||
"INSERT INTO din_membercard (userId, ordered, produced, delivered, active) VALUES (?, ?, ?, ?, ?)");
|
||||
$this->updateStmt = self::$PDO->prepare(
|
||||
"UPDATE din_membercard SET
|
||||
userId=?,
|
||||
ordered=?,
|
||||
produced=?,
|
||||
delivered=?,
|
||||
active=?
|
||||
WHERE id=?");
|
||||
$this->deleteStmt = self::$PDO->prepare(
|
||||
"DELETE FROM din_membercard WHERE id=?");
|
||||
|
||||
$this->active = 0;
|
||||
|
||||
$this->new = true;
|
||||
$this->updated = false;
|
||||
$this->delete = false;
|
||||
}
|
||||
|
||||
function findByUserId($userId) {
|
||||
$this->findByUserIdStmt->execute(array($userId));
|
||||
|
||||
$array = $this->findByUserIdStmt->fetch();
|
||||
$this->findByUserIdStmt->closeCursor();
|
||||
if (!is_array($array)) {
|
||||
return false;
|
||||
}
|
||||
if (!isset($array['id'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->setId($array['id']);
|
||||
$this->setUserId($array['userId']);
|
||||
if (!is_null($array['ordered'])) {
|
||||
$this->setOrdered(new DateTime($array['ordered']));
|
||||
}
|
||||
if (!is_null($array['produced'])) {
|
||||
$this->setProduced(new DateTime($array['produced']));
|
||||
}
|
||||
if (!is_null($array['delivered'])) {
|
||||
$this->setDelivered(new DateTime($array['delivered']));
|
||||
}
|
||||
$this->setActive($array['active']);
|
||||
|
||||
$this->updated = false;
|
||||
$this->new = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private function doInsert() {
|
||||
$this->insertStmt->bindValue(1, $this->getUserId());
|
||||
|
||||
if (!is_null($this->getOrdered())) {
|
||||
$this->insertStmt->bindValue(2, $this->getOrdered()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->insertStmt->bindValue(2, null);
|
||||
}
|
||||
|
||||
if (!is_null($this->getProduced())) {
|
||||
$this->insertStmt->bindValue(3, $this->getProduced()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->insertStmt->bindValue(3, null);
|
||||
}
|
||||
|
||||
if (!is_null($this->getDelivered())) {
|
||||
$this->insertStmt->bindValue(4, $this->getDelivered()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->insertStmt->bindValue(4, null);
|
||||
}
|
||||
|
||||
$this->insertStmt->bindValue(5, $this->getActive());
|
||||
|
||||
$this->insertStmt->execute();
|
||||
$id = self::$PDO->lastInsertId();
|
||||
$this->setId($id);
|
||||
|
||||
$this->updated = false;
|
||||
$this->new = false;
|
||||
}
|
||||
|
||||
private function doUpdate() {
|
||||
$this->updateStmt->bindValue(1, $this->getUserId());
|
||||
|
||||
if (!is_null($this->getOrdered())) {
|
||||
$this->updateStmt->bindValue(2, $this->getOrdered()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->updateStmt->bindValue(2, null);
|
||||
}
|
||||
|
||||
if (!is_null($this->getProduced())) {
|
||||
$this->updateStmt->bindValue(3, $this->getProduced()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->updateStmt->bindValue(3, null);
|
||||
}
|
||||
|
||||
if (!is_null($this->getDelivered())) {
|
||||
$this->updateStmt->bindValue(4, $this->getDelivered()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->updateStmt->bindValue(4, null);
|
||||
}
|
||||
|
||||
$this->updateStmt->bindValue(5, $this->getActive());
|
||||
|
||||
$this->updateStmt->bindValue(6, $this->getId());
|
||||
|
||||
$this->updateStmt->execute();
|
||||
|
||||
$this->updated = false;
|
||||
$this->new = false;
|
||||
}
|
||||
|
||||
private function doDelete() {
|
||||
$values = array($this->getId());
|
||||
$this->deleteStmt->execute($values);
|
||||
}
|
||||
|
||||
function store() {
|
||||
if ($this->delete) {
|
||||
$this->doDelete();
|
||||
} elseif ($this->new && $this->updated) {
|
||||
$this->doInsert();
|
||||
} elseif ($this->updated) {
|
||||
$this->doUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
function setId($id) {
|
||||
$this->id = $id;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getUserId() {
|
||||
return $this->userId;
|
||||
}
|
||||
|
||||
function setUserId($userId) {
|
||||
$this->userId = $userId;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getOrdered() {
|
||||
return $this->ordered;
|
||||
}
|
||||
|
||||
function setOrdered(DateTime $ordered) {
|
||||
$this->ordered = $ordered;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getProduced() {
|
||||
return $this->produced;
|
||||
}
|
||||
|
||||
function setProduced(DateTime $produced) {
|
||||
$this->produced = $produced;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getDelivered() {
|
||||
return $this->delivered;
|
||||
}
|
||||
|
||||
function setDelivered(DateTime $delivered) {
|
||||
$this->delivered = $delivered;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getActive() {
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
function setActive($active) {
|
||||
$this->active = $active;
|
||||
$this->updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
class MembershipActivationCode {
|
||||
protected static $PDO;
|
||||
const DATETIME_FORMAT = "Y-m-d H:i:s";
|
||||
|
||||
private $id;
|
||||
private $userId;
|
||||
private $code;
|
||||
private $ordered;
|
||||
private $used;
|
||||
|
||||
private $new;
|
||||
private $updated;
|
||||
private $delete;
|
||||
|
||||
function __construct() {
|
||||
// connect to DB
|
||||
if (!isset(self::$PDO)) {
|
||||
$dsn = getDSN("PDO");
|
||||
if (is_null($dsn)) {
|
||||
throw new Exception("No DSN");
|
||||
}
|
||||
try {
|
||||
self::$PDO = new PDO($dsn["dsn"], $dsn["username"], $dsn["password"]);
|
||||
self::$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (Exception $e) {
|
||||
throw new Exception("Database connection error: ". getDSN());
|
||||
}
|
||||
}
|
||||
|
||||
$this->selectStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM din_membership_activationcode WHERE id=?");
|
||||
$this->insertStmt = self::$PDO->prepare(
|
||||
"INSERT INTO din_membership_activationcode (userId, ordered, used) VALUES (?, ?, ?)");
|
||||
$this->updateStmt = self::$PDO->prepare(
|
||||
"UPDATE din_membership_activationcode SET
|
||||
userId=?,
|
||||
ordered=?,
|
||||
used=?
|
||||
WHERE id=?");
|
||||
$this->deleteStmt = self::$PDO->prepare(
|
||||
"DELETE FROM din_membership_activationcode WHERE id=?");
|
||||
|
||||
$this->new = true;
|
||||
$this->updated = false;
|
||||
$this->delete = false;
|
||||
}
|
||||
|
||||
function findById($id) {
|
||||
$this->selectStmt->execute(array($id));
|
||||
|
||||
$array = $this->findByIdStmt->fetch();
|
||||
$this->findByIdStmt->closeCursor();
|
||||
if (!is_array($array)) {
|
||||
return false;
|
||||
}
|
||||
if (!isset($array['id'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->setId($array['id']);
|
||||
$this->setUserId($array['userId']);
|
||||
if (!is_null($array['ordered'])) {
|
||||
$this->setOrdered(new DateTime($array['ordered']));
|
||||
}
|
||||
if (!is_null($array['used'])) {
|
||||
$this->setUsed(new DateTime($array['used']));
|
||||
}
|
||||
|
||||
// generate code from id
|
||||
$this->setCode(substr(crypt(trim($this->getId()), 1813), 2, 6));
|
||||
|
||||
$this->updated = false;
|
||||
$this->new = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private function doInsert() {
|
||||
$this->insertStmt->bindValue(1, $this->getUserId());
|
||||
|
||||
if (!is_null($this->getOrdered())) {
|
||||
$this->insertStmt->bindValue(2, $this->getOrdered()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->insertStmt->bindValue(2, null);
|
||||
}
|
||||
|
||||
if (!is_null($this->getUsed())) {
|
||||
$this->insertStmt->bindValue(3, $this->getUsed()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->insertStmt->bindValue(3, null);
|
||||
}
|
||||
|
||||
$this->insertStmt->execute();
|
||||
$id = self::$PDO->lastInsertId();
|
||||
$this->setId($id);
|
||||
|
||||
$this->updated = false;
|
||||
$this->new = false;
|
||||
}
|
||||
|
||||
private function doUpdate() {
|
||||
$this->updateStmt->bindValue(1, $this->getUserId());
|
||||
|
||||
if (!is_null($this->getOrdered())) {
|
||||
$this->updateStmt->bindValue(2, $this->getOrdered()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->updateStmt->bindValue(2, null);
|
||||
}
|
||||
|
||||
if (!is_null($this->getUsed())) {
|
||||
$this->updateStmt->bindValue(3, $this->getUsed()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->updateStmt->bindValue(3, null);
|
||||
}
|
||||
|
||||
$this->updateStmt->bindValue(6, $this->getId());
|
||||
|
||||
$this->updateStmt->execute();
|
||||
|
||||
$this->updated = false;
|
||||
$this->new = false;
|
||||
}
|
||||
|
||||
private function doDelete() {
|
||||
$values = array($this->getId());
|
||||
$this->deleteStmt->execute($values);
|
||||
}
|
||||
|
||||
function store() {
|
||||
if ($this->delete) {
|
||||
$this->doDelete();
|
||||
} elseif ($this->new && $this->updated) {
|
||||
$this->doInsert();
|
||||
} elseif ($this->updated) {
|
||||
$this->doUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
function setId($id) {
|
||||
$this->id = $id;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getUserId() {
|
||||
return $this->userId;
|
||||
}
|
||||
|
||||
function setUserId($userId) {
|
||||
$this->userId = $userId;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
function setCode($code) {
|
||||
$this->code = $code;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getOrdered() {
|
||||
return $this->ordered;
|
||||
}
|
||||
|
||||
function setOrdered(DateTime $ordered) {
|
||||
$this->ordered = $ordered;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getUsed() {
|
||||
return $this->used;
|
||||
}
|
||||
|
||||
function setUsed(DateTime $used) {
|
||||
$this->used = $used;
|
||||
$this->updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
|
||||
class MembershipCard {
|
||||
protected static $PDO;
|
||||
const DATETIME_FORMAT = "Y-m-d H:i:s";
|
||||
|
||||
private $id;
|
||||
private $userId;
|
||||
private $ordered;
|
||||
private $produced;
|
||||
private $delivered;
|
||||
private $active;
|
||||
|
||||
private $new;
|
||||
private $updated;
|
||||
private $delete;
|
||||
|
||||
function __construct() {
|
||||
// connect to DB
|
||||
if (!isset(self::$PDO)) {
|
||||
$dsn = getDSN("PDO");
|
||||
if (is_null($dsn)) {
|
||||
throw new Exception("No DSN");
|
||||
}
|
||||
try {
|
||||
self::$PDO = new PDO($dsn["dsn"], $dsn["username"], $dsn["password"]);
|
||||
self::$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (Exception $e) {
|
||||
throw new Exception("Database connection error: ". getDSN());
|
||||
}
|
||||
}
|
||||
|
||||
$this->selectStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM din_membershipcard WHERE id=?");
|
||||
$this->findByUserIdStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM din_membershipcard WHERE userId=?");
|
||||
$this->insertStmt = self::$PDO->prepare(
|
||||
"INSERT INTO din_membershipcard (userId, ordered, produced, delivered, active) VALUES (?, ?, ?, ?, ?)");
|
||||
$this->updateStmt = self::$PDO->prepare(
|
||||
"UPDATE din_membershipcard SET
|
||||
userId=?,
|
||||
ordered=?,
|
||||
produced=?,
|
||||
delivered=?,
|
||||
active=?
|
||||
WHERE id=?");
|
||||
$this->deleteStmt = self::$PDO->prepare(
|
||||
"DELETE FROM din_membershipcard WHERE id=?");
|
||||
|
||||
$this->active = 0;
|
||||
|
||||
$this->new = true;
|
||||
$this->updated = false;
|
||||
$this->delete = false;
|
||||
}
|
||||
|
||||
function findByUserId($userId) {
|
||||
$this->findByUserIdStmt->execute(array($userId));
|
||||
|
||||
$array = $this->findByUserIdStmt->fetch();
|
||||
$this->findByUserIdStmt->closeCursor();
|
||||
if (!is_array($array)) {
|
||||
return false;
|
||||
}
|
||||
if (!isset($array['id'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->setId($array['id']);
|
||||
$this->setUserId($array['userId']);
|
||||
if (!is_null($array['ordered'])) {
|
||||
$this->setOrdered(new DateTime($array['ordered']));
|
||||
}
|
||||
if (!is_null($array['produced'])) {
|
||||
$this->setProduced(new DateTime($array['produced']));
|
||||
}
|
||||
if (!is_null($array['delivered'])) {
|
||||
$this->setDelivered(new DateTime($array['delivered']));
|
||||
}
|
||||
$this->setActive($array['active']);
|
||||
|
||||
$this->updated = false;
|
||||
$this->new = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private function doInsert() {
|
||||
$this->insertStmt->bindValue(1, $this->getUserId());
|
||||
|
||||
if (!is_null($this->getOrdered())) {
|
||||
$this->insertStmt->bindValue(2, $this->getOrdered()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->insertStmt->bindValue(2, null);
|
||||
}
|
||||
|
||||
if (!is_null($this->getProduced())) {
|
||||
$this->insertStmt->bindValue(3, $this->getProduced()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->insertStmt->bindValue(3, null);
|
||||
}
|
||||
|
||||
if (!is_null($this->getDelivered())) {
|
||||
$this->insertStmt->bindValue(4, $this->getDelivered()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->insertStmt->bindValue(4, null);
|
||||
}
|
||||
|
||||
$this->insertStmt->bindValue(5, $this->getActive());
|
||||
|
||||
$this->insertStmt->execute();
|
||||
$id = self::$PDO->lastInsertId();
|
||||
$this->setId($id);
|
||||
|
||||
$this->updated = false;
|
||||
$this->new = false;
|
||||
}
|
||||
|
||||
private function doUpdate() {
|
||||
$this->updateStmt->bindValue(1, $this->getUserId());
|
||||
|
||||
if (!is_null($this->getOrdered())) {
|
||||
$this->updateStmt->bindValue(2, $this->getOrdered()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->updateStmt->bindValue(2, null);
|
||||
}
|
||||
|
||||
if (!is_null($this->getProduced())) {
|
||||
$this->updateStmt->bindValue(3, $this->getProduced()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->updateStmt->bindValue(3, null);
|
||||
}
|
||||
|
||||
if (!is_null($this->getDelivered())) {
|
||||
$this->updateStmt->bindValue(4, $this->getDelivered()->format(self::DATETIME_FORMAT));
|
||||
} else {
|
||||
$this->updateStmt->bindValue(4, null);
|
||||
}
|
||||
|
||||
$this->updateStmt->bindValue(5, $this->getActive());
|
||||
|
||||
$this->updateStmt->bindValue(6, $this->getId());
|
||||
|
||||
$this->updateStmt->execute();
|
||||
|
||||
$this->updated = false;
|
||||
$this->new = false;
|
||||
}
|
||||
|
||||
private function doDelete() {
|
||||
$values = array($this->getId());
|
||||
$this->deleteStmt->execute($values);
|
||||
}
|
||||
|
||||
function store() {
|
||||
if ($this->delete) {
|
||||
$this->doDelete();
|
||||
} elseif ($this->new && $this->updated) {
|
||||
$this->doInsert();
|
||||
} elseif ($this->updated) {
|
||||
$this->doUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
function setId($id) {
|
||||
$this->id = $id;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getUserId() {
|
||||
return $this->userId;
|
||||
}
|
||||
|
||||
function setUserId($userId) {
|
||||
$this->userId = $userId;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getOrdered() {
|
||||
return $this->ordered;
|
||||
}
|
||||
|
||||
function setOrdered(DateTime $ordered) {
|
||||
$this->ordered = $ordered;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getProduced() {
|
||||
return $this->produced;
|
||||
}
|
||||
|
||||
function setProduced(DateTime $produced) {
|
||||
$this->produced = $produced;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getDelivered() {
|
||||
return $this->delivered;
|
||||
}
|
||||
|
||||
function setDelivered(DateTime $delivered) {
|
||||
$this->delivered = $delivered;
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
function getActive() {
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
function setActive($active) {
|
||||
$this->active = $active;
|
||||
$this->updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
+9
-21
@@ -532,22 +532,6 @@ possibly include it instead? --Thomas Misund, 26. Oct 2009
|
||||
</div> <!-- #content-wrap -->
|
||||
|
||||
<?php
|
||||
// Print Google Analytics tracking code
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-52914-1']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
|
||||
</script>
|
||||
<?php
|
||||
|
||||
$time_end = microtime(true);
|
||||
$time = round(($time_end - $GLOBALS['time_start']), 4);
|
||||
@@ -3227,9 +3211,6 @@ Teksten under er hentet fra kunnskapsdatabasen. Du st
|
||||
while ($row =& $users->users->fetchRow(DB_FETCHMODE_OBJECT)){
|
||||
$user = new User($row->id);
|
||||
print "<tr>";
|
||||
print "<form action=\"" . $action . "\" method=\"post\">";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"membership-sale\" />";
|
||||
print "<input type=\"hidden\" name=\"userid\" value=\"" . $user->getId() . "\" />";
|
||||
print "<td class=\"number\" id=\"user_" . $user->getId() . "_cardno\">". $user->cardno . "</td>\n";
|
||||
print "<td><a href=\"index.php?page=display-user&userid=" . $user->id . "\">" . $user->getName() . "</a></td>";
|
||||
print "<td class=\"is_member\">";
|
||||
@@ -3250,6 +3231,9 @@ Teksten under er hentet fra kunnskapsdatabasen. Du st
|
||||
print "<td class=\"is_member\">" . $user->getLastSticker() . "</td>";
|
||||
|
||||
print "<td>";
|
||||
print "<form action=\"" . $action . "\" method=\"post\">";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"membership-sale\" />";
|
||||
print "<input type=\"hidden\" name=\"userid\" value=\"" . $user->getId() . "\" />";
|
||||
if ($user->hasExpired()) {
|
||||
if (!$user->getCardProduced()) {
|
||||
print "forny (produser kort)";
|
||||
@@ -3280,16 +3264,20 @@ Teksten under er hentet fra kunnskapsdatabasen. Du st
|
||||
print "-";
|
||||
}
|
||||
}
|
||||
print "</form>";
|
||||
print "</td>";
|
||||
|
||||
print "<td>";
|
||||
print "<form action=\"" . $action . "\" method=\"post\">";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"membership-sale\" />";
|
||||
print "<input type=\"hidden\" name=\"userid\" value=\"" . $user->getId() . "\" />";
|
||||
if ($user->getCardDelivered()) {
|
||||
print "<input type=\"hidden\" name=\"subaction\" value=\"order-new-card\" />";
|
||||
print "<input type=\"hidden\" name=\"subaction2\" value=\"order-new-card\" />";
|
||||
print "<input type=\"submit\" name=\"order-new-card\" value=\"bestille nytt kort\" />";
|
||||
}
|
||||
print "</form>";
|
||||
print "</td>";
|
||||
|
||||
print "</form>";
|
||||
print "</tr>";
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
+3
-2
@@ -73,6 +73,7 @@ class Payment {
|
||||
$description, $returnURL) ) {
|
||||
$orderRef = $this->payex->getOrderRef(); // get the orderRef
|
||||
$this->payex->redirect($orderRef); // redirect the user
|
||||
mysql_query("INSERT INTO `din_transaction_check`(`order_id`,`inserted`,`order_ref`) VALUES('$orderID', NOW(), '$orderRef')");
|
||||
} else {
|
||||
echo 'Initialize() failed.<br>';
|
||||
echo 'Code: '.$this->payex->getcode().' ';
|
||||
@@ -83,7 +84,7 @@ class Payment {
|
||||
|
||||
public function completeTransaction($orderRef, $transaction_id) {
|
||||
if ( $this->payex->Complete($orderRef) ) {
|
||||
|
||||
#file_put_contents('tmp', var_export("\n\n" . time() . "\n\n" . $this->payex->Check($orderRef) . "\n\nTransaction:" . $this->payex->getTransactionStatus() ."\n",true) . "\n\n", FILE_APPEND);
|
||||
/*
|
||||
Transaction statuses (defined in payex_defines.php):
|
||||
0=Sale, 1=Initialize, 2=Credit, 3=Authorize, 4=Cancel, 5=Failure, 6=Capture
|
||||
@@ -95,7 +96,6 @@ class Payment {
|
||||
notify("Betalingen er ikke riktig gjennomført. Vennligst ta kontakt med support om du tror dette skyldes en feil.");
|
||||
return false;
|
||||
}
|
||||
|
||||
$transaction = new Transaction($transaction_id);
|
||||
$transaction->setStatus("OK");
|
||||
notify("Betalingen er gjennomført. En kvittering er blitt sendt til din registrerte epostadresse.");
|
||||
@@ -104,6 +104,7 @@ class Payment {
|
||||
$this->user_email = $user->email;
|
||||
}
|
||||
$this->_sendConfirmationMail($transaction_id);
|
||||
mysql_query("UPDATE `din_transaction_check` SET `order_ref2` = '$orderRef' WHERE `order_id`='{$transaction->id}' LIMIT 1");
|
||||
return true;
|
||||
}else {
|
||||
notify("Betalingen er ikke riktig gjennomført. Vennligst ta kontakt med support om du tror dette skyldes en feil.");
|
||||
|
||||
+21
-17
@@ -535,31 +535,35 @@ class User {
|
||||
}
|
||||
|
||||
public function registerMembership($cardno) {
|
||||
if ($this->cardno != NULL) {
|
||||
notify("Du har prøvd å registrere nytt medlemskort, selv om du allerede har et registrert medlemskort. Vennligst kontakt administrator om du tror dette er en feil.");
|
||||
return false;
|
||||
}
|
||||
$sql = "SELECT id " . "FROM din_user " . "WHERE cardno = $cardno";
|
||||
// check that the activation code is valid
|
||||
$sql = "SELECT id FROM din_user WHERE cardno=$cardno";
|
||||
$result = $this->conn->query($sql);
|
||||
if (DB :: isError($result) != true) {
|
||||
if ($result->numRows() > 0) {
|
||||
notify("Kortnummeret er allerede i bruk. Vennligst kontrollér nummeret.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
error($result->toString());
|
||||
notify("En ukjent feil oppstod. Vennligst kontakt administrator.");
|
||||
}
|
||||
|
||||
$expires = $this->getExpiryDate();
|
||||
// register cardno as used
|
||||
$sql = "INSERT INTO din_usedcardno VALUES ($this->cardno, NOW())";
|
||||
$result = $this->conn->query($sql);
|
||||
|
||||
$sql = "UPDATE din_user SET " . " cardno = $cardno, " . " expires = '$expires' " . "WHERE " . " id = $this->id";
|
||||
$result = $this->conn->query($sql);
|
||||
if (DB :: isError($result) != true) {
|
||||
$this->_registerUpdate("Medlemskap registrert.");
|
||||
$sql = "INSERT INTO din_usedcardno VALUES ( " . " $cardno, NOW())";
|
||||
$result = $this->conn->query($sql);
|
||||
return true;
|
||||
} else {
|
||||
error($result->toString());
|
||||
notify("En ukjent feil oppstod. Vennligst kontakt administrator.");
|
||||
}
|
||||
if ($this->cardno == null) {
|
||||
// user doesn't have a previous card number, set his cardno to current cardno
|
||||
$this->cardno = $cardno;
|
||||
}
|
||||
|
||||
$expires = $this->getExpiryDate();
|
||||
|
||||
$sql = "UPDATE din_user SET cardno=" . $this->cardno . ", expires = '$expires' WHERE id=" . $this->id;
|
||||
$result = $this->conn->query($sql);
|
||||
if (DB::isError($result) != true) {
|
||||
$this->_registerUpdate("Medlemskap registrert.");
|
||||
return true;
|
||||
} else {
|
||||
error($result->toString());
|
||||
notify("En ukjent feil oppstod. Vennligst kontakt administrator.");
|
||||
|
||||
+3
-3
@@ -7,10 +7,10 @@ print('<?xml version="1.0" encoding="ISO-8859-1"?'.'>');
|
||||
|
||||
$conn = db_connect();
|
||||
|
||||
$action = mysql_real_escape_string($_REQUEST['action']);
|
||||
$action = $_REQUEST['action'];
|
||||
if ($action == 'checkZip'){
|
||||
|
||||
$zip = mysql_real_escape_string($_REQUEST['zip']);
|
||||
$zip = $_REQUEST['zip'];
|
||||
if ($zip != "") {
|
||||
$sql = "SELECT poststed AS postarea
|
||||
FROM din_postnummer
|
||||
@@ -72,7 +72,7 @@ if ($action == 'checkZip'){
|
||||
printRemoveCatXML($type);
|
||||
|
||||
}else if ($action == 'checkUsername') {
|
||||
$username = mysql_real_escape_string($_REQUEST['username']);
|
||||
$username = $_REQUEST['username'];
|
||||
$conn = db_connect("forum");
|
||||
$sql = sprintf("SELECT user_id FROM phpbb_users u "."WHERE username_clean = '%s' ", strtolower($username));
|
||||
$result = & $conn->query($sql);
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ header("Content-type: application/xml");
|
||||
|
||||
$conn = db_connect();
|
||||
|
||||
$zip = mysql_real_escape_string($_REQUEST['zip']);
|
||||
$zip = $_REQUEST['zip'];
|
||||
|
||||
$sql = "SELECT poststed AS postarea
|
||||
FROM din_postnummer
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
// Retrieve the data source name for connecting to the MySQL server and
|
||||
// selecting the sampdb database using our top-secret name and password
|
||||
|
||||
// To use the original MySQL module, $driver should be "mysql".
|
||||
// To use the "MySQL improved" module, $driver should be "mysqli".
|
||||
// This function is bloated to be able to use the same version on different servers.
|
||||
function getDSN($host = "default") {
|
||||
if ($host == "default" || $host == "dns" || $host == "PDO") {
|
||||
$host_name = "localhost";
|
||||
$driver = "mysql";
|
||||
$user_name = "glium337_dbuser";
|
||||
$password = "sdfXhu4Shgfd";
|
||||
$db_name = "glium337_dns";
|
||||
|
||||
if ($host == "PDO") {
|
||||
// return PDO compatible DSN
|
||||
return array(
|
||||
"dsn" => $driver .":dbname=".$db_name.";host=".$host_name,
|
||||
"username" => $user_name,
|
||||
"password" => $password
|
||||
);
|
||||
}
|
||||
} elseif ($host == "forum") {
|
||||
/*$host_name = "localhost";
|
||||
$driver = "mysql";
|
||||
$user_name = "forum2";
|
||||
$password = "e9bAlSu1oI";
|
||||
$db_name = "phpbb1";*/
|
||||
$host_name = "localhost";
|
||||
$driver = "mysql";
|
||||
$user_name = "glium337_phpbb";
|
||||
$password = "n0ffn0ff";
|
||||
$db_name = "glium337_phpbb";
|
||||
}
|
||||
|
||||
return "$driver://$user_name:$password@$host_name/$db_name";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Domain Object parent class
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
|
||||
abstract class domain_DomainObject {
|
||||
private $id = -1;
|
||||
|
||||
function __construct($id = null) {
|
||||
if (is_null($id)) {
|
||||
$this->markNew();
|
||||
} else {
|
||||
$this->id = $id;
|
||||
}
|
||||
}
|
||||
|
||||
// Unit of Work pattern - not implemented yet
|
||||
function markNew() {
|
||||
domain_ObjectWatcher::addNew($this);
|
||||
}
|
||||
|
||||
function markDeleted() {
|
||||
domain_ObjectWatcher::addDelete($this);
|
||||
}
|
||||
|
||||
function markDirty() {
|
||||
domain_ObjectWatcher::addDirty($this);
|
||||
}
|
||||
|
||||
function markClean() {
|
||||
domain_ObjectWatcher::addClean($this);
|
||||
}
|
||||
|
||||
function setId($id) {
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
function collection() {
|
||||
return self::getCollection(get_class($this));
|
||||
}
|
||||
|
||||
static function getCollection($type) {
|
||||
return domain_HelperFactory::getCollection($type);
|
||||
}
|
||||
|
||||
function finder() {
|
||||
return self::getFinder(get_class($this));
|
||||
}
|
||||
|
||||
static function getFinder($type) {
|
||||
return domain_HelperFactory::getFinder($type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Helper factory for fetching collections from the database mapper
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class domain_HelperFactory {
|
||||
const MEMBERSHIP = "domain_Membership";
|
||||
const MEMBERSHIPCARD = "domain_MembershipCard";
|
||||
const USER = "domain_User";
|
||||
const USERADDRESS = "domain_UserAddress";
|
||||
const USERUPDATE = "domain_UserUpdate";
|
||||
|
||||
function getCollection($type) {
|
||||
switch ($type) {
|
||||
case (self::MEMBERSHIP):
|
||||
return new mapper_MembershipCollection();
|
||||
case (self::MEMBERSHIPCARD):
|
||||
return new mapper_MembershipCardCollection();
|
||||
case (self::USER):
|
||||
return new mapper_UserCollection();
|
||||
case (self::USERADDRESS):
|
||||
return new mapper_UserAddressCollection();
|
||||
case (self::USERUPDATE):
|
||||
return new mapper_UserUpdateCollection();
|
||||
default:
|
||||
throw new Exception("Unknown collection type $type");
|
||||
}
|
||||
}
|
||||
|
||||
function getFinder($type) {
|
||||
switch ($type) {
|
||||
case (self::MEMBERSHIP):
|
||||
return new mapper_MembershipMapper();
|
||||
case (self::MEMBERSHIPCARD):
|
||||
return new mapper_MembershipCardMapper();
|
||||
case (self::USER):
|
||||
return new mapper_UserMapper();
|
||||
case (self::USERADDRESS):
|
||||
return new mapper_UserAddressMapper();
|
||||
case (self::USERUPDATE):
|
||||
return new mapper_UserUpdateMapper();
|
||||
default:
|
||||
throw new Exception("Unknown finder type $type");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Domain Membership model class
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
|
||||
class domain_Membership extends domain_DomainObject {
|
||||
private $user;
|
||||
private $card;
|
||||
private $created;
|
||||
private $starts;
|
||||
private $expires;
|
||||
|
||||
function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
}
|
||||
|
||||
function setUser(domain_User $user) {
|
||||
$this->user = $user;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getUser() {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
function setCard(domain_MembershipCard $card) {
|
||||
$this->card = $card;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getCard() {
|
||||
return $this->card;
|
||||
}
|
||||
|
||||
function setCreated(DateTime $created) {
|
||||
$this->created = $created;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getCreated() {
|
||||
return $this->created;
|
||||
}
|
||||
|
||||
function setStarts(DateTime $starts) {
|
||||
$this->starts = $starts;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getStarts() {
|
||||
return $this->starts;
|
||||
}
|
||||
|
||||
function setExpires($expires) {
|
||||
$this->expires = $expires;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getExpires() {
|
||||
return $this->expires;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Domain MembershipCard model class
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
|
||||
class domain_MembershipCard extends domain_DomainObject {
|
||||
private $user;
|
||||
private $created;
|
||||
private $produced;
|
||||
private $lastSticker;
|
||||
private $stickers;
|
||||
private $memberships;
|
||||
|
||||
function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
}
|
||||
|
||||
function setUser(domain_User $user) {
|
||||
$this->user = $user;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getUser() {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
function setCreated(DateTime $created) {
|
||||
$this->created = $created;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getCreated() {
|
||||
return $this->created;
|
||||
}
|
||||
|
||||
function setProduced(DateTime $produced) {
|
||||
$this->produced = $produced;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getProduced() {
|
||||
return $this->produced;
|
||||
}
|
||||
|
||||
function setLastSticker($laststicker) {
|
||||
$this->lastSticker = $laststicker;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getLastSticker() {
|
||||
return $this->lastSticker;
|
||||
}
|
||||
|
||||
function getStickers() {
|
||||
// if (is_null($this->stickers)) {
|
||||
// $this->stickers = self::getFinder("domain_MembershipCardSticker")->findByCardId($this->getId());
|
||||
// }
|
||||
// return $this->stickers;
|
||||
return null;
|
||||
}
|
||||
|
||||
function getMemberships() {
|
||||
if (is_null($this->memberships)) {
|
||||
$this->memberships = self::getFinder("domain_Membership")->findByCardId($this->getId());
|
||||
}
|
||||
return $this->memberships;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Identity map for ensuring that one object doesnt become two
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class domain_ObjectWatcher {
|
||||
private $all = array();
|
||||
private $dirty = array();
|
||||
private $new = array();
|
||||
private $delete = array(); // not implemented
|
||||
private static $instance;
|
||||
|
||||
private function __construct() { }
|
||||
|
||||
static function instance() {
|
||||
if (!isset(self::$instance)) {
|
||||
self::$instance = new domain_ObjectWatcher();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
function globalKey(domain_DomainObject $obj) {
|
||||
$key = get_class($obj) . "." . $obj->getId();
|
||||
return $key;
|
||||
}
|
||||
|
||||
static function add(domain_DomainObject $obj) {
|
||||
$inst = self::instance();
|
||||
$inst->all[$inst->globalKey($obj)] = $obj;
|
||||
}
|
||||
|
||||
static function exists($classname, $id) {
|
||||
$inst = self::instance();
|
||||
$key = "$classname.$id";
|
||||
if (isset($inst->all[$key])) {
|
||||
return $inst->all[$key];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static function addDirty(domain_DomainObject $obj) {
|
||||
$inst = self::instance();
|
||||
// verify that the updated object is an object allready in the database
|
||||
if (!in_array($obj, $inst->new, true)) {
|
||||
$inst->dirty[$inst->globalKey($obj)] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
static function addNew(domain_DomainObject $obj) {
|
||||
$inst = self::instance();
|
||||
// we don't yet have an id
|
||||
$inst->new[] = $obj;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark object as clean, changes will not be stored to database
|
||||
*/
|
||||
static function addClean(domain_DomainObject $obj) {
|
||||
$inst = self::instance();
|
||||
|
||||
unset($inst->dirty[$inst->globalKey($obj)]);
|
||||
|
||||
// check if the object is in the new array, and remove it from it
|
||||
if (in_array($obj, $inst->new, true)) {
|
||||
$pruned=array();
|
||||
foreach ($inst->new as $newobj) {
|
||||
if (!($newobj === $obj)) {
|
||||
$pruned[] = $newobj;
|
||||
}
|
||||
}
|
||||
$inst->new = $pruned;
|
||||
}
|
||||
}
|
||||
|
||||
static function addDelete(domain_DomainObject $obj) {
|
||||
$inst = self::instance();
|
||||
|
||||
unset($inst->dirty[$inst->globalKey($obj)]);
|
||||
|
||||
if (in_array($obj, $inst->new, true)) {
|
||||
$pruned=array();
|
||||
foreach ($inst->new as $newobj) {
|
||||
if (!($newobj === $obj)) {
|
||||
$pruned[] = $newobj;
|
||||
}
|
||||
}
|
||||
$inst->new = $pruned;
|
||||
}
|
||||
|
||||
$inst->delete[] = $obj;
|
||||
}
|
||||
|
||||
function performOperations() {
|
||||
foreach ($this->dirty as $key=>$obj) {
|
||||
$obj->finder()->update($obj);
|
||||
}
|
||||
foreach ($this->new as $key=>$obj) {
|
||||
$obj->finder()->insert($obj);
|
||||
}
|
||||
foreach ($this->delete as $key=>$obj) {
|
||||
//$obj->finder()->delete($obj);
|
||||
}
|
||||
$this->dirty = array();
|
||||
$this->new = array();
|
||||
$this->delete = array();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Domain User Model class
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
|
||||
class domain_User extends domain_DomainObject {
|
||||
private $username;
|
||||
private $firstname;
|
||||
private $lastname;
|
||||
private $password;
|
||||
private $validaddress;
|
||||
private $email;
|
||||
private $birthdate;
|
||||
private $placeOfStudy;
|
||||
private $passwordreset;
|
||||
private $divisionIdRequest;
|
||||
private $updates;
|
||||
private $memberships;
|
||||
private $address;
|
||||
private $cards;
|
||||
|
||||
|
||||
function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
}
|
||||
|
||||
function setUsername($username_s) {
|
||||
$this->username = $username_s;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getUsername() {
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
function setPassword($password_s) {
|
||||
$this->password = $password_s;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getPassword() {
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
function setFirstname($firstname_s) {
|
||||
$this->firstname = $firstname_s;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getFirstname() {
|
||||
return $this->firstname;
|
||||
}
|
||||
|
||||
function setLastname($lastname_s) {
|
||||
$this->lastname = $lastname_s;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getLastname() {
|
||||
return $this->lastname;
|
||||
}
|
||||
|
||||
function setValidaddress($validaddress_i) {
|
||||
$this->validaddress = $validaddress_i;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getValidaddress() {
|
||||
return $this->validaddress;
|
||||
}
|
||||
|
||||
function setEmail($email_s) {
|
||||
$this->email = $email_s;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getEmail() {
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
function setBirthdate($birthdate_d) {
|
||||
$this->birthdate = $birthdate_d;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getBirthdate() {
|
||||
return $this->birthdate;
|
||||
}
|
||||
|
||||
function setPlaceOfStudy($placeofstudy_i) {
|
||||
$this->placeOfStudy = $placeofstudy_i;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getPlaceOfStudy() {
|
||||
return $this->placeOfStudy;
|
||||
}
|
||||
|
||||
function setPasswordreset($passwordreset_i) {
|
||||
$this->passwordreset = $passwordreset_i;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getPasswordreset() {
|
||||
return $this->passwordreset;
|
||||
}
|
||||
|
||||
function setDivisionIdRequest($divisionidrequest_i) {
|
||||
$this->divisionIdRequest = $divisionidrequest_i;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getDivisionIdRequest() {
|
||||
return $this->divisionIdRequest;
|
||||
}
|
||||
|
||||
function getUpdates() {
|
||||
if (is_null($this->updates)) {
|
||||
$this->updates = self::getFinder("domain_UserUpdate")->findByUserId($this->getId());
|
||||
}
|
||||
return $this->updates;
|
||||
}
|
||||
|
||||
function getAddress() {
|
||||
if (is_null($this->address)) {
|
||||
$this->address = self::getFinder("domain_UserAddress")->findByUserId($this->getId());
|
||||
}
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
function getMemberships() {
|
||||
if (is_null($this->memberships)) {
|
||||
$this->memberships = self::getFinder("domain_Membership")->findByUserId($this->getId());
|
||||
}
|
||||
return $this->memberships;
|
||||
}
|
||||
|
||||
function getCards() {
|
||||
if (is_null($this->cards)) {
|
||||
$this->cards = self::getFinder("domain_MembershipCard")->findByUserId($this->getId());
|
||||
}
|
||||
return $this->cards;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Domain UserAddress model class
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
|
||||
class domain_UserAddress extends domain_DomainObject {
|
||||
private $user;
|
||||
private $phone;
|
||||
private $address;
|
||||
|
||||
function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
}
|
||||
|
||||
function setUser(domain_User $user) {
|
||||
$this->user = $user;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getUser() {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
function setAddress($address) {
|
||||
$this->phone = $address;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getAddress() {
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Domain UserPhone model class
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
|
||||
class domain_UserPhone extends domain_DomainObject {
|
||||
private $user;
|
||||
private $phone;
|
||||
|
||||
function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
}
|
||||
|
||||
function setUser(domain_User $user) {
|
||||
$this->user = $user;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getUser() {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
function setPhone($phone) {
|
||||
$this->phone = $phone;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getPhone() {
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Domain UserUpdate model class
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
|
||||
class domain_UserUpdate extends domain_DomainObject {
|
||||
private $date;
|
||||
private $message;
|
||||
private $user;
|
||||
private $updateBy;
|
||||
|
||||
function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
}
|
||||
|
||||
function setDate($date_d) {
|
||||
$this->date = $date_d;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getDate() {
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
function setMessage($message_s) {
|
||||
$this->message = $message_s;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getMessage() {
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
function setUser($user) {
|
||||
$this->user = $user;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getUser() {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
function setUpdatedBy($updatedBy) {
|
||||
$this->updatedBy = $updatedBy;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
function getUpdatedBy() {
|
||||
return $this->updatedBy;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Collection object for handling multiple rows and creating objects from database results
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
abstract class mapper_Collection implements Iterator {
|
||||
protected $mapper;
|
||||
protected $total = 0;
|
||||
protected $raw = array();
|
||||
|
||||
private $result;
|
||||
private $pointer;
|
||||
private $objects = array();
|
||||
|
||||
function __construct(array $raw = null, mapper_Mapper $mapper = null) {
|
||||
if (!is_null($raw) && !is_null($mapper)) {
|
||||
$this->rewind();
|
||||
$this->raw = $raw;
|
||||
$this->total = count($raw);
|
||||
}
|
||||
$this->mapper = $mapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an object to the collection
|
||||
**/
|
||||
function add(domain_DomainObject $object) {
|
||||
$class = $this->targetClass();
|
||||
if (!($object instanceof $class)) {
|
||||
throw new Exception("This is a {$class} collection");
|
||||
}
|
||||
$this->notifyAccess();
|
||||
$this->objects[$this->total] = $object;
|
||||
$this->total++;
|
||||
}
|
||||
|
||||
abstract function targetClass();
|
||||
|
||||
protected function notifyAccess() {
|
||||
// something is coming here..
|
||||
}
|
||||
|
||||
private function getRow($num) {
|
||||
$this->notifyAccess();
|
||||
if ($num >= $this->total || $num < 0) {
|
||||
return null;
|
||||
}
|
||||
if (isset($this->objects[$num])) {
|
||||
return $this->objects[$num];
|
||||
}
|
||||
if (isset($this->raw[$num])) {
|
||||
// object has not been created yet
|
||||
$this->objects[$num]=$this->mapper->createObject($this->raw[$num]);
|
||||
return $this->objects[$num];
|
||||
}
|
||||
}
|
||||
|
||||
public function rewind() {
|
||||
$this->pointer = 0;
|
||||
}
|
||||
|
||||
public function current() {
|
||||
return $this->getRow($this->pointer);
|
||||
}
|
||||
|
||||
public function key() {
|
||||
return $this->pointer;
|
||||
}
|
||||
|
||||
public function next() {
|
||||
$row = $this->getRow($this->pointer);
|
||||
if ($row) {
|
||||
$this->pointer++;
|
||||
}
|
||||
return $row;
|
||||
}
|
||||
|
||||
public function valid() {
|
||||
return (!is_null($this->current()));
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Abstract mapper class for database mapping from domain
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
abstract class mapper_Mapper {
|
||||
protected static $PDO;
|
||||
|
||||
function __construct() {
|
||||
if (!isset(self::$PDO)) {
|
||||
$dsn = getDSN("PDO");
|
||||
if (is_null($dsn)) {
|
||||
throw new Exception("No DSN");
|
||||
}
|
||||
try {
|
||||
self::$PDO = new PDO($dsn["dsn"], $dsn["username"], $dsn["password"]);
|
||||
self::$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (Exception $e) {
|
||||
throw new Exception("Database connection error: ". getDSN());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function find($id) {
|
||||
// check if object allready has been fetch from database
|
||||
$old = $this->getFromMap($id);
|
||||
if ($old) {
|
||||
return $old;
|
||||
}
|
||||
|
||||
// get object from database
|
||||
$this->selectStmt()->execute(array($id));
|
||||
$array = $this->selectStmt()->fetch();
|
||||
$this->selectStmt()->closeCursor();
|
||||
if (!is_array($array)) {
|
||||
return null;
|
||||
}
|
||||
if (!isset($array['id'])) {
|
||||
return null;
|
||||
}
|
||||
$object = $this->createObject($array);
|
||||
return $object;
|
||||
}
|
||||
|
||||
function findAll() {
|
||||
$this->selectAllStmt()->execute(array());
|
||||
return $this->getCollection( $this->selectAllStmt()->fetchAll( PDO::FETCH_ASSOC ) );
|
||||
}
|
||||
|
||||
function createObject($array) {
|
||||
$old = $this->getFromMap($array['id']);
|
||||
if ($old) { return $old; }
|
||||
|
||||
// construct object
|
||||
$obj = $this->doCreateObject($array);
|
||||
|
||||
// add object to object watcher map
|
||||
$this->addToMap($obj);
|
||||
$obj->markClean();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
function insert(domain_DomainObject $obj) {
|
||||
$this->doInsert($obj);
|
||||
$this->addToMap($obj);
|
||||
}
|
||||
|
||||
function delete(domain_DomainObject $obj) {
|
||||
$this->doDelete($obj);
|
||||
//$this->removeFromMap($obj);
|
||||
}
|
||||
|
||||
private function getFromMap($id) {
|
||||
return domain_ObjectWatcher::exists($this->targetClass(), $id);
|
||||
}
|
||||
|
||||
private function addToMap(domain_DomainObject $obj) {
|
||||
return domain_ObjectWatcher::add($obj);
|
||||
}
|
||||
|
||||
abstract function update(domain_DomainObject $object);
|
||||
protected abstract function doCreateObject(array $array);
|
||||
protected abstract function doInsert(domain_DomainObject $object);
|
||||
protected abstract function doDelete(domain_DomainObject $object);
|
||||
protected abstract function targetClass();
|
||||
protected abstract function selectStmt();
|
||||
protected abstract function selectAllStmt();
|
||||
protected abstract function deleteStmt();
|
||||
abstract function getCollection(array $raw);
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* MembershipCard collection - collection of elements in the user database
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class mapper_MembershipCardCollection extends mapper_Collection {
|
||||
function targetClass() {
|
||||
return "domain_MembershipCard";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* MembershipCard object mapper to database
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
//require_once( "mapper/Mapper.php" );
|
||||
//require_once( "mapper/UserMapper.php" );
|
||||
//require_once( "mapper/Collections.php" );
|
||||
|
||||
class mapper_MembershipCardMapper extends mapper_Mapper {
|
||||
|
||||
function __construct() {
|
||||
// initialize database connection and common setup
|
||||
parent::__construct();
|
||||
|
||||
// prepare SQL statements
|
||||
$this->selectStmt = self::$PDO->prepare(
|
||||
"SELECT c.id as id, u.id as userId, u.hasCard, u.lastSticker, c.date as created FROM din_usedcardno c LEFT JOIN din_user u ON c.id = u.cardno WHERE c.id=?");
|
||||
$this->selectAllStmt = self::$PDO->prepare(
|
||||
"SELECT u.id as userId, u.cardno as id, u.hasCard, u.lastSticker, c.date as created FROM din_user u LEFT JOIN din_usedcardno c ON u.cardno = c.id");
|
||||
$this->findByUserIdStmt = self::$PDO->prepare(
|
||||
"SELECT c.id as id, u.id as userId, u.hasCard, u.lastSticker, c.date as created FROM din_usedcardno c LEFT JOIN din_user u ON c.id = u.cardno WHERE u.id=?");
|
||||
// $this->updateStmt = self::$PDO->prepare(
|
||||
// "UPDATE din_user SET
|
||||
// cardno=?,
|
||||
// expires=?,
|
||||
// WHERE id=?");
|
||||
// $this->insertStmt = self::$PDO->prepare(
|
||||
// "INSERT INTO din_user (
|
||||
// expires
|
||||
// ) values (?)");
|
||||
// $this->deleteStmt = self::$PDO->prepare(
|
||||
// "DELETE FROM din_user WHERE id=?");
|
||||
}
|
||||
|
||||
protected function doCreateObject(array $array) {
|
||||
$obj = new domain_MembershipCard($array["id"]);
|
||||
|
||||
$user_mapper = new mapper_UserMapper();
|
||||
$obj->setUser($user_mapper->find($array["userId"]));
|
||||
|
||||
$obj->setCreated(new DateTime($array["created"]));
|
||||
if ($array["hasCard"]) $obj->setProduced(new DateTime()); // set produced date to now if card has been produced
|
||||
$obj->setLastSticker($array["lastSticker"]);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
protected function doInsert(domain_DomainObject $object) {
|
||||
}
|
||||
|
||||
function update(domain_DomainObject $object) {
|
||||
}
|
||||
|
||||
protected function doDelete(domain_DomainObject $object) {
|
||||
}
|
||||
|
||||
function selectStmt() {
|
||||
return $this->selectStmt;
|
||||
}
|
||||
|
||||
function selectAllStmt() {
|
||||
return $this->selectAllStmt;
|
||||
}
|
||||
|
||||
function deleteStmt() {
|
||||
//return $this->deleteStmt;
|
||||
}
|
||||
|
||||
function findByUserId($userid) {
|
||||
$this->findByUserIdStmt->execute(array($userid));
|
||||
return new mapper_MembershipCardCollection($this->findByUserIdStmt->fetchAll(), $this);
|
||||
}
|
||||
|
||||
function getCollection(array $raw) {
|
||||
return new mapper_MembershipCardCollection($raw, $this);
|
||||
}
|
||||
|
||||
protected function targetClass() {
|
||||
return "domain_MembershipCard";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Membership collection - collection of elements in the user database
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class mapper_MembershipCollection extends mapper_Collection {
|
||||
function targetClass() {
|
||||
return "domain_Membership";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Membership object mapper to database
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class mapper_MembershipMapper extends mapper_Mapper {
|
||||
|
||||
function __construct() {
|
||||
// initialize database connection and common setup
|
||||
parent::__construct();
|
||||
|
||||
// prepare SQL statements
|
||||
$this->selectStmt = self::$PDO->prepare(
|
||||
"SELECT u.id as userId, u.cardno, u.expires FROM din_user u WHERE u.id=?");
|
||||
$this->selectAllStmt = self::$PDO->prepare(
|
||||
"SELECT u.id as userId, u.cardno, u.expires FROM din_user u");
|
||||
$this->updateStmt = self::$PDO->prepare(
|
||||
"UPDATE din_user SET
|
||||
cardno=?,
|
||||
expires=?,
|
||||
WHERE id=?");
|
||||
// $this->insertStmt = self::$PDO->prepare(
|
||||
// "UPDATE din_user (
|
||||
// cardno, username, password, firstname, lastname, addresstype, valid_address, email, birthdate, placeOfStudy, passwordReset, division_id_request
|
||||
// ) values (?)");
|
||||
$this->deleteStmt = self::$PDO->prepare(
|
||||
"DELETE FROM din_user WHERE id=?");
|
||||
$this->findByUserIdStmt = self::$PDO->prepare(
|
||||
"SELECT u.id as userId, u.cardno, u.expires FROM din_user u WHERE u.id=?");
|
||||
}
|
||||
|
||||
protected function doCreateObject(array $array) {
|
||||
$obj = new domain_Membership($array["userId"]);
|
||||
|
||||
$user_mapper = new mapper_UserMapper();
|
||||
$obj->setUser($user_mapper->find($array["userId"]));
|
||||
|
||||
$card_mapper = new mapper_MembershipCardMapper();
|
||||
$obj->setCard($card_mapper->find($array["cardno"]));
|
||||
|
||||
$obj->setCreated(new DateTime("-9999-12-31"));
|
||||
$obj->setStarts(new DateTime("-9999-12-31"));
|
||||
$obj->setExpires(new DateTime($array["expires"]));
|
||||
return $obj;
|
||||
}
|
||||
|
||||
protected function doInsert(domain_DomainObject $object) {
|
||||
// $values = array($object->getUsername());
|
||||
// //$this->insertStmt->execute($values);
|
||||
// $id = self::$PDO->lastInsertId();
|
||||
// $object->setId($id);
|
||||
}
|
||||
|
||||
function update(domain_DomainObject $object) {
|
||||
$values = array(
|
||||
$object->getCard()->getId(),
|
||||
$object->getExpires(),
|
||||
$object->getId()
|
||||
);
|
||||
print_r($values);
|
||||
//$this->updateStmt->execute($values);
|
||||
}
|
||||
|
||||
protected function doDelete(domain_DomainObject $object) {
|
||||
$values = array($object->getId());
|
||||
$this->deleteStmt->execute($values);
|
||||
}
|
||||
|
||||
function selectStmt() {
|
||||
return $this->selectStmt;
|
||||
}
|
||||
|
||||
function selectAllStmt() {
|
||||
return $this->selectAllStmt;
|
||||
}
|
||||
|
||||
function deleteStmt() {
|
||||
//return $this->deleteStmt;
|
||||
}
|
||||
|
||||
function findByUserId($userid) {
|
||||
$this->findByUserIdStmt->execute(array($userid));
|
||||
return new mapper_MembershipCollection($this->findByUserIdStmt->fetchAll(), $this);
|
||||
}
|
||||
|
||||
function findByCardId($userid) {
|
||||
//$this->findByCardIdStmt->execute(array($userid));
|
||||
//return new mapper_UserUpdateCollection($this->findByUserIdStmt->fetchAll(), $this);
|
||||
$this->selectStmt->execute(array($userid));
|
||||
return new mapper_MembershipCollection($this->selectStmt->fetchAll(), $this);
|
||||
}
|
||||
|
||||
function getCollection(array $raw) {
|
||||
return new mapper_MembershipCollection($raw, $this);
|
||||
}
|
||||
|
||||
protected function targetClass() {
|
||||
return "domain_Membership";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* User address collection - collection of elements in the user address database
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class mapper_UserAddressCollection extends mapper_Collection {
|
||||
function targetClass() {
|
||||
return "domain_UserAddress";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* User address object mapper to database
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class mapper_UserAddressMapper extends mapper_Mapper {
|
||||
|
||||
function __construct() {
|
||||
// initialize database connection and common setup
|
||||
parent::__construct();
|
||||
|
||||
// prepare SQL statements
|
||||
$this->selectStmt = self::$PDO->prepare(
|
||||
"SELECT user_id, street, zipcode FROM din_useraddressno WHERE user_id=?");
|
||||
$this->selectAllStmt = self::$PDO->prepare(
|
||||
"SELECT user_id, street, zipcode FROM din_useraddressno");
|
||||
$this->updateStmt = self::$PDO->prepare(
|
||||
"UPDATE din_useraddressno SET
|
||||
street=?,
|
||||
zipcode=?,
|
||||
WHERE user_id=?");
|
||||
$this->insertStmt = self::$PDO->prepare(
|
||||
"INSERT INTO din_useraddressno (
|
||||
user_id, street, zipcode
|
||||
) values (?, ?, ?)");
|
||||
$this->deleteStmt = self::$PDO->prepare(
|
||||
"DELETE FROM din_useraddressno WHERE user_id=?");
|
||||
$this->findByUserIdStmt = self::$PDO->prepare(
|
||||
"SELECT user_id, street, zipcode FROM din_useraddressno WHERE user_id=?");
|
||||
}
|
||||
|
||||
protected function doCreateObject(array $array) {
|
||||
$obj = new domain_Membership($array["user_id"]);
|
||||
|
||||
$user_mapper = new mapper_UserMapper();
|
||||
$obj->setUser($user_mapper->find($array["user_id"]));
|
||||
|
||||
$obj->setStreet($array["street"]);
|
||||
$obj->setZipCode($array["zipcode"]);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
protected function doInsert(domain_DomainObject $object) {
|
||||
$values = array($object->getUser()->getId(), $object->getStreet(), $object->getZipCode());
|
||||
$this->insertStmt->execute($values);
|
||||
$id = self::$PDO->lastInsertId();
|
||||
$object->setId($id);
|
||||
}
|
||||
|
||||
function update(domain_DomainObject $object) {
|
||||
$values = array(
|
||||
$object->getStreet(),
|
||||
$object->getZipCode(),
|
||||
$object->getId()
|
||||
);
|
||||
$this->updateStmt->execute($values);
|
||||
}
|
||||
|
||||
protected function doDelete(domain_DomainObject $object) {
|
||||
$values = array($object->getId());
|
||||
$this->deleteStmt->execute($values);
|
||||
}
|
||||
|
||||
function selectStmt() {
|
||||
return $this->selectStmt;
|
||||
}
|
||||
|
||||
function selectAllStmt() {
|
||||
return $this->selectAllStmt;
|
||||
}
|
||||
|
||||
function deleteStmt() {
|
||||
return $this->deleteStmt;
|
||||
}
|
||||
|
||||
function findByUserId($userid) {
|
||||
$this->findByUserIdStmt->execute(array($userid));
|
||||
return new mapper_UserAddressCollection($this->findByUserIdStmt->fetchAll(), $this);
|
||||
}
|
||||
|
||||
function getCollection(array $raw) {
|
||||
return new mapper_UserAddressCollection($raw, $this);
|
||||
}
|
||||
|
||||
protected function targetClass() {
|
||||
return "domain_UserAddress";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* User collection - collection of elements in the user database
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class mapper_UserCollection extends mapper_Collection {
|
||||
function targetClass() {
|
||||
return "domain_User";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* User object mapper to database
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class mapper_UserMapper extends mapper_Mapper {
|
||||
|
||||
function __construct() {
|
||||
// initialize database connection and common setup
|
||||
parent::__construct();
|
||||
|
||||
// prepare SQL statements
|
||||
$this->selectStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM din_user WHERE id=?");
|
||||
$this->selectAllStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM din_user");
|
||||
$this->updateStmt = self::$PDO->prepare(
|
||||
"UPDATE din_user SET
|
||||
username=?,
|
||||
password=?,
|
||||
firstname=?,
|
||||
lastname=?,
|
||||
addresstype='no',
|
||||
valid_address=?,
|
||||
email=?,
|
||||
birthdate=?,
|
||||
placeOfStudy=?,
|
||||
passwordReset=?,
|
||||
division_id_request=?
|
||||
WHERE id=?");
|
||||
$this->insertStmt = self::$PDO->prepare(
|
||||
"INSERT INTO din_user (
|
||||
username
|
||||
) values (?)");
|
||||
$this->deleteStmt = self::$PDO->prepare(
|
||||
"DELETE FROM din_user WHERE id=?");
|
||||
}
|
||||
|
||||
protected function doCreateObject(array $array) {
|
||||
$obj = new domain_User($array["id"]);
|
||||
$obj->setUsername($array["username"]);
|
||||
$obj->setPassword($array["password"]);
|
||||
$obj->setFirstname($array["firstname"]);
|
||||
$obj->setLastname($array["lastname"]);
|
||||
$obj->setValidaddress($array["valid_address"]);
|
||||
$obj->setEmail($array["email"]);
|
||||
$obj->setBirthdate($array["birthdate"]);
|
||||
$obj->setPlaceOfStudy($array["placeOfStudy"]);
|
||||
$obj->setPasswordreset($array["passwordReset"]);
|
||||
$obj->setDivisionIdRequest($array["division_id_request"]);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
protected function doInsert(domain_DomainObject $object) {
|
||||
$values = array($object->getUsername());
|
||||
//$this->insertStmt->execute($values);
|
||||
$id = self::$PDO->lastInsertId();
|
||||
$object->setId($id);
|
||||
}
|
||||
|
||||
function update(domain_DomainObject $object) {
|
||||
$values = array(
|
||||
$object->getUsername(),
|
||||
$object->getPassword(),
|
||||
$object->getFirstname(),
|
||||
$object->getLastname(),
|
||||
$object->getValidAddress(),
|
||||
$object->getEmail(),
|
||||
$object->getBirthdate(),
|
||||
$object->getPlaceOfStudy(),
|
||||
$object->getPasswordreset(),
|
||||
$object->getDivisionIdRequest(),
|
||||
$object->getId()
|
||||
);
|
||||
print_r($values);
|
||||
//$this->updateStmt->execute($values);
|
||||
}
|
||||
|
||||
protected function doDelete(domain_DomainObject $object) {
|
||||
$values = array($object->getId());
|
||||
$this->deleteStmt->execute($values);
|
||||
}
|
||||
|
||||
function selectStmt() {
|
||||
return $this->selectStmt;
|
||||
}
|
||||
|
||||
function selectAllStmt() {
|
||||
return $this->selectAllStmt;
|
||||
}
|
||||
|
||||
function deleteStmt() {
|
||||
return $this->deleteStmt;
|
||||
}
|
||||
|
||||
function getCollection(array $raw) {
|
||||
return new mapper_UserCollection($raw, $this);
|
||||
}
|
||||
|
||||
protected function targetClass() {
|
||||
return "domain_User";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* User updates collection - collection of elements in the user database
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class mapper_UserUpdateCollection extends mapper_Collection {
|
||||
function targetClass() {
|
||||
return "domain_UserUpdate";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* User object mapper to database
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class mapper_UserUpdateMapper extends mapper_Mapper {
|
||||
|
||||
function __construct() {
|
||||
// initialize database connection and common setup
|
||||
parent::__construct();
|
||||
|
||||
// prepare SQL statements
|
||||
$this->selectStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM din_userupdate WHERE id=?");
|
||||
$this->selectAllStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM din_userupdate");
|
||||
$this->findByUserIdStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM din_userupdate WHERE user_id_updated=?");
|
||||
$this->updateStmt = self::$PDO->prepare(
|
||||
"UPDATE din_userupdate SET
|
||||
date=?,
|
||||
user_id_updated=?,
|
||||
comment=?,
|
||||
user_id_updated_by=?
|
||||
WHERE id=?");
|
||||
$this->insertStmt = self::$PDO->prepare(
|
||||
"INSERT INTO din_userupdate (
|
||||
date, user_id_updated, comment, user_id_updated_by
|
||||
) values (?,?,?,?)");
|
||||
$this->deleteStmt = self::$PDO->prepare(
|
||||
"DELETE FROM din_userupdate WHERE id=?");
|
||||
}
|
||||
|
||||
protected function doCreateObject(array $array) {
|
||||
$obj = new domain_UserUpdate($array["id"]);
|
||||
$obj->setDate($array["date"]);
|
||||
$obj->setUser($array["user_id_updated"]);
|
||||
$obj->setMessage($array["comment"]);
|
||||
$obj->setUpdatedBy($array["user_id_updated_By"]);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
protected function doInsert(domain_DomainObject $object) {
|
||||
$values = array($object->getUsername());
|
||||
//$this->insertStmt->execute($values);
|
||||
$id = self::$PDO->lastInsertId();
|
||||
$object->setId($id);
|
||||
}
|
||||
|
||||
function update(domain_DomainObject $object) {
|
||||
$values = array(
|
||||
$object->getDate(),
|
||||
$object->getUser(),
|
||||
$object->getMessage(),
|
||||
$object->getUpdatedBy(),
|
||||
$object->getId()
|
||||
);
|
||||
print_r($values);
|
||||
$this->updateStmt->execute($values);
|
||||
}
|
||||
|
||||
protected function doDelete(domain_DomainObject $object) {
|
||||
$values = array($object->getId());
|
||||
$this->deleteStmt->execute($values);
|
||||
}
|
||||
|
||||
function selectStmt() {
|
||||
return $this->selectStmt;
|
||||
}
|
||||
|
||||
function selectAllStmt() {
|
||||
return $this->selectAllStmt;
|
||||
}
|
||||
|
||||
function deleteStmt() {
|
||||
return $this->deleteStmt();
|
||||
}
|
||||
|
||||
function findByUserId($userid) {
|
||||
$this->findByUserIdStmt->execute(array($userid));
|
||||
return new mapper_UserUpdateCollection($this->findByUserIdStmt->fetchAll(), $this);
|
||||
}
|
||||
|
||||
function getCollection(array $raw) {
|
||||
return new mapper_UserCollection($raw, $this);
|
||||
}
|
||||
|
||||
protected function targetClass() {
|
||||
return "domain_UserUpdate";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
header("Content-type: Text/plain");
|
||||
|
||||
require_once "includes.php";
|
||||
|
||||
$conn = & DB :: connect(getDSN());
|
||||
if (DB :: isError($conn)) {
|
||||
print ("error: " . $conn->toString());
|
||||
exit ();
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$u = 0;
|
||||
|
||||
$sql = "SELECT u.id, u.cardno, u.hasCard, uc.date, u.expires FROM din_user u LEFT JOIN din_usedcardno uc ON u.cardno = uc.id ORDER BY u.cardno";
|
||||
$result = & $conn->query($sql);
|
||||
if (DB :: isError($result) != true) {
|
||||
while($row = & $result->fetchRow(DB_FETCHMODE_ASSOC)) {
|
||||
if ($row["cardno"] > 0) {
|
||||
$ins_stmt = "INSERT INTO din_membershipcard (id, userId, ordered, produced, delivered, active) VALUES (";
|
||||
$ins_stmt .= $row["cardno"] . ", ";
|
||||
$ins_stmt .= $row["id"] . ", ";
|
||||
if ($row["date"]) {
|
||||
$ins_stmt .= "\"" . $row["date"] . "\", ";
|
||||
} else {
|
||||
$ins_stmt .= "\"2005-12-28 16:28:31\", ";
|
||||
}
|
||||
|
||||
if ($row["hasCard"] == 1) {
|
||||
if ($row["date"]) {
|
||||
$ins_stmt .= "\"" . $row["date"] . "\", ";
|
||||
} else {
|
||||
$ins_stmt .= "\"2005-12-28 16:28:31\", ";
|
||||
}
|
||||
} else {
|
||||
$ins_stmt .= "NULL, ";
|
||||
}
|
||||
|
||||
if ($row["hasCard"] == 1) {
|
||||
if ($row["date"]) {
|
||||
$ins_stmt .= "\"" . $row["date"] . "\", ";
|
||||
} else {
|
||||
$ins_stmt .= "\"2005-12-28 16:28:31\", ";
|
||||
}
|
||||
} else {
|
||||
$ins_stmt .= "NULL, ";
|
||||
}
|
||||
$ins_stmt .= $row["hasCard"];
|
||||
$ins_stmt .= ")";
|
||||
|
||||
//print $ins_stmt . "\n";
|
||||
//$conn->query($ins_stmt);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "\n\nInsert $i rows\nUpdated $u rows";
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
header("Content-type: Text/plain");
|
||||
|
||||
require_once "includes.php";
|
||||
|
||||
$conn = & DB :: connect(getDSN());
|
||||
if (DB :: isError($conn)) {
|
||||
print ("error: " . $conn->toString());
|
||||
exit ();
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$u = 0;
|
||||
|
||||
$user = new User(735);
|
||||
|
||||
$card = $user->getMembershipCard();
|
||||
|
||||
//print_r($card);
|
||||
|
||||
if (is_null($card)) {
|
||||
print "User is missing card!\n\n";
|
||||
print "Creating card ..\n";
|
||||
$newcard = new MembershipCard();
|
||||
$newcard->setOrdered(new DateTime());
|
||||
$user->setMembershipCard($newcard);
|
||||
$card = $user->getMembershipCard();
|
||||
$card->store();
|
||||
}
|
||||
|
||||
print "User " . $user->getName() . " has the following card: \n";
|
||||
print "Card id " . $card->getId() . "\n";
|
||||
if (!is_null($card->getOrdered())) {
|
||||
print "Ordered " . $card->getOrdered()->format(DateTime::RFC1123) . "\n";
|
||||
}
|
||||
if (!is_null($card->getProduced())) {
|
||||
print "Produced " . $card->getProduced()->format(DateTime::RFC1123) . "\n";
|
||||
}
|
||||
if (!is_null($card->getDelivered())) {
|
||||
print "Delivered " . $card->getDelivered()->format(DateTime::RFC1123) . "\n";
|
||||
}
|
||||
print "Active " . $card->getActive() . "\n";
|
||||
|
||||
$produced = new DateTime();
|
||||
$produced->modify("+1 month");
|
||||
$card->setProduced($produced);
|
||||
|
||||
print "New time: " . $card->getProduced()->format('U') . "\n";
|
||||
|
||||
$card->setActive(false);
|
||||
|
||||
$card->store();
|
||||
|
||||
print_r($card);
|
||||
|
||||
return true;
|
||||
|
||||
$sql = "SELECT u.id, u.cardno, u.hasCard, uc.date, u.expires FROM din_user u LEFT JOIN din_usedcardno uc ON u.cardno = uc.id ORDER BY u.cardno";
|
||||
$result = & $conn->query($sql);
|
||||
if (DB :: isError($result) != true) {
|
||||
while($row = & $result->fetchRow(DB_FETCHMODE_ASSOC)) {
|
||||
if ($row["cardno"] > 0) {
|
||||
$ins_stmt = "INSERT INTO din_membershipcard (id, userId, ordered, produced, delivered, active) VALUES (";
|
||||
$ins_stmt .= $row["cardno"] . ", ";
|
||||
$ins_stmt .= $row["id"] . ", ";
|
||||
if ($row["date"]) {
|
||||
$ins_stmt .= "\"" . $row["date"] . "\", ";
|
||||
} else {
|
||||
$ins_stmt .= "\"2005-12-28 16:28:31\", ";
|
||||
}
|
||||
|
||||
if ($row["hasCard"] == 1) {
|
||||
if ($row["date"]) {
|
||||
$ins_stmt .= "\"" . $row["date"] . "\", ";
|
||||
} else {
|
||||
$ins_stmt .= "\"2005-12-28 16:28:31\", ";
|
||||
}
|
||||
} else {
|
||||
$ins_stmt .= "NULL, ";
|
||||
}
|
||||
|
||||
if ($row["hasCard"] == 1) {
|
||||
if ($row["date"]) {
|
||||
$ins_stmt .= "\"" . $row["date"] . "\", ";
|
||||
} else {
|
||||
$ins_stmt .= "\"2005-12-28 16:28:31\", ";
|
||||
}
|
||||
} else {
|
||||
$ins_stmt .= "NULL, ";
|
||||
}
|
||||
$ins_stmt .= $row["hasCard"];
|
||||
$ins_stmt .= ")";
|
||||
|
||||
//print $ins_stmt . "\n";
|
||||
//$conn->query($ins_stmt);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "\n\nInsert $i rows\nUpdated $u rows";
|
||||
+1
-1
@@ -8,7 +8,7 @@ header("Content-type: application/xml");
|
||||
|
||||
$conn = db_connect();
|
||||
|
||||
$posId = mysql_real_escape_string($_REQUEST['positionid']);
|
||||
$posId = $_REQUEST['positionid'];
|
||||
|
||||
$sql = "SELECT name, text
|
||||
FROM din_position
|
||||
|
||||
@@ -0,0 +1,700 @@
|
||||
/**
|
||||
* text: #000 (black)
|
||||
* background: #FFF (white)
|
||||
* light-fill: #EEE
|
||||
* conrast-fill: #DDD
|
||||
* passive-cell: #AAA
|
||||
* border: #CCC
|
||||
* link: #00D
|
||||
*
|
||||
**/
|
||||
/* =general
|
||||
*********************************************************************/
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
font-size: .905em;
|
||||
line-height: 1.5em;
|
||||
font-family: arial, sans-serif;
|
||||
}
|
||||
|
||||
img {
|
||||
border: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
td img {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.mceEditor img {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 0 5px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
em {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
strong, p.strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
|
||||
/* =links
|
||||
*********************************************************************/
|
||||
|
||||
a {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
text-decoration: none;
|
||||
color: #00D;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #00D;
|
||||
}
|
||||
|
||||
th a {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
th a:visited {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.optionsMenu a, a.button, span.button, label.button {
|
||||
border: 1px solid #CCC;
|
||||
background: #DDD;
|
||||
padding: 1px 5px;
|
||||
margin: 3px 0;
|
||||
letter-spacing: 1px;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
a.read {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
a.unread {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a.skip-nav {
|
||||
display: none;
|
||||
}
|
||||
|
||||
a.contact {
|
||||
background: url("graphics/user_go.png") no-repeat right;
|
||||
padding-right: 20px;
|
||||
}
|
||||
/* =lists
|
||||
*********************************************************************/
|
||||
|
||||
ul {
|
||||
|
||||
}
|
||||
|
||||
li {
|
||||
|
||||
}
|
||||
|
||||
ul.linker, .linker li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
/* =forms
|
||||
*********************************************************************/
|
||||
|
||||
form {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
textarea, input {
|
||||
font-family: arial, sans-serif;
|
||||
line-height: 1.2em;
|
||||
font-size: 1em;
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
||||
form .title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
textarea:focus, input:focus {
|
||||
background: #FFD;
|
||||
}
|
||||
|
||||
.readonly {
|
||||
background: inherit;
|
||||
border: none;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
width: 90%;
|
||||
max-width: 600px;
|
||||
padding: 15px;
|
||||
border: 3px solid #CCC;
|
||||
}
|
||||
|
||||
fieldset label {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
legend {
|
||||
font-weight: bold;
|
||||
padding: 0 5px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
fieldset input, fieldset select, fieldset textarea {
|
||||
margin: 0 15px;
|
||||
}
|
||||
|
||||
input.submit {
|
||||
margin: 0px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
div.horizontal-form {
|
||||
padding: 3px;
|
||||
margin: 5px 0;
|
||||
background: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.delete {
|
||||
text-align: right;
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.formHelp {
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.formHelpMessage {
|
||||
background: #FFD;
|
||||
border: 1px solid black;
|
||||
font-size: 11px;
|
||||
padding: 3px 3px 3px 20px;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.helpMessageClose {
|
||||
border: 1px solid black;
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
padding: 0 2px;
|
||||
line-height: 1em;
|
||||
cursor: pointer;
|
||||
background: red;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
/* =tables
|
||||
*********************************************************************/
|
||||
|
||||
table {
|
||||
margin: 5px 0;
|
||||
padding: 0;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
th {
|
||||
padding: 0 5px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2px;
|
||||
background: #DDD;
|
||||
}
|
||||
|
||||
tr {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
td {
|
||||
vertical-align: top;
|
||||
padding: 0px 5px;
|
||||
background: #EEE;
|
||||
}
|
||||
|
||||
td.label {
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
td.number {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
td.phone {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
td.date {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
td.is_member{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
tr.table-footer td {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.calendar {
|
||||
width: 98%;
|
||||
margin: 0 auto;
|
||||
font-size: .85em;
|
||||
}
|
||||
|
||||
.calendar td {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
td.passive {
|
||||
background: #AAA;
|
||||
}
|
||||
|
||||
td.weekNumber {
|
||||
background: #DDD;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.calendar-event, label.calendar-event.button {
|
||||
background: #CCC;
|
||||
}
|
||||
|
||||
div.calendar-concert, label.calendar-concert.button {
|
||||
background: #DDD;
|
||||
}
|
||||
|
||||
.calendar td div {
|
||||
padding: 2px 1px;
|
||||
margin: 1px;
|
||||
line-height: 1em;
|
||||
border-bottom: 1px dotted #000;
|
||||
}
|
||||
|
||||
td h4 {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
th a {
|
||||
display: block;
|
||||
}
|
||||
|
||||
table.sortable tr:hover td {
|
||||
background: #DDD;
|
||||
}
|
||||
|
||||
td.unread {
|
||||
text-align: center;
|
||||
font-size: 1.8em;
|
||||
line-height: 0.1em;
|
||||
padding: 15px 5px 0px 3px;
|
||||
}
|
||||
|
||||
|
||||
/* =headings
|
||||
*********************************************************************/
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size:1.2em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
/* =header
|
||||
*********************************************************************/
|
||||
#header {
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
-moz-border-radius: 8px;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
letter-spacing: 3px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#header h1 a {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* =navigation
|
||||
*********************************************************************/
|
||||
|
||||
|
||||
#nav {
|
||||
float: left;
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
-moz-border-radius: 8px;
|
||||
color: #000;
|
||||
width: 170px;
|
||||
margin: 5px 0 15px 0;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
#navList {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
li.menulist {
|
||||
background: url(graphics/minus.png) no-repeat 3px 0.3em;
|
||||
line-height: 1.2em;
|
||||
list-style: none outside;
|
||||
margin: 0px 0 10px;
|
||||
padding: 2px 10px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.jsenabled li.menulist {
|
||||
background: url(graphics/plus.png) no-repeat 3px 0.3em;
|
||||
}
|
||||
|
||||
.jsenabled .menu, .jsenabled .submenu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.menu, .submenu {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.menu li, .submenu li {
|
||||
background: #EEE;
|
||||
list-style: none outside;
|
||||
margin: 3px 5px;
|
||||
padding: 0px 3px;
|
||||
border: 1px dotted #CCC;
|
||||
}
|
||||
|
||||
.menu li:hover, .submenu li:hover {
|
||||
background: #DDD;
|
||||
}
|
||||
|
||||
#nav li a {
|
||||
color: black;
|
||||
}
|
||||
|
||||
a.switch {
|
||||
background-color: transparent;
|
||||
color: #000;
|
||||
font-size: .9em;
|
||||
line-height: 1em;
|
||||
padding-left: 5px;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
}
|
||||
|
||||
a.switch:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.menu li a, .submenu li a {
|
||||
display: block;
|
||||
background-color: transparent;
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.menu li a:hover, submenu li a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
span.key {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#calHeader {
|
||||
width: 400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#previous {
|
||||
float: left;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#next {
|
||||
float: right;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#previous a, #next a {
|
||||
border: 1px solid #CCC;
|
||||
font-weight: bold;
|
||||
padding: 0 5px;
|
||||
margin: 0px;
|
||||
line-height: 1em;
|
||||
background: #DDD;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/* =content
|
||||
*********************************************************************/
|
||||
#content {
|
||||
padding: 0px;
|
||||
margin: 5px 0 15px 207px;
|
||||
}
|
||||
|
||||
div.text-column {
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
* html div.text-column {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
div.article_images {
|
||||
float: right;
|
||||
margin: 0px 0px 3px 3px;
|
||||
width: 200px;
|
||||
}
|
||||
div.article_images div {
|
||||
border: 1px dotted #ccc;
|
||||
}
|
||||
/*div.primary_image {
|
||||
float: right;
|
||||
margin: 0px 0px 3px 3px;
|
||||
width: 200px;
|
||||
border: 1px dotted #ccc;
|
||||
}
|
||||
*/
|
||||
span.caption {
|
||||
font-size: 11px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/*div.extra_image {
|
||||
float: left;
|
||||
margin: 0px 3px 3px 0px;
|
||||
width: 200px;
|
||||
border: 1px dotted #ccc;
|
||||
}*/
|
||||
|
||||
p.date {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
p.date:first-letter {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
p.subtitle {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
p.intro {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.messages, div.errors {
|
||||
margin: 0 0 5px 0;
|
||||
padding: 3px;
|
||||
background: #000;
|
||||
color: #FFF;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.messages ul, div.erros ul {
|
||||
margin: 0 0 0 35px;
|
||||
padding: 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.timeData {
|
||||
border: 1px solid #CCC;
|
||||
background: #EEE;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
div.optionsMenu {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
div.product {
|
||||
border: 1px solid black;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
div.product_images {
|
||||
float: right;
|
||||
}
|
||||
|
||||
tr.barshift-full td {
|
||||
background: #AAA;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
td.worker-status {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.calendar-barshift {
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.calendar-barshift.full {
|
||||
border: 1px solid #CCC;
|
||||
background: #DDD;
|
||||
}
|
||||
|
||||
div.calendar-barshift h4 {
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.calendar-barshift ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.calendar-register-me {
|
||||
border: 1px solid black;
|
||||
padding: 1px;
|
||||
width: 50%;
|
||||
color: black;
|
||||
margin: 0px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
background: #DDD;
|
||||
}
|
||||
|
||||
div.calendar-barshift li {
|
||||
white-space: nowrap;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.comments {
|
||||
border-top: 2px solid #CCC;
|
||||
|
||||
}
|
||||
|
||||
div.comment {
|
||||
border-top: 2px solid #CCC;
|
||||
padding: 5px 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
div.comment-meta {
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
|
||||
div.comment-main {
|
||||
margin-left: 150px;
|
||||
min-height: 60px;
|
||||
border-left: 2px dotted #CCC;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
* html div.comment-main {
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.clear-right {
|
||||
clear: right;
|
||||
}
|
||||
/* =footer
|
||||
*********************************************************************/
|
||||
#footer {
|
||||
clear: both;
|
||||
text-align: center;
|
||||
background: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
-moz-border-radius: 8px;
|
||||
color: #000;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* =extras
|
||||
*********************************************************************/
|
||||
.domenabled ul#finder, .domenabled ul#finder li, .domenabled ul#finder ul {
|
||||
list-style-type:none;
|
||||
margin: 5px 0;
|
||||
padding:0;
|
||||
line-height: 1em;
|
||||
}
|
||||
|
||||
.domenabled ul#finder ul.hidden {
|
||||
display: none;
|
||||
}
|
||||
.domenabled ul#finder ul.shown {
|
||||
margin: 3px 25px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.domenabled ul#finder li a {
|
||||
}
|
||||
|
||||
.domenabled #finder a.open {
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.domenabled #finder a.parent {
|
||||
color: black;
|
||||
}
|
||||
|
||||
|
||||
.domenabled div.disabled {
|
||||
display: none;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
if (isset($_GET["id"])) $id = $_GET["id"];
|
||||
else $id = 1;
|
||||
|
||||
include("functions.php");
|
||||
include("domain/DomainObject.php");
|
||||
include("domain/HelperFactory.php");
|
||||
include("domain/ObjectWatcher.php");
|
||||
include("domain/Membership.php");
|
||||
include("domain/MembershipCard.php");
|
||||
include("domain/User.php");
|
||||
include("domain/UserAddress.php");
|
||||
include("domain/UserUpdate.php");
|
||||
include("mapper/Collection.php");
|
||||
include("mapper/Mapper.php");
|
||||
include("mapper/MembershipCardCollection.php");
|
||||
include("mapper/MembershipCardMapper.php");
|
||||
include("mapper/MembershipCollection.php");
|
||||
include("mapper/MembershipMapper.php");
|
||||
include("mapper/UserAddressCollection.php");
|
||||
include("mapper/UserAddressMapper.php");
|
||||
include("mapper/UserCollection.php");
|
||||
include("mapper/UserMapper.php");
|
||||
include("mapper/UserUpdateCollection.php");
|
||||
include("mapper/UserUpdateMapper.php");
|
||||
|
||||
header("Content-type: text/plain");
|
||||
$user = new domain_User();
|
||||
$users = $user->collection();
|
||||
for ($i = 13048; $i <= 13048; $i++) {
|
||||
if ($user = domain_DomainObject::getFinder("domain_User")->find($i)) {
|
||||
$users->add($user);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($users as $user) {
|
||||
print_r($user);
|
||||
$user->getUpdates();;
|
||||
$user->getMemberships();
|
||||
$user->getCards();
|
||||
$user->getAddress();
|
||||
|
||||
print_r($user);
|
||||
//print "\n" . $user->getMemberships()->current()->getStarts()->format("Y-m-d");
|
||||
}
|
||||
//$userMapper->update($user);
|
||||
|
||||
// perform database modifications
|
||||
domain_ObjectWatcher::instance()->performOperations();
|
||||
?>
|
||||
+406
@@ -0,0 +1,406 @@
|
||||
|
||||
|
||||
|
||||
1282505719
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>e094adb6c5424befa5252d12c0b7405c</id><date>2010-08-22 19:35:18</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>d3ae9d6518434e00a3c8086a265bab72</transactionRef><transactionNumber>60765680</transactionNumber><orderId>2366</orderId><productId>Handlevogn #2002</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2002</productNumber><clientGsmNumber /><BankHash>f72de24c-a91f-4211-9890-6aecd84c098c</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282510849
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>5059ac4ca04a4937a8dcbbfee00a2c7f</id><date>2010-08-22 21:00:48</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>32081b3de82f4aaf89acdf35358c7963</transactionRef><transactionNumber>60772833</transactionNumber><orderId>2367</orderId><productId>Handlevogn #2003</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2003</productNumber><clientGsmNumber /><BankHash>6a66af56-1726-4ac3-83fe-d10e7cd68e6c</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282510871
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>eb391672a83e4deb9d24dc9e730f342e</id><date>2010-08-22 21:01:08</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>32081b3de82f4aaf89acdf35358c7963</transactionRef><transactionNumber>60772833</transactionNumber><orderId>2367</orderId><productId>Handlevogn #2003</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>True</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2003</productNumber><clientGsmNumber /><BankHash>6a66af56-1726-4ac3-83fe-d10e7cd68e6c</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282550541
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>5e6e90a77b344de499cff2cf158ac923</id><date>2010-08-23 08:02:22</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>d46018b98b8e44acb529d964d692fac0</transactionRef><transactionNumber>60787685</transactionNumber><orderId>2369</orderId><productId>Handlevogn #2005</productId><paymentMethod>VISA</paymentMethod><amount>3500</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2005</productNumber><clientGsmNumber /><BankHash>e2c6be94-b9d6-4eed-b4ba-7a32dc3c6cbd</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282573529
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>15ea32953976409d8b78d8b6b27eb27e</id><date>2010-08-23 14:25:31</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>ec2df9c96297424d85cd0d47b2f9fcbf</transactionRef><transactionNumber>60819315</transactionNumber><orderId>2370</orderId><productId>Handlevogn #2006</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2006</productNumber><clientGsmNumber /><BankHash>3022deee-1692-456c-9ff3-78fd85716e5b</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282586080
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>d61d4c5295e64446abf7805e8c91ceed</id><date>2010-08-23 17:54:40</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>7534a641ae95457dbe9a069d1725af50</transactionRef><transactionNumber>60840581</transactionNumber><orderId>2371</orderId><productId>Handlevogn #2007</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2007</productNumber><clientGsmNumber /><BankHash>c2f14ad4-a4e4-43e1-b80d-d62ae09b96df</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282648956
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>bb5c74d22efc47a79d44bc89895eb9af</id><date>2010-08-24 11:22:36</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>d46f1ca0ab2b4c26a1ddad6882d02305</transactionRef><transactionNumber>60894560</transactionNumber><orderId>2372</orderId><productId>Handlevogn #2008</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2008</productNumber><clientGsmNumber /><BankHash>9c4a0b07-f679-4b8b-8611-0ea840c72f09</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282685139
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>74cbe5f35ba34bb2815c1a9f8dceddc7</id><date>2010-08-24 21:25:41</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>f7eddf4a4f8b4f7ca079c416a1fbf969</transactionRef><transactionNumber>60947408</transactionNumber><orderId>2373</orderId><productId>Handlevogn #2009</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2009</productNumber><clientGsmNumber /><BankHash>6eeea499-04e6-4954-8c75-12b94dab4b4b</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282686581
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>a350bc437aaa40ee9ebbe1534a613bdd</id><date>2010-08-24 21:49:43</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>7823b391ec3446fda9338ab72d95a7fb</transactionRef><transactionNumber>60948286</transactionNumber><orderId>2374</orderId><productId>Handlevogn #2010</productId><paymentMethod>VISA</paymentMethod><amount>3500</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2010</productNumber><clientGsmNumber /><BankHash>98520b06-2ab1-4e4f-b36c-fcf426c141d2</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282723867
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>ac8d5a17f4e842f1859ca72000f8a079</id><date>2010-08-25 08:11:13</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>1499c1b3b24f4a93b1a90c026dcead92</transactionRef><transactionNumber>60964440</transactionNumber><orderId>2375</orderId><productId>Handlevogn #2011</productId><paymentMethod>VISA</paymentMethod><amount>3500</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2011</productNumber><clientGsmNumber /><BankHash>b6c74b29-824c-4c23-9a9c-9579ff8a8a43</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282727829
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>7de3cea0e77546d7b2db172cd177d27c</id><date>2010-08-25 09:17:18</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>05921260da7d4abfbe17597dc9071de4</transactionRef><transactionNumber>60969140</transactionNumber><orderId>2376</orderId><productId>Handlevogn #2012</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2012</productNumber><clientGsmNumber /><BankHash>eb369acd-4e1f-4754-8102-dd546e6a6feb</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282738005
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>120f08aca0924528a8b0b0bc5edcbd96</id><date>2010-08-25 12:06:52</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>861db9cc775c45e38c42551663f5d79c</transactionRef><transactionNumber>60984896</transactionNumber><orderId>2377</orderId><productId>Handlevogn #2013</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2013</productNumber><clientGsmNumber /><BankHash>e997ba84-47c3-4859-854a-3c459e29a7da</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282741121
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>01e6efaf9e71412198f69a8083bcf230</id><date>2010-08-25 12:58:48</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>fe07cfa6713b4f3c90e09b4cdb493131</transactionRef><transactionNumber>60989005</transactionNumber><orderId>2378</orderId><productId>Handlevogn #2014</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2014</productNumber><clientGsmNumber /><BankHash>23dc2914-dfac-465a-ab6e-c696f85f24f4</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282811261
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>098af6566668442fa046e855b17276c9</id><date>2010-08-26 08:27:47</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>70ffe0dd5a874285a65a8ebf893c358d</transactionRef><transactionNumber>61050450</transactionNumber><orderId>2381</orderId><productId>Handlevogn #2018</productId><paymentMethod>VISA</paymentMethod><amount>3500</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2018</productNumber><clientGsmNumber /><BankHash>a6f06651-0be5-4026-aae0-825bdbb82108</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282843511
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>2c5567978ed947d8b2f9f6553c6409b1</id><date>2010-08-26 17:25:18</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>7cf90d1bbd87417f8fcedc4a2e184f83</transactionRef><transactionNumber>61092457</transactionNumber><orderId>2382</orderId><productId>Handlevogn #2019</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2019</productNumber><clientGsmNumber /><BankHash>6899f446-ad7a-4402-a2a0-2b09a9c7f395</BankHash><AuthenticatedStatus>None</AuthenticatedStatus><AuthenticatedWith>N</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282850785
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>653042fdedc14c42b7bd7eabf7dfe01e</id><date>2010-08-26 19:26:30</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>2e07a26fa6f24f7685658c2e43193adc</transactionRef><transactionNumber>61102870</transactionNumber><orderId>2383</orderId><productId>Handlevogn #2020</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2020</productNumber><clientGsmNumber /><BankHash>afef68d3-32fb-4500-ae17-5f1b3edc00ed</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282853724
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>51ffa9cbafbb4fe98cafb909deece26c</id><date>2010-08-26 20:15:29</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>a772cf01b0d948c4af68b2ec90030381</transactionRef><transactionNumber>61107210</transactionNumber><orderId>2384</orderId><productId>Handlevogn #2021</productId><paymentMethod>VISA</paymentMethod><amount>3500</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2021</productNumber><clientGsmNumber /><BankHash>a9dce6eb-7fa0-4fc8-bb9a-5f67eb6f104e</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282857116
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>42aeca023601405db1dc54f58cd50e9e</id><date>2010-08-26 21:12:05</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>5</transactionStatus><orderStatus>0</orderStatus><transactionRef>93b181e86a454028b660364a7d4681db</transactionRef><transactionNumber>61111788</transactionNumber><orderId>2385</orderId><productId>Handlevogn #2022</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><errorDetails><transactionErrorCode>OperationCancelledbyCustomer</transactionErrorCode><transactionErrorDescription>Accomplish3rdParty</transactionErrorDescription><transactionThirdPartyError>USER_CANCELED</transactionThirdPartyError></errorDetails><clientAccount>0</clientAccount><productNumber>Handlevogn #2022</productNumber><clientGsmNumber /><transactionFailedReason>CreditCard_Error</transactionFailedReason><BankHash>fdb400b7-ab13-4dbf-922b-cc2e29c34807</BankHash><AuthenticatedWith>N</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1282934047
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>5e6d107f6cb34f6784d94aee2dfcb3df</id><date>2010-08-27 18:34:12</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>55085049016649fbad8b2c9f656b7fe4</transactionRef><transactionNumber>61173917</transactionNumber><orderId>2387</orderId><productId>Handlevogn #2023</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2023</productNumber><clientGsmNumber /><BankHash>9e8db6da-82f6-40d7-a6ea-b4e31923adc4</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283020700
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>7d005970e5ec4aec958e4ba5a0fc040b</id><date>2010-08-28 18:38:24</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>df0747b89f0e4d5b913e1a7bdb60830a</transactionRef><transactionNumber>61230117</transactionNumber><orderId>2395</orderId><productId>Handlevogn #2022</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2022</productNumber><clientGsmNumber /><BankHash>fdb400b7-ab13-4dbf-922b-cc2e29c34807</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283025954
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>a1a3c6dec393475eaac30071241158fa</id><date>2010-08-28 20:05:57</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>359191c81f7945509e87b3b7dd3bae1c</transactionRef><transactionNumber>61234078</transactionNumber><orderId>2396</orderId><productId>Handlevogn #2024</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2024</productNumber><clientGsmNumber /><BankHash>bfc2af58-e859-4bf7-83ce-18987986f821</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283093789
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>e4746b3aba0c4b79b42c831083935616</id><date>2010-08-29 14:56:31</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>5</transactionStatus><orderStatus>0</orderStatus><transactionRef>5a671425a02c4262a9e0205761711c96</transactionRef><transactionNumber>61275180</transactionNumber><orderId>2397</orderId><productId>Handlevogn #2029</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><errorDetails><transactionErrorCode>OperationCancelledbyCustomer</transactionErrorCode><transactionErrorDescription>Accomplish3rdParty</transactionErrorDescription><transactionThirdPartyError>USER_CANCELED</transactionThirdPartyError></errorDetails><clientAccount>0</clientAccount><productNumber>Handlevogn #2029</productNumber><clientGsmNumber /><transactionFailedReason>CreditCard_Error</transactionFailedReason><BankHash>cfab921c-ac1d-4384-b35a-e0f58dfc1b0c</BankHash><AuthenticatedWith>N</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283094793
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>8695a6799e77436b81c6dbc774331a1c</id><date>2010-08-29 15:13:16</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>110de966de874459bd3009aca71c4c45</transactionRef><transactionNumber>61276520</transactionNumber><orderId>2398</orderId><productId>Handlevogn #2029</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2029</productNumber><clientGsmNumber /><BankHash>cfab921c-ac1d-4384-b35a-e0f58dfc1b0c</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283117421
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>993852cbe06646e1ba7aa6d65f83edaf</id><date>2010-08-29 21:30:23</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>1bc5196f457749c08f17f3a05e465848</transactionRef><transactionNumber>61309033</transactionNumber><orderId>2399</orderId><productId>Handlevogn #2030</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2030</productNumber><clientGsmNumber /><BankHash>0b203ce0-a937-45f8-ae2b-83e54e193acc</BankHash><AuthenticatedStatus>None</AuthenticatedStatus><AuthenticatedWith>N</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283153028
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>8442d00e3ad943319741b81938b6fe94</id><date>2010-08-30 07:23:50</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>1c390bdad9754c42ba483f127b5dc4c3</transactionRef><transactionNumber>61321831</transactionNumber><orderId>2400</orderId><productId>Handlevogn #2031</productId><paymentMethod>VISA</paymentMethod><amount>3500</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2031</productNumber><clientGsmNumber /><BankHash>a75352b3-de7c-4c28-ae47-f07d95b9a3a1</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283167111
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>74571323d258454dac69d37dd475c6d4</id><date>2010-08-30 11:18:33</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>9c20e11f4c554dc9b18cbedacad511d2</transactionRef><transactionNumber>61345231</transactionNumber><orderId>2401</orderId><productId>Handlevogn #2032</productId><paymentMethod>VISA</paymentMethod><amount>3500</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2032</productNumber><clientGsmNumber /><BankHash>36b5e281-5871-48af-93e0-a8a7fd3a6813</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283203827
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>aca416f295a34a1da3f4520ac2abf18a</id><date>2010-08-30 21:30:27</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>d0e2b3cc44dc4edfbe0f3addc2ace202</transactionRef><transactionNumber>61405709</transactionNumber><orderId>2402</orderId><productId>Handlevogn #2033</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2033</productNumber><clientGsmNumber /><BankHash>94e42dc4-fff7-407d-ae24-3fad8452930a</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283259775
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>a0039ebc8ae5478d90009856d5ac04a7</id><date>2010-08-31 13:02:56</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>a699c98f29e84864bcdb071bac7f6a66</transactionRef><transactionNumber>61456158</transactionNumber><orderId>2403</orderId><productId>Handlevogn #2035</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2035</productNumber><clientGsmNumber /><BankHash>f8386f65-3ce3-4330-ac6e-2f0b7f387f4d</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283278469
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>e711fb50999f4899898f6f75f272a835</id><date>2010-08-31 18:14:28</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>a35a9a1024bc4966aa1e24c568bf0000</transactionRef><transactionNumber>61484730</transactionNumber><orderId>2404</orderId><productId>Handlevogn #2036</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2036</productNumber><clientGsmNumber /><BankHash>54c5a40d-a96f-4a52-824b-20ed0cd69a9d</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283279270
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>100ce69d7fcf41ce8b66e1699102b408</id><date>2010-08-31 18:27:50</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>4d151e1ec8904eb9825079e33f2b7744</transactionRef><transactionNumber>61486047</transactionNumber><orderId>2405</orderId><productId>Handlevogn #2037</productId><paymentMethod>VISA</paymentMethod><amount>3500</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2037</productNumber><clientGsmNumber /><BankHash>bb6affe3-a56c-4158-aeeb-2cdb10267f76</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283428309
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>a357b465ea754680be4bbce35353839b</id><date>2010-09-02 11:51:53</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>7f040adde7984ddaa0928b6459181f20</transactionRef><transactionNumber>61643552</transactionNumber><orderId>2408</orderId><productId>Handlevogn #2040</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2040</productNumber><clientGsmNumber /><BankHash>83874db6-6775-470f-9333-a4e791dce01a</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283460713
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>33f73cd7d75f467b8717e31703633b65</id><date>2010-09-02 20:51:58</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>f1b084d30c7f44f296b9447a2fd2c4f9</transactionRef><transactionNumber>61687075</transactionNumber><orderId>2409</orderId><productId>Handlevogn #2042</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2042</productNumber><clientGsmNumber /><BankHash>e9d5c828-7ef8-4182-b6c8-67bbf68d5bb8</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283609260
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>2b36c602d6bf4127bd7017c7a099d549</id><date>2010-09-04 14:07:44</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>b2c16494d2ea430892e31f434e14ba1c</transactionRef><transactionNumber>61804574</transactionNumber><orderId>2411</orderId><productId>Handlevogn #2044</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2044</productNumber><clientGsmNumber /><BankHash>8fd040fa-def4-489a-875c-6338467b19b4</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283766055
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>3af5a2d27767442ba33adb8ac1f3c84b</id><date>2010-09-06 09:40:57</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>34a5797f62584eddab3c9ec5a1624e48</transactionRef><transactionNumber>61907498</transactionNumber><orderId>2413</orderId><productId>Handlevogn #2046</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2046</productNumber><clientGsmNumber /><BankHash>041d5df3-a4c5-4a65-905d-5f3c28e17d1b</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283798299
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>1ec0343876dc458ca1282911faca8389</id><date>2010-09-06 18:38:19</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>fdd1407dbe064a2d8425a2103b247a12</transactionRef><transactionNumber>61960716</transactionNumber><orderId>2414</orderId><productId>Handlevogn #2047</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2047</productNumber><clientGsmNumber /><BankHash>c977e9e0-46c1-4bb6-a99d-d7588d169ab6</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283809157
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>d2a435fddacb457ca32701a33ce795be</id><date>2010-09-06 21:39:18</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>7a682ca187d8437c88fd3483567d014e</transactionRef><transactionNumber>61975518</transactionNumber><orderId>2415</orderId><productId>Handlevogn #2048</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2048</productNumber><clientGsmNumber /><BankHash>712bc131-5df9-4367-a974-4d7956e893bb</BankHash><AuthenticatedStatus>None</AuthenticatedStatus><AuthenticatedWith>N</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283876520
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>f9c5be5413c342eca866e225727ca46d</id><date>2010-09-07 16:22:00</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>b232458c8bb849a1879231398ba0d642</transactionRef><transactionNumber>62042444</transactionNumber><orderId>2419</orderId><productId>Handlevogn #2051</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2051</productNumber><clientGsmNumber /><BankHash>3603891b-812e-4dff-95ec-01e86843df9f</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1283946296
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>ff5a4ea5dbef433db472e9f0b903d92f</id><date>2010-09-08 11:45:03</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>c44f0d4906174ee59a8c01024cc93d9e</transactionRef><transactionNumber>62104987</transactionNumber><orderId>2420</orderId><productId>Handlevogn #2052</productId><paymentMethod>VISA</paymentMethod><amount>3500</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2052</productNumber><clientGsmNumber /><BankHash>4fc830ad-8395-42ab-9d0e-d005234d9e4c</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1284033493
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>c24ed26cc7dd4d1db9b3dea3424f259e</id><date>2010-09-09 11:58:18</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>8c2a0c43dbb449298b37ef24d4773744</transactionRef><transactionNumber>62190338</transactionNumber><orderId>2421</orderId><productId>Handlevogn #2053</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2053</productNumber><clientGsmNumber /><BankHash>dbe87dd5-8189-42b7-b317-5aecddd35ff3</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1284033988
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>d100ea7dc3fd498d9fb264382b88f7a4</id><date>2010-09-09 12:06:35</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>8eb9f1f45e914427af632ceb17d87f19</transactionRef><transactionNumber>62190945</transactionNumber><orderId>2422</orderId><productId>Handlevogn #2054</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2054</productNumber><clientGsmNumber /><BankHash>71021cb2-f31c-4cea-952a-895ebe1d412a</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1284054550
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>a20586f809104f1799f3b275501c3b40</id><date>2010-09-09 17:49:19</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>123aa4cddab74a36a601dd8888bb668a</transactionRef><transactionNumber>62219522</transactionNumber><orderId>2423</orderId><productId>Handlevogn #2055</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2055</productNumber><clientGsmNumber /><BankHash>e5088860-1cf8-4a5a-9261-1975d97a4bbb</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1284062934
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>67f80ba8cb154580b4dc395cea66765d</id><date>2010-09-09 20:09:02</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>5</transactionStatus><orderStatus>0</orderStatus><transactionRef>274437709fd7441f8c89ef1a52a8796f</transactionRef><transactionNumber>62230690</transactionNumber><orderId>2424</orderId><productId>Handlevogn #2057</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><errorDetails><transactionErrorCode>PaymentRefusedByFinancialInstitution</transactionErrorCode><transactionErrorDescription>Accomplish3rdParty</transactionErrorDescription><transactionThirdPartyError>REJECTED_BY_ACQUIRER_INSUFFICIENT_FUNDS</transactionThirdPartyError></errorDetails><clientAccount>0</clientAccount><productNumber>Handlevogn #2057</productNumber><clientGsmNumber /><transactionFailedReason>CreditCard_Error</transactionFailedReason><BankHash>736dcb50-c6ed-4375-b18f-6e968991b1e2</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1284118506
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>c5dd9b00c2884a6080733d666263e70c</id><date>2010-09-10 11:35:12</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>2dcd272e05b54b57b236a399bb7521ca</transactionRef><transactionNumber>62269664</transactionNumber><orderId>2425</orderId><productId>Handlevogn #2058</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2058</productNumber><clientGsmNumber /><BankHash>fd21cab2-d40a-4688-a38c-c82e68b49e9e</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1284123934
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>28a7b71a982f444291d3e1b79074f998</id><date>2010-09-10 13:05:39</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>ab508d6f7fc8449daf4ab95eff70bc06</transactionRef><transactionNumber>62279755</transactionNumber><orderId>2426</orderId><productId>Handlevogn #2059</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2059</productNumber><clientGsmNumber /><BankHash>be0c0aa6-5205-44b7-8f2e-c986710e012e</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
|
||||
|
||||
1284282203
|
||||
|
||||
array (
|
||||
'CompleteResult' => '<?xml version="1.0" encoding="utf-8" ?><payex><header name="Payex Header v1.0"><id>9d823c70fafa40a98d20003119b5aeff</id><date>2010-09-12 09:03:27</date></header><status><code>OK</code><description>OK</description><errorCode>OK</errorCode><paramName /><thirdPartyError /></status><transactionStatus>0</transactionStatus><orderStatus>0</orderStatus><transactionRef>edc6cb6b514f4c8482de2266ac4f55d7</transactionRef><transactionNumber>62380303</transactionNumber><orderId>2427</orderId><productId>Handlevogn #2061</productId><paymentMethod>VISA</paymentMethod><amount>20000</amount><alreadyCompleted>False</alreadyCompleted><clientAccount>0</clientAccount><productNumber>Handlevogn #2061</productNumber><clientGsmNumber /><BankHash>c3871cdf-4f0a-4b17-9eef-5a84cfd2cb62</BankHash><AuthenticatedStatus>3DSecure</AuthenticatedStatus><AuthenticatedWith>Y</AuthenticatedWith><fraudData>false</fraudData></payex>',
|
||||
)
|
||||
tmp
|
||||
true
|
||||
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Calendar class
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class App_Calendar_Calendar {
|
||||
private $date;
|
||||
private $month;
|
||||
private $startOfMonth;
|
||||
private $endOfMonth;
|
||||
|
||||
function __construct(DateTime $date) {
|
||||
$this->fillCalendar($date);
|
||||
}
|
||||
|
||||
function fillCalendar(DateTime $date) {
|
||||
$this->date = $date;
|
||||
|
||||
// set startofmonth to first day of month
|
||||
$this->startOfMonth = new DateTime("2000-01-01");
|
||||
$this->startOfMonth->setDate($date->format('Y'), $date->format('m'), 1);
|
||||
|
||||
// set endofmonth to last day of month
|
||||
$this->endOfMonth = new DateTime("2000-01-01");
|
||||
$this->endOfMonth->setDate($date->format('Y'), $date->format('m'), $date->format('t'));
|
||||
$this->month = new App_Calendar_Month($this->startOfMonth);
|
||||
|
||||
// fill month with weeks
|
||||
$startofweek = new DateTime("2000-01-01");
|
||||
$startofweek->setISODate($this->startOfMonth->format('o'), $this->startOfMonth->format('W')); // gets the week number
|
||||
$startofweek->setTime(0, 0);
|
||||
while ($startofweek <= $this->endOfMonth) {
|
||||
$week = new App_Calendar_Week(new DateTime($startofweek->format('Y-m-d')));
|
||||
for ($i = 1; $i <= 7; $i++) {
|
||||
$startofday = new DateTime("2000-01-01");
|
||||
$startofday->setISODate($startofweek->format('o'), $startofweek->format('W'), $i);
|
||||
$day = new App_Calendar_Day($startofday);
|
||||
$week->addDay($day);
|
||||
}
|
||||
$this->month->addWeek($week);
|
||||
|
||||
// add seven days to startofweek
|
||||
$startofweek->setISODate($startofweek->format('o'), $startofweek->format('W'), 8);
|
||||
}
|
||||
}
|
||||
|
||||
function getMonth() {
|
||||
return $this->month;
|
||||
}
|
||||
|
||||
function isInMonth(App_Calendar_Day $day) {
|
||||
if (($day->getDate() >= $this->startOfMonth) && ($day->getDate() <= $this->endOfMonth)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calendar month class
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class App_Calendar_Month {
|
||||
private $month;
|
||||
private $weeks = array();
|
||||
|
||||
function __construct(DateTime $month) {
|
||||
$this->month = $month;
|
||||
}
|
||||
|
||||
function getMonth() {
|
||||
return $this->month;
|
||||
}
|
||||
|
||||
function setMonthName($name) {
|
||||
$this->monthName = $name;
|
||||
}
|
||||
|
||||
function getMonthName() {
|
||||
return $this->monthName;
|
||||
}
|
||||
|
||||
function addWeek(App_Calendar_Week $week) {
|
||||
$this->weeks[] = $week;
|
||||
}
|
||||
|
||||
function getWeeks() {
|
||||
return $this->weeks;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calendar week class
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class App_Calendar_Week {
|
||||
private $week;
|
||||
private $days = array();
|
||||
|
||||
function __construct($week) {
|
||||
$this->week = $week;
|
||||
}
|
||||
|
||||
function getWeek() {
|
||||
return $this->week;
|
||||
}
|
||||
|
||||
function addDay(App_Calendar_Day $day) {
|
||||
$this->days[] = $day;
|
||||
}
|
||||
|
||||
function getDays() {
|
||||
return $this->days;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calendar day class
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class App_Calendar_Day {
|
||||
private $date;
|
||||
private $shifts = array();
|
||||
|
||||
function __construct(DateTime $date) {
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
function getDate() {
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
function addShift(App_Domain_WorkShift $shift) {
|
||||
$this->shifts[] = $shift;
|
||||
}
|
||||
|
||||
function getShifts() {
|
||||
return $this->shifts;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -6,13 +6,29 @@
|
||||
class App_Command_AddShift extends App_Command_Command {
|
||||
|
||||
function doExecute(App_Controller_Request $request) {
|
||||
$title = $request->getProperty("title");
|
||||
$starts = $request->getProperty("starts");
|
||||
$ends = $request->getProperty("ends");
|
||||
$numworkers = $request->getProperty("numworkers");
|
||||
$location = $request->getProperty("location");
|
||||
$group = 97; // CNS bar
|
||||
$salaryType = 3; // CNS bar
|
||||
$title = $request->getProperty("title");
|
||||
$starts = $request->getProperty("starts_date") . " " . $request->getProperty("starts_time");
|
||||
$ends = $request->getProperty("ends_date") . " " . $request->getProperty("ends_time");
|
||||
$num_workers = $request->getProperty("num_workers");
|
||||
$comment = $request->getProperty("comment");
|
||||
|
||||
$request->setProperty("location", 4); // glassbaren
|
||||
$groupid = 97; // CNS bar
|
||||
$salaryType = 3;
|
||||
|
||||
$locations = App_Domain_Location::getFinder("App_Domain_Location")->findAll();
|
||||
$location = App_Domain_location::getFinder("App_Domain_Location")->find($request->getProperty("location"));
|
||||
|
||||
$request->setObject("locations", $locations);
|
||||
|
||||
if (is_null($request->getProperty("title"))) {
|
||||
// no user data given yet, show add shift page
|
||||
$request->setProperty("starts_date", date("j/n/Y"));
|
||||
$request->setProperty("starts_time", date("H:i"));
|
||||
$request->setProperty("ends_date", date("j/n/Y"));
|
||||
$request->setProperty("ends_time", date("H:i"));
|
||||
return self::statuses('CMD_DEFAULT');
|
||||
}
|
||||
|
||||
if (empty($title)) {
|
||||
$request->addFeedback("Tittel må oppgis.");
|
||||
@@ -22,18 +38,40 @@ class App_Command_AddShift extends App_Command_Command {
|
||||
if (empty($starts)) {
|
||||
$request->addFeedback("Starttid må oppgis.");
|
||||
return self::statuses('CMD_INSUFFICIENT_DATA');
|
||||
} else {
|
||||
// change dd/mm/yyyy to dd.mm.yyyy to be on a valid date format
|
||||
$starts = str_replace("/", ".", $starts);
|
||||
}
|
||||
|
||||
if (empty($ends)) {
|
||||
$request->addFeedback("Sluttid må oppgis.");
|
||||
return self::statuses('CMD_INSUFFICIENT_DATA');
|
||||
} else {
|
||||
// change dd/mm/yyyy to dd.mm.yyyy to be on a valid date format
|
||||
$ends = str_replace("/", ".", $ends);
|
||||
}
|
||||
|
||||
if (empty($numworkers)) {
|
||||
if (empty($num_workers)) {
|
||||
$request->addFeedback("Antall må oppgis.");
|
||||
return self::statuses('CMD_INSUFFICIENT_DATA');
|
||||
}
|
||||
|
||||
$salary_type_object = App_Domain_DomainObject::getFinder("App_Domain_WorkSalaryType")->find($salaryType);
|
||||
$group = App_Domain_DomainObject::getFinder("App_Domain_Group")->find($groupid);
|
||||
|
||||
$shift = new App_Domain_WorkShift();
|
||||
$shift->setTitle($title);
|
||||
$shift->setStarts(new DateTime($starts));
|
||||
$shift->setEnds(new DateTime($ends));
|
||||
$shift->setActive(true);
|
||||
$shift->setComment($comment);
|
||||
$shift->setLocked(false);
|
||||
$shift->setAutoAssignWorkers(false);
|
||||
$shift->setNumWorkers($num_workers);
|
||||
$shift->setGroup($group);
|
||||
$shift->setSalaryType($salary_type_object);
|
||||
$shift->setLocation($location);
|
||||
|
||||
return self::statuses('CMD_OK');
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Add shift command class
|
||||
*/
|
||||
class App_Command_GetShift extends App_Command_Command {
|
||||
|
||||
function doExecute(App_Controller_Request $request) {
|
||||
if (is_null($request->getProperty("shift"))) {
|
||||
$request->addFeedback("Skift må oppgis");
|
||||
return self::statuses('CMD_INSUFFICIENT_DATA');
|
||||
}
|
||||
|
||||
$shift = App_Domain_WorkShift::getFinder("App_Domain_WorkShift")->find($request->getProperty("shift"));
|
||||
|
||||
if (is_null($shift)) {
|
||||
$request->addFeedback("Fant ikke skiftet");
|
||||
return self::statuses('CMD_ERROR');
|
||||
}
|
||||
|
||||
$request->setProperty("starts_date", $shift->getStarts()->format("j/n/Y"));
|
||||
$request->setProperty("starts_time", $shift->getStarts()->format("H:i"));
|
||||
$request->setProperty("ends_date", $shift->getEnds()->format("j/n/Y"));
|
||||
$request->setProperty("ends_time", $shift->getEnds()->format("H:i"));
|
||||
$request->setProperty("title", $shift->getTitle());
|
||||
$request->setProperty("num_workers", $shift->getNumWorkers());
|
||||
$request->setProperty("location", $shift->getLocation()->getId());
|
||||
|
||||
$locations = App_Domain_Location::getFinder("App_Domain_Location")->findAll();
|
||||
$request->setObject("locations", $locations);
|
||||
|
||||
return self::statuses('CMD_OK');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* View calendar command class
|
||||
*/
|
||||
class App_Command_ViewCalendar extends App_Command_Command {
|
||||
|
||||
function doExecute(App_Controller_Request $request) {
|
||||
if (is_null($request->getProperty("month"))) {
|
||||
// no month given, show current month
|
||||
$calendar = new App_Calendar_Calendar(new DateTime());
|
||||
} else {
|
||||
$calendar = new App_Calendar_Calendar(new DateTime($request->getProperty("month")."-01"));
|
||||
}
|
||||
|
||||
// Set month name
|
||||
$calendar->getMonth()->setMonthName($calendar->getMonth()->getMonth()->format("F"));
|
||||
|
||||
// Add shifts to calendar
|
||||
$shifts = App_Domain_Location::getFinder("App_Domain_WorkShift")->findAll();
|
||||
$shifts->rewind();
|
||||
|
||||
// initialization
|
||||
$shift = $shifts->next();
|
||||
|
||||
foreach ($calendar->getMonth()->getWeeks() as $week) {
|
||||
foreach ($week->getDays() as $day) {
|
||||
// end of day in PHP 5.2.0
|
||||
$dayends = clone $day->getDate();
|
||||
$dayends->modify("+1 day");
|
||||
|
||||
while ($shifts->valid() && ($shift->getStarts() < $dayends)) {
|
||||
//while ($shifts->valid() && ($shift->getStarts() < $day->getDate()->add(new DateInterval('P1D'))) { // Requires PHP >= 5.3.0
|
||||
|
||||
// Skip shifts that starts before current day
|
||||
if ($shift->getStarts() >= $day->getDate()) {
|
||||
$day->addShift($shift);
|
||||
}
|
||||
|
||||
// go to next shift
|
||||
$shift = $shifts->next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$request->setObject('calendar', $calendar);
|
||||
|
||||
return self::statuses('CMD_DEFAULT');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -26,6 +26,8 @@ class App_Controller_AccessManager {
|
||||
}
|
||||
|
||||
function getCommandAccess($cmd) {
|
||||
// Do the user has access to the specified command ?
|
||||
// Currently not implemented, return true if user is logged in
|
||||
if (!is_null(App_Base_SessionRegistry::getUserId())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class App_Controller_ApplicationHelper {
|
||||
$status = App_Command_Command::statuses();
|
||||
$map->addView("default", $status, "login");
|
||||
$status = App_Command_Command::statuses("CMD_OK");
|
||||
$map->addView("default", $status, "calendar");
|
||||
//$map->addView("default", $status, "");
|
||||
$status = App_Command_Command::statuses("CMD_ERROR");
|
||||
$map->addView("default", $status, "error");
|
||||
|
||||
@@ -79,11 +79,24 @@ class App_Controller_ApplicationHelper {
|
||||
$status = App_Command_Command::statuses();
|
||||
$map->addView("login", $status, "login");
|
||||
$status = App_Command_Command::statuses("CMD_OK");
|
||||
$map->addView("login", $status, "calendar");
|
||||
$map->addForward("login", $status, "view-calendar");
|
||||
|
||||
$map->addClassroot("logout", "Logout");
|
||||
//$map->addClassroot("logout", "Logout");
|
||||
|
||||
$map->addClassroot("add-shift", "AddShift");
|
||||
$status = App_Command_Command::statuses();
|
||||
$map->addView("add-shift", $status, "view-shift");
|
||||
$status = App_Command_Command::statuses("CMD_OK");
|
||||
$map->addForward("add-shift", $status, "view-calendar");
|
||||
|
||||
$map->addClassroot("view-shift", "GetShift");
|
||||
$map->addView("view-shift", App_Command_Command::statuses(), "view-shift");
|
||||
|
||||
$map->addClassroot("view-calendar", "ViewCalendar");
|
||||
$status = App_Command_Command::statuses();
|
||||
$map->addView("view-calendar", $status, "calendar");
|
||||
|
||||
App_Base_ApplicationRegistry::setControllerMap($map);
|
||||
|
||||
$appCtrl = new App_Controller_AppController(App_Base_ApplicationRegistry::getControllerMap());
|
||||
@@ -97,9 +110,6 @@ class App_Controller_ApplicationHelper {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function ensure ($expr, $message) {
|
||||
if (!$expr) {
|
||||
throw new Exception($message);
|
||||
|
||||
@@ -22,6 +22,8 @@ class App_Controller_Controller {
|
||||
while ($cmd = $app_c->getCommand($request)) {
|
||||
$cmd->execute($request);
|
||||
}
|
||||
// store modifications to database
|
||||
App_Domain_ObjectWatcher::instance()->performOperations();
|
||||
$this->invokeView($app_c->getView($request));
|
||||
}
|
||||
|
||||
|
||||
@@ -49,20 +49,20 @@ class App_Controller_Request {
|
||||
return $this->feedback;
|
||||
}
|
||||
|
||||
function getFeedbackString ($separator="\n") {
|
||||
function getFeedbackString($separator="\n") {
|
||||
return implode($separator, $this->feedback);
|
||||
}
|
||||
|
||||
function setObject( $name, $object ) {
|
||||
$this->objects[$name] = $object;
|
||||
}
|
||||
function setObject($name, $object) {
|
||||
$this->objects[$name] = $object;
|
||||
}
|
||||
|
||||
function getObject( $name ) {
|
||||
if ( isset( $this->objects[$name] ) ) {
|
||||
return $this->objects[$name];
|
||||
}
|
||||
return null;
|
||||
function getObject($name) {
|
||||
if ( isset( $this->objects[$name] ) ) {
|
||||
return $this->objects[$name];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function setCommand (App_Command_Command $cmd) {
|
||||
return $this->command = $cmd;
|
||||
|
||||
@@ -35,7 +35,13 @@ class App_Domain_Group extends App_Domain_DomainObject {
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
function setDivision(App_Domain_Division $division) {
|
||||
function setDivision($division) {
|
||||
// check if division is an instance of App_Domain_Division
|
||||
if (!is_null($division)) {
|
||||
if (!($division instanceof App_Domain_Division)) {
|
||||
throw new Exception("Division must be an instance of division class or null");
|
||||
}
|
||||
}
|
||||
$this->division = $division;
|
||||
$this->markDirty();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
class App_Domain_HelperFactory {
|
||||
const DIVISION = "App_Domain_Division";
|
||||
const GROUP = "App_Domain_Group";
|
||||
const LOCATION = "App_Domain_Location";
|
||||
const USER = "App_Domain_User";
|
||||
const USER_PHONE = "App_Domain_UserPhone";
|
||||
@@ -20,6 +21,8 @@ class App_Domain_HelperFactory {
|
||||
switch ($type) {
|
||||
case (self::DIVISION):
|
||||
return new App_Mapper_DivisionCollection();
|
||||
case (self::GROUP):
|
||||
return new App_Mapper_GroupCollection();
|
||||
case (self::LOCATION):
|
||||
return new App_Mapper_LocationCollection();
|
||||
case (self::USER):
|
||||
@@ -43,6 +46,8 @@ class App_Domain_HelperFactory {
|
||||
switch ($type) {
|
||||
case (self::DIVISION):
|
||||
return new App_Mapper_DivisionMapper();
|
||||
case (self::GROUP):
|
||||
return new App_Mapper_GroupMapper();
|
||||
case (self::LOCATION):
|
||||
return new App_Mapper_LocationMapper();
|
||||
case (self::USER):
|
||||
|
||||
@@ -15,7 +15,7 @@ abstract class App_Mapper_Collection implements Iterator {
|
||||
private $pointer;
|
||||
private $objects = array();
|
||||
|
||||
function __construct(array $raw = null, mapper_Mapper $mapper = null) {
|
||||
function __construct(array $raw = null, App_Mapper_Mapper $mapper = null) {
|
||||
if (!is_null($raw) && !is_null($mapper)) {
|
||||
$this->rewind();
|
||||
$this->raw = $raw;
|
||||
|
||||
@@ -50,7 +50,7 @@ class App_Mapper_GroupMapper extends App_Mapper_Mapper {
|
||||
$obj->setMailinglist($array["mailinglist"]);
|
||||
|
||||
// find division and create division object
|
||||
$division_mapper = new App_Domain_DivisionMapper();
|
||||
$division_mapper = new App_Mapper_DivisionMapper();
|
||||
$division = $division_mapper->find($array["division_id"]);
|
||||
$obj->setDivision($division);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class App_Mapper_Location extends App_Mapper_Collection {
|
||||
class App_Mapper_LocationCollection extends App_Mapper_Collection {
|
||||
function targetClass() {
|
||||
return "App_Domain_Location";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
class App_Mapper_UserObjectFactory extends App_Mapper_DomainObjectFactory {
|
||||
function createObject ( array $array ) {
|
||||
$obj = new App_Domain_User($array['id']);
|
||||
$obj->setname($array['name']);
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class App_Mapper_WorkSalaryTyperMapper extends App_Mapper_Mapper {
|
||||
class App_Mapper_WorkSalaryTypeMapper extends App_Mapper_Mapper {
|
||||
|
||||
function __construct() {
|
||||
// initialize database connection and common setup
|
||||
|
||||
@@ -16,7 +16,7 @@ class App_Mapper_WorkShiftMapper extends App_Mapper_Mapper {
|
||||
$this->selectStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM work_shift WHERE id=?");
|
||||
$this->selectAllStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM work_shift");
|
||||
"SELECT * FROM work_shift ORDER BY starts");
|
||||
$this->findByGroupIdStmt = self::$PDO->prepare(
|
||||
"SELECT * FROM work_shift WHERE group_id=?");
|
||||
$this->updateStmt = self::$PDO->prepare(
|
||||
@@ -54,18 +54,18 @@ class App_Mapper_WorkShiftMapper extends App_Mapper_Mapper {
|
||||
$obj->setAutoAssignWorkers($array["autoassign_workers"]);
|
||||
|
||||
// find group and create division object
|
||||
$group_mapper = new App_Domain_GroupMapper();
|
||||
$group_mapper = new App_Mapper_GroupMapper();
|
||||
$group = $group_mapper->find($array["group_id"]);
|
||||
$obj->setGroup($group);
|
||||
|
||||
// find location and create location object
|
||||
$location_mapper = new App_Domain_LocationMapper();
|
||||
$location_mapper = new App_Mapper_LocationMapper();
|
||||
$location = $location_mapper->find($array["location_id"]);
|
||||
$obj->setLocation($location);
|
||||
|
||||
// find salary type and create salary type object
|
||||
$salarytype_mapper = new App_Domain_WorkSalaryTypeMapper();
|
||||
$salarytype = $salarytype_mapper->find($array["slarytype_id"]);
|
||||
$salarytype_mapper = new App_Mapper_WorkSalaryTypeMapper();
|
||||
$salarytype = $salarytype_mapper->find($array["salarytype_id"]);
|
||||
$obj->setSalaryType($salarytype);
|
||||
|
||||
return $obj;
|
||||
@@ -86,7 +86,7 @@ class App_Mapper_WorkShiftMapper extends App_Mapper_Mapper {
|
||||
|
||||
$this->insertStmt->execute();
|
||||
$id = self::$PDO->lastInsertId();
|
||||
$this->setId($id);
|
||||
$object->setId($id);
|
||||
}
|
||||
|
||||
function update(App_Domain_DomainObject $object) {
|
||||
|
||||
@@ -2,34 +2,97 @@
|
||||
|
||||
$request = App_View_ViewHelper::getRequest();
|
||||
$currentUser = $request->getObject('currentUser');
|
||||
$calendar = $request->getObject('calendar');
|
||||
|
||||
//$venue = $request->getObject('venue');
|
||||
|
||||
include_once("Calendar.php");
|
||||
$calendar = new Calendar("barshifts");
|
||||
//$month = scriptParam("month");
|
||||
if (!empty($month)){
|
||||
$year = substr($month, 0, 4);
|
||||
$month = substr($month, 4, 2);
|
||||
}else {
|
||||
if (!is_null($request->getProperty("month"))){
|
||||
$year = substr($request->getProperty("month"), 0, 4);
|
||||
$month = substr($request->getProperty("month"), 5, 2);
|
||||
} else {
|
||||
$year = date("Y");
|
||||
$month = date("m");
|
||||
}
|
||||
|
||||
// from calendar::display()
|
||||
$previousYear = ($year - 1) . "-" . $month;
|
||||
$previousMonth = date("Y-m", strtotime("-1 month", strtotime("$year-$month-01")));
|
||||
$nextMonth = date("Y-m", strtotime("+1 month", strtotime("$year-$month-01")));
|
||||
$nextYear = ($year + 1) . "-" . $month;
|
||||
|
||||
$fDate = "$year-$month-01";
|
||||
|
||||
$dayOfWeek = date("w", strtotime("$year-$month-01"));
|
||||
if ($dayOfWeek == "0"){
|
||||
$dayOfWeek = 7;
|
||||
}
|
||||
$lastDayOfMonth = date("t", strtotime("$year-$month-01"));
|
||||
$weekNumber = date("W", strtotime("$year-$month-01"));
|
||||
|
||||
include("Common/header.php");
|
||||
?>
|
||||
|
||||
<div>
|
||||
|
||||
<h1>Vaktliste for <?=$calendar->getMonth()->getMonthName()?> <?=$year?></h1>
|
||||
|
||||
<?php
|
||||
print $request->getFeedbackString("<br />");
|
||||
?>
|
||||
<div id="calHeader">
|
||||
<div id="previous">
|
||||
<a href="<?=$_SERVER["PHP_SELF"]?>?cmd=<?=$request->getProperty('cmd')?>&month=<?php print $previousYear; ?>"><<</a>
|
||||
<a href="<?=$_SERVER["PHP_SELF"]?>?cmd=<?=$request->getProperty('cmd')?>&month=<?php print $previousMonth; ?>"><</a>
|
||||
</div>
|
||||
<div id="next">
|
||||
<a href="<?=$_SERVER["PHP_SELF"]?>?cmd=<?=$request->getProperty('cmd')?>&month=<?php print $nextMonth; ?>">></a>
|
||||
<a href="<?=$_SERVER["PHP_SELF"]?>?cmd=<?=$request->getProperty('cmd')?>&month=<?php print $nextYear; ?>">>></a>
|
||||
</div>
|
||||
|
||||
<h2><?php print(strftime("%B - %Y", strtotime($fDate))); ?></h2>
|
||||
</div>
|
||||
|
||||
<?php //$calendar->_displayCalendarOptions(); ?>
|
||||
<table class="calendar">
|
||||
<tr>
|
||||
<th>Uke</th>
|
||||
<th>Mandag</th>
|
||||
<th>Tirsdag</th>
|
||||
<th>Onsdag</th>
|
||||
<th>Torsdag</th>
|
||||
<th>Fredag</th>
|
||||
<th>Lørdag</th>
|
||||
<th>Søndag</th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
print "<h1>Vaktliste for " . $month . " " . $year . "</h1>\n";
|
||||
foreach ($calendar->getMonth()->getWeeks() as $week) {
|
||||
print "<tr>";
|
||||
print "<td class=\"weekNumber\">" . $week->getWeek()->format("W") . "</td>";
|
||||
|
||||
print $request->getFeedbackString("<br />");
|
||||
|
||||
$calendar->display($year, $month);
|
||||
foreach ($week->getDays() as $day) {
|
||||
// is the date in current month ?
|
||||
if ($calendar->isInMonth($day)) {
|
||||
print "<td class=\"active\">";
|
||||
} else {
|
||||
print "<td class=\"passive\">";
|
||||
}
|
||||
print $day->getDate()->format("j");
|
||||
|
||||
foreach ($day->getShifts() as $shift) {
|
||||
print "<div>";
|
||||
print $shift->getStarts()->format("H:i") . " <b>" . $shift->getTitle() . "</b> <a href=\"?work\">work</a>" . " <a href=\"?edit-shift\">edit</a>";
|
||||
print "<br />";
|
||||
print $shift->getEnds()->format("H:i") . " <i>" . $shift->getLocation()->getName() . "</i>";
|
||||
print "</div>";
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
include("Common/header.php");
|
||||
?>
|
||||
|
||||
<table width="1000" cellpadding="0" cellspacing="0" style="background-color: #616161;">
|
||||
<tr id="meny-top">
|
||||
<td><a href="">min side</a></td>
|
||||
<td>|</td>
|
||||
<td><a href="">aktiv</a></td>
|
||||
<td></td>
|
||||
<td><a href=""></a></td>
|
||||
<td></td>
|
||||
<td><a href=""></a></td>
|
||||
<td></td>
|
||||
<td><a href=""></a></td>
|
||||
<td></td>
|
||||
<td><a href="">logg ut</a></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="wrap" style="width:100%;padding-top: 10px;">
|
||||
<div id="content">
|
||||
<div class="text-column">
|
||||
<h1>Velkommen til Studentersamfundet Inside!</h1>
|
||||
<p>Her kan du registrere medlemskapet du har kjøpt, kjøpe medlemskap gjennom vår nettbutikk og oppdatere adressen din.
|
||||
Se også hvilke foreninger som tar inn nye medlemmer, eller hva som skjer på studentersamfundet denne uken!</p>
|
||||
|
||||
|
||||
<div class="contentElem">
|
||||
<form method="post" action="index.php?action=log-in">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="label"><label for="username">brukernavn</label></td>
|
||||
<td><input type="text" name="username" id="username" size="12" maxlength="12" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="password">passord</label></td>
|
||||
|
||||
<td><input type="password" name="password" id="password" size="12" maxlength="50" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="submit" value="logg inn" class="submit" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h3>Ny bruker?</h3>
|
||||
<p><a href="index.php?page=register-user">Registrér deg!</a></p>
|
||||
|
||||
<br />
|
||||
|
||||
<h3>Mangler du eller har du glemt brukernavn og passord?</h3>
|
||||
<p>Du kan få tilsendt brukernavn og resatt passordet ditt ved å oppgi medlemskortnummer eller epostadresse:</p>
|
||||
|
||||
<fieldset>
|
||||
<legend>Tast inn epost eller medlemskortnummer for å få tilsendt brukernavn og passord:</legend>
|
||||
<form method="post" action="index.php?action=order-password">
|
||||
<input type="text" name="userid" />
|
||||
<input type="submit" value="send bestilling" />
|
||||
</form>
|
||||
</fieldset>
|
||||
<br />
|
||||
|
||||
<h3>Noe som ikke virker?</h3>
|
||||
<p>Send epost til <a href="mailto:medlemskap@studentersamfundet.no">medlemskap@studentersamfundet.no</a>. Oppgi medlemskortnummer og en kort beskrivelse av hva som ikke virker, så skal vi hjelpe deg så fort vi kan.</p>
|
||||
</div> <!-- #text-colum -->
|
||||
</div><!-- #content -->
|
||||
|
||||
<div id="left" class="sidebar">
|
||||
<div class="column-element">
|
||||
Meny
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include("Common/footer.php");
|
||||
?>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
$request = App_View_ViewHelper::getRequest();
|
||||
$shift = $request->getObject("WorkShift");
|
||||
|
||||
include("Common/header.php");
|
||||
|
||||
|
||||
function showDate($name) {
|
||||
print "<input type=\"text\" name=\"" . $name . "_date\" size=\"8\" . maxlength=\"10\" value=\"" . date("j/n/Y") . "\" />";
|
||||
print "<input type=\"text\" name=\"" . $name . "_time\" size=\"8\" . maxlength=\"10\" value=\"" . date("H:i") . "\" />";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div>
|
||||
<h1>Legg til nytt vakt</h1>
|
||||
|
||||
<?php
|
||||
if (count($request->getFeedback()) > 0) {
|
||||
print "<div class=\"messages\">\n";
|
||||
print " <h3>Beskjeder</h3>\n";
|
||||
print " <ul>\n";
|
||||
print " <li>" . $request->getFeedbackString("</li>\n <li>") . "</li>\n";
|
||||
print " </ul>\n";
|
||||
print "</div>\n";
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="contentElem">
|
||||
<form method="post" action="<?=$_SERVER['PHP_SELF']?>?cmd=<?=$request->getProperty("cmd")?>">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="label"><label for="title">Hva</label></td>
|
||||
<td><input type="text" name="title" id="title" value="<?=$request->getProperty("title")?>" size="20" maxlength="40" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="starts">Starter</label></td>
|
||||
<td>
|
||||
<input type="text" name="starts_date" value="<?=$request->getProperty("starts_date")?>" size="8" maxlength="10" />
|
||||
<input type="text" name="starts_time" value="<?=$request->getProperty("starts_time")?>" size="4" maxlength="5" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="ends">Slutter</label></td>
|
||||
<td>
|
||||
<input type="text" name="ends_date" value="<?=$request->getProperty("ends_date")?>" size="8" maxlength="10" />
|
||||
<input type="text" name="ends_time" value="<?=$request->getProperty("ends_time")?>" size="4" maxlength="5" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="repeats">Gjentagelser</label></td>
|
||||
<td>Gjentas ikke</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="location">Hvor</label></td>
|
||||
<td>
|
||||
<select name="location" id="location">
|
||||
<?php
|
||||
$request->getObject("locations")->rewind();
|
||||
while ($location = $request->getObject("locations")->next()) {
|
||||
print "<option value=\"" . $location->getId() . "\"";
|
||||
if ($location->getId() == $request->getProperty("location")) print " selected";
|
||||
print ">" . $location->getName() . "</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="num_workers">Antall på jobb</label></td>
|
||||
<td><input type="text" name="num_workers" id="num_workers" value="<?=$request->getProperty("num_workers")?>" size="10" maxlength="20" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="comment">Evt. beskrivelse</label></td>
|
||||
<td><textarea rows="3" cols="30" name="comment" id="comment"><?=$request->getProperty("comment")?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="submit" value="legg til" class="submit" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include("Common/footer.php");
|
||||
?>
|
||||
@@ -18,6 +18,42 @@ Class Calendar {
|
||||
$nextYear = $year +1 . $month;
|
||||
|
||||
$fDate = "$year-$month-01";
|
||||
/*switch ($this->type){
|
||||
case 'events':
|
||||
$events = new Events();
|
||||
$list = $events->getListMonth($year, $month);
|
||||
break;
|
||||
|
||||
case 'concerts':
|
||||
$concerts = new Concerts();
|
||||
$list = $concerts->getListMonth($year, $month);
|
||||
break;
|
||||
|
||||
case 'all':
|
||||
$endMonth = date("Y-m", strtotime("+1 month", strtotime("$year-$month-01")));
|
||||
$sql = "SELECT id, name, DAYOFMONTH(time) AS date, 'event' AS type, time
|
||||
FROM din_event
|
||||
WHERE time >= '$year-$month-01'
|
||||
AND time < '$endMonth-01'
|
||||
UNION " .
|
||||
"SELECT id, tittel AS name, DAYOFMONTH(tid) AS date, 'concert' AS type, tid AS time
|
||||
FROM program
|
||||
WHERE tid >= '$year-$month-01'
|
||||
AND tid < '$endMonth-01'
|
||||
ORDER BY time ASC";
|
||||
$conn = db_connect();
|
||||
$list =& $conn->query($sql);
|
||||
break;
|
||||
|
||||
case 'barshifts':
|
||||
$barshifts = new BarShifts();
|
||||
$list = $barshifts->getListMonth($year, $month);
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
$dayOfWeek = date("w", strtotime("$year-$month-01"));
|
||||
if ($dayOfWeek == "0"){
|
||||
|
||||
Reference in new issue
Block a user