ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPaymentBookings Class Reference
+ Collaboration diagram for ilPaymentBookings:

Public Member Functions

 __construct ($a_user_id= '', $a_admin_view=false)
 setBookingId ($a_booking_id)
 getBookingId ()
 setTransaction ($a_transaction)
 getTransaction ()
 setPobjectId ($a_pobject_id)
 getPobjectId ()
 setCustomerId ($a_customer_id)
 getCustomerId ()
 setVendorId ($a_vendor_id)
 getVendorId ()
 setPayMethod ($a_pay_method)
 getPayMethod ()
 setOrderDate ($a_order_date)
 getOrderDate ()
 setDuration ($a_duration)
 getDuration ()
 setUnlimitedDuration ($a_unlimited_duration)
 getUnlimitedDuration ()
 setPriceType ($a_price_type)
 getPriceType ()
 setPrice ($a_price)
 getPrice ()
 setDiscount ($a_discount)
 getDiscount ()
 setPayed ($a_payed)
 getPayedStatus ()
 setAccess ($a_access)
 getAccessStatus ()
 setVoucher ($a_voucher)
 getVoucher ()
 setTransactionExtern ($a_transaction_extern)
 getTransactionExtern ()
 getStreet ()
 setStreet ($a_street, $a_house_nr)
 getPoBox ()
 setPoBox ($a_po_box)
 getZipcode ()
 setZipcode ($a_zipcode)
 getCity ()
 setCity ($a_city)
 getCountry ()
 setCountry ($a_country)
 setVatUnit ($a_vat_unit)
 getVatUnit ()
 setVatRate ($a_vat_rate)
 getVatRate ()
 setObjectTitle ($a_object_title)
 getObjectTitle ()
 setEmailExtern ($a_email_extern)
 getEmailExtern ()
 setNameExtern ($a_name_extern)
 getNameExtern ()
 setCurrencyUnit ($a_currency_unit)
 getCurrencyUnit ()
 setAccessStartdate ($a_access_startdate)
 getAccessStartdate ()
 setAccessEnddate ($a_access_enddate)
 getAccessEnddate ()
 setAccessExtension ($a_access_extension)
 getAccessExtension ()
 add ()
 update ()
 delete ()
 getBookings ()
 getBooking ($a_booking_id)
 __read ()
 __getVendorIds ()
 getDistinctTransactions ($a_user_id)
 getBookingsByPaymethod ($pay_method)
 deleteAddressesByPaymethod ($pay_method)
 getUniqueTitles ()

Static Public Member Functions

static getBookingsOfCustomer ($a_usr_id)
static _getCountBookingsByVendor ($a_vendor_id)
static _getCountBookingsByCustomer ($a_vendor_id)
static _getCountBookingsByObject ($a_pobject_id)
static _hasAccess ($a_pobject_id, $a_user_id=0, $a_transaction=0)
static __readBillByTransaction ($a_user_id, $a_transaction_nr)
static _readBookingByTransaction ($a_transaction)
static _hasAccesstoExtensionPrice ($a_user_id, $a_pobject_id)
static _lookupOrder ($a_pobject_id)

Data Fields

 $user_id = null
 $db = null
 $bookings = array()
 $booking_id = null
 $transaction = null
 $pobject_id = null
 $customer_id = null
 $vendor_id = null
 $pay_method = null
 $order_date = null
 $duration = 0
 $unlimited_duration = 0
 $price = 0
 $discount = 0
 $transaction_extern = null
 $vat_unit = 0
 $object_title = null
 $payed = null
 $access = null
 $voucher = null
 $street = null
 $house_nr = null
 $po_box = null
 $zipcode = null
 $city = null
 $country = null
 $email_extern = null
 $name_extern = null
 $currency_unit = null
 $access_startdate = null
 $access_enddate = null
 $admin_view = false
 $access_extension = false

Private Member Functions

 __checkExtensionDependencies ()
 __calculateAccessEnddate ()

Private Attributes

 $price_type = null

Detailed Description

Definition at line 14 of file class.ilPaymentBookings.php.

Constructor & Destructor Documentation

ilPaymentBookings::__construct (   $a_user_id = '',
  $a_admin_view = false 
)

Definition at line 62 of file class.ilPaymentBookings.php.

References __read(), and ilPaymentSettings\_getInstance().

