<link rel="stylesheet" href="/js/jquery-ui/smoothness/jquery-ui-1.8.21.custom.css" type="text/css" />
<script type="text/javascript" src="/js/jquery-ui/jquery-ui-1.8.21.custom.min.js"></script>

<script>
	$(function() {
			$( "#t_expires" ).datepicker({
				showButtonPanel: true
			});
	});
  function upload_task_attach(text){
      $("#t_attach").val(text);
      $("#upload_status0").text(text);
  }
</script>

<div class="row-fluid">
  <div class="span9 offset1" style="border-right:1px solid #ddd; min-height:750px;padding:15px 50px 15px 0;">
  <h3>Suggest Task Ideas</h3>
  <p class="muted">Suggest an idea for articles you want to write, and describe what do you think the article worth writing, and what will be included in the articles.</p>
  <p><br> </p>
<form action="<?php echo site_url('welcome/create_task_submit') ?>"  name="form_create_task" id="form_create_task" method="post">

  <div class="control-group">
  <label class="control-label">Task name</label>
    <div class="controls">
		<input type="text" class="span12" id="t_title" name="t_title" placeholder="Task name" value="<?php echo isset($task)?$task->t_title:false; ?>" />
    </div>
  </div>
  
  <div class="control-group">
  <label class="control-label">Task description</label>
  <div class="controls">
		<textarea rows="12" class="span12" id="t_content" name="t_content" ><?php echo isset($task)?$task->t_content:false; ?></textarea>
    </div>
  </div>
  
  <div class="">
    <div class="span3">
      <div class="control-group">
        <label class="control-label">Estimated time of completion</label>
          <div class="controls">
            <input class="span12" size="16" id="t_expires" name="t_expires" type="text" placeholder="yy-mm-dd" value="<?php echo isset($task)?date('m/d/Y',strtotime($task->t_expires)):false; ?>" />
          </div>
      </div>
    </div>
    <input type="hidden" name="t_attach" id="t_attach" value="">
</form>
    <div class="span2">
      <div class="control-group">
        <label class="control-label">.</label>
          <div class="controls" style="position:relative">
            <form action="<?php echo site_url('welcome/upload_task_attach') ?>" 
              method="post" 
              target="ifm1"
              class="form-horizontal"
              enctype="multipart/form-data" style="position:absolute;z-index:10;">
              <input class="span12" style="filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;cursor: pointer;" type="file" name="task_attach" id="task_attach" onChange="this.form.submit()" />
            </form>
            <span class="text-info" style="position: absolute;top: 4px;"> Add Attachment + </span>
          </div>
      </div>
    </div>
    <div class="span6">
      <div class="control-group">
        <label class="control-label">.</label>
          <div class="controls" id="upload_status0" style="padding-top: 4px;"> </div>
      </div>
    </div>
  </div>
  <div id="upload_status1">
         <iframe class="ifm1 hide" name="ifm1"></iframe>
    </div>

	<div class="btn-group pull-right">
   <button class="btn btn-primary"  onclick="submitForm('form_create_task');">Submit your task.</button>
  </div>


  </div>
  <div class="span2" style="padding-right:12px;"><?php echo $rank_view; ?></div>
</div>
