Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="content"<?php print $content_attributes; ?>>
- <?php
- // Hide comments, tags, and links now so that we can render them later.
- hide($content['comments']);
- hide($content['links']);
- hide($content['field_tags']);
- // print render($content);
- $node_wrapper = entity_metadata_wrapper('node', $node);
- $valuation[1] = $node_wrapper->field_item->value();
- $valuation[2] = $node_wrapper->field_retail_price->value();
- $valuation[3] = $node_wrapper->field_sale_price->value();
- $valuation[4] = $node_wrapper->field_your_price->value();
- $rows = count($valuation[1]); // define number of rows
- $cols = 6;// define number of columns
- for ($i=0;$i<$rows;$i++){
- $j = sprintf('<input type="Submit" id="%s %s" name="itemselect" value="%s" />', $valuation[1][$i], $node->title, "Select");
- $k = sprintf('<input type=text name="itemname" value="%s %s" />', $valuation[1][$i], $node->title);
- $valuation[6][$i]=$j;
- $valuation[5][$i]=$k;
- }
- echo "<form name=\"products\" method=\"post\" action=\"\">";
- echo "<table border='1'>";
- for($tr=1;$tr<=$rows;$tr++){
- echo "<tr class=\"row$tr\">";
- for($td=1;$td<=$cols;$td++){
- echo "<td class=\"column$td\">".$valuation[($td)][($tr-1)]."</td>";
- }
- echo "</tr>";
- }
- echo "</table>";
- echo "</form>";
- ?>
- <?php if($_POST['itemselect']) {
- $itemid=$_POST['itemname'];
- drupal_set_message($itemid);
- }
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment