ILIAS  eassessment Revision 61809
 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 ()
 add ()
 update ()
 delete ()
 getBookingsOfCustomer ($a_usr_id)
 getBookings ()
 getBooking ($a_booking_id)
 _getCountBookingsByVendor ($a_vendor_id)
 _getCountBookingsByCustomer ($a_vendor_id)
 _getCountBookingsByObject ($a_pobject_id)
 _hasAccess ($a_pobject_id, $a_user_id=0, $a_transaction=0)
 _getActivation ($a_pobject_id, $a_user_id=0)
 _getCountBookingsByPayMethod ($a_pm)
 __read ()
 __getVendorIds ()
 getDistinctTransactions ($a_user_id)
 getBookingsByPaymethod ($pay_method)
 deleteAddressesByPaymethod ($pay_method)
 getUniqueTitles ()

Static Public Member Functions

static __readBillByTransaction ($a_user_id, $a_transaction_nr)
static _readBookingByTransaction ($a_transaction)

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
 $admin_view = false

Detailed Description

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

Member Function Documentation

ilPaymentBookings::__getVendorIds ( )

Definition at line 915 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 769 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 938 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 654 of file class.ilPaymentBookings.php.

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

{
global $ilDB,$ilias;
if(ANONYMOUS_USER_ID == $a_user_id)
return false;
$usr_id = $a_user_id ? $a_user_id : $ilias->account->getId();
$res = $this->db->queryf('
SELECT * 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 = $this->db->fetchObject($res))
{
$orderDateYear = date("Y", $row->order_date);
$orderDateMonth = date("m", $row->order_date);
$orderDateDay = date("d", $row->order_date);
$orderDateHour = date("H", $row->order_date);
$orderDateMinute = date("i", $row->order_date);
$orderDateSecond = date("s", $row->order_date);
if (($orderDateMonth + $row->duration) > 12)
{
$years = floor(($orderDateMonth + $row->duration) / 12);
$months = ($orderDateMonth + $row->duration) - (12 * $years);
$orderDateYear += $years;
$orderDateMonth = $months;
}
else
{
$orderDateMonth += $row->duration;
}
$startDate = date("Y-m-d H:i:s", $row->order_date);
$endDate = date("Y-m-d H:i:s", mktime($orderDateHour, $orderDateMinute, $orderDateSecond, $orderDateMonth, $orderDateDay, $orderDateYear));
if (date("Y-m-d H:i:s") >= $startDate &&
date("Y-m-d H:i:s") <= $endDate)
{
$activation = array(
"activation_start" => $row->order_date,
"activation_end" => mktime($orderDateHour, $orderDateMinute, $orderDateSecond, $orderDateMonth, $orderDateDay, $orderDateYear)
);
return $activation;
}
}
return false;
}
ilPaymentBookings::_getCountBookingsByCustomer (   $a_vendor_id)

Definition at line 548 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;
}
ilPaymentBookings::_getCountBookingsByObject (   $a_pobject_id)

Definition at line 568 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:

ilPaymentBookings::_getCountBookingsByPayMethod (   $a_pm)

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

References $res, and $row.

{
switch($a_pm)
{
case 'pm_bill':
$res = $this->db->queryf ('
SELECT COUNT(booking_id) bid FROM payment_statistc
WHERE pay_method = %s',
array('integer'),
array('1'));
while($row = $this->db->fetchObject($res))
{
return $row->bid;
}
return 0;
case 'pm_bmf':
$res = $this->db->queryf ('
SELECT COUNT(booking_id) bid FROM payment_statistc
WHERE pay_method = %s',
array('integer'),
array('2'));
while($row = $this->db->fetchObject($res))
{
return $row->bid;
}
return 0;
case 'pm_paypal':
$res = $this->db->queryf ('
SELECT COUNT(booking_id) bid FROM payment_statistc
WHERE pay_method = %s',
array('integer'),
array('3'));
while($row = $this->db->fetchObject($res))
{
return $row->bid;
}
return 0;
case 'pm_epay':
$res = $this->db->queryf ('
SELECT COUNT(booking_id) bid FROM payment_statistc
WHERE pay_method = %s',
array('integer'),
array('4'));
while($row = $this->db->fetchObject($res))
{
return $row->bid;
}
return 0;
default:
return 0;
}
}
ilPaymentBookings::_getCountBookingsByVendor (   $a_vendor_id)

Definition at line 531 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:

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

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

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

Referenced by ilPaymentObject\_hasAccess().

{
global $ilDB, $ilias, $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 : $ilias->account->getId();
$res = $ilDB->queryf('
SELECT * 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))
{
$orderDateYear = date("Y", $row->order_date);
$orderDateMonth = date("m", $row->order_date);
$orderDateDay = date("d", $row->order_date);
$orderDateHour = date("H", $row->order_date);
$orderDateMinute = date("i", $row->order_date);
$orderDateSecond = date("s", $row->order_date);
if($row->duration != 0)
{
if (($orderDateMonth + $row->duration) > 12)
{
$years = floor(($orderDateMonth + $row->duration) / 12);
$months = ($orderDateMonth + $row->duration) - (12 * $years);
$orderDateYear += $years;
$orderDateMonth = $months;
}
else
{
$orderDateMonth += $row->duration;
}
$startDate = date("Y-m-d H:i:s", $row->order_date);
$endDate = date("Y-m-d H:i:s", mktime($orderDateHour, $orderDateMinute, $orderDateSecond, $orderDateMonth, $orderDateDay, $orderDateYear));
if (date("Y-m-d H:i:s") >= $startDate &&
date("Y-m-d H:i:s") <= $endDate)
{
return true;
}
}
else return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilPaymentBookings::_readBookingByTransaction (   $a_transaction)
static

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

References ilPayMethods\_EnabledSaveUserAddress(), getAccessStatus(), getCity(), getCountry(), getCurrencyUnit(), getCustomerId(), getDiscount(), getDuration(), getEmailExtern(), getNameExtern(), getObjectTitle(), getOrderDate(), getPayedStatus(), getPayMethod(), getPobjectId(), getPoBox(), getPrice(), getStreet(), getTransaction(), getTransactionExtern(), getVatRate(), getVatUnit(), getVendorId(), getVoucher(), and getZipcode().

{
$next_id = $this->db->nextId('payment_statistic');
{
$statement = $this->db->manipulateF('
INSERT INTO payment_statistic
(
booking_id,
transaction,
pobject_id,
customer_id,
b_vendor_id,
b_pay_method,
order_date,
duration,
price,
discount,
payed,
access_granted,
voucher,
transaction_extern,
street,
po_box,
zipcode,
city,
country,
vat_rate,
vat_unit,
object_title,
email_extern,
name_extern,
currency_unit
)
VALUES
( %s,%s,%s,%s,%s,%s,%s,%s,%s,%s, %s,%s,%s,%s,%s,%s,%s,%s,%s,%s, %s,%s,%s,%s,%s)',
array( 'integer',
'text',
'integer',
'integer',
'integer',
'integer',
'integer',
'text',
'float',
'float',
'integer',
'integer',
'text',
'text',
'text',
'text',
'text',
'text',
'text',
'float',
'float',
'text',
'text',
'text',
'text'),
array( $next_id,
$this->getTransaction(),
$this->getPobjectId(),
$this->getCustomerId(),
$this->getVendorId(),
$this->getPayMethod(),
$this->getOrderDate(),
$this->getDuration(),
$this->getPrice(),
$this->getDiscount(),
$this->getPayedStatus(),
$this->getAccessStatus(),
$this->getVoucher(),
$this->getStreet(),
$this->getPoBox(),
$this->getZipcode(),
$this->getCity(),
$this->getCountry(),
$this->getVatRate(),
$this->getVatUnit(),
$this->getObjectTitle(),
$this->getEmailExtern(),
$this->getNameExtern(),
$this->getCurrencyUnit()
));
}
else
{#currency_unit
$statement = $this->db->manipulateF('
INSERT INTO payment_statistic
(
booking_id,
transaction,
pobject_id,
customer_id,
b_vendor_id,
b_pay_method,
order_date,
duration,
price,
discount,
payed,
access_granted,
voucher,
transaction_extern,
vat_rate,
vat_unit,
object_title,
email_extern,
name_extern,
currency_unit
)
VALUES
( %s,%s,%s,%s,%s,%s,%s,%s,%s,%s, %s,%s,%s,%s,%s,%s,%s,%s,%s,%s)',
array( 'integer',
'text',
'integer',
'integer',
'integer',
'integer',
'integer',
'text',
'float',
'float',
'integer',
'integer',
'text',
'text',
'float',
'float',
'text',
'text',
'text',
'text'),
array( $next_id,
$this->getTransaction(),
$this->getPobjectId(),
$this->getCustomerId(),
$this->getVendorId(),
$this->getPayMethod(),
$this->getOrderDate(),
$this->getDuration(),
$this->getPrice(),
$this->getDiscount(),
$this->getPayedStatus(),
$this->getAccessStatus(),
$this->getVoucher(),
$this->getVatRate(),
$this->getVatUnit(),
$this->getObjectTitle(),
$this->getEmailExtern(),
$this->getNameExtern(),
$this->getCurrencyUnit()
));
}
return $next_id;
}

+ Here is the call graph for this function:

ilPaymentBookings::delete ( )

Definition at line 472 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 992 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::getAccessStatus ( )

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

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

Definition at line 974 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));
$i = 0;
while($row = $ilDB->fetchAssoc($res))
{
$booking[] = $row;
/*$booking[$i]['booking_id'] = $row->booking_id;
$booking[$i]['pay_method'] = $row->b_pay_method;
$i++;*/
}
return $booking ? $booking : array();
}
ilPaymentBookings::getBookingsOfCustomer (   $a_usr_id)

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

