views/assertions.php
changeset 3 f3e55c2386a1
child 4 fcb273554da6
equal deleted inserted replaced
2:7c6c888b2fed 3:f3e55c2386a1
       
     1 <?php if(isset($title))
       
     2     echo "<h2>$title</h2>";
       
     3 ?>
       
     4 <table border=1>
       
     5 <tr>
       
     6 <th>
       
     7 <?php if(isset($show_influences))
       
     8         $colspan=3;
       
     9       else
       
    10         $colspan=2;?>
       
    11 <th colspan="<?=$colspan?>"><?=$user_name?>
       
    12 <th colspan="<?=$colspan?>"><?=$other_user_name?>
       
    13 <tr>
       
    14 <th>Id
       
    15 <?php if(isset($show_influences)):?>
       
    16 <th>Influo
       
    17 <?php endif;?>
       
    18 <th>Valoro
       
    19 <th>Kalkulita
       
    20 <?php if(isset($show_influences)):?>
       
    21 <th>Influo
       
    22 <?php endif;?>
       
    23 <th>Valoro
       
    24 <th>Kalkulita
       
    25 <th>Teksto
       
    26 <th>Ŝanĝi
       
    27 <?php foreach($assertions as $assertion):?>
       
    28 <?=form_open("opiniarbo/index/$assertionid/$other_user");?>
       
    29 <tr>
       
    30 <?="<input type=\"hidden\" name=\"id\" id=\"id\" value=\"{$assertion['id']}\"/>";?>
       
    31 <?php
       
    32     if(isset($assertion['parent']))
       
    33         echo "<input type=\"hidden\" name=\"parent\" id=\"parent\" value=\"{$assertion['parent']}\"/>";
       
    34     echo "<td>{$assertion['id']}";
       
    35     if(isset($assertion['value1']))
       
    36     {
       
    37         $value1 = $assertion['value1'];
       
    38         // We suppose any value1 comes with vid
       
    39         echo "<input type=\"hidden\" name=\"vid\" id=\"vid\" value=\"{$assertion['vid']}\">";
       
    40     }
       
    41     else
       
    42         $value1 = "";
       
    43     if (isset($show_influences))
       
    44     {
       
    45         if (isset($assertion['parent']))
       
    46         {
       
    47             if(isset($assertion['influence1']))
       
    48                 $influence1 = $assertion['influence1'];
       
    49             else
       
    50                 $influence1 = "";
       
    51             echo "<td><input type=\"text\" name=\"influence\" id=\"influence\" value=\"{$influence1}\" maxlength=\"5\" size=\"3\" />";
       
    52         }
       
    53         else
       
    54             echo "<td>";
       
    55     }
       
    56 
       
    57     echo "<td><input type=\"text\" name=\"value\" id=\"value\" value=\"{$value1}\" maxlength=\"5\" size=\"3\" />";
       
    58 
       
    59     if (isset($assertion['calc_value1']))
       
    60         echo "<td>{$assertion['calc_value1']}";
       
    61     else
       
    62         echo "<td>";
       
    63 
       
    64     if (isset($show_influences))
       
    65     {
       
    66         if (isset($assertion['parent']))
       
    67         {
       
    68             if(isset($assertion['influence2']))
       
    69                 $influence2 = $assertion['influence2'];
       
    70             else
       
    71                 $influence2 = "";
       
    72             echo "<td>{$influence2}";
       
    73         }
       
    74         else
       
    75             echo "<td>";
       
    76     }
       
    77 
       
    78     if (isset($assertion['value2']))
       
    79         echo "<td>{$assertion['value2']}";
       
    80     else
       
    81         echo "<td>";
       
    82 
       
    83     if (isset($assertion['calc_value2']))
       
    84         echo "<td>{$assertion['value2']}";
       
    85     else
       
    86         echo "<td>";
       
    87     echo "<td>" . anchor("opiniarbo/index/{$assertion['id']}/{$other_user}",
       
    88         $assertion['text']);
       
    89 ?>
       
    90 <td>
       
    91 <?php  if(isset($assertion['value1'])):?>
       
    92     <input type="submit" name="modify" value="Ŝanĝi"/>
       
    93     <input type="submit" name="delete" value="Forigi"/>
       
    94 <?php  else:?>
       
    95     <input type="submit" name="addvalue" value="Taksi"/>
       
    96 <?php  endif;?>
       
    97 </form>
       
    98 <?php endforeach;?>
       
    99 </table>