views/assertions.php
changeset 3 f3e55c2386a1
child 4 fcb273554da6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/views/assertions.php	Sun Dec 28 16:57:53 2008 +0000
@@ -0,0 +1,99 @@
+<?php if(isset($title))
+    echo "<h2>$title</h2>";
+?>
+<table border=1>
+<tr>
+<th>
+<?php if(isset($show_influences))
+        $colspan=3;
+      else
+        $colspan=2;?>
+<th colspan="<?=$colspan?>"><?=$user_name?>
+<th colspan="<?=$colspan?>"><?=$other_user_name?>
+<tr>
+<th>Id
+<?php if(isset($show_influences)):?>
+<th>Influo
+<?php endif;?>
+<th>Valoro
+<th>Kalkulita
+<?php if(isset($show_influences)):?>
+<th>Influo
+<?php endif;?>
+<th>Valoro
+<th>Kalkulita
+<th>Teksto
+<th>Ŝanĝi
+<?php foreach($assertions as $assertion):?>
+<?=form_open("opiniarbo/index/$assertionid/$other_user");?>
+<tr>
+<?="<input type=\"hidden\" name=\"id\" id=\"id\" value=\"{$assertion['id']}\"/>";?>
+<?php
+    if(isset($assertion['parent']))
+        echo "<input type=\"hidden\" name=\"parent\" id=\"parent\" value=\"{$assertion['parent']}\"/>";
+    echo "<td>{$assertion['id']}";
+    if(isset($assertion['value1']))
+    {
+        $value1 = $assertion['value1'];
+        // We suppose any value1 comes with vid
+        echo "<input type=\"hidden\" name=\"vid\" id=\"vid\" value=\"{$assertion['vid']}\">";
+    }
+    else
+        $value1 = "";
+    if (isset($show_influences))
+    {
+        if (isset($assertion['parent']))
+        {
+            if(isset($assertion['influence1']))
+                $influence1 = $assertion['influence1'];
+            else
+                $influence1 = "";
+            echo "<td><input type=\"text\" name=\"influence\" id=\"influence\" value=\"{$influence1}\" maxlength=\"5\" size=\"3\" />";
+        }
+        else
+            echo "<td>";
+    }
+
+    echo "<td><input type=\"text\" name=\"value\" id=\"value\" value=\"{$value1}\" maxlength=\"5\" size=\"3\" />";
+
+    if (isset($assertion['calc_value1']))
+        echo "<td>{$assertion['calc_value1']}";
+    else
+        echo "<td>";
+
+    if (isset($show_influences))
+    {
+        if (isset($assertion['parent']))
+        {
+            if(isset($assertion['influence2']))
+                $influence2 = $assertion['influence2'];
+            else
+                $influence2 = "";
+            echo "<td>{$influence2}";
+        }
+        else
+            echo "<td>";
+    }
+
+    if (isset($assertion['value2']))
+        echo "<td>{$assertion['value2']}";
+    else
+        echo "<td>";
+
+    if (isset($assertion['calc_value2']))
+        echo "<td>{$assertion['value2']}";
+    else
+        echo "<td>";
+    echo "<td>" . anchor("opiniarbo/index/{$assertion['id']}/{$other_user}",
+        $assertion['text']);
+?>
+<td>
+<?php  if(isset($assertion['value1'])):?>
+    <input type="submit" name="modify" value="Ŝanĝi"/>
+    <input type="submit" name="delete" value="Forigi"/>
+<?php  else:?>
+    <input type="submit" name="addvalue" value="Taksi"/>
+<?php  endif;?>
+</form>
+<?php endforeach;?>
+</table>