Help bij maken functies voor joomla
Ik heb de gehele code tussen de php tags geplaatst zodat het duidelijk is wat mijn code is. Dus de eerste en de laatste regel horen er niet bij.
Helemaal onderaan heb ik een afbeelding geplaatst van de site, maar je kunt deze ook live bekijken via de volgende link;
http://www.kugelberger.eu/en/products/ball-screws/fk
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
[code]<?php defined( '_JEXEC' ) or die; ?>
<div id="fk_moer">
<p><strong>Flange single nut</strong></p>
<p style="line-height: 2em; color: #eec216; background-color: #000000; display: block; padding-left: 1em;"><strong>DIN 69051-5<br /></strong></p>
<div style="width: 50%; float: left;">
<ul>
<li>Standard lead</li>
<li>Nut with seal</li>
<li>Ground ball nut tracks</li>
<li>Right hand thread (Left hand on request)</li>
</ul>
</div>
<div><a data-lightbox="transitionIn:elastic;transitionOut:elastic;" href="/images/kugelberger/FK_ISO_BIG.png" data-spotlight="on"> <img src="/images/kugelberger/FK_ISO.jpg" alt="Spotlight Image" border="0" height="178" width="305" /> </a></div>
<hr />
<h3>Make your selection:</h3>
<form method="post">
<label>Type:</label>
<select name="type">
<?php foreach ($rows as $row): ?>
<option value="<?php echo $row->Type; ?>"><?php echo $row->Type; ?>
<?php endforeach ?>
</select>
<input name="select" type="submit" value="SELECT">
</form>
<?php
if (isset($_POST['select'])) {
// Execute this code if the submit button is pressed.
$type = $_POST['type'];
} else {
$type = "FK 1605";
}
?>
<p>The current select Type is <strong><?php echo $type; ?></strong>, see the dimensions below;
<div class="drawing">
<?php
// De CAD file zonder maten
if ($type <= "FK 3210") {
echo "<img src=\"/images/FK_1.png\" alt=\"Spotlight Image\" border=\"0\" height=\"285\" width=\"705\">";
$trans = "";
} else {
echo "<img src=\"/images/FK_2.png\" alt=\"Spotlight Image\" border=\"0\" height=\"285\" width=\"705\">";
$trans = "trans";
}
for ($i = 0; $i < count($rows); $i++) {
if ($rows[$i]->Type == $type) {
$sel_result = $rows[$i];
}
}
?>
<div class="dd1"><p><?php echo $sel_result->dd1; ?></p></div>
<div class="d3"><p><?php echo $sel_result->d3; ?></p></div>
<div class="D1"><p><?php echo $sel_result->D1; ?></p></div>
<div class="D4"><p><?php echo $sel_result->D4; ?></p></div>
<div class="D5"><p><?php echo $sel_result->D5; ?></p></div>
<div class="D6"><p><?php echo $sel_result->D6; ?></p></div>
<div class="L<?php echo $trans; ?>"><p><?php echo $sel_result->L; ?></p></div>
<div class="L0<?php echo $trans; ?>"><p><?php echo $sel_result->L0; ?></p></div>
<div class="L7<?php echo $trans; ?>"><p><?php echo $sel_result->L7; ?></p></div>
<div class="L8<?php echo $trans; ?>"><p><?php echo $sel_result->L8; ?></p></div>
</div>
<div>
<table class="zebra">
<caption>
[Units: mm]
</caption>
<tr>
<th scope="col">d0</th>
<th scope="col">P</th>
<th scope="col">i</th>
<th scope="col">Ca</th>
<th scope="col">Coa</th>
<th scope="col">STP-file</th>
</tr>
<tr>
<td><?php echo $sel_result->d0; ?></td>
<td><?php echo $sel_result->P; ?></td>
<td><?php echo $sel_result->i; ?></td>
<td><?php echo $sel_result->Ca; ?></td>
<td><?php echo $sel_result->Coa; ?></td>
<td><?php $file = $sel_result->Type; $file = str_replace(" ", "", $file); ?>
<a href="images/STP/<?php echo $file; ?>.stp.zip" class="wf_file"> <img class="wf_file_icon" src="media/jce/icons/archive.png" style="border: 0px; vertical-align: middle;" alt="zip" /> <span class="wf_file_text"> <?php echo $file; ?>.stp.zip</span></a></td>
</tr>
</table>
</div>
</div>
?>
[code]<?php defined( '_JEXEC' ) or die; ?>
<div id="fk_moer">
<p><strong>Flange single nut</strong></p>
<p style="line-height: 2em; color: #eec216; background-color: #000000; display: block; padding-left: 1em;"><strong>DIN 69051-5<br /></strong></p>
<div style="width: 50%; float: left;">
<ul>
<li>Standard lead</li>
<li>Nut with seal</li>
<li>Ground ball nut tracks</li>
<li>Right hand thread (Left hand on request)</li>
</ul>
</div>
<div><a data-lightbox="transitionIn:elastic;transitionOut:elastic;" href="/images/kugelberger/FK_ISO_BIG.png" data-spotlight="on"> <img src="/images/kugelberger/FK_ISO.jpg" alt="Spotlight Image" border="0" height="178" width="305" /> </a></div>
<hr />
<h3>Make your selection:</h3>
<form method="post">
<label>Type:</label>
<select name="type">
<?php foreach ($rows as $row): ?>
<option value="<?php echo $row->Type; ?>"><?php echo $row->Type; ?>
<?php endforeach ?>
</select>
<input name="select" type="submit" value="SELECT">
</form>
<?php
if (isset($_POST['select'])) {
// Execute this code if the submit button is pressed.
$type = $_POST['type'];
} else {
$type = "FK 1605";
}
?>
<p>The current select Type is <strong><?php echo $type; ?></strong>, see the dimensions below;
<div class="drawing">
<?php
// De CAD file zonder maten
if ($type <= "FK 3210") {
echo "<img src=\"/images/FK_1.png\" alt=\"Spotlight Image\" border=\"0\" height=\"285\" width=\"705\">";
$trans = "";
} else {
echo "<img src=\"/images/FK_2.png\" alt=\"Spotlight Image\" border=\"0\" height=\"285\" width=\"705\">";
$trans = "trans";
}
for ($i = 0; $i < count($rows); $i++) {
if ($rows[$i]->Type == $type) {
$sel_result = $rows[$i];
}
}
?>
<div class="dd1"><p><?php echo $sel_result->dd1; ?></p></div>
<div class="d3"><p><?php echo $sel_result->d3; ?></p></div>
<div class="D1"><p><?php echo $sel_result->D1; ?></p></div>
<div class="D4"><p><?php echo $sel_result->D4; ?></p></div>
<div class="D5"><p><?php echo $sel_result->D5; ?></p></div>
<div class="D6"><p><?php echo $sel_result->D6; ?></p></div>
<div class="L<?php echo $trans; ?>"><p><?php echo $sel_result->L; ?></p></div>
<div class="L0<?php echo $trans; ?>"><p><?php echo $sel_result->L0; ?></p></div>
<div class="L7<?php echo $trans; ?>"><p><?php echo $sel_result->L7; ?></p></div>
<div class="L8<?php echo $trans; ?>"><p><?php echo $sel_result->L8; ?></p></div>
</div>
<div>
<table class="zebra">
<caption>
[Units: mm]
</caption>
<tr>
<th scope="col">d0</th>
<th scope="col">P</th>
<th scope="col">i</th>
<th scope="col">Ca</th>
<th scope="col">Coa</th>
<th scope="col">STP-file</th>
</tr>
<tr>
<td><?php echo $sel_result->d0; ?></td>
<td><?php echo $sel_result->P; ?></td>
<td><?php echo $sel_result->i; ?></td>
<td><?php echo $sel_result->Ca; ?></td>
<td><?php echo $sel_result->Coa; ?></td>
<td><?php $file = $sel_result->Type; $file = str_replace(" ", "", $file); ?>
<a href="images/STP/<?php echo $file; ?>.stp.zip" class="wf_file"> <img class="wf_file_icon" src="media/jce/icons/archive.png" style="border: 0px; vertical-align: middle;" alt="zip" /> <span class="wf_file_text"> <?php echo $file; ?>.stp.zip</span></a></td>
</tr>
</table>
</div>
</div>
?>
Gewijzigd op 01/06/2012 11:20:43 door Hans Jonker
Er zijn nog geen reacties op dit bericht.