Public Member Functions | |
| ilPaymentVendors () | |
| Constructor public. | |
| getVendors () | |
| isAssigned ($a_usr_id) | |
| add ($a_usr_id) | |
| update ($a_usr_id, $a_cost_center) | |
| delete ($a_usr_id) | |
| __read () | |
| _isVendor ($a_usr_id) | |
| _getCostCenter ($a_usr_id) | |
Data Fields | |
| $db = null | |
| $vendors = array() | |
Definition at line 34 of file class.ilPaymentVendors.php.
| ilPaymentVendors::__read | ( | ) |
Definition at line 105 of file class.ilPaymentVendors.php.
References $query, $res, and $row.
Referenced by add(), delete(), ilPaymentVendors(), and update().
{
$this->vendors = array();
$query = "SELECT * FROM payment_vendors ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->vendors[$row->vendor_id]['vendor_id'] = $row->vendor_id;
$this->vendors[$row->vendor_id]['cost_center'] = $row->cost_center;
}
return true;
}
Here is the caller graph for this function:| ilPaymentVendors::_getCostCenter | ( | $ | a_usr_id | ) |
Definition at line 133 of file class.ilPaymentVendors.php.
References $query, $res, and $row.
Referenced by ilPaymentStatisticGUI::addStatisticWorksheet(), and ilObjPaymentSettingsGUI::addStatisticWorksheet().
{
global $ilDB;
$query = "SELECT * FROM payment_vendors ".
"WHERE vendor_id = '".$a_usr_id."'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->cost_center;
}
return -1;
}
Here is the caller graph for this function:| ilPaymentVendors::_isVendor | ( | $ | a_usr_id | ) |
Definition at line 121 of file class.ilPaymentVendors.php.
Referenced by ilPaymentBaseGUI::__buildButtons(), ilPaymentAdminGUI::__forwardToDefault(), ilPaymentBookings::__getVendorIds(), ilPaymentObjectGUI::__showVendorSelector(), and ilPaymentObject::_getObjectsData().
{
global $ilDB;
$query = "SELECT cost_center FROM payment_vendors ".
"WHERE vendor_id = '".$a_usr_id."'";
$res = $ilDB->query($query);
return $res->numRows() ? true : false;
}
Here is the caller graph for this function:| ilPaymentVendors::add | ( | $ | a_usr_id | ) |
Definition at line 63 of file class.ilPaymentVendors.php.
References $query, and __read().
{
if(isset($this->vendors[$a_usr_id]))
{
die("class.ilPaymentVendors::add() Vendor already exists");
}
$query = "INSERT INTO payment_vendors ".
"SET vendor_id = '".$a_usr_id."', ".
"cost_center = '".IL_INST_ID."_".$a_usr_id."'";
$this->db->query($query);
$this->__read();
return true;
}
Here is the call graph for this function:| ilPaymentVendors::delete | ( | $ | a_usr_id | ) |
Definition at line 89 of file class.ilPaymentVendors.php.
References $query, and __read().
{
if(!isset($this->vendors[$a_usr_id]))
{
die("class.ilPaymentVendors::delete() Vendor does not exist");
}
$query = "DELETE FROM payment_vendors ".
"WHERE vendor_id = '".$a_usr_id."'";
$this->db->query($query);
$this->__read();
return true;
}
Here is the call graph for this function:| ilPaymentVendors::getVendors | ( | ) |
Definition at line 53 of file class.ilPaymentVendors.php.
{
return $this->vendors;
}
| ilPaymentVendors::ilPaymentVendors | ( | ) |
Constructor public.
Definition at line 44 of file class.ilPaymentVendors.php.
References __read().
{
global $ilDB;
$this->db =& $ilDB;
$this->__read();
}
Here is the call graph for this function:| ilPaymentVendors::isAssigned | ( | $ | a_usr_id | ) |
Definition at line 58 of file class.ilPaymentVendors.php.
{
return isset($this->vendors[$a_usr_id]);
}
| ilPaymentVendors::update | ( | $ | a_usr_id, | |
| $ | a_cost_center | |||
| ) |
Definition at line 78 of file class.ilPaymentVendors.php.
References $query, and __read().
{
$query = "UPDATE payment_vendors ".
"SET cost_center = '".$a_cost_center."' ".
"WHERE vendor_id = '".$a_usr_id."'";
$this->db->query($query);
$this->__read();
return true;
}
Here is the call graph for this function:| ilPaymentVendors::$db = null |
Definition at line 36 of file class.ilPaymentVendors.php.
| ilPaymentVendors::$vendors = array() |
Definition at line 38 of file class.ilPaymentVendors.php.
1.7.1