<div id="siteContent">
  <div >
    <h1 style='display:inline-block'>mHero: Workflow Participant</h1>
    <div style='float:right;display:inline-block'>
      <img text='mHero' style='width:12em' src='file/mHero.png'  />
    </div>
  </div>
  <hr/>

  <h2><span type='form' name="person:surname"/>, <span type='form' name="person:firstname"/> </h2>
  <a  type='form'  name='view_url'>(Return to main record)</a>

  
  <div id="error" />

  <form  method="post" action="mHero_person_workflow" id='start_flow'>
    <input type="hidden" name="id"/>
    <table class="multiFormTable" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <th colspan="2">mHero Workflow</th>
      </tr>
      <tr >
	<td>
	  <label for='flow'>Workflow <select name='flow'><option>Select a workflow</option></select>
	</td>
	<td>
	  <input type="submit" value='Start Workflow' />
	</td>
      </tr>
    </table>      
  </form>

  <form  method="GET" action="mHero_person_workflow" id='view_results'>
    <input type="hidden" name="id"/>
    <table class="multiFormTable" border="0" cellpadding="0" cellspacing="0">
      <tr >
	<td>
	  <label for='flow'>Workflow <select name='flow'><option>Select a workflow</option></select>
	</td>
	<td>
	  <input type="submit" value='View Results' />
	</td>
      </tr>
    </table>
  </form>

  <span ifset='!true' name='show_results' >
    <script id='mHero_show_results'/>
    <div id='results_ajax' > &nbsp;</div>
  </span>

  <span ifset='true' name='has_flow' >
    <span ifset='true' name='show_results' >
      <span id='results'>
	<h1><a name='flow_editor'><span name='flow_name'/></a></h1>
	
	<h2>
	  Workflow Results:
	  <span style='float:right;padding-right:10em;'><span name='phone'/></span>
	</h2>
	<p>
	  View Contact in RapidPro:
	  <span name='contact_url' />
	</p>
	  
	<div >
	  <table class="multiFormTable" border="0" cellpadding="0" cellspacing="0" 	tbody >
	    <tr ><th colspan='5'><center>Status of Variables</center></th></tr>
	    <tr>
	      <th>Label</th>
	      <th>Timestamp</th>
	      <th>Value</th>
	      <th>Rule Value</th>
	      <th>Text</th>
	    </tr>
	    <tbody id='results_value'/>
	    <tr ><th colspan='5'><center>Individual Runs of the Workflow</center></th></tr>
	    <tr>
	      <th>Label</th>
	      <th>Value</th>
	      <th>Text</th>
	      <th>Message Sent</th>
	      <th>Response Received</th>
	    </tr>
	    <tbody id='results_step'/>
	  </table>	

	</div>
      </span>
    </span>
  </span>

</div>
