5873 |
hartmut |
1 |
<?php
|
|
|
2 |
|
5877 |
hartmut |
3 |
/**
|
|
|
4 |
* Dieses Template wird nach einer Targo Zahlung angezeigt
|
|
|
5 |
*/
|
5873 |
hartmut |
6 |
|
5877 |
hartmut |
7 |
if ($this->get_option('wpsg_mod_targo_url_use') == 0)
|
|
|
8 |
{
|
5888 |
hartmut |
9 |
$url = $this->get_option('wpsg_mod_targo_url_live');
|
5877 |
hartmut |
10 |
}
|
|
|
11 |
else
|
|
|
12 |
{
|
5888 |
hartmut |
13 |
$url = $this->get_option('wpsg_mod_targo_url_test');
|
5877 |
hartmut |
14 |
}
|
5873 |
hartmut |
15 |
?>
|
|
|
16 |
|
5922 |
hartmut |
17 |
<p><?php echo __('Um den Betrag mit einer Finanzierung bei der TARGOBANK zu bezahlen, klicken Sie bitte auf folgendes Logo.', 'wpsg'); ?></p>
|
5873 |
hartmut |
18 |
<p>
|
5922 |
hartmut |
19 |
<!--
|
5877 |
hartmut |
20 |
<a title="<?php echo __('Mit Targo bezahlen', 'wpsg'); ?>" href="<?php echo $url; ?>">
|
5922 |
hartmut |
21 |
<img src="<?php echo $this->getRessourceURL('gfx/targologo.png'); ?>" align="left" alt="<?php echo __('Finanzierung bei Targo beantragen.', 'wpsg'); ?>" style="margin-right:7px;">
|
5873 |
hartmut |
22 |
|
|
|
23 |
</a>
|
5922 |
hartmut |
24 |
-->
|
5873 |
hartmut |
25 |
</p>
|
|
|
26 |
|
5922 |
hartmut |
27 |
<form class="wpsg_productform" id="wpsg_produktform" method="post" action="<?php echo $url ?>">
|
|
|
28 |
|
|
|
29 |
<input type="image" name="image" src="<?php echo $this->getRessourceURL('gfx/targologo.png'); ?>" alt="<?php echo __('Finanzierung bei Targo beantragen.', 'wpsg'); ?>" style="margin-right:7px;">
|
|
|
30 |
|
|
|
31 |
<div style="display:none;">
|
5873 |
hartmut |
32 |
<?php $o_id = $this->view['o_id'];
|
|
|
33 |
$k_id = $this->view['k_id'];
|
|
|
34 |
$oOrder = wpsg_order::getInstance($o_id);
|
|
|
35 |
$brutto = $oOrder->getAmount(WPSG_BRUTTO);
|
|
|
36 |
$brutto = wpsg_round($brutto, 2);
|
|
|
37 |
/** @var wpsg_customer */
|
|
|
38 |
$oCustomer = wpsg_customer::getInstance($k_id);
|
|
|
39 |
/*
|
|
|
40 |
$geb1 = $oCustomer->getBirthdate("Y-m-d");
|
|
|
41 |
$geb2 = $oCustomer->getBirthdate();
|
|
|
42 |
$geb3 = $oCustomer->data["geb"];
|
|
|
43 |
$geb4 = wpsg_date("Y-m-d", strtotime($geb3));
|
|
|
44 |
$geb5 = strtotime($geb3);
|
|
|
45 |
$geb6 = strtotime("0000-00-00");
|
|
|
46 |
$geb6 = strtotime("1901-12-13");
|
|
|
47 |
$geb6 = strtotime("1901-12-14");
|
|
|
48 |
*/
|
|
|
49 |
$dl = $this->view['targoLink'];
|
|
|
50 |
|
|
|
51 |
$street = $oOrder-> getInvoiceStreetClear(true);
|
|
|
52 |
$nr = $oOrder-> getInvoiceStreetNr();
|
|
|
53 |
|
|
|
54 |
?>
|
|
|
55 |
<?php ?>
|
5922 |
hartmut |
56 |
<?php
|
|
|
57 |
function toIso($string) {
|
|
|
58 |
return mb_convert_encoding($string, "ISO-8859-1");
|
|
|
59 |
}
|
5873 |
hartmut |
60 |
|
5922 |
hartmut |
61 |
?>
|
|
|
62 |
|
5873 |
hartmut |
63 |
<br /><br />
|
|
|
64 |
<b>Obligatorische Daten für Targobank</b><br />
|
|
|
65 |
<input type="text" id="koop_id" name="koop_id" value="<?php echo $this->get_option('wpsg_mod_targo_koop_id');?>" placeholder="koop_id"><br />
|
|
|
66 |
<input type="text" id="SessionID" name="sessionID" value="<?php echo session_id();?>" placeholder="sessionID"><br />
|
|
|
67 |
<input type="text" id="amount" name="amount" value="<?php echo $brutto;?>" placeholder="amount"><br />
|
|
|
68 |
<input type="text" id="dealerID" name="dealerID" value="<?php echo $this->get_option('wpsg_mod_targo_dealerid');?>" placeholder="dealerID"><br />
|
|
|
69 |
<input type="text" id="dealerText" name="dealerText" value="<?php echo $this->view['targoLink'];?>" placeholder="dealerText"><br />
|
5888 |
hartmut |
70 |
<input type="text" id="documentno" name="documentno" value="<?php echo $this->view['o_id'];?>" placeholder="documentno"><br />
|
5873 |
hartmut |
71 |
|
|
|
72 |
|
|
|
73 |
<b>Optionale Daten für Targobank</b><br />
|
5922 |
hartmut |
74 |
<input type="text" id="dealerShopURL" name="dealerShopURL" value="<?php echo $this->get_option('wpsg_mod_targo_dealerShopURL');?>" placeholder="dealerShopURL"><br />
|
|
|
75 |
<input type="text" id="dealerAbortURL" name="dealerAbortURL" value="<?php echo $this->get_option('wpsg_mod_targo_dealerAbortURL');?>" placeholder="dealerAbortURL"><br />
|
5873 |
hartmut |
76 |
<input type="text" id="hash" name="hash" value="" placeholder="hash">(hashkey)<br />
|
|
|
77 |
<input type="text" id="" name="" value="" placeholder=""><br />
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
<b>Adressdaten aus Kundendaten</b><br />
|
5922 |
hartmut |
81 |
<?php
|
|
|
82 |
$titel = $oCustomer->getTitle();
|
|
|
83 |
$isotitel = '';
|
|
|
84 |
if (($titel == "Herr") || ($titel == "Frau")) $isotitel = toIso($titel);
|
|
|
85 |
?>
|
|
|
86 |
<input type="text" id="surname" name="gender" value="<?php echo $isotitel;?>" placeholder="titel"><br />
|
|
|
87 |
<input type="text" id="surname" name="surname" value="<?php echo toIso($oCustomer->getName());?>" placeholder="surname"><br />
|
|
|
88 |
<input type="text" id="firstname" name="firstname" value="<?php echo toIso($oCustomer->getFirstname());?>" placeholder="firstname"><br />
|
|
|
89 |
<input type="text" id="street" name="street" value="<?php echo toIso($oOrder->getInvoiceStreetClear(true));?>" placeholder="street"><br />
|
|
|
90 |
<input type="text" id="streetnumber" name="streetnumber" value="<?php echo toIso($oOrder->getInvoiceStreetNr());?>" placeholder="streetnumber"><br />
|
|
|
91 |
<input type="text" id="zip" name="zip" value="<?php echo toIso($oCustomer->getZip());?>" placeholder="zip"><br />
|
|
|
92 |
<input type="text" id="city" name="city" value="<?php echo toIso($oCustomer->getCity());?>" placeholder="city"><br />
|
5873 |
hartmut |
93 |
<input type="text" id="telnocode" name="telnocode" value="" placeholder="vorwahl"><br />
|
5922 |
hartmut |
94 |
<input type="text" id="telno" name="telno" value="<?php echo toIso($oCustomer->getPhone());?>" placeholder="telno"><br />
|
|
|
95 |
<input type="text" id="birthday" name="birthday" value="<?php
|
|
|
96 |
|
|
|
97 |
$dt = $oCustomer->getBirthdate("Y-m-d");
|
|
|
98 |
|
|
|
99 |
if ($oCustomer->geb == '0000-00-00' || strtotime($dt) === false)
|
|
|
100 |
{
|
|
|
101 |
|
|
|
102 |
echo '';
|
|
|
103 |
|
|
|
104 |
}
|
|
|
105 |
else
|
|
|
106 |
{
|
|
|
107 |
|
|
|
108 |
echo $oCustomer->getBirthdate("Y-m-d");
|
|
|
109 |
|
|
|
110 |
}
|
5873 |
hartmut |
111 |
|
5922 |
hartmut |
112 |
?>" placeholder="birthday"><br />
|
|
|
113 |
<input type="text" id="email" name="email" value="<?php echo toIso($oCustomer->getEMail());?>" placeholder="email"><br />
|
|
|
114 |
|
5873 |
hartmut |
115 |
<input type="submit" id="submit" name="submit" value="submit" >
|
|
|
116 |
|
5922 |
hartmut |
117 |
</div>
|
5873 |
hartmut |
118 |
</form>
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
<?php if ($this->get_option('wpsg_mod_targo_autostart') == '1') { ?>
|
|
|
122 |
<script type="text/javascript">/* <![CDATA[ */
|
|
|
123 |
|
|
|
124 |
jQuery(document).ready(function() {
|
|
|
125 |
window.setTimeout(function() {
|
5922 |
hartmut |
126 |
//location.href = "<?php echo $url;?>";
|
|
|
127 |
jQuery('#submit').trigger("click");
|
5873 |
hartmut |
128 |
}, 1000);
|
|
|
129 |
} );
|
|
|
130 |
|
|
|
131 |
/* ]]> */</script>
|
|
|
132 |
<?php } ?>
|