ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilPurchaseBMFGUI Class Reference
+ Inheritance diagram for ilPurchaseBMFGUI:
+ Collaboration diagram for ilPurchaseBMFGUI:

Public Member Functions

 ilPurchaseBMFGUI ($user_obj)
 
 cancel ()
 
 showPersonalData ()
 
 getPersonalData ()
 
 showPaymentType ()
 
 getPaymentType ()
 
 showDebitEntry ()
 
 getDebitEntry ()
 
 sendDebitEntry ()
 
 showCreditCard ()
 
 getCreditCard ()
 
 sendCreditCard ()
 
executeCommand ()
 execute command More...
 
- Public Member Functions inherited from ilPurchaseBaseGUI
 __construct ($user_obj, $pay_method)
 
 cancel ()
 
 showPersonalData ()
 
 getPersonalData ()
 
 showBillConfirm ()
 
 executeCommand ()
 execute command More...
 
 __addBookings ($external_data=null)
 
 __sendBill ($bookings)
 
 __emptyShoppingCart ()
 
 __clearSession ()
 
 __loadTemplate ()
 
 __buildStatusline ()
 
 __buildLocator ()
 
 __buildStylesheet ()
 
 __getCountries ()
 shows select box f�r countries More...
 
 __getCountryCode ($value='')
 
 __getCountryName ($value='')
 
 __getTotalAmount ()
 depricated!? More...
 
 getBill ()
 
 __showShoppingCart ()
 
 getAccess ()
 
 setAccess ($access)
 
 getPayed ()
 
 setPayed ($payed)
 
- Public Member Functions inherited from ilShopBaseGUI
 __construct ()
 

Data Fields

 $ctrl
 
 $tpl
 
 $user_obj
 
 $coupon_obj = null
 
 $error
 
 $shoppingCart
 
 $soapClient
 
 $pay_method = null
 
- Data Fields inherited from ilPurchaseBaseGUI
 $ctrl
 
 $tpl
 
 $psc_obj = null
 
 $user_obj = null
 
 $coupon_obj = null
 
 $error
 
 $pmethod_obj = null
 

Private Attributes

 $totalVat = 0
 
 $pm_id = 0
 

Additional Inherited Members

- Protected Member Functions inherited from ilShopBaseGUI
 prepareOutput ()
 
 addPager ($result)
 
- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 
 $lng = null
 
 $tpl = null
 
 $settings = null
 

Detailed Description

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

Member Function Documentation

◆ cancel()

ilPurchaseBMFGUI::cancel ( )

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

References ilUtil\redirect().

53  {
54  ilUtil::redirect("./payment.php");
55  }
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ executeCommand()

& ilPurchaseBMFGUI::executeCommand ( )

execute command

Definition at line 1015 of file class.ilPurchaseBMFGUI.php.

References $cmd.

1016  {
1017  global $tree;
1018 
1019  $cmd = $this->ctrl->getCmd();
1020 
1021  switch ($this->ctrl->getNextClass($this))
1022  {
1023 
1024  default:
1025  if(!$cmd = $this->ctrl->getCmd())
1026  {
1027  $cmd = 'showPersonalData';
1028  }
1029  $this->$cmd();
1030  break;
1031  }
1032  }
$cmd
Definition: sahs_server.php:35

◆ getCreditCard()

ilPurchaseBMFGUI::getCreditCard ( )

Definition at line 785 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilUserPasswordManager\getInstance(), sendCreditCard(), ilUtil\sendInfo(), showCreditCard(), and ilUtil\stripSlashes().

