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

Public Member Functions

 ilPaymentBookings ($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 ()
 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 ()
 getAccessStartdate ()
 getAccessEnddate ()
 setAccessExtension ($a_access_extension)
 getAccessExtension ()
 add ()
 update ()
 delete ()
 getBookings ()
 getBooking ($a_booking_id)
 _getActivation ($a_pobject_id, $a_user_id=0)
 __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
 $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

 setAccessStartdate ($a_access_startdate)
 setAccessEnddate ($a_access_enddate)
 __checkExtensionDependencies ()
 __calculateAccessEnddate ()

Detailed Description

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

Member Function Documentation

ilPaymentBookings::__calculateAccessEnddate ( )
private

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

References $access_enddate, 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 316 of file class.ilPaymentBookings.php.

References $ilDB, __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)
{
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentBookings::__getVendorIds ( )

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

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

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 708 of file class.ilPaymentBookings.php.

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

Referenced by ilPaymentBookings().

{
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 876 of file class.ilPaymentBookings.php.

References $bookings, $ilDB, $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';
$i = 0;
$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:

ilPaymentBookings::_getActivation (   $a_pobject_id,
  $a_user_id = 0 
)

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

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

{
global $ilDB, $ilUser;
if(ANONYMOUS_USER_ID == $a_user_id)
return false;
$usr_id = $a_user_id ? $a_user_id : $ilUser->getId();
$res = $ilDB->queryf('
SELECT order_date, duration, 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->fetchObject($res))
{
if($row->duration != 0)
{
if( time() >= $row->order_date
&& date("Y-m-d") <= $row->access_enddate)
{
$activation = array(
"activation_start" => $row->order_date,
"activation_end" => mktime(0, 0, 0,
date('m', $row->access_enddate),
date('d', $row->access_enddate),
date('Y', $row->access_enddate))
);
return $activation;
}
}
}
return false;
}
static ilPaymentBookings::_getCountBookingsByCustomer (   $a_vendor_id)
static

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

References $ilDB, $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 602 of file class.ilPaymentBookings.php.

References $ilDB, $res, and $row.

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

{
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 565 of file class.ilPaymentBookings.php.

References $ilDB, $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 619 of file class.ilPaymentBookings.php.

References $ilDB, $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_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->fetchObject($res))
{
if($row->duration != 0)
{
if( time() >= $row->order_date
&& date("Y-m-d") <= $row->access_enddate)
{
return true;
}
}
else 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 1008 of file class.ilPaymentBookings.php.

References $ilDB, $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 1024 of file class.ilPaymentBookings.php.

References $ilDB, $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 943 of file class.ilPaymentBookings.php.

References $ilDB, $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;
}
}

+ Here is the caller graph for this function:

ilPaymentBookings::add ( )

Definition at line 396 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(), getStreet(), getTransaction(), getTransactionExtern(), getVatRate(), getVatUnit(), getVendorId(), getVoucher(), getZipcode(), and setAccessStartdate().

{
if($this->getAccessExtension() == 1)
{
}
else
{
$this->setAccessStartdate(date('Y-m-d H:i:s', $this->getOrderDate()));
if($this->getDuration() > 0)
{
}
}
$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 503 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 927 of file class.ilPaymentBookings.php.

References $ilDB, and $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 302 of file class.ilPaymentBookings.php.

References $access_enddate.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getAccessExtension ( )

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

References $access_extension.

Referenced by add().

+ Here is the caller graph for this function:

ilPaymentBookings::getAccessStartdate ( )

Definition at line 293 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 172 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 548 of file class.ilPaymentBookings.php.

References $res, and $row.

{
$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 71 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 543 of file class.ilPaymentBookings.php.

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

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

References $ilDB, $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 518 of file class.ilPaymentBookings.php.

References $ilDB, $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 219 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 228 of file class.ilPaymentBookings.php.

References $country.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getCurrencyUnit ( )

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

References $currency_unit.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getCustomerId ( )

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

Referenced by __checkExtensionDependencies(), and add().

{
return $this->customer_id;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getDiscount ( )

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

Referenced by add().

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

+ Here is the caller graph for this function:

ilPaymentBookings::getDistinctTransactions (   $a_user_id)

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

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

{
global $ilDB;
$query = 'SELECT booking_id, order_date, customer_id, transaction FROM payment_statistic
WHERE customer_id = %s
GROUP BY transaction, order_date, booking_id, customer_id
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 127 of file class.ilPaymentBookings.php.

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

{
return $this->duration;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getEmailExtern ( )

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

References $email_extern.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getNameExtern ( )

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

References $name_extern.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getObjectTitle ( )

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

Referenced by add().

{
return $this->object_title;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getOrderDate ( )

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

Referenced by __checkExtensionDependencies(), and add().

{
return $this->order_date;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPayedStatus ( )

Definition at line 164 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 111 of file class.ilPaymentBookings.php.

References $pay_method.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPobjectId ( )

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

Referenced by __checkExtensionDependencies(), and add().

{
return $this->pobject_id;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPoBox ( )

Definition at line 202 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 146 of file class.ilPaymentBookings.php.

Referenced by add().

{
return $this->price;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getStreet ( )

Definition at line 193 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 79 of file class.ilPaymentBookings.php.

Referenced by add().

{
return $this->transaction;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getTransactionExtern ( )

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

Referenced by add().

{
return $this->transaction_extern;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getUniqueTitles ( )

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

References $data, $query, $res, $row, $vendor, __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_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 137 of file class.ilPaymentBookings.php.

{
return $this->unlimited_duration;
}
ilPaymentBookings::getVatRate ( )

Definition at line 250 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 241 of file class.ilPaymentBookings.php.

Referenced by add().

{
return $this->vat_unit;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getVendorId ( )

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

Referenced by add().

{
return $this->vendor_id;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getVoucher ( )

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

References $voucher.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getZipcode ( )

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

References $zipcode.

Referenced by add().

{
}

+ Here is the caller graph for this function:

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

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

References $ilDB, __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:

ilPaymentBookings::setAccess (   $a_access)

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

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

Definition at line 298 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 307 of file class.ilPaymentBookings.php.

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

Definition at line 289 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 67 of file class.ilPaymentBookings.php.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

References $street.

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

Definition at line 75 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 184 of file class.ilPaymentBookings.php.

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

Definition at line 131 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 246 of file class.ilPaymentBookings.php.

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

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

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

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

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

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

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

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

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

Definition at line 486 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 26 of file class.ilPaymentBookings.php.

Referenced by getAccessStatus().

ilPaymentBookings::$access_enddate = null

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

Referenced by __calculateAccessEnddate(), and getAccessEnddate().

ilPaymentBookings::$access_extension = false

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

Referenced by getAccessExtension().

ilPaymentBookings::$access_startdate = null

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

Referenced by getAccessStartdate().

ilPaymentBookings::$admin_view = false

Definition at line 41 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 32 of file class.ilPaymentBookings.php.

Referenced by getCity().

ilPaymentBookings::$country = null

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

Referenced by getCountry().

ilPaymentBookings::$currency_unit = null

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

Referenced by getCurrencyUnit().

ilPaymentBookings::$db = null

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

ilPaymentBookings::$email_extern = null

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

Referenced by getEmailExtern().

ilPaymentBookings::$house_nr = null

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

ilPaymentBookings::$name_extern = null

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

Referenced by getNameExtern().

ilPaymentBookings::$payed = null

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

Referenced by getPayedStatus().

ilPaymentBookings::$po_box = null

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

Referenced by getPoBox().

ilPaymentBookings::$street = null

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

Referenced by getStreet(), and setStreet().

ilPaymentBookings::$user_id = null

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

Referenced by __getVendorIds(), and _readBookingByTransaction().

ilPaymentBookings::$voucher = null

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

Referenced by getVoucher().

ilPaymentBookings::$zipcode = null

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

Referenced by getZipcode().


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