Guest User

Untitled

a guest
Jun 4th, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1.   <div class="content"<?php print $content_attributes; ?>>
  2.  
  3.  
  4.     <?php
  5.       // Hide comments, tags, and links now so that we can render them later.
  6.       hide($content['comments']);
  7.       hide($content['links']);
  8.       hide($content['field_tags']);
  9. //      print render($content);
  10. $node_wrapper = entity_metadata_wrapper('node', $node);
  11. $valuation[1] = $node_wrapper->field_item->value();
  12. $valuation[2] = $node_wrapper->field_retail_price->value();
  13. $valuation[3] = $node_wrapper->field_sale_price->value();
  14. $valuation[4] = $node_wrapper->field_your_price->value();
  15.  
  16. $rows = count($valuation[1]); // define number of rows
  17. $cols = 6;// define number of columns
  18.  
  19.  
  20. for ($i=0;$i<$rows;$i++){
  21.  
  22. $j = sprintf('<input type="Submit" id="%s %s" name="itemselect" value="%s" />', $valuation[1][$i], $node->title, "Select");
  23.  
  24. $k = sprintf('<input type=text name="itemname" value="%s %s" />', $valuation[1][$i], $node->title);
  25.  
  26. $valuation[6][$i]=$j;
  27. $valuation[5][$i]=$k;
  28. }
  29.  
  30. echo "<form name=\"products\" method=\"post\" action=\"\">";
  31. echo "<table border='1'>";
  32. for($tr=1;$tr<=$rows;$tr++){
  33.  
  34.  
  35.     echo "<tr class=\"row$tr\">";
  36.         for($td=1;$td<=$cols;$td++){
  37.         echo "<td class=\"column$td\">".$valuation[($td)][($tr-1)]."</td>";
  38.         }
  39.     echo "</tr>";
  40. }
  41.  
  42. echo "</table>";
  43. echo "</form>";
  44.  
  45.     ?>
  46.  
  47. <?php if($_POST['itemselect']) {
  48. $itemid=$_POST['itemname'];
  49. drupal_set_message($itemid);
  50. }
  51. ?>
  52.  
  53.  
  54.   </div>
Advertisement
Add Comment
Please, Sign In to add comment