786  {
787  if ($_POST["card_holder"] == "" ||
788  $_POST["card_number"]["block_1"] == "" ||
789  $_POST["card_number"]["block_2"] == "" ||
790  $_POST["card_number"]["block_3"] == "" ||
791  $_POST["card_number"]["block_4"] == "" ||
792  $_POST["validity"]["month"] == "" ||
793  $_POST["validity"]["year"] == "" ||
794  $_POST["validity"]["year"]."-".$_POST["validity"]["month"] < date("Y-m"))
795  {
796  $this->error = $this->lng->txt('pay_bmf_credit_card_not_valid');
797  ilUtil::sendInfo($this->error);
798  $this->showCreditCard();
799  return;
800  }
801  if ($_POST["terms_conditions"] != 1)
802  {
803  $this->error = $this->lng->txt('pay_bmf_check_terms_conditions');
804  ilUtil::sendInfo($this->error);
805  $this->showCreditCard();
806  return;
807  }
808 
809  require_once 'Services/User/classes/class.ilUserPasswordManager.php';
810  $verified_passwd = ilUserPasswordManager::getInstance()->verifyPassword($this->user_obj, ilUtil::stripSlashes($_POST["password"]));
811  if ($_POST["password"] == "" || $verified_passwd == false)
812  {
813  $this->error = $this->lng->txt('pay_bmf_password_not_valid');
814  ilUtil::sendInfo($this->error);
815  $this->showCreditCard();
816  return;
817  }
818 
819  $_SESSION["bmf"]["credit_card"]["gueltigkeit"]["monat"] = $_POST["validity"]["month"];
820  $_SESSION["bmf"]["credit_card"]["gueltigkeit"]["jahr"] = $_POST["validity"]["year"];
821  $_SESSION["bmf"]["credit_card"]["karteninhaber"] = $_POST["card_holder"];
822  $_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_1"] = $_POST["card_number"]["block_1"];
823  $_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_2"] = $_POST["card_number"]["block_2"];
824  $_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_3"] = $_POST["card_number"]["block_3"];
825  $_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_4"] = $_POST["card_number"]["block_4"];
826  $_SESSION["bmf"]["credit_card"]["kartenpruefnummer"] = $_POST["check_number"];
827  # zum testen
828  $this->error = "";
829  $this->sendCreditCard();
830  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getInstance()
Single method to reduce footprint (included files, created instances)
+ Here is the call graph for this function:

◆ getDebitEntry()

ilPurchaseBMFGUI::getDebitEntry ( )

Definition at line 370 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilUserPasswordManager\getInstance(), sendDebitEntry(), ilUtil\sendInfo(), showDebitEntry(), and ilUtil\stripSlashes().

371  {
372  if ($_POST["account_holder"] == "" ||
373  $_POST["bank_code"] == "" ||
374  $_POST["account_number"] == "")
375  {
376  $this->error = $this->lng->txt('pay_bmf_debit_entry_not_valid');
377  ilUtil::sendInfo($this->error);
378  $this->showDebitEntry();
379  return;
380  }
381  if ($_POST["terms_conditions"] != 1)
382  {
383  $this->error = $this->lng->txt('pay_bmf_check_terms_conditions');
384  ilUtil::sendInfo($this->error);
385  $this->showDebitEntry();
386  return;
387  }
388  require_once 'Services/User/classes/class.ilUserPasswordManager.php';
389  $verified_passwd = ilUserPasswordManager::getInstance()->verifyPassword($this->user_obj, ilUtil::stripSlashes($_POST["password"]));
390  if ($_POST["password"] == "" || $verified_passwd == false)
391  {
392  $this->error = $this->lng->txt('pay_bmf_password_not_valid');
393  ilUtil::sendInfo($this->error);
394  $this->showDebitEntry();
395  return;
396  }
397 
398  $_SESSION["bmf"]["debit_entry"]["BLZ"] = $_POST["bank_code"];
399  $_SESSION["bmf"]["debit_entry"]["kontoinhaber"] = $_POST["account_holder"];
400  $_SESSION["bmf"]["debit_entry"]["kontoNr"] = $_POST["account_number"];
401 
402  $this->error = "";
403  $this->sendDebitEntry();
404  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getInstance()
Single method to reduce footprint (included files, created instances)
+ Here is the call graph for this function:

◆ getPaymentType()

ilPurchaseBMFGUI::getPaymentType ( )

Definition at line 256 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilUtil\sendInfo(), showCreditCard(), showDebitEntry(), and showPaymentType().

257  {
258  if (($_POST["payment_type"] != "credit_card" && $_POST["payment_type"] != "debit_entry") ||
259  ($_SESSION["bmf"]["personal_data"]["country"] != "DE" && $_POST["payment_type"] == "debit_entry"))
260  {
261  $this->error = $this->lng->txt('pay_bmf_payment_type_not_valid');
262  ilUtil::sendInfo($this->error);
263  $this->showPaymentType();
264  return;
265  }
266 
267  $_SESSION["bmf"]["payment_type"] = $_POST["payment_type"];
268 
269  $this->error = "";
270  if ($_SESSION["bmf"]["payment_type"] == "credit_card")
271  {
272  $this->showCreditCard();
273  }
274  else
275  {
276  $this->showDebitEntry();
277  }
278  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ getPersonalData()

ilPurchaseBMFGUI::getPersonalData ( )

Definition at line 139 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilUtil\sendInfo(), showPaymentType(), and showPersonalData().

140  {
141 
142  if ($_SESSION["bmf"]["personal_data"]["firstname"] == "" ||
143  $_SESSION["bmf"]["personal_data"]["lastname"] == "" ||
144  $_POST["zipcode"] == "" ||
145  $_POST["city"] == "" ||
146  $_POST["country"] == "" ||
147  $_SESSION["bmf"]["personal_data"]["email"] == "")
148  {
149  $this->error = $this->lng->txt('pay_bmf_personal_data_not_valid');
150  ilUtil::sendInfo($this->error);
151  $this->showPersonalData();
152  return;
153  }
154  if (($_POST["street"] == "" && $_POST["house_number"] == "" && $_POST["po_box"] == "") ||
155  (($_POST["street"] != "" || $_POST["house_number"] != "") && $_POST["po_box"] != "") ||
156  ($_POST["street"] != "" && $_POST["house_number"] == "") ||
157  ($_POST["street"] == "" && $_POST["house_number"] != ""))
158  {
159  $this->error = $this->lng->txt('pay_bmf_street_or_pobox');
160  ilUtil::sendInfo($this->error);
161  $this->showPersonalData();
162  return;
163  }
164 
165 
166  $_SESSION["bmf"]["personal_data"]["firstname"] = $this->user_obj->getFirstname();
167  $_SESSION["bmf"]["personal_data"]["lastname"] = $this->user_obj->getLastname();
168  $_SESSION["bmf"]["personal_data"]["street"] = $_POST["street"];
169  $_SESSION["bmf"]["personal_data"]["house_number"] = $_POST["house_number"];
170  $_SESSION["bmf"]["personal_data"]["po_box"] = $_POST["po_box"];
171  $_SESSION["bmf"]["personal_data"]["zipcode"] = $_POST["zipcode"];
172  $_SESSION["bmf"]["personal_data"]["city"] = $_POST["city"];
173  $_SESSION["bmf"]["personal_data"]["country"] = $_POST["country"];
174  $_SESSION["bmf"]["personal_data"]["email"] = $this->user_obj->getEmail();
175  $_SESSION["bmf"]["personal_data"]["language"] = $this->user_obj->getLanguage();
176 
177  if ($_SESSION["bmf"]["personal_data"]["country"] != "DE")
178  {
179  if ($_SESSION["bmf"]["payment_type"] == "debit_entry")
180  {
181  $_SESSION["bmf"]["payment_type"] = "";
182  }
183  }
184 
185  $this->error = "";
186  $this->showPaymentType();
187  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ ilPurchaseBMFGUI()

ilPurchaseBMFGUI::ilPurchaseBMFGUI (   $user_obj)

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

References $user_obj, and ilPayMethods\_getIdByTitle().

43  {
44  $this->pm_id = ilPayMethods::_getIdByTitle('bmf');
45  $this->pay_method = ilPayMethods::_getIdByTitle('bmf');
46  // Get user object
47  $this->user_obj = $user_obj;
48 
49  parent::__construct($this->user_obj, $this->pay_method);
50  }
static _getIdByTitle($a_pm_title)
+ Here is the call graph for this function:

◆ sendCreditCard()

ilPurchaseBMFGUI::sendCreditCard ( )

Definition at line 832 of file class.ilPurchaseBMFGUI.php.

References $_SESSION, $result, ilPurchaseBaseGUI\__clearSession(), ilPurchaseBaseGUI\__emptyShoppingCart(), ilUtil\sendInfo(), showCreditCard(), showPaymentType(), and showPersonalData().

Referenced by getCreditCard().

833  {
834  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
835 
836  $this->psc_obj->clearCouponItemsSession();
837 
838  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
839  {
840 
841  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
842  $this->tpl->touchBlock("stop_floating");
843  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
844 
845  }
846  else
847  {
848  $payment = new KreditkartenzahlungWS();
849 
850  $customer = new Kunde($this->user_obj->getId());
851 
852  $creditCard = new Kreditkarte();
853 
854  $sc_obj = new ilPaymentShoppingCart($this->user_obj);
855 
856  $tmp_bookEntries = $sc_obj->getShoppingCart();
857  if (!is_array($tmp_bookEntries))
858  {
859  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
860  }
861  else
862  {
863  $totalAmount = 0;
864  for ($i = 0; $i < count($tmp_bookEntries); $i++)
865  {
866  $booking = true;
867 
868  if (!empty($_SESSION["coupons"]["bmf"]))
869  {
870  $price = $tmp_bookEntries[$i]["price"];
871  $tmp_bookEntries[$i]["math_price"] = $price;
872 
873  foreach ($_SESSION["coupons"]["bmf"] as $key => $coupon)
874  {
875  $this->coupon_obj->setId($coupon["pc_pk"]);
876  $this->coupon_obj->setCurrentCoupon($coupon);
877 
878  $tmp_pobject = new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i]['pobject_id']);
879 
880  if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
881  {
882  $_SESSION["coupons"]["bmf"][$key]["total_objects_coupon_price"] += $price;
883  $_SESSION["coupons"]["bmf"][$key]["items"][] = $tmp_bookEntries[$i];
884 
885  $booking = false;
886  }
887 
888  unset($tmp_pobject);
889  }
890  }
891 
892  if ($booking)
893  {
894  $tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ",", ".");
895 
896  $bookEntries[] = new Buchung($tmp_bookEntries[$i]);
897  $totalAmount += $tmp_bookEntries[$i]["price"];
898  }
899  else
900  {
901  $tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ",", ".");
902  }
903  }
904 
905  $coupon_discount_items = $this->psc_obj->calcDiscountPrices($_SESSION["coupons"]["bmf"]);
906 
907  if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
908  {
909  foreach ($coupon_discount_items as $item)
910  {
911  $item["price"] = number_format((float)$item["discount_price"] , 2, ".", "");
912  $bookEntries[] = new Buchung($item);
913  $totalAmount += $item["discount_price"];
914  }
915  }
916 
917  $totalAmount = number_format((float)$totalAmount , 2, ".", "");
918  $values = array("betrag" => $totalAmount, "buchungen" => $bookEntries);
919  $bookingList = new BuchungsListe($this->user_obj->getId(), $values);
920  }
921 
922  $resultObj = $payment->zahlenUndAnlegenKunde($customer, $creditCard, $bookingList);
923  $result = $resultObj->ergebnis;
924 
925  if (is_object($result))
926  {
927  if ($result->code < 0)
928  {
929  $this->tpl->setVariable("HEADER",$this->lng->txt('error'));
930  $this->tpl->touchBlock("stop_floating");
931  $error = $this->lng->txt('pay_bmf_server_error_code') . " " . $result->code . ": " . $result->kurzText . "<br>\n" . $result->langText;
932  if ($result->code == -103 ||
933  $result->code == -104 ||
934  $result->code == -107 ||
935  ($result->code <= -202 && $result->code >= -208) ||
936  $result->code == -213)
937  {
939  $this->showPersonalData();
940  }
941  else if ($result->code == -507 ||
942  $result->code == -510 ||
943  $result->code == -511)
944  {
946  $this->showPaymentType();
947  }
948  else if ($result->code == -701 ||
949  $result->code == -1701 ||
950  $result->code == -1706 ||
951  $result->code == -1707 ||
952  $result->code == -1710 ||
953  $result->code == -1711)
954  {
956  $this->showCreditCard();
957  }
958  else
959  {
960  $error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
962  $this->showPersonalData();
963  }
964  }
965  else
966  {
967  // everything ok => send confirmation, fill statistik, delete session, delete shopping cart.
968  $external_data = array();
969  $external_data['voucher'] = $resultObj->buchungsListe->buchungen[$b++]->belegNr;
970  $external_data['transaction_extern'] = $resultObj->buchungsListe->kassenzeichen;
971  $external_data['street'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse).' '.utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
972  $external_data['po_box'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
973  $external_data['zipcode'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
974  $external_data['city'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
975  $external_data['country'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
976 
977  parent::__addbookings($external_data);
978 
979  $this->__emptyShoppingCart();
980  $this->__clearSession();
981 
982  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
983  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_thanks'));
984  $this->tpl->touchBlock("stop_floating");
985 
986  ilUtil::sendInfo($this->lng->txt('pay_bmf_thanks'));
987 
988  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.pay_bmf_credit_card.html','Services/Payment');
989 
990  if ($this->ilias->getSetting("https") != 1)
991  {
992  $this->tpl->setCurrentBlock("buyed_objects");
993  $link = $this->ctrl->getLinkTargetByClass('ilshopboughtobjectsgui');
994  $this->tpl->setVariable("LINK_GOTO_BUYED_OBJECTS", $link);
995  $this->tpl->setVariable("TXT_GOTO_BUYED_OBJECTS", $this->lng->txt('pay_goto_buyed_objects'));
996  $this->tpl->parseCurrentBlock("buyed_objects");
997  }
998  $this->tpl->setVariable("TXT_CLOSE_WINDOW", $this->lng->txt('close_window'));
999  }
1000  }
1001  else
1002  {
1003  $this->tpl->setVariable("HEADER",$this->lng->txt('error'));
1004  $this->tpl->touchBlock("stop_floating");
1005  ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
1006  }
1007  #zum testen
1008  }
1009 
1010  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$result
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendDebitEntry()

ilPurchaseBMFGUI::sendDebitEntry ( )

Definition at line 406 of file class.ilPurchaseBMFGUI.php.

References $_SESSION, $result, ilPurchaseBaseGUI\__clearSession(), ilPurchaseBaseGUI\__emptyShoppingCart(), ilUtil\sendInfo(), showDebitEntry(), showPaymentType(), and showPersonalData().

Referenced by getDebitEntry().

407  {
408  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
409 
410  $this->psc_obj->clearCouponItemsSession();
411 
412  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
413  {
414 
415  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
416  $this->tpl->touchBlock("stop_floating");
417  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
418 
419  }
420  else
421  {
422  $customer = new KundenstammdatenPflegeWS();
423 
424  $newCustomer = new Kunde($this->user_obj->getId());
425 
426  $resultCustomerObj = $customer->anlegenKunde($newCustomer);
427 
428  $resultCustomer = $resultCustomerObj->ergebnis;
429 
430  if (is_object($resultCustomer))
431  {
432  if ($resultCustomer->code < 0)
433  {
434  $error = $this->lng->txt('pay_bmf_server_error_code') . " " . $resultCustomer->code . ": " . $resultCustomer->kurzText . "<br>\n" . $resultCustomer->langText;
435  if ($resultCustomer->code == -103 ||
436  $resultCustomer->code == -104 ||
437  $resultCustomer->code == -107 ||
438  ($resultCustomer->code <= -202 && $resultCustomer->code >= -208) ||
439  $resultCustomer->code == -213)
440  {
442  $this->showPersonalData();
443  }
444  else
445  {
446  $error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
448  $this->showPersonalData();
449  }
450  }
451  else
452  {
453  $payment = new LastschriftWS();
454 
455  $debitEntry = new Lastschrift();
456 
457  $address = new LieferAdresse();
458 
459  $bank = new Bankverbindung();
460 
461  $sc_obj = new ilPaymentShoppingCart($this->user_obj);
462 
463  $tmp_bookEntries = $sc_obj->getShoppingCart();
464 
465  if (!is_array($tmp_bookEntries))
466  {
467  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
468  }
469  else
470  {
471  $totalAmount = 0;
472  for ($i = 0; $i < count($tmp_bookEntries); $i++)
473  {
474  $booking = true;
475 
476  if (!empty($_SESSION["coupons"]["bmf"]))
477  {
478  $price = $tmp_bookEntries[$i]["price"];
479  $tmp_bookEntries[$i]["math_price"] = $price;
480 
481  foreach ($_SESSION["coupons"]["bmf"] as $key => $coupon)
482  {
483  $this->coupon_obj->setId($coupon["pc_pk"]);
484  $this->coupon_obj->setCurrentCoupon($coupon);
485 
486  $tmp_pobject = new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i]['pobject_id']);
487 
488  if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
489  {
490  $_SESSION["coupons"]["bmf"][$key]["total_objects_coupon_price"] += $price;
491  $_SESSION["coupons"]["bmf"][$key]["items"][] = $tmp_bookEntries[$i];
492  $booking = false;
493  }
494 
495  unset($tmp_pobject);
496  }
497  }
498 
499  if ($booking)
500  {
501  $tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ".", "");
502  $bookEntries[] = new Buchung($tmp_bookEntries[$i]);
503  $totalAmount += $tmp_bookEntries[$i]["price"];
504  }
505  else
506  {
507  $tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ",", ".");
508  }
509  }
510 
511  $coupon_discount_items = $this->psc_obj->calcDiscountPrices($_SESSION["coupons"]["bmf"]);
512 
513  if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
514  {
515  foreach ($coupon_discount_items as $item)
516  {
517  $item["price"]= number_format( (float) $item["discount_price"], 2, ".", "");
518  $bookEntries[] = new Buchung($item);
519  $totalAmount += $item["price"];
520  }
521  }
522 
523  $totalAmount = number_format( (float) $totalAmount , 2, ".", "");
524  $values = array("betrag" => $totalAmount, "buchungen" => $bookEntries);
525  $bookingList = new BuchungsListe($this->user_obj->getId(), $values);
526  }
527 
528 
529 
530  $resultObj = $payment->abbuchenOhneEinzugsermaechtigung($resultCustomerObj->kunde->EShopKundenNr, $address, $bank, $bookingList);
531  $result = $resultObj->ergebnis;
532 
533  if (is_object($result))
534  {
535  if ($result->code < 0)
536  {
537  $this->tpl->setVariable("HEADER",$this->lng->txt('error'));
538  $this->tpl->touchBlock("stop_floating");
539  $error = $this->lng->txt('pay_bmf_server_error_code') . " " . $result->code . ": " . $result->kurzText . "<br>\n" . $result->langText;
540  if ($result->code == -103 ||
541  $result->code == -104 ||
542  $result->code == -107 ||
543  ($result->code <= -202 && $result->code >= -208) ||
544  $result->code == -213)
545  {
547  $this->showPersonalData();
548  }
549  else if ($result->code == -507 ||
550  $result->code == -510 ||
551  $result->code == -511)
552  {
554  $this->showPaymentType();
555  }
556  else if ($result->code == -402 ||
557  $result->code == -402 ||
558  $result->code == -403 ||
559  $result->code == -406 ||
560  $result->code == -410 ||
561  $result->code == -413 ||
562  $result->code == -701 ||
563  $result->code == -702 ||
564  $result->code == -703)
565  {
567  $this->showDebitEntry();
568  }
569  else
570  {
571  $error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
573  $this->showPersonalData();
574  }
575 
576  }
577  else
578  {
579  $resultCustomerObj->kunde->vorname = utf8_decode($resultCustomerObj->kunde->vorname);
580  $resultCustomerObj->kunde->nachname = utf8_decode($resultCustomerObj->kunde->nachname);
581  $resultCustomerObj->kunde->rechnungsAdresse->strasse = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse);
582  $resultCustomerObj->kunde->rechnungsAdresse->hausNr = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
583  $resultCustomerObj->kunde->rechnungsAdresse->postfach = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
584  $resultCustomerObj->kunde->rechnungsAdresse->PLZ = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
585  $resultCustomerObj->kunde->rechnungsAdresse->ort = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
586  $resultCustomerObj->kunde->rechnungsAdresse->land = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
587 
588  // everything ok => send confirmation, fill statistik, delete session, delete shopping cart.
589  $external_data = array();
590  $external_data['voucher'] = $resultObj->buchungsListe->buchungen[$b++]->belegNr;
591  $external_data['transaction_extern'] = $resultObj->buchungsListe->kassenzeichen;
592  $external_data['street'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse).' '.utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
593  $external_data['po_box'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
594  $external_data['zipcode'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
595  $external_data['city'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
596  $external_data['country'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
597 
598  parent::__addbookings($external_data);
599 
600  $this->__emptyShoppingCart();
601  $this->__clearSession();
602 
603  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
604  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_thanks'));
605  $this->tpl->touchBlock("stop_floating");
606 
607  ilUtil::sendInfo($this->lng->txt('pay_bmf_thanks'));
608 
609  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.pay_bmf_debit_entry.html','Services/Payment');
610 
611  if ($this->ilias->getSetting("https") != 1)
612  {
613  $this->tpl->setCurrentBlock("buyed_objects");
614  $link = $this->ctrl->getLinkTargetByClass('ilshopboughtobjectsgui');
615  $this->tpl->setVariable("LINK_GOTO_BUYED_OBJECTS", $link);
616  $this->tpl->setVariable("TXT_GOTO_BUYED_OBJECTS", $this->lng->txt('pay_goto_buyed_objects'));
617  $this->tpl->parseCurrentBlock("buyed_objects");
618  }
619  $this->tpl->setVariable("TXT_CLOSE_WINDOW", $this->lng->txt('close_window'));
620  }
621  }
622  else
623  {
624  $this->tpl->setVariable("HEADER",$this->lng->txt('error'));
625  $this->tpl->touchBlock("stop_floating");
626  ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
627  }
628  }
629  }
630  else
631  {
632  $this->tpl->setVariable("HEADER",$this->lng->txt('error'));
633  $this->tpl->touchBlock("stop_floating");
634  ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
635  }
636  }
637  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$result
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showCreditCard()

ilPurchaseBMFGUI::showCreditCard ( )

Definition at line 639 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilPurchaseBaseGUI\__showShoppingCart(), ilObject\_getIcon(), ilUtil\prepareFormOutput(), and ilUtil\sendInfo().

Referenced by getCreditCard(), getPaymentType(), and sendCreditCard().

640  {
641  // user_id $this->user_obj->getId()
642  // all
643 
644 /* if ($_SESSION["bmf"]["credit_card"]["karteninhaber"] == "" &&
645  $this->error == "" &&
646  $_POST["card_holder"] == "")
647  {
648  $_SESSION["bmf"]["credit_card"]["karteninhaber"] = $_SESSION["bmf"]["personal_data"]["vorname"] . " " . $_SESSION["bmf"]["personal_data"]["nachname"];
649  }*/
650 
651  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
652 
653  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
654  {
655 
656  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
657  $this->tpl->touchBlock("stop_floating");
658  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
659 
660  }
661  else
662  {
663 
664  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_credit_card.html','Services/Payment');
665  $this->__showShoppingCart();
666 
667  $this->tpl->setVariable("CREDIT_CARD_FORMACTION",$this->ctrl->getFormAction($this));
668 
669  // set table header
670  $this->tpl->setVariable("TYPE_IMG",ilObject::_getIcon('', '', 'pays'));
671  $this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
672  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_step3_credit_card'));
673  $this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_credit_card_data'));
674  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_credit_card'));
675  $this->tpl->touchBlock("stop_floating");
676  $this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
677 
678  // set plain text variables
679  $this->tpl->setVariable("TXT_CARD_HOLDER",$this->lng->txt('pay_bmf_card_holder'));
680  $this->tpl->setVariable("TXT_CHECK_NUMBER",$this->lng->txt('pay_bmf_check_number'));
681  $this->tpl->setVariable("TXT_OPTIONAL",$this->lng->txt('pay_bmf_optional'));
682  $this->tpl->setVariable("TXT_CARD_NUMBER",$this->lng->txt('pay_bmf_card_number'));
683  $this->tpl->setVariable("TXT_VALIDITY",$this->lng->txt('pay_bmf_validity'));
684  $this->tpl->setVariable("TXT_TERMS_CONDITIONS",$this->lng->txt('pay_bmf_terms_conditions'));
685  $this->tpl->setVariable("TXT_TERMS_CONDITIONS_READ",$this->lng->txt('pay_bmf_terms_conditions_read'));
686  $this->tpl->setVariable("TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt('pay_bmf_terms_conditions_show'));
687  $this->tpl->setVariable("LINK_TERMS_CONDITIONS","./payment.php?view=conditions");
688  $this->tpl->setVariable("TXT_PASSWORD",$this->lng->txt('password'));
689  $this->tpl->setVariable("TXT_CONFIRM_ORDER",$this->lng->txt('pay_confirm_order'));
690 
691  $this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_send_order'));
692  $this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
693 
694  // fill defaults
695 
696  $this->tpl->setVariable("CARD_HOLDER",
697  $this->error != "" && isset($_POST['card_holder'])
698  ? ilUtil::prepareFormOutput($_POST['card_holder'],true)
699  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['karteninhaber'],true));
700  $this->tpl->setVariable("CARD_NUMBER_BLOCK_1",
701  $this->error != "" && isset($_POST['card_number']['block_1'])
702  ? ilUtil::prepareFormOutput($_POST['card_number']['block_1'],true)
703  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_1'],true));
704  $this->tpl->setVariable("CARD_NUMBER_BLOCK_2",
705  $this->error != "" && isset($_POST['card_number']['block_2'])
706  ? ilUtil::prepareFormOutput($_POST['card_number']['block_2'],true)
707  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_2'],true));
708  $this->tpl->setVariable("CARD_NUMBER_BLOCK_3",
709  $this->error != "" && isset($_POST['card_number']['block_3'])
710  ? ilUtil::prepareFormOutput($_POST['card_number']['block_3'],true)
711  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_3'],true));
712  $this->tpl->setVariable("CARD_NUMBER_BLOCK_4",
713  $this->error != "" && isset($_POST['card_number']['block_4'])
714  ? ilUtil::prepareFormOutput($_POST['card_number']['block_4'],true)
715  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_4'],true));
716  $this->tpl->setVariable("CHECK_NUMBER",
717  $this->error != "" && isset($_POST['check_number'])
718  ? ilUtil::prepareFormOutput($_POST['check_number'],true)
719  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kartenpruefnummer'],true));
720  for ($i = 1; $i <= 12; $i++)
721  {
722  $this->tpl->setCurrentBlock("loop_validity_months");
723  $this->tpl->setVariable("LOOP_VALIDITY_MONTHS", $i < 10 ? "0" . $i : $i);
724  $this->tpl->setVariable("LOOP_VALIDITY_MONTHS_TXT", $i < 10 ? "0" . $i : $i);
725  if ($this->error != "" &&
726  isset($_POST['validity']['month']))
727  {
728  if ($_POST['validity']['month'] == $i)
729  {
730  $this->tpl->setVariable("LOOP_VALIDITY_MONTHS_SELECTED", " selected");
731  }
732  }
733  else
734  {
735  if ($_SESSION["bmf"]["credit_card"]["gueltigkeit"]["monat"] == $i)
736  {
737  $this->tpl->setVariable("LOOP_VALIDITY_MONTHS_SELECTED", " selected");
738  }
739  }
740  $this->tpl->parseCurrentBlock("loop_validity_months");
741  }
742  for ($i = date("Y"); $i <= (date("Y")+6); $i++)
743  {
744  $this->tpl->setCurrentBlock("loop_validity_years");
745  $this->tpl->setVariable("LOOP_VALIDITY_YEARS", $i);
746  $this->tpl->setVariable("LOOP_VALIDITY_YEARS_TXT", $i);
747  if ($this->error != "" &&
748  isset($_POST['validity']['year']))
749  {
750  if ($_POST['validity']['year'] == $i)
751  {
752  $this->tpl->setVariable("LOOP_VALIDITY_YEARS_SELECTED", " selected");
753  }
754  }
755  else
756  {
757  if ($_SESSION["bmf"]["credit_card"]["gueltigkeit"]["jahr"] == $i)
758  {
759  $this->tpl->setVariable("LOOP_VALIDITY_YEARS_SELECTED", " selected");
760  }
761  }
762  $this->tpl->parseCurrentBlock("loop_validity_years");
763  }
764 /* if ($this->error != "" &&
765  isset($_POST["terms_conditions"]))
766  {
767  $this->tpl->setVariable("TERMS_CONDITIONS_" . $_POST["terms_conditions"], " checked") ;
768  }*/
769 /* if ($this->error != "" &&
770  isset($_POST["password"]))
771  {
772  $this->tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST['password'],true));
773  }*/
774 
775  // Button
776  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
777  $this->tpl->setCurrentBlock("btn_cell");
778  $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPaymentType"));
779  $this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
780  $this->tpl->parseCurrentBlock("btn_cell");
781 
782  }
783  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showDebitEntry()

ilPurchaseBMFGUI::showDebitEntry ( )

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

References $_POST, $_SESSION, ilPurchaseBaseGUI\__showShoppingCart(), ilObject\_getIcon(), ilUtil\prepareFormOutput(), and ilUtil\sendInfo().

Referenced by getDebitEntry(), getPaymentType(), and sendDebitEntry().

281  {
282  // user_id $this->user_obj->getId()
283  // all
284 
285 /* if ($_SESSION["bmf"]["debit_entry"]["kontoinhaber"] == "" &&
286  $this->error == "" &&
287  $_POST["account_holder"] == "")
288  {
289  $_SESSION["bmf"]["debit_entry"]["kontoinhaber"] = $_SESSION["bmf"]["personal_data"]["vorname"] . " " . $_SESSION["bmf"]["personal_data"]["nachname"];
290  }*/
291 
292  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
293 
294  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
295  {
296 
297  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
298  $this->tpl->touchBlock("stop_floating");
299  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
300 
301  }
302  else
303  {
304 
305  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_debit_entry.html','Services/Payment');
306 
307  $this->__showShoppingCart();
308 
309  $this->tpl->setVariable("DEBIT_ENTRY_FORMACTION",$this->ctrl->getFormAction($this));
310 
311  // set table header
312  $this->tpl->setVariable("TYPE_IMG",ilObject::_getIcon('', '', 'pays'));
313  $this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
314  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_step3_debit_entry'));
315  $this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_debit_entry_data'));
316  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_debit_entry'));
317  $this->tpl->touchBlock("stop_floating");
318  $this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
319 
320  // set plain text variables
321  $this->tpl->setVariable("TXT_ACCOUNT_HOLDER",$this->lng->txt('pay_bmf_account_holder'));
322  $this->tpl->setVariable("TXT_OPTIONAL",$this->lng->txt('pay_bmf_optional'));
323  $this->tpl->setVariable("TXT_BANK_CODE",$this->lng->txt('pay_bmf_bank_code'));
324  $this->tpl->setVariable("TXT_ACCOUNT_NUMBER",$this->lng->txt('pay_bmf_account_number'));
325  $this->tpl->setVariable("TXT_TERMS_CONDITIONS",$this->lng->txt('pay_bmf_terms_conditions'));
326  $this->tpl->setVariable("TXT_TERMS_CONDITIONS_READ",$this->lng->txt('pay_bmf_terms_conditions_read'));
327  $this->tpl->setVariable("TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt('pay_bmf_terms_conditions_show'));
328  $this->tpl->setVariable("LINK_TERMS_CONDITIONS","./payment.php?view=conditions");
329  $this->tpl->setVariable("TXT_PASSWORD",$this->lng->txt('password'));
330  $this->tpl->setVariable("TXT_CONFIRM_ORDER",$this->lng->txt('pay_confirm_order'));
331 
332  $this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_send_order'));
333  $this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
334 
335  // fill defaults
336 
337  $this->tpl->setVariable("ACCOUNT_HOLDER",
338  $this->error != "" && isset($_POST['account_holder'])
339  ? ilUtil::prepareFormOutput($_POST['account_holder'],true)
340  : ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['kontoinhaber'],true));
341  $this->tpl->setVariable("BANK_CODE",
342  $this->error != "" && isset($_POST['bank_code'])
343  ? ilUtil::prepareFormOutput($_POST['bank_code'],true)
344  : ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['BLZ'],true));
345  $this->tpl->setVariable("ACCOUNT_NUMBER",
346  $this->error != "" && isset($_POST['account_number'])
347  ? ilUtil::prepareFormOutput($_POST['account_number'],true)
348  : ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['kontoNr'],true));
349 /* if ($this->error != "" &&
350  isset($_POST["terms_conditions"]))
351  {
352  $this->tpl->setVariable("TERMS_CONDITIONS_" . strtoupper($_POST["terms_conditions"]), " checked") ;
353  }*/
354 /* if ($this->error != "" &&
355  isset($_POST["password"]))
356  {
357  $this->tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST['password'],true));
358  }*/
359 
360  // Button
361  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
362  $this->tpl->setCurrentBlock("btn_cell");
363  $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPaymentType"));
364  $this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
365  $this->tpl->parseCurrentBlock("btn_cell");
366 
367  }
368  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPaymentType()

ilPurchaseBMFGUI::showPaymentType ( )

Definition at line 189 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilObject\_getIcon(), and ilUtil\sendInfo().

Referenced by getPaymentType(), getPersonalData(), sendCreditCard(), and sendDebitEntry().

190  {
191  // user_id $this->user_obj->getId()
192  // all
193 
194  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
195 
196  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
197  {
198 
199  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
200  $this->tpl->touchBlock("stop_floating");
201  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
202 
203  }
204  else
205  {
206 
207  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_payment_type.html','Services/Payment');
208 
209  $this->tpl->setVariable("PAYMENT_TYPE_FORMACTION",$this->ctrl->getFormAction($this));
210 
211  // set table header
212  $this->tpl->setVariable("TYPE_IMG", ilObject::_getIcon('', '', 'pays'));
213  $this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
214  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_step2'));
215  $this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_payment_type'));
216  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_payment_type'));
217  $this->tpl->touchBlock("stop_floating");
218  $this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
219 
220  // set plain text variables
221  if ($_SESSION["bmf"]["personal_data"]["country"] == "DE")
222  {
223  $this->tpl->setVariable("TXT_DEBIT_ENTRY",$this->lng->txt('pay_bmf_debit_entry'));
224  }
225  $this->tpl->setVariable("TXT_CREDIT_CARD",$this->lng->txt('pay_bmf_credit_card'));
226 
227  $this->tpl->setVariable("INPUT_VALUE",ucfirst($this->lng->txt('next')));
228  $this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
229 
230  // fill defaults
231 
232  if ($this->error != "" &&
233  isset($_POST["payment_type"]))
234  {
235  $this->tpl->setVariable("PAYMENT_TYPE_" . strtoupper($_POST["payment_type"]), " checked") ;
236  }
237  else
238  {
239  if (($_SESSION["bmf"]["personal_data"]["country"] != "DE" && $_POST["payment_type"] != "debit_entry") ||
240  $_SESSION["bmf"]["personal_data"]["country"] == "DE")
241  {
242  $this->tpl->setVariable("PAYMENT_TYPE_" . strtoupper($_SESSION["bmf"]["payment_type"]), " checked") ;
243  }
244  }
245 
246  // Button
247  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
248  $this->tpl->setCurrentBlock("btn_cell");
249  $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPersonalData"));
250  $this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
251  $this->tpl->parseCurrentBlock("btn_cell");
252 
253  }
254  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPersonalData()

ilPurchaseBMFGUI::showPersonalData ( )

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

References $_POST, $_SESSION, ilPurchaseBaseGUI\__getCountries(), ilUtil\prepareFormOutput(), ilUtil\sendInfo(), ilSelectInputGUI\setOptions(), ilTextInputGUI\setValue(), and ilNonEditableValueGUI\setValue().

Referenced by getPersonalData(), sendCreditCard(), and sendDebitEntry().

58  {
59  // user_id $this->user_obj->getId()
60  // all
61 
62  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
63 
64  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
65  {
66 
67  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
68  $this->tpl->touchBlock("stop_floating");
69  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
70 
71  }
72  else
73  {
74  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_step1'));
75  $this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_personal_data'));
76  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_personal_data'));
77 
78  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
79 
80  $oForm = new ilPropertyFormGUI();
81  $oForm->setFormAction($this->ctrl->getFormAction($this, 'getPersonalData'));
82  $oForm->setTitle($this->lng->txt('pay_bmf_personal_data'));
83 
84  $oFirstname = new ilNonEditableValueGUI($this->lng->txt('firstname'));
85  $oFirstname->setValue($this->user_obj->getFirstname());
86  $oForm->addItem($oFirstname);
87 
88  $oLastname = new ilNonEditableValueGUI($this->lng->txt('lastname'));
89  $oLastname->setValue($this->user_obj->getLastname());
90  $oForm->addItem($oLastname);
91 
92  $oStreet = new ilTextInputGUI($this->lng->txt('street'),'street');
93  $oStreet->setValue($this->error != '' && isset($_POST['street'])
94  ? ilUtil::prepareFormOutput($_POST['street'],true)
95  : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['street'],true));
96  $oForm->addItem($oStreet);
97 
98  $oHouseNumber = new ilTextInputGUI($this->lng->txt('pay_bmf_house_number'), 'house_number');
99  $oHouseNumber->setValue($this->error != '' && isset($_POST['house_number'])
100  ? ilUtil::prepareFormOutput($_POST['house_number'],true)
101  : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['house_number'],true));
102  $oForm->addItem($oHouseNumber);
103 
104  $oPoBox = new ilTextInputGUI($this->lng->txt('pay_bmf_or').' '.$this->lng->txt('pay_bmf_po_box'), 'po_box');
105  $oPoBox->setValue($this->error != '' && isset($_POST['po_box'])
106  ? ilUtil::prepareFormOutput($_POST['po_box'],true)
107  : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['po_box'],true));
108  $oForm->addItem($oPoBox);
109 
110  $oZipCode = new ilTextInputGUI($this->lng->txt('zipcode'), 'zipcode');
111  $oZipCode->setValue($this->error != '' && isset($_POST['zipcode'])
112  ? ilUtil::prepareFormOutput($_POST['zipcode'],true)
113  : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['zipcode'],true));
114  $oForm->addItem($oZipCode);
115 
116  $oCity = new ilTextInputGUI($this->lng->txt('city'), 'city');
117  $oCity->setValue($this->error != '' && isset($_POST['city'])
118  ? ilUtil::prepareFormOutput($_POST['city'],true)
119  : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['city'],true));
120  $oForm->addItem($oCity);
121 
122 
123  $oCountry = new ilSelectInputGUI($this->lng->txt('country'), 'country');
124  $oCountry->setOptions($this->__getCountries());
125  $oCountry->setValue($this->error != '' && isset($_POST['country']) ? $_POST['country']
126  : $_SESSION['bmf']['personal_data']['country']);
127  $oForm->addItem($oCountry);
128 
129  $oEmail = new ilNonEditableValueGUI($this->lng->txt('email'));
130  $oEmail->setValue($this->user_obj->getEmail());
131  $oForm->addItem($oEmail);
132 
133  $oForm->addcommandButton('getPersonalData',ucfirst($this->lng->txt('next')));
134  $this->tpl->setVariable('FORM',$oForm->getHTML());
135 
136  }
137  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$_POST['username']
Definition: cron.php:12
This class represents a selection list property in a property form.
This class represents a property form user interface.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
This class represents a non editable value in a property form.
setValue($a_value)
Set Value.
__getCountries()
shows select box f�r countries
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $coupon_obj

ilPurchaseBMFGUI::$coupon_obj = null

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

◆ $ctrl

ilPurchaseBMFGUI::$ctrl

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

◆ $error

ilPurchaseBMFGUI::$error

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

◆ $pay_method

ilPurchaseBMFGUI::$pay_method = null

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

◆ $pm_id

ilPurchaseBMFGUI::$pm_id = 0
private

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

◆ $shoppingCart

ilPurchaseBMFGUI::$shoppingCart

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

◆ $soapClient

ilPurchaseBMFGUI::$soapClient

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

◆ $totalVat

ilPurchaseBMFGUI::$totalVat = 0
private

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

◆ $tpl

ilPurchaseBMFGUI::$tpl

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

◆ $user_obj

ilPurchaseBMFGUI::$user_obj

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

Referenced by ilPurchaseBMFGUI().


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