{
global $ilDB;
$this->admin_view = $a_admin_view;
$this->user_id = $a_user_id;
$this->db = $ilDB;
include_once './Services/Payment/classes/class.ilPaymentSettings.php';
$this->currency_unit = $genSet->get('currency_unit');
if($a_user_id)
{
$this->__read();
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilPaymentBookings::__calculateAccessEnddate ( )
private

Definition at line 400 of file class.ilPaymentBookings.php.

References $access_enddate, $duration, getAccessStartdate(), getDuration(), IL_CAL_DATETIME, and setAccessEnddate().

Referenced by __checkExtensionDependencies(), and add().

{
include_once('Services/Calendar/classes/class.ilDateTime.php');
$start_date = $tmp_ts->getUnixTime();
$duration = $this->getDuration();
$startDateYear = date("Y", $start_date);
$startDateMonth = date("m", $start_date);
$startDateDay = date("d", $start_date);
$startDateHour = date("H", $start_date);
$startDateMinute = date("i",$start_date);
$startDateSecond = date("s", $start_date);
$access_enddate = date("Y-m-d H:i:s", mktime($startDateHour, $startDateMinute, $startDateSecond,
$startDateMonth + $duration, $startDateDay, $startDateYear));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentBookings::__checkExtensionDependencies ( )
private

Definition at line 339 of file class.ilPaymentBookings.php.

References __calculateAccessEnddate(), getCustomerId(), getDuration(), getOrderDate(), getPobjectId(), and setAccessStartdate().

Referenced by add().

{
global $ilDB;
$ilDB->setLimit(1,0);
// check unlimited_duration
$res_1 = $ilDB->queryF('SELECT * FROM payment_statistic
WHERE pobject_id = %s
AND customer_id = %s
AND duration = %s
AND access_enddate = %s',
array('integer','integer', 'integer', 'timestamp'),
array($this->getPobjectId(), $this->getCustomerId(), 0, NULL)
);
$row_1 = $ilDB->fetchAssoc($res_1);
if(count($row_1) > 0 )
{
// error: user already has unlimited duration. not able to extend ...
return false;
}
// get last access_enddate
$res_2 = $ilDB->queryF('SELECT * FROM payment_statistic
WHERE pobject_id = %s
AND customer_id = %s
ORDER BY access_enddate DESC',
array('integer','integer'),
array($this->getPobjectId(), $this->getCustomerId())
);
$row_2 = $ilDB->fetchAssoc($res_2);
if(count($row_2) > 0)
{
//user has already bought this object
// use access_enddate as startdate
$old_enddate = $row_2['access_enddate']; # Y-m-d H:i:s
$current_date = date("Y-m-d H:i:s", $this->getOrderDate());
if($old_enddate <= $current_date)
{
// Zugriff ist abgelaufen, nimm das aktuelle Datum als startdate
$this->setAccessStartdate($current_date);
}
else
{
// der Zugriff ist noch nicht abgelaufen, nimm enddate als startdate
$this->setAccessStartdate($old_enddate);
}
if($this->getDuration() > 0)
{
}
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentBookings::__getVendorIds ( )

Definition at line 865 of file class.ilPaymentBookings.php.

References $user_id, ilPaymentTrustees\_getVendorsForStatisticsByTrusteeId(), and ilPaymentTrustees\_hasStatisticPermissionByVendor().

Referenced by __read(), and getUniqueTitles().

{
if(ilPaymentVendors::_isVendor($this->user_id))
{
$vendors[] = $this->user_id;
}
if(isset ($vend))
{
foreach($vend as $v)
{
{
$vendors[] = $v;
}
}
}
return $vendors ? $vendors : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentBookings::__read ( )

Definition at line 720 of file class.ilPaymentBookings.php.

References $_SESSION, $ilUser, $query, $res, $row, and __getVendorIds().

Referenced by __construct().

{
global $ilUser;
if(ANONYMOUS_USER_ID == $ilUser->getId())
return false;
$data = array();
$data_types = array();
$query = 'SELECT * FROM payment_statistic ps '
. 'INNER JOIN payment_objects po ON po.pobject_id = ps.pobject_id ';
if($_SESSION['pay_statistics']['customer'])
{
$query .= 'LEFT JOIN usr_data ud ON ud.usr_id = ps.customer_id ';
}
if($_SESSION['pay_statistics']['vendor'] && $this->admin_view)
{
$query .= 'LEFT JOIN usr_data udv ON udv.usr_id = ps.b_vendor_id ';
}
$query .= 'WHERE 1 = 1 ';
if ($_SESSION['pay_statistics']['transaction_value'] != '')
{
if ($_SESSION['pay_statistics']['transaction_type'] == 0)
{
$query .= "AND transaction_extern LIKE %s ";
$data_types[] = 'text';
$data[] = $_SESSION['pay_statistics']['transaction_value'].'%';
}
else if ($_SESSION['pay_statistics']['transaction_type'] == 1)
{
$query .= "AND transaction_extern LIKE %s ";
$data_types[] = 'text';
$data[] = '%'.$_SESSION['pay_statistics']['transaction_value'];
}
}
if ($_SESSION['pay_statistics']['customer'] != '')
{
$query .= "AND ud.login LIKE %s ";
$data_types[] = 'text';
$data[] = '%'.$_SESSION['pay_statistics']['customer'].'%';
}
if ($_SESSION['pay_statistics']['from']['date']['d'] != '' &&
$_SESSION['pay_statistics']['from']['date']['m'] != '' &&
$_SESSION['pay_statistics']['from']['date']['y'] != '')
{
$from = mktime(0, 0, 0, $_SESSION['pay_statistics']['from']['date']['m'],
$_SESSION['pay_statistics']['from']['date']['d'],
$_SESSION['pay_statistics']['from']['date']['y']);
$query .= 'AND order_date >= %s ';
$data_types[] = 'integer';
$data[] = $from;
}
if ($_SESSION['pay_statistics']['til']['date']['d'] != '' &&
$_SESSION['pay_statistics']['til']['date']['m'] != '' &&
$_SESSION['pay_statistics']['til']['date']['y'] != '')
{
$til = mktime(23, 59, 59, $_SESSION['pay_statistics']['til']['date']['m'],
$_SESSION['pay_statistics']['til']['date']['d'],
$_SESSION['pay_statistics']['til']['date']['y']);
$query .= 'AND order_date <= %s ';
$data_types[] = 'integer';
$data[] = $til;
}
if ($_SESSION['pay_statistics']['payed'] == '0' ||
$_SESSION['pay_statistics']['payed'] == '1')
{
$query .= 'AND payed = %s ';
$data_types[] = 'integer';
$data[] = $_SESSION['pay_statistics']['payed'];
}
if ($_SESSION['pay_statistics']['access'] == '0' ||
$_SESSION['pay_statistics']['access'] == '1')
{
$query .= 'AND access_granted = %s ';
$data_types[] = 'integer';
$data[] = $_SESSION['pay_statistics']['access'];
}
if ($_SESSION['pay_statistics']['pay_method'] == '1' ||
$_SESSION['pay_statistics']['pay_method'] == '2' ||
$_SESSION['pay_statistics']['pay_method'] == '3')
{
$query .= 'AND b_pay_method = %s ';
$data_types[] = 'integer';
$data[] = $_SESSION['pay_statistics']['pay_method'];
}
if(!$this->admin_view)
{
$vendors = $this->__getVendorIds();
if (is_array($vendors) &&
count($vendors) > 1)
{
$query .= ' AND '.$this->db->in('ps.b_vendor_id', $vendors, false, 'integer').' ';
}
else if(is_array($vendors) && count($vendors) == 1)
{
$query .= 'AND ps.b_vendor_id = %s ';
$data[] = $vendors['0'];
$data_types[] = 'integer';
}
if((int)$_SESSION['pay_statistics']['filter_title_id'])
{
$query .= "AND po.ref_id = ".(int)$_SESSION['pay_statistics']['filter_title_id']." ";
}
}
else
{
if($_SESSION['pay_statistics']['vendor'])
{
$query .= 'AND udv.login LIKE %s ';
$data[] = '%'.$_SESSION['pay_statistics']['vendor'].'%';
$data_types[] = 'text';
}
if((int)$_SESSION['pay_statistics']['adm_filter_title_id'])
{
$query .= "AND po.ref_id = ".(int)$_SESSION['pay_statistics']['adm_filter_title_id']." ";
}
}
$query .= 'ORDER BY order_date DESC';
$cnt_data = count($data);
$cnt_data_types = count($data_types);
if($cnt_data == 0 || $cnt_data_types == 0)
{
$res = $this->db->query($query);
}
else
{
$res= $this->db->queryf($query, $data_types, $data);
}
while($row = $this->db->fetchAssoc($res))
{
$this->bookings[$row['booking_id']] = $row;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilPaymentBookings::__readBillByTransaction (   $a_user_id,
  $a_transaction_nr 
)
static

Definition at line 888 of file class.ilPaymentBookings.php.

References $bookings, $query, $res, and $row.

Referenced by ilShopBoughtObjectsGUI\createBill().

{
global $ilDB;
$query = 'SELECT * FROM payment_statistic as ps, payment_objects as po
WHERE ps.pobject_id = po.pobject_id
AND customer_id = %s
AND transaction = %s';
$res = $ilDB->queryF($query, array('integer','text'), array($a_user_id, $a_transaction_nr));
while($row = $ilDB->fetchAssoc($res))
{
}
return $bookings;
}

+ Here is the caller graph for this function:

static ilPaymentBookings::_getCountBookingsByCustomer (   $a_vendor_id)
static

Definition at line 622 of file class.ilPaymentBookings.php.

References $res, and $row.

{
global $ilDB;
if(ANONYMOUS_USER_ID == $a_vendor_id)
return 0;
$res = $ilDB->queryf('
SELECT COUNT(booking_id) bid FROM payment_statistic
WHERE customer_id = %s',
array('integer'),
array($a_vendor_id));
while($row = $ilDB->fetchObject($res))
{
return $row->bid;
}
return 0;
}
static ilPaymentBookings::_getCountBookingsByObject (   $a_pobject_id)
static

Definition at line 642 of file class.ilPaymentBookings.php.

References $res, and $row.

Referenced by ilPaymentObjectGUI\deleteObject(), ilObjPaymentSettingsGUI\deleteObjectObject(), ilObjPaymentSettingsGUI\editDetailsObject(), and ilObjPaymentSettingsGUI\objectsObject().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT COUNT(booking_id) bid FROM payment_statistic
WHERE pobject_id = %s',
array('integer'),
array($a_pobject_id));
while($row = $ilDB->fetchObject($res))
{
return $row->bid;
}
return 0;
}

+ Here is the caller graph for this function:

static ilPaymentBookings::_getCountBookingsByVendor (   $a_vendor_id)
static

Definition at line 605 of file class.ilPaymentBookings.php.

References $res, and $row.

Referenced by ilObjPaymentSettingsGUI\deleteVendorsObject(), and ilObjPaymentSettingsGUI\vendorsObject().

{
global $ilDB;
$res = $ilDB->queryf(
'SELECT COUNT(booking_id) bid FROM payment_statistic
WHERE b_vendor_id = %s',
array('integer'),
array($a_vendor_id));
while($row = $ilDB->fetchAssoc($res))
{
return $row['bid'];
}
return 0;
}

+ Here is the caller graph for this function:

static ilPaymentBookings::_hasAccess (   $a_pobject_id,
  $a_user_id = 0,
  $a_transaction = 0 
)
static

Definition at line 659 of file class.ilPaymentBookings.php.

References $ilUser, $res, $row, and $usr_id.

Referenced by ilPaymentObject\_hasAccess(), and ilObjectListGUI\insertPayment().

{
global $ilDB, $ilUser;
if(ANONYMOUS_USER_ID == $ilUser->getId() && !$a_transaction)
{
return false;
}
else
if($a_transaction)
{
$res = $ilDB->queryf('
SELECT * FROM payment_statistic
WHERE pobject_id = %s
AND transaction = %s
AND payed = %s
AND access_granted = %s',
array('integer','text', 'integer', 'integer'),
array($a_pobject_id, $a_transaction, '1', '1'));
}
else
{
$usr_id = $a_user_id ? $a_user_id : $ilUser->getId();
$res = $ilDB->queryf('
SELECT order_date, duration, access_startdate, access_enddate
FROM payment_statistic
WHERE pobject_id = %s
AND customer_id = %s
AND payed = %s
AND access_granted = %s',
array('integer', 'integer', 'integer', 'integer'),
array($a_pobject_id, $usr_id, '1', '1'));
}
while($row = $ilDB->fetchAssoc($res))
{
if($row['duration'] == 0 && $row['access_enddate'] == NULL)
{
return true;
}
else
if($row['access_startdate'] == NULL)
{
if(time() >= $row['order_date']
&& date("Y-m-d H:i:s") <= $row['access_enddate'])
{
return true;
}
}
else
if (date("Y-m-d H:i:s") >= $row['access_startdate']
&& date("Y-m-d H:i:s") <= $row['access_enddate'])
{
return true;
}
}
return false;
}

+ Here is the caller graph for this function:

static ilPaymentBookings::_hasAccesstoExtensionPrice (   $a_user_id,
  $a_pobject_id 
)
static

Definition at line 1019 of file class.ilPaymentBookings.php.

References $res, and $row.

Referenced by ilShopPurchaseGUI\showDetails().

{
global $ilDB;
$res = $ilDB->queryF('SELECT * FROM payment_statistic
WHERE customer_id = %s AND pobject_id = %s
AND duration > %s',
array('integer','integer', 'integer'),
array($a_user_id, $a_pobject_id, 0));
if($row = $ilDB->numRows($res))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilPaymentBookings::_lookupOrder (   $a_pobject_id)
static

Definition at line 1035 of file class.ilPaymentBookings.php.

References $ilUser, $res, and $row.

Referenced by ilObjectListGUI\insertPayment().

{
global $ilUser, $ilDB;
$booking = array();
$res = $ilDB->queryF('
SELECT order_date, duration
FROM payment_statistic
WHERE pobject_id = %s
AND customer_id = %s
ORDER BY order_date DESC',
array('integer', 'integer'),
array($a_pobject_id, $ilUser->getId()));
while($row = $ilDB->fetchAssoc($res))
{
$booking = $row;
break;
}
return $booking;
}

+ Here is the caller graph for this function:

static ilPaymentBookings::_readBookingByTransaction (   $a_transaction)
static

Definition at line 953 of file class.ilPaymentBookings.php.

References $res, $row, and $user_id.

Referenced by ilObjFileGUI\executeCommand().

{
global $ilDB;
$trans_exp = explode('_', $a_transaction);
$user_id = $trans_exp[1];
$res = $ilDB->queryF('SELECT * FROM payment_statistic
WHERE transaction = %s
AND payed = %s
AND access_granted = %s
AND customer_id = %s',
array('text', 'integer','integer','integer'),
array($a_transaction, 1,1, (int)$user_id));
if($row = $ilDB->numRows($res))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilPaymentBookings::add ( )

Definition at line 422 of file class.ilPaymentBookings.php.

References __calculateAccessEnddate(), __checkExtensionDependencies(), ilPayMethods\_EnabledSaveUserAddress(), getAccessEnddate(), getAccessExtension(), getAccessStartdate(), getAccessStatus(), getCity(), getCountry(), getCurrencyUnit(), getCustomerId(), getDiscount(), getDuration(), getEmailExtern(), getNameExtern(), getObjectTitle(), getOrderDate(), getPayedStatus(), getPayMethod(), getPobjectId(), getPoBox(), getPrice(), getPriceType(), getStreet(), getTransaction(), getTransactionExtern(), getVatRate(), getVatUnit(), getVendorId(), getVoucher(), getZipcode(), setAccessStartdate(), ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

{
include_once './Services/Payment/classes/class.ilPaymentPrices.php';
switch($this->getPriceType())
{
// do nothing. access_startdate, access_enddate is already set
break;
if($this->getAccessExtension() == 1)
{
}
else
{
$this->setAccessStartdate(date('Y-m-d H:i:s', $this->getOrderDate()));
if($this->getDuration() > 0)
{
}
}
break;
default:
return false; // price_type_not_set!!!
break;
}
$next_id = $this->db->nextId('payment_statistic');
{
$statement = $this->db->insert('payment_statistic',
array(
'booking_id' => array('integer', $next_id),
'transaction' => array('text', $this->getTransaction()),
'pobject_id' => array('integer', $this->getPobjectId()),
'customer_id' => array('integer', $this->getCustomerId()),
'b_vendor_id' => array('integer', $this->getVendorId()),
'b_pay_method' => array('integer', $this->getPayMethod()),
'order_date' => array('integer', $this->getOrderDate()),
'duration' => array('text', $this->getDuration()),
'price' => array('float', $this->getPrice()),
'discount' => array('float', $this->getDiscount()),
'payed' => array('integer', $this->getPayedStatus()),
'access_granted'=> array('integer', $this->getAccessStatus()),
'voucher' => array('text', $this->getVoucher()),
'transaction_extern'=> array('text',$this->getTransactionExtern()),
'street' => array('text', $this->getStreet()),
'po_box' => array('text', $this->getPoBox()),
'zipcode' => array('text', $this->getZipcode()),
'city' => array('text', $this->getCity()),
'country' => array('text', $this->getCountry()),
'vat_rate' => array('float', $this->getVatRate()),
'vat_unit' => array('float', $this->getVatUnit()),
'object_title' => array('text', $this->getObjectTitle()),
'email_extern' => array('text', $this->getEmailExtern()),
'name_extern' => array('text', $this->getNameExtern()),
'currency_unit' => array('text', $this->getCurrencyUnit()),
'access_startdate'=> array('timestamp', $this->getAccessStartdate()),
'access_enddate'=> array('timestamp', $this->getAccessEnddate())
));
}
else
{
$statement = $this->db->insert('payment_statistic',
array(
'booking_id' => array('integer', $next_id),
'transaction' => array('text', $this->getTransaction()),
'pobject_id' => array('integer', $this->getPobjectId()),
'customer_id' => array('integer', $this->getCustomerId()),
'b_vendor_id' => array('integer', $this->getVendorId()),
'b_pay_method' => array('integer', $this->getPayMethod()),
'order_date' => array('integer', $this->getOrderDate()),
'duration' => array('text', $this->getDuration()),
'price' => array('float', $this->getPrice()),
'discount' => array('float', $this->getDiscount()),
'payed' => array('integer', $this->getPayedStatus()),
'access_granted'=> array('integer', $this->getAccessStatus()),
'voucher' => array('text', $this->getVoucher()),
'transaction_extern'=> array('text',$this->getTransactionExtern()),
# 'street' => array('text', $this->getStreet()),
# 'po_box' => array('text', $this->getPoBox()),
# 'zipcode' => array('text', $this->getZipcode()),
# 'city' => array('text', $this->getCity()),
# 'country' => array('text', $this->getCountry()),
'vat_rate' => array('float', $this->getVatRate()),
'vat_unit' => array('float', $this->getVatUnit()),
'object_title' => array('text', $this->getObjectTitle()),
'email_extern' => array('text', $this->getEmailExtern()),
'name_extern' => array('text', $this->getNameExtern()),
'currency_unit' => array('text', $this->getCurrencyUnit()),
'access_startdate'=> array('timestamp', $this->getAccessStartdate()),
'access_enddate'=> array('timestamp', $this->getAccessEnddate())
));
}
return $next_id;
}

+ Here is the call graph for this function:

ilPaymentBookings::delete ( )

Definition at line 542 of file class.ilPaymentBookings.php.

References getBookingId().

{
if($this->getBookingId())
{
$statement = $this->db->manipulateF('
DELETE FROM payment_statistic WHERE booking_id = %s',
array('integer'),
array((int)$this->getBookingId())
);
return true;
}
return false;
}

+ Here is the call graph for this function:

ilPaymentBookings::deleteAddressesByPaymethod (   $pay_method)

Definition at line 937 of file class.ilPaymentBookings.php.

References $pay_method.

{
global $ilDB;
$ilDB->manipulateF('
UPDATE payment_statistic
SET street = null,
po_box = null,
city = null,
zipcode = null,
country = null
WHERE b_pay_method = %s',
array('integer'),
array($pay_method));
}
ilPaymentBookings::getAccessEnddate ( )

Definition at line 325 of file class.ilPaymentBookings.php.

References $access_enddate.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getAccessExtension ( )

Definition at line 334 of file class.ilPaymentBookings.php.

References $access_extension.

Referenced by add().

+ Here is the caller graph for this function:

ilPaymentBookings::getAccessStartdate ( )

Definition at line 316 of file class.ilPaymentBookings.php.

References $access_startdate.

Referenced by __calculateAccessEnddate(), and add().

+ Here is the caller graph for this function:

ilPaymentBookings::getAccessStatus ( )

Definition at line 195 of file class.ilPaymentBookings.php.

References $access.

Referenced by add(), and update().

{
return $this->access;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getBooking (   $a_booking_id)

Definition at line 587 of file class.ilPaymentBookings.php.

References $res, and $row.

{
$booking = array();
$res = $this->db->queryf('
SELECT * FROM payment_statistic ps, payment_objects po
WHERE ps.pobject_id = po.pobject_id
AND booking_id = %s',
array('integer'),
array($a_booking_id));
while($row = $this->db->fetchObject($res))
{
$booking = $row;
}
return $booking ? $booking : array();
}
ilPaymentBookings::getBookingId ( )

Definition at line 85 of file class.ilPaymentBookings.php.

References $booking_id.

Referenced by delete(), and update().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getBookings ( )

Definition at line 582 of file class.ilPaymentBookings.php.

{
return $this->bookings ? $this->bookings : array();
}
ilPaymentBookings::getBookingsByPaymethod (   $pay_method)

Definition at line 923 of file class.ilPaymentBookings.php.

References $pay_method, $res, and $row.

{
global $ilDB;
$res = $ilDB->queryF('
SELECT * FROM payment_statistic WHERE b_pay_method = %s', array('integer'), array($pay_method));
while($row = $ilDB->fetchAssoc($res))
{
$booking[] = $row;
}
return $booking ? $booking : array();
}
static ilPaymentBookings::getBookingsOfCustomer (   $a_usr_id)
static

Definition at line 557 of file class.ilPaymentBookings.php.

References $res, and $row.

Referenced by ilShopBoughtObjectsGUI\showItems().

{
global $ilDB;
if(ANONYMOUS_USER_ID == $a_usr_id)
return array();
$booking = array();
$res = $ilDB->queryf('
SELECT * from payment_statistic ps, payment_objects po
WHERE ps.pobject_id = po.pobject_id
AND customer_id = %s
ORDER BY order_date DESC',
array('integer'),
array($a_usr_id)
);
while($row = $ilDB->fetchAssoc($res))
{
$booking[$row['booking_id']] = $row;
}
return $booking;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getCity ( )

Definition at line 242 of file class.ilPaymentBookings.php.

References $city.

Referenced by add().

{
return $this->city;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getCountry ( )

Definition at line 251 of file class.ilPaymentBookings.php.

References $country.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getCurrencyUnit ( )

Definition at line 307 of file class.ilPaymentBookings.php.

References $currency_unit.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getCustomerId ( )

Definition at line 109 of file class.ilPaymentBookings.php.

References $customer_id.

Referenced by __checkExtensionDependencies(), and add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getDiscount ( )

Definition at line 178 of file class.ilPaymentBookings.php.

References $discount.

Referenced by add().

{
if($this->discount == null) $this->discount = 0;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getDistinctTransactions (   $a_user_id)

Definition at line 906 of file class.ilPaymentBookings.php.

References $query, $res, and $row.

{
global $ilDB;
$query = 'SELECT * FROM payment_statistic
WHERE customer_id = %s
GROUP BY transaction
ORDER BY order_date DESC';
$res = $ilDB->queryF($query, array('integer'), array($a_user_id));
while($row = $ilDB->fetchAssoc($res))
{
$booking[$row['booking_id']] = $row;
}
return $booking ? $booking : array();
}
ilPaymentBookings::getDuration ( )

Definition at line 141 of file class.ilPaymentBookings.php.

References $duration.

Referenced by __calculateAccessEnddate(), __checkExtensionDependencies(), and add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getEmailExtern ( )

Definition at line 290 of file class.ilPaymentBookings.php.

References $email_extern.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getNameExtern ( )

Definition at line 299 of file class.ilPaymentBookings.php.

References $name_extern.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getObjectTitle ( )

Definition at line 281 of file class.ilPaymentBookings.php.

References $object_title.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getOrderDate ( )

Definition at line 133 of file class.ilPaymentBookings.php.

References $order_date.

Referenced by __checkExtensionDependencies(), and add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPayedStatus ( )

Definition at line 187 of file class.ilPaymentBookings.php.

References $payed.

Referenced by add(), and update().

{
return $this->payed;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPayMethod ( )

Definition at line 125 of file class.ilPaymentBookings.php.

References $pay_method.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPobjectId ( )

Definition at line 101 of file class.ilPaymentBookings.php.

References $pobject_id.

Referenced by __checkExtensionDependencies(), and add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPoBox ( )

Definition at line 225 of file class.ilPaymentBookings.php.

References $po_box.

Referenced by add().

{
return $this->po_box;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPrice ( )

Definition at line 169 of file class.ilPaymentBookings.php.

References $price.

Referenced by add().

{
return $this->price;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPriceType ( )

Definition at line 160 of file class.ilPaymentBookings.php.

References $price_type.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getStreet ( )

Definition at line 216 of file class.ilPaymentBookings.php.

References $street.

Referenced by add().

{
return $this->street;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getTransaction ( )

Definition at line 93 of file class.ilPaymentBookings.php.

References $transaction.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getTransactionExtern ( )

Definition at line 211 of file class.ilPaymentBookings.php.

References $transaction_extern.

Referenced by add().

+ Here is the caller graph for this function:

ilPaymentBookings::getUniqueTitles ( )

Definition at line 974 of file class.ilPaymentBookings.php.

References $query, $res, $row, __getVendorIds(), and DB_FETCHMODE_OBJECT.

{
$query = 'SELECT DISTINCT(po.ref_id) ref_id FROM payment_statistic ps, payment_objects po';
$query .= " WHERE ps.pobject_id = po.pobject_id ";
if(!$this->admin_view)
{
$vendors = $this->__getVendorIds();
if (is_array($vendors) && count($vendors) > 1)
{
foreach($vendors as $vendor)
{
$arr_data[] = '%s';
$data[] = $vendor;
$data_types[] = 'integer';
}
$str_data = implode(',',$arr_data);
$query .= 'AND ps.b_vendor_id IN ('.$str_data.') ';
}
else if(is_array($vendors) && count($vendors) == 1)
{
$query .= 'AND ps.b_vendor_id = %s ';
$data[] = $vendors['0'];
$data_types[] = 'integer';
}
}
$query .= "ORDER BY order_date DESC";
if(!$data_types && !$data)
{
$res = $this->db->query($query);
}
else $res = $this->db->queryf($query, $data_types, $data);
$rows = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$rows[] = $row->ref_id;
}
return is_array($rows) ? $rows : array();
}

+ Here is the call graph for this function:

ilPaymentBookings::getUnlimitedDuration ( )

Definition at line 151 of file class.ilPaymentBookings.php.

References $unlimited_duration.

ilPaymentBookings::getVatRate ( )

Definition at line 273 of file class.ilPaymentBookings.php.

Referenced by add().

{
return $this->vat_rate;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getVatUnit ( )

Definition at line 264 of file class.ilPaymentBookings.php.

References $vat_unit.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getVendorId ( )

Definition at line 117 of file class.ilPaymentBookings.php.

References $vendor_id.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getVoucher ( )

Definition at line 203 of file class.ilPaymentBookings.php.

References $voucher.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getZipcode ( )

Definition at line 234 of file class.ilPaymentBookings.php.

References $zipcode.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::setAccess (   $a_access)

Definition at line 191 of file class.ilPaymentBookings.php.

{
$this->access = $a_access;
}
ilPaymentBookings::setAccessEnddate (   $a_access_enddate)

Definition at line 321 of file class.ilPaymentBookings.php.

Referenced by __calculateAccessEnddate().

{
$this->access_enddate = $a_access_enddate;
}

+ Here is the caller graph for this function:

ilPaymentBookings::setAccessExtension (   $a_access_extension)

Definition at line 330 of file class.ilPaymentBookings.php.

{
$this->access_extension = $a_access_extension;
}
ilPaymentBookings::setAccessStartdate (   $a_access_startdate)

Definition at line 312 of file class.ilPaymentBookings.php.

Referenced by __checkExtensionDependencies(), and add().

{
$this->access_startdate = $a_access_startdate;
}

+ Here is the caller graph for this function:

ilPaymentBookings::setBookingId (   $a_booking_id)

Definition at line 81 of file class.ilPaymentBookings.php.

{
return $this->booking_id = $a_booking_id;
}
ilPaymentBookings::setCity (   $a_city)

Definition at line 246 of file class.ilPaymentBookings.php.

{
$this->city = $a_city;
}
ilPaymentBookings::setCountry (   $a_country)

Definition at line 255 of file class.ilPaymentBookings.php.

{
$this->country = $a_country;
}
ilPaymentBookings::setCurrencyUnit (   $a_currency_unit)

Definition at line 303 of file class.ilPaymentBookings.php.

{
$this->currency_unit = $a_currency_unit;
}
ilPaymentBookings::setCustomerId (   $a_customer_id)

Definition at line 105 of file class.ilPaymentBookings.php.

{
$this->customer_id = $a_customer_id;
}
ilPaymentBookings::setDiscount (   $a_discount)

Definition at line 173 of file class.ilPaymentBookings.php.

{
if($a_discount == null) $a_discount = 0;
$this->discount = $a_discount;
}
ilPaymentBookings::setDuration (   $a_duration)

Definition at line 137 of file class.ilPaymentBookings.php.

{
$this->duration = $a_duration;
}
ilPaymentBookings::setEmailExtern (   $a_email_extern)

Definition at line 286 of file class.ilPaymentBookings.php.

{
$this->email_extern = $a_email_extern;
}
ilPaymentBookings::setNameExtern (   $a_name_extern)

Definition at line 295 of file class.ilPaymentBookings.php.

{
$this->name_extern = $a_name_extern;
}
ilPaymentBookings::setObjectTitle (   $a_object_title)

Definition at line 277 of file class.ilPaymentBookings.php.

{
$this->object_title = $a_object_title;
}
ilPaymentBookings::setOrderDate (   $a_order_date)

Definition at line 129 of file class.ilPaymentBookings.php.

{
$this->order_date = $a_order_date;
}
ilPaymentBookings::setPayed (   $a_payed)

Definition at line 183 of file class.ilPaymentBookings.php.

{
$this->payed = $a_payed;
}
ilPaymentBookings::setPayMethod (   $a_pay_method)

Definition at line 121 of file class.ilPaymentBookings.php.

{
$this->pay_method = $a_pay_method;
}
ilPaymentBookings::setPobjectId (   $a_pobject_id)

Definition at line 97 of file class.ilPaymentBookings.php.

{
$this->pobject_id = $a_pobject_id;
}
ilPaymentBookings::setPoBox (   $a_po_box)

Definition at line 229 of file class.ilPaymentBookings.php.

{
$this->po_box = $a_po_box;
}
ilPaymentBookings::setPrice (   $a_price)

Definition at line 165 of file class.ilPaymentBookings.php.

{
$this->price = $a_price;
}
ilPaymentBookings::setPriceType (   $a_price_type)

Definition at line 156 of file class.ilPaymentBookings.php.

{
$this->price_type = $a_price_type;
}
ilPaymentBookings::setStreet (   $a_street,
  $a_house_nr 
)

Definition at line 220 of file class.ilPaymentBookings.php.

References $street.

{
$street = $a_street.' '.$a_house_nr;
$this->street = $street;
}
ilPaymentBookings::setTransaction (   $a_transaction)

Definition at line 89 of file class.ilPaymentBookings.php.

Referenced by ilPurchase\purchase().

{
$this->transaction = $a_transaction;
}

+ Here is the caller graph for this function:

ilPaymentBookings::setTransactionExtern (   $a_transaction_extern)

Definition at line 207 of file class.ilPaymentBookings.php.

{
$this->transaction_extern = $a_transaction_extern;
}
ilPaymentBookings::setUnlimitedDuration (   $a_unlimited_duration)

Definition at line 145 of file class.ilPaymentBookings.php.

{
if($a_unlimited_duration == '' || null) $a_unlimited_duration = 0;
$this->unlimited_duration = $a_unlimited_duration;
}
ilPaymentBookings::setVatRate (   $a_vat_rate)

Definition at line 269 of file class.ilPaymentBookings.php.

{
$this->vat_rate = $a_vat_rate;
}
ilPaymentBookings::setVatUnit (   $a_vat_unit)

Definition at line 259 of file class.ilPaymentBookings.php.

{
$this->vat_unit = $a_vat_unit;
}
ilPaymentBookings::setVendorId (   $a_vendor_id)

Definition at line 113 of file class.ilPaymentBookings.php.

{
$this->vendor_id = $a_vendor_id;
}
ilPaymentBookings::setVoucher (   $a_voucher)

Definition at line 199 of file class.ilPaymentBookings.php.

{
$this->voucher = $a_voucher;
}
ilPaymentBookings::setZipcode (   $a_zipcode)

Definition at line 238 of file class.ilPaymentBookings.php.

{
$this->zipcode = $a_zipcode;
}
ilPaymentBookings::update ( )

Definition at line 525 of file class.ilPaymentBookings.php.

References getAccessStatus(), getBookingId(), and getPayedStatus().

{
if($this->getBookingId())
{
$statement = $this->db->manipulateF('
UPDATE payment_statistic
SET payed = %s,
access_granted = %s
WHERE booking_id = %s',
array('integer', 'integer', 'integer'),
array((int) $this->getPayedStatus(), (int) $this->getAccessStatus(), $this->getBookingId()));
return true;
}
return false;
}

+ Here is the call graph for this function:

Field Documentation

ilPaymentBookings::$access = null

Definition at line 39 of file class.ilPaymentBookings.php.

Referenced by getAccessStatus().

ilPaymentBookings::$access_enddate = null

Definition at line 53 of file class.ilPaymentBookings.php.

Referenced by __calculateAccessEnddate(), and getAccessEnddate().

ilPaymentBookings::$access_extension = false

Definition at line 57 of file class.ilPaymentBookings.php.

Referenced by getAccessExtension().

ilPaymentBookings::$access_startdate = null

Definition at line 52 of file class.ilPaymentBookings.php.

Referenced by getAccessStartdate().

ilPaymentBookings::$admin_view = false

Definition at line 54 of file class.ilPaymentBookings.php.

ilPaymentBookings::$booking_id = null

Definition at line 24 of file class.ilPaymentBookings.php.

Referenced by getBookingId().

ilPaymentBookings::$bookings = array()

Definition at line 22 of file class.ilPaymentBookings.php.

Referenced by __readBillByTransaction().

ilPaymentBookings::$city = null

Definition at line 45 of file class.ilPaymentBookings.php.

Referenced by getCity().

ilPaymentBookings::$country = null

Definition at line 46 of file class.ilPaymentBookings.php.

Referenced by getCountry().

ilPaymentBookings::$currency_unit = null

Definition at line 50 of file class.ilPaymentBookings.php.

Referenced by getCurrencyUnit().

ilPaymentBookings::$customer_id = null

Definition at line 27 of file class.ilPaymentBookings.php.

Referenced by getCustomerId().

ilPaymentBookings::$db = null

Definition at line 20 of file class.ilPaymentBookings.php.

ilPaymentBookings::$discount = 0

Definition at line 34 of file class.ilPaymentBookings.php.

Referenced by getDiscount().

ilPaymentBookings::$duration = 0

Definition at line 31 of file class.ilPaymentBookings.php.

Referenced by __calculateAccessEnddate(), and getDuration().

ilPaymentBookings::$email_extern = null

Definition at line 48 of file class.ilPaymentBookings.php.

Referenced by getEmailExtern().

ilPaymentBookings::$house_nr = null

Definition at line 42 of file class.ilPaymentBookings.php.

ilPaymentBookings::$name_extern = null

Definition at line 49 of file class.ilPaymentBookings.php.

Referenced by getNameExtern().

ilPaymentBookings::$object_title = null

Definition at line 37 of file class.ilPaymentBookings.php.

Referenced by getObjectTitle().

ilPaymentBookings::$order_date = null

Definition at line 30 of file class.ilPaymentBookings.php.

Referenced by getOrderDate().

ilPaymentBookings::$pay_method = null
ilPaymentBookings::$payed = null

Definition at line 38 of file class.ilPaymentBookings.php.

Referenced by getPayedStatus().

ilPaymentBookings::$po_box = null

Definition at line 43 of file class.ilPaymentBookings.php.

Referenced by getPoBox().

ilPaymentBookings::$pobject_id = null

Definition at line 26 of file class.ilPaymentBookings.php.

Referenced by getPobjectId().

ilPaymentBookings::$price = 0

Definition at line 33 of file class.ilPaymentBookings.php.

Referenced by getPrice().

ilPaymentBookings::$price_type = null
private

Definition at line 55 of file class.ilPaymentBookings.php.

Referenced by getPriceType().

ilPaymentBookings::$street = null

Definition at line 41 of file class.ilPaymentBookings.php.

Referenced by getStreet(), and setStreet().

ilPaymentBookings::$transaction = null

Definition at line 25 of file class.ilPaymentBookings.php.

Referenced by getTransaction().

ilPaymentBookings::$transaction_extern = null

Definition at line 35 of file class.ilPaymentBookings.php.

Referenced by getTransactionExtern().

ilPaymentBookings::$unlimited_duration = 0

Definition at line 32 of file class.ilPaymentBookings.php.

Referenced by getUnlimitedDuration().

ilPaymentBookings::$user_id = null

Definition at line 19 of file class.ilPaymentBookings.php.

Referenced by __getVendorIds(), and _readBookingByTransaction().

ilPaymentBookings::$vat_unit = 0

Definition at line 36 of file class.ilPaymentBookings.php.

Referenced by getVatUnit().

ilPaymentBookings::$vendor_id = null

Definition at line 28 of file class.ilPaymentBookings.php.

Referenced by getVendorId().

ilPaymentBookings::$voucher = null

Definition at line 40 of file class.ilPaymentBookings.php.

Referenced by getVoucher().

ilPaymentBookings::$zipcode = null

Definition at line 44 of file class.ilPaymentBookings.php.

Referenced by getZipcode().


The documentation for this class was generated from the following file: