Added new pages and inital support for membership management for ticket booth
This commit is contained in:
1 parent
2a4b4a328f
commit
725d5a0915
7 files changed
+945
-762
No files matched your search
+36
-3
@@ -393,6 +393,15 @@ class ActionParser {
|
||||
case 'delete-bugreport' :
|
||||
$this->_deleteBugReport();
|
||||
break;
|
||||
|
||||
case 'membership-sale':
|
||||
$this->_membershipSale();
|
||||
break;
|
||||
|
||||
case 'membercard-production':
|
||||
$this->_membercardProduction();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
} else
|
||||
@@ -939,9 +948,9 @@ class ActionParser {
|
||||
$order->performOperations();
|
||||
$GLOBALS['extraScriptParams']['page'] = "transaction-confirmation";
|
||||
$GLOBALS['extraScriptParams']['transactionid'] = $transaction_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function _payexTransaction() {
|
||||
$payment = new Payment(NULL, $_POST);
|
||||
if ($payment->status == "FAILURE") {
|
||||
@@ -984,7 +993,7 @@ class ActionParser {
|
||||
} else {
|
||||
$item = new OrderItem($item_id);
|
||||
$item->setQuantity($qty);
|
||||
|
||||
|
||||
$comment = scriptParam("ordercomment$item_id");
|
||||
$item->setComment($comment);
|
||||
}
|
||||
@@ -1201,5 +1210,29 @@ class ActionParser {
|
||||
BugReport :: delete(scriptParam("bugreportid"));
|
||||
}
|
||||
|
||||
public function _membershipSale() {
|
||||
$userid = scriptParam("userid");
|
||||
|
||||
if (!empty($userid)) {
|
||||
$user = new User(scriptParam("userid"));
|
||||
$subaction = scriptParam("subaction");
|
||||
if ($subaction == "sticker-sale") {
|
||||
$user->_registerUpdate("Oblat solgt i billettbod");
|
||||
$user->updateExpiry(scriptParam("new-sticker-date"));
|
||||
$user->updateLastSticker(scriptParam("new-sticker-date"));
|
||||
} elseif ($subaction == "give-sticker") {
|
||||
$user->_registerUpdate("Gyldig medlemskap, oblat gitt i billettbod");
|
||||
$user->updateLastSticker(scriptParam("new-sticker-date"));
|
||||
}
|
||||
} else {
|
||||
error("Ukjent bruker-id : " . $userid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function _membercardProduction() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
+34
-34
@@ -1,35 +1,35 @@
|
||||
<?php
|
||||
|
||||
define("ARTIST", "1");
|
||||
define("SHOW", "2");
|
||||
|
||||
class Categories {
|
||||
var $categories;
|
||||
var $conn;
|
||||
|
||||
function Categories(){
|
||||
Categories::__construct();
|
||||
}
|
||||
|
||||
function __construct(){
|
||||
$conn =& DB::connect(getDSN());
|
||||
if (DB::isError($conn)){
|
||||
error("Categories: " . $conn->toString());
|
||||
exit();
|
||||
}else {
|
||||
$this->conn = $conn;
|
||||
}
|
||||
|
||||
$sql = "SELECT id, title FROM tf_article_category";
|
||||
$result = $this->conn->query($sql);
|
||||
if (DB::isError($result) != true){
|
||||
$this->categories = $result;
|
||||
}
|
||||
}
|
||||
|
||||
public function getCategories(){
|
||||
return $this->categories;
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
define("ARTIST", "1");
|
||||
define("SHOW", "2");
|
||||
|
||||
class Categories {
|
||||
var $categories;
|
||||
var $conn;
|
||||
|
||||
function Categories(){
|
||||
Categories::__construct();
|
||||
}
|
||||
|
||||
function __construct(){
|
||||
$conn =& DB::connect(getDSN());
|
||||
if (DB::isError($conn)){
|
||||
error("Categories: " . $conn->toString());
|
||||
exit();
|
||||
}else {
|
||||
$this->conn = $conn;
|
||||
}
|
||||
|
||||
$sql = "SELECT id, title FROM tf_article_category";
|
||||
$result = $this->conn->query($sql);
|
||||
if (DB::isError($result) != true){
|
||||
$this->categories = $result;
|
||||
}
|
||||
}
|
||||
|
||||
public function getCategories(){
|
||||
return $this->categories;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
+64
-51
@@ -5,11 +5,11 @@ class Navigation {
|
||||
public
|
||||
function display(){
|
||||
?>
|
||||
<div id="nav">
|
||||
|
||||
<div id="nav">
|
||||
|
||||
<a class="skip-nav" href="#content">hopp til innhold</a>
|
||||
<ul id="navList">
|
||||
<?php
|
||||
<?php
|
||||
if(checkAuth("view-menu-quick")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -18,14 +18,14 @@ class Navigation {
|
||||
<li><a href="index.php?page=display-current-user">oppdatér brukerinformasjon</a></li>
|
||||
<li><a href="index.php?page=change-username">endre brukernavn</a></li>
|
||||
<?php if (!isMember(getCurrentUser())){?>
|
||||
<li><a href="index.php?page=register-membership">kjøp/registrér medlemskap</a></li>
|
||||
<li><a href="index.php?page=register-membership">kjøp/registrér medlemskap</a></li>
|
||||
<?php }else if (membershipExpired(getCurrentUser())){?>
|
||||
<li><a href="index.php?page=register-membership">aktiver medlemskap</a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php
|
||||
<?php }?>
|
||||
<?php
|
||||
if(checkAuth("view-menu-messages")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -36,8 +36,8 @@ class Navigation {
|
||||
<li>ny melding</li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php
|
||||
<?php }?>
|
||||
<?php
|
||||
if(checkAuth("view-menu-jobs")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -46,12 +46,12 @@ class Navigation {
|
||||
<li><a href="index.php?page=display-jobs">vis ledige</a></li>
|
||||
<?php if(isAdmin()){
|
||||
?><li><a href="index.php?page=register-job">registrér stilling</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> <li><a href="index.php?page=display-jobs-archive">arkiv</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php
|
||||
<?php }?>
|
||||
<?php
|
||||
if(checkAuth("view-menu-barshifts")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -61,11 +61,11 @@ class Navigation {
|
||||
<li><a href="index.php?page=display-barshifts-calendar">vis kalender</a></li>
|
||||
<?php if(checkAuth("view-register-barshift")){
|
||||
?><li><a href="index.php?page=register-barshift">registrér vakt</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php
|
||||
<?php }?>
|
||||
<?php
|
||||
if(checkAuth("view-menu-events")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -75,12 +75,12 @@ class Navigation {
|
||||
<li><a href="index.php?page=display-events">kommende aktiviteter</a></li>
|
||||
<?php if(checkAuth("view-register-event")){
|
||||
?><li><a href="index.php?page=register-event">registrér aktivitet</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> <li><a href="index.php?page=display-all-calendar">kombolender</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php
|
||||
<?php }?>
|
||||
<?php
|
||||
if(checkAuth("view-menu-concerts")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -90,15 +90,15 @@ class Navigation {
|
||||
<li><a href="index.php?page=display-concerts">kommende program</a></li>
|
||||
<?php if(checkAuth("view-register-concert")){
|
||||
?><li><a href="index.php?page=register-concert">registrér arrangement</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> <?php if(checkAuth("view-week-program")){
|
||||
?><li><a href="index.php?page=week-program">ukesprogram</a></li>
|
||||
<li><a href="index.php?page=program-selection">programutvalg</a></li>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php
|
||||
<?php }?>
|
||||
<?php
|
||||
if(checkAuth("view-menu-divisions")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -107,15 +107,15 @@ class Navigation {
|
||||
<li><a href="index.php?page=display-divisions">vis foreninger</a></li>
|
||||
<?php if(checkAuth("view-register-division")){
|
||||
?><li><a href="index.php?page=register-division">registrér forening</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> <li><a href="index.php?page=display-positions">vis stillingsbeskrivelser</a></li>
|
||||
<?php if(checkAuth("view-register-position")){
|
||||
?><li><a href="index.php?page=register-position">registrér stillingsbeskrivelse</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> </ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php
|
||||
<?php }?>
|
||||
<?php
|
||||
if(checkAuth("view-menu-documents")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -126,8 +126,8 @@ class Navigation {
|
||||
?><li><a href="index.php?page=upload-document">last opp nytt</a></li>
|
||||
<?php } ?> </ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php
|
||||
<?php }?>
|
||||
<?php
|
||||
if(checkAuth("view-menu-users")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -136,22 +136,22 @@ class Navigation {
|
||||
<li><a href="index.php?page=display-users">vis medlemmer</a></li>
|
||||
<?php if(checkAuth("view-register-user")){
|
||||
?><li><a href="index.php?page=register-user">registrér medlem</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> <?php if(checkAuth("view-display-user-expiries")){
|
||||
?><li><a href="index.php?page=display-user-expiries">administrér utløpsdatoer</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> <?php if(checkAuth("view-register-membership-bankpayment")){
|
||||
?><li><a href="index.php?page=register-membership-bankpayment">registrer bankbetalinger</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> <?php if(checkAuth("view-register-user-ea-update")){
|
||||
?><li><a href="index.php?page=register-user-ea-update">registrer EA oppdatering</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> <?php if(checkAuth("view-display-division-requests")){
|
||||
?><li><a href="index.php?page=display-division-requests">vis aktivforespørseler</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> <?php if(checkAuth("view-register-usergrouprelationship")){
|
||||
?><li><a href="index.php?page=register-usergrouprelationship">registrér gruppemedlemskap</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> <?php if(checkAuth("view-display-usergrouprelationships")){
|
||||
?><li><a href="index.php?page=display-usergrouprelationships">slett gruppemedlemskap</a></li>
|
||||
<?php }
|
||||
@@ -160,11 +160,24 @@ class Navigation {
|
||||
<?php }
|
||||
?> <?php if(checkAuth("view-payex-testpage")){
|
||||
?><li><a href="index.php?page=payex-form">payex testside</a></li>
|
||||
<?php }
|
||||
<?php }
|
||||
?> </ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php
|
||||
<?php }?>
|
||||
<?php
|
||||
if(checkAuth("view-membership-sale")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
<a href="#" id="billettbodSwitch" class="switch">billettbod</a>
|
||||
<ul id="billettbodMenu" class="menu">
|
||||
<li><a href="index.php?page=membership-sale">salg av medlemskap</a></li>
|
||||
<?php if(checkAuth("view-membercard-production")){
|
||||
?><li><a href="index.php?page=membercard-production">administrer medlemskort</a></li>
|
||||
<?php }
|
||||
?> </ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php
|
||||
if(checkAuth("view-menu-access")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -178,9 +191,9 @@ class Navigation {
|
||||
<li><a href="index.php?page=register-actiongrouprelationship">registrér forhold</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
if(checkAuth("view-menu-webpages")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -190,8 +203,8 @@ class Navigation {
|
||||
<li><a href="index.php?page=register-article">registrér nyhet</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php
|
||||
<?php }?>
|
||||
<?php
|
||||
if(checkAuth("view-menu-settings")){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -215,9 +228,9 @@ class Navigation {
|
||||
<li><a href="?page=display-sms-log">Vis logg for SMS-tjeneste</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
if(isAdmin()){
|
||||
?>
|
||||
<li class="menulist">
|
||||
@@ -229,7 +242,7 @@ class Navigation {
|
||||
<li><a href="#">rediger e-post</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
|
||||
if(checkAuth("view-menu-webshop")){
|
||||
@@ -238,17 +251,17 @@ class Navigation {
|
||||
<a href="#" id="webshopSwitch" class="switch">nettbutikk</a>
|
||||
<ul id="webshopMenu" class="menu">
|
||||
<li><a href="index.php?page=display-webshop">vis produkter</a></li>
|
||||
<li><a href="index.php?page=display-carts">vis handlekurver</a></li>
|
||||
<li><a href="index.php?page=display-carts">vis handlekurver</a></li>
|
||||
<?php if (checkAuth('view-display-sales')) {?>
|
||||
<li><a href="index.php?page=display-sales">vis solgte produkter</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
|
||||
if (loggedIn()){
|
||||
?>
|
||||
?>
|
||||
<li class="menulist">
|
||||
<a href="#" id="linksSwitch" class="switch">andre sider</a>
|
||||
<ul id="linksMenu" class="menu">
|
||||
@@ -265,18 +278,18 @@ class Navigation {
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
if (loggedIn()){
|
||||
?><a href="index.php?action=log-out">logg ut</a>
|
||||
<?php
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
+729
-618
File diff suppressed because it is too large.
Load diff
+42
-18
@@ -98,10 +98,10 @@ class User {
|
||||
}
|
||||
}
|
||||
} else { //ID set, existing user
|
||||
if ($data != NULL) {
|
||||
if ($data != NULL) {
|
||||
//Update existing user
|
||||
$this->addresstype = isset ($data['addresstype']) ? "int" : "no";
|
||||
} else {
|
||||
} else {
|
||||
//Retrieve data from backend for display or other actions
|
||||
if ($data = $this->_retrieveData()) {
|
||||
$this->username = stripcslashes($data['username']);
|
||||
@@ -227,7 +227,7 @@ class User {
|
||||
}
|
||||
}
|
||||
|
||||
//Logging
|
||||
//Logging
|
||||
$sql = sprintf("INSERT INTO din_userupdate " . "VALUES (NULL, NOW(), %s, %s, %s)", $this->conn->quoteSmart($this->id), $this->conn->quoteSmart("User registered."), $this->conn->quoteSmart((getCurrentUser() == 0) ? $this->id : getCurrentUser()));
|
||||
$result = $this->conn->query($sql);
|
||||
if (DB :: isError($result) == true) {
|
||||
@@ -261,7 +261,7 @@ class User {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Slett adressen hvis den kun består av en x.
|
||||
// Slett adressen hvis den kun består av en x.
|
||||
// Brukeren får da en mail med informasjon om å oppdatere adressen sin.
|
||||
if (substr($this->street, 0, 1) == 'x') {
|
||||
$link = substr($this->street, 2);
|
||||
@@ -286,7 +286,7 @@ class User {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// ugly fix ... set address manual if the user is admin
|
||||
if (isAdmin()) {
|
||||
$this->setAddressStatus($this->validAddress);
|
||||
@@ -364,6 +364,17 @@ class User {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getId () {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getLastSticker () {
|
||||
if ($this->lastSticker > 0) {
|
||||
return $this->lastSticker;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function changeUsername($username, $password) {
|
||||
switch (checkForumUsername($username, $password)) {
|
||||
case "wrong-password" :
|
||||
@@ -422,7 +433,7 @@ class User {
|
||||
return $row->date;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getOrderId() {
|
||||
$sql = "SELECT id FROM din_order " .
|
||||
"WHERE user_id = $this->id " .
|
||||
@@ -618,7 +629,7 @@ class User {
|
||||
}
|
||||
|
||||
/**
|
||||
* Bankbetaling med KID
|
||||
* Bankbetaling med KID
|
||||
*/
|
||||
public function renewMembershipBankpayment() {
|
||||
if (false and $this->isHonorMember()) {
|
||||
@@ -713,8 +724,8 @@ class User {
|
||||
if (DB :: isError($result) != true) {
|
||||
$this->_registerUpdate("Oppdatert oblat til " . $newDate);
|
||||
$this->lastSticker = $newDate;
|
||||
notify("Oblat oppdatert.");
|
||||
|
||||
notify("Oblat oppdatert til " . $this->getLastSticker() . " for " . $this->getName() . ".");
|
||||
|
||||
// Assume that a letter is sent to the registered address.
|
||||
// We mark the address as valid, and will update it as invalid if the letter is not delivered
|
||||
$this->setAddressStatus(1);
|
||||
@@ -734,8 +745,8 @@ class User {
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
print " <td><a href=\"index.php?page=display-user&userid=" .
|
||||
$this->id . "\" title=\"mer informasjon om " .
|
||||
print " <td><a href=\"index.php?page=display-user&userid=" .
|
||||
$this->id . "\" title=\"mer informasjon om " .
|
||||
$this->firstname . " " . $this->lastname . "\">" .
|
||||
$this->firstname . "</a></td>\n";
|
||||
|
||||
@@ -847,6 +858,19 @@ class User {
|
||||
}
|
||||
}
|
||||
|
||||
public function hasCard() {
|
||||
if ($this->hasCard) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function hasCardSticker() {
|
||||
if ($this->getLastSticker() >= date("Y", strtotime($this->expires))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function getExpiryDate() {
|
||||
if (date("Y-m-d") > date("Y-11-15")) {
|
||||
return date("Y", strtotime("+1 year")) . "-12-31";
|
||||
@@ -917,7 +941,7 @@ class User {
|
||||
* 0 - not valid address
|
||||
* 1 - valid address
|
||||
* 2 - status of address unknown
|
||||
*
|
||||
*
|
||||
* @param integer $value
|
||||
* @return boolean
|
||||
**/
|
||||
@@ -936,7 +960,7 @@ class User {
|
||||
switch ($value) {
|
||||
case 1:
|
||||
$valuetext = "gyldig"; break;
|
||||
case 2:
|
||||
case 2:
|
||||
$valuetext = "ukjent"; break;
|
||||
default:
|
||||
$valuetext = "ugyldig"; break;
|
||||
@@ -1128,7 +1152,7 @@ class User {
|
||||
"action=\"javascript: setHasCard('" . $this->id . "')\" " .
|
||||
"method=\"post\">";
|
||||
} else {
|
||||
print "<form action=\"javascript: updateUserExpiry('" .
|
||||
print "<form action=\"javascript: updateUserExpiry('" .
|
||||
$this->id . "')\" method=\"get\">";
|
||||
}
|
||||
} else {
|
||||
@@ -1160,8 +1184,8 @@ class User {
|
||||
print "</form>";
|
||||
print "</td>\n";
|
||||
|
||||
print " <td id=\"user_" . $this->id . "_laststicker\">";
|
||||
print ($this->lastSticker == '0000') ? "" : $this->lastSticker;
|
||||
print "<td id=\"user_" . $this->id . "_laststicker\">";
|
||||
print $this->getLastSticker();
|
||||
print "</td>\n";
|
||||
|
||||
print " <td>";
|
||||
@@ -1363,7 +1387,7 @@ class User {
|
||||
$sendto = $this->email;
|
||||
$linkMessage = "";
|
||||
if ($link) {
|
||||
$linkMessage = "Brevet vi har forsøkt å sende kan du også " .
|
||||
$linkMessage = "Brevet vi har forsøkt å sende kan du også " .
|
||||
"lese på nett fra denne adressen:\n$link\n\n";
|
||||
}
|
||||
$subject = "Postforsendelse er ikke kommet frem til addressen din";
|
||||
@@ -1373,7 +1397,7 @@ class User {
|
||||
"om at du var ukjent på din oppgitte adresse. \n" .
|
||||
"Vi sendte brevet til følgende adresse: \"" . $this->street . ", " .
|
||||
$this->zipcode . " " . $this->postarea . "\". " .
|
||||
"På grunn av tilbakemeldingen om at du er ukjent på adressen ".
|
||||
"På grunn av tilbakemeldingen om at du er ukjent på adressen ".
|
||||
"er brevet så blitt makulert av Posten, på oppdrag av oss." .
|
||||
"\n" .
|
||||
$linkMessage .
|
||||
|
||||
+32
-32
@@ -35,29 +35,29 @@ class Users {
|
||||
"ON u.id = ugr.user_id " .
|
||||
"AND ugr.group_id = ABS($selection) " .
|
||||
"WHERE ugr.user_id IS NULL " .
|
||||
$sqladdresslimit .
|
||||
$sqladdresslimit .
|
||||
"ORDER BY name ASC " .
|
||||
"$limit";
|
||||
"$limit";
|
||||
}else {
|
||||
$sql = "SELECT DISTINCT u.id, concat(u.firstName, ' ', u.lastName) AS name " .
|
||||
"FROM din_user u, din_usergrouprelationship ugr " .
|
||||
"WHERE u.id != 0 " .
|
||||
"AND u.id = ugr.user_id " .
|
||||
"AND ugr.group_id = $selection " .
|
||||
$sqladdresslimit .
|
||||
$sqladdresslimit .
|
||||
"ORDER BY name ASC " .
|
||||
"$limit";
|
||||
"$limit";
|
||||
}
|
||||
}else {
|
||||
$selection = strtoupper($selection);
|
||||
if (is_numeric($selection)){
|
||||
$sql = "SELECT DISTINCT u.id
|
||||
$sql = "SELECT DISTINCT u.id
|
||||
FROM din_user u
|
||||
WHERE u.cardno = $selection";
|
||||
}else {
|
||||
// Add wildcards around and between words
|
||||
$selection = "%" . str_replace(" ", "% %", $selection) . "%";
|
||||
|
||||
|
||||
$sql = "SELECT DISTINCT u.id
|
||||
FROM din_user u
|
||||
WHERE CONCAT(UPPER(u.firstName), ' ', UPPER(u.lastName)) LIKE '$selection'
|
||||
@@ -68,17 +68,17 @@ class Users {
|
||||
ORDER BY u.firstname, u.lastname ASC
|
||||
$limit";
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = $this->conn->query($sql);
|
||||
if (DB::isError($result) != true){
|
||||
$this->users = $result;
|
||||
}else {
|
||||
error($result->toString());
|
||||
}
|
||||
return $this->users;
|
||||
return $this->users;
|
||||
}
|
||||
|
||||
public
|
||||
public
|
||||
function displayExpiryList($selection = 2, $limit = 25, $expiry = '0000-00-00', $format = "screen"){
|
||||
switch ($expiry){
|
||||
case 'lifetime':
|
||||
@@ -104,14 +104,14 @@ class Users {
|
||||
break;
|
||||
case 'all':
|
||||
$expression = '1';
|
||||
break;
|
||||
break;
|
||||
}
|
||||
$sql = "SELECT u.id
|
||||
FROM din_user u, din_usergrouprelationship ugr
|
||||
WHERE $expression
|
||||
AND u.id = ugr.user_id
|
||||
AND ugr.group_id = $selection
|
||||
LIMIT $limit";
|
||||
LIMIT $limit";
|
||||
$result = $this->conn->query($sql);
|
||||
if (DB::isError($result) == true) {
|
||||
error($result->toString());
|
||||
@@ -134,7 +134,7 @@ class Users {
|
||||
<th>registrert</th>
|
||||
<th>sist endret</th>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
while ($row =& $result->fetchRow(DB_FETCHMODE_OBJECT)){
|
||||
$user = new User($row->id);
|
||||
$user->displayExpiryList($expiry);
|
||||
@@ -159,12 +159,12 @@ class Users {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function displayExpiryListSearch($search){
|
||||
|
||||
$selection = strtoupper($search);
|
||||
if (is_numeric($selection)){
|
||||
$sql = "SELECT DISTINCT u.id
|
||||
$sql = "SELECT DISTINCT u.id
|
||||
FROM din_user u
|
||||
WHERE u.cardno = $selection " .
|
||||
"OR u.id = $selection";
|
||||
@@ -195,7 +195,7 @@ class Users {
|
||||
<th>registrert</th>
|
||||
<th>sist endret</th>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
while ($row =& $result->fetchRow(DB_FETCHMODE_OBJECT)){
|
||||
$user = new User($row->id);
|
||||
$user->displayExpiryList();
|
||||
@@ -222,7 +222,7 @@ class Users {
|
||||
<th>telefon</th>
|
||||
<th>grupper</th>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
while ($row =& $this->users->fetchRow(DB_FETCHMODE_OBJECT)){
|
||||
$user = new User($row->id);
|
||||
$user->displayList();
|
||||
@@ -248,7 +248,7 @@ AND ugr.group_id = g.id
|
||||
AND u.id = $currentUser
|
||||
AND g.admin = 1
|
||||
AND g.division_id = d.id
|
||||
AND udr.division_id_request = d.id";
|
||||
AND udr.division_id_request = d.id";
|
||||
}
|
||||
$result = $this->conn->query($sql);
|
||||
if (DB::isError($result) != true){
|
||||
@@ -285,10 +285,10 @@ AND udr.division_id_request = d.id";
|
||||
print("<p>Ingen forespørseler registrert.</p>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get number of users with study place affiliations
|
||||
*
|
||||
*
|
||||
* @param none
|
||||
* @return mixed array
|
||||
**/
|
||||
@@ -299,19 +299,19 @@ AND udr.division_id_request = d.id";
|
||||
} else {
|
||||
$sql = "SELECT s.navn AS studyPlace, COUNT(*) AS count FROM din_user u INNER JOIN studiesteder s ON u.placeOfStudy=s.id GROUP BY placeOfStudy ORDER BY studyPlace";
|
||||
}
|
||||
|
||||
|
||||
$result = $this->conn->query($sql);
|
||||
if (DB::isError($result) != true) {
|
||||
$this->usersStudyPlaceList = $result;
|
||||
} else {
|
||||
error($result->toString());
|
||||
}
|
||||
return $this->usersStudyPlaceList;
|
||||
return $this->usersStudyPlaceList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get max number of users for one study place affiliations
|
||||
*
|
||||
*
|
||||
* @param none
|
||||
* @return mixed array
|
||||
**/
|
||||
@@ -322,7 +322,7 @@ AND udr.division_id_request = d.id";
|
||||
} else {
|
||||
$sql = "SELECT COUNT(*) AS count FROM din_user GROUP BY placeOfStudy ORDER BY count DESC LIMIT 1";
|
||||
}
|
||||
|
||||
|
||||
$result = $this->conn->query($sql);
|
||||
if (DB::isError($result) != true) {
|
||||
$this->usersStudyPlaceMax = $result->fetchRow(DB_FETCHMODE_OBJECT);
|
||||
@@ -332,10 +332,10 @@ AND udr.division_id_request = d.id";
|
||||
}
|
||||
return $this->usersStudyPlaceMax;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* List number of users with study place affiliations
|
||||
*
|
||||
*
|
||||
* @param none
|
||||
* @return none
|
||||
**/
|
||||
@@ -345,18 +345,18 @@ AND udr.division_id_request = d.id";
|
||||
if (!isset($this->usersStudyPlaceList)) $this->getUsersStudyPlaceList($year);
|
||||
|
||||
print "<h2>Oversikt over hvor medlemmene har registrert at de studerer</h2>\n";
|
||||
|
||||
|
||||
print "<p>";
|
||||
print "<a href=\"" . $_SERVER["PHP_SELF"] . "?page=" . $_GET["page"] . "\">Vis alle</a> | ";
|
||||
print "<a href=\"" . $_SERVER["PHP_SELF"] . "?page=" . $_GET["page"] . "&year=current\">inneværende år</a>";
|
||||
print "</p>";
|
||||
|
||||
|
||||
if ($year) {
|
||||
print "<p>Viser oversikt over studiestuder for alle som har betalt medlemskap i nåværende år.</p>";
|
||||
} else {
|
||||
print "<p>Viser alle medlemmer som noensinne har registrert seg.</p>";
|
||||
}
|
||||
|
||||
|
||||
$n = 0;
|
||||
if ($this->usersStudyPlaceList->numRows() > 0) {
|
||||
$scalefactor = 600/($this->getMaxUsersStudyPlace($year));
|
||||
@@ -365,7 +365,7 @@ AND udr.division_id_request = d.id";
|
||||
print "<th>Studiested</th>";
|
||||
print "<th colspan=\"2\">Antall</th>";
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
while ($row =& $this->usersStudyPlaceList->fetchRow(DB_FETCHMODE_OBJECT)) {
|
||||
print "<tr>";
|
||||
print "<td>" . $row->studyPlace . "</td>";
|
||||
@@ -403,7 +403,7 @@ AND udr.division_id_request = d.id";
|
||||
// KID betaling
|
||||
$n++;
|
||||
$payment = array();
|
||||
$payment["date"] = mktime(0,0,0, substr($payment_line,17,2),
|
||||
$payment["date"] = mktime(0,0,0, substr($payment_line,17,2),
|
||||
substr($payment_line,15,2),
|
||||
substr($payment_line,19,2));
|
||||
$payment["amount"] = intval(substr($payment_line,40,7)) . "," . substr($payment_line,47,2);
|
||||
@@ -443,7 +443,7 @@ AND udr.division_id_request = d.id";
|
||||
|
||||
/**
|
||||
* Update addresses from a CSV file recieved through EA
|
||||
*
|
||||
*
|
||||
* @param string eafile
|
||||
* @return boolean
|
||||
**/
|
||||
|
||||
+8
-6
@@ -6,7 +6,7 @@ if (!isset($_SESSION['tinyMCE']['theme'])){
|
||||
$_SESSION['tinyMCE']['theme'] = "simple";
|
||||
}
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
|
||||
$locale = Array('no_NO', 'nor_nor');
|
||||
setlocale(LC_TIME, $locale);
|
||||
|
||||
@@ -17,7 +17,7 @@ require_once "language.php";
|
||||
set_include_path("../includes");
|
||||
|
||||
$include_path = "../includes/";
|
||||
|
||||
|
||||
//PEAR-class
|
||||
require_once $include_path."DB.php";
|
||||
|
||||
@@ -90,7 +90,7 @@ require_once "WeekPrograms.php";
|
||||
if (isAdmin()){
|
||||
error_reporting(E_ALL);
|
||||
}else {
|
||||
error_reporting(0);
|
||||
error_reporting(0);
|
||||
}
|
||||
|
||||
//cookies
|
||||
@@ -163,7 +163,7 @@ $sections = Array("display-barshifts" => "barshifts",
|
||||
"display-division-requests" => "users",
|
||||
"display-divisions" => "divisions",
|
||||
"display-documents" => "documents",
|
||||
"display-event" => "events",
|
||||
"display-event" => "events",
|
||||
"display-events" => "events",
|
||||
"display-events-archive" => "events",
|
||||
"display-events-calendar" => "events",
|
||||
@@ -201,7 +201,9 @@ $sections = Array("display-barshifts" => "barshifts",
|
||||
"edit-product" => "webshop",
|
||||
"edit-user" => "users",
|
||||
"edit-usergrouprelationship" => "users",
|
||||
"payex-form" => "users",
|
||||
"membercard-production" => "billettbod",
|
||||
"membership-sale" => "billettbod",
|
||||
"payex-form" => "users",
|
||||
"register-action" => "access",
|
||||
"register-actiongrouprelationship" => "access",
|
||||
"register-article" => "webpages",
|
||||
@@ -225,7 +227,7 @@ $sections = Array("display-barshifts" => "barshifts",
|
||||
"renew-membership" => "users",
|
||||
"reset-password" => "",
|
||||
"upload-document" => "documents",
|
||||
"week-program" => "concerts"
|
||||
"week-program" => "concerts"
|
||||
);
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user