References $res, and $row.

{
if(ANONYMOUS_USER_ID == $a_usr_id)
return array();
$res = $this->db->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 = $this->db->fetchAssoc($res))
{
$booking[$row['booking_id']] = $row;
}
return $booking ? $booking : array();
}
ilPaymentBookings::getCity ( )

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

References $country.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getCurrencyUnit ( )

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

References $currency_unit.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getCustomerId ( )

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

Referenced by add().

{
return $this->customer_id;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getDiscount ( )

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

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

Referenced by add().

{
return $this->duration;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getEmailExtern ( )

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

References $email_extern.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getNameExtern ( )

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

References $name_extern.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getObjectTitle ( )

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

Referenced by add().

{
return $this->order_date;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPayedStatus ( )

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

References $pay_method.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPobjectId ( )

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

Referenced by add().

{
return $this->pobject_id;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getPoBox ( )

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

Referenced by add().

{
return $this->price;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getStreet ( )

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

Referenced by add().

{
return $this->transaction;
}

+ Here is the caller graph for this function:

ilPaymentBookings::getTransactionExtern ( )

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

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

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

References $voucher.

Referenced by add().

{
}

+ Here is the caller graph for this function:

ilPaymentBookings::getZipcode ( )

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

References $ilDB, and __read().

{
global $ilDB;
$this->admin_view = $a_admin_view;
$this->user_id = $a_user_id;
$this->db = $ilDB;
// TODO: CURRENCY
include_once './Services/Payment/classes/class.ilGeneralSettings.php';
$genSet = new ilGeneralSettings();
$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 164 of file class.ilPaymentBookings.php.

{
$this->access = $a_access;
}
ilPaymentBookings::setBookingId (   $a_booking_id)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

References $street.

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

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

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

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

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

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

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

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

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

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

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

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

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

Definition at line 455 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::$admin_view = false

Definition at line 38 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: