<?cs include:"super_util.cs" ?>

<?cs def:print_row(label, value) ?> 
    <tr>
     <td class="table_heading"><?cs var:label ?></td>
     <td><?cs var:value ?></td>
    </tr>
<?cs /def ?>



<?cs def:print_delivered_info() ?>
 <?cs if:display_del ?>
    <?cs call:print_row(lang.survey_info_detail.time_sent, info.deliver_time) ?> 
    <?cs call:print_row(lang.survey_info_detail.release_time, info.release_time) ?> 
    <?cs call:print_row(lang.survey_info_detail.unrelease_time, info.unrelease_time) ?> 
    <?cs call:print_row(lang.survey_info_detail.result_time, info.result_time) ?> 
    <?cs call:print_row(lang.survey_info_detail.save_course, lang.survey_info_detail.save[info.save]) ?> 
    <?cs call:print_row(lang.survey_info_detail.takers, lang.survey_info_detail.taker[info.taker]) ?> 
    <?cs call:print_row(lang.survey_info_detail.number_course, info.course_count) ?> 
     <?cs if:display_course_list ?>
       <?cs call:print_row(lang.survey_info_detail.course_list, dummy) ?> 
       <?cs each:this = info.course ?>
          <?cs call:print_row(dummy, this) ?> 
       <?cs /each ?>
     <?cs /if ?>
 <?cs /if ?>
<?cs /def ?>
  



<?cs def:print_shared_users() ?> 
  <?cs if:display_shared ?>
       <?cs call:print_row(lang.survey_info_detail.shared_users, dummy) ?> 
       <?cs each:this = info.shared ?>
          <?cs call:print_row(dummy, this) ?> 
       <?cs /each ?>
  <?cs /if ?>
<?cs /def ?>





<?cs def:print_close_win() ?>
  <?cs if:close_win ?>
   <div class="center_msg">
     <form action="">
     <div><input type="button" value="<?cs var:lang.survey_info_detail.close_win ?>" onclick="javascript:window.close()" title="<?cs var:lang.survey_info_detail.close_win ?>" />
     </div>
    </form>
  </div>
 <?cs /if ?>
<?cs /def ?>




<?cs def:print_delete_button() ?>
  <?cs if:delete_button ?>
  <tr><td class="survey_color" colspan="2" align="center">
   <div class="cener_msg">
    <form method="post" action="survey_delete_survey" onsubmit="return window.confirm('<?cs if:(info.state == "released") || (info.state == "www" ) ?><?cs var:lang.survey_info_detail.delete_survey_and_results_warning ?><?cs else ?><?cs var:lang.survey_info_detail.delete_survey_only_warning ?><?cs /if ?>')">
    <div>
     <input type="hidden" name="id" value="<?cs var:Query.id ?>" />
     <input type="hidden" name="count" value="<?cs var:Query.count ?>" />
     <?cs if:Query.www_count ?>
     <input type="hidden" name="www_count" value="<?cs var:Query.www_count ?>" />
     <?cs /if ?>
     <input type="hidden" name="admin" value="<?cs var:Query.admin ?>" />
     <?cs if:Query.username ?>
     <input type="hidden" name="username" value="<?cs var:Query.username ?>" />
     <?cs /if ?>
    </div>
    <input type="button" value="<?cs var:lang.survey_info_detail.cancel_button ?>" title="<?cs var:lang.survey_info_detail.cancel_button ?>" onclick="javascript:window.close()" />
    <input type="submit" value="<?cs var:lang.survey_info_detail.delete_button ?>" title="<?cs var:lang.survey_info_detail.delete_button ?>"  />
    </form></div>
  </td></tr>
  <?cs /if ?>
<?cs /def ?> 







<?cs call:html_header() ?>
   <head>
      <title><?cs var:lang.survey_info_detail.page_title ?></title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <link rel="StyleSheet" href="<?cs var:image_path ?>common.css" type="text/css"  />
   <link rel="StyleSheet" href="<?cs var:image_path ?>survey.css" type="text/css"  />
  </head>
  
<body>
<table width="100%">
  <tr><td align="center">
   <table border="1" cellspacing="0" cellpadding="3">
    <caption><i><?cs var:info.title ?></i></caption>
    <?cs call:print_row(lang.survey_info_detail.current_time, current_time) ?> 
    <?cs call:print_row(lang.survey_info_detail.id, info.id) ?> 
    <?cs call:print_row(lang.survey_info_detail.create_time, info.create_time) ?> 

   <?cs if:info.state == "developing" ?>
        <?cs call:print_row(lang.survey_info_detail.status, lang.survey_info_detail.under_development) ?>
   <?cs elif:info.state == "finished" ?>
        <?cs call:print_row(lang.survey_info_detail.status, lang.survey_info_detail.finalized) ?>
   <?cs elif:info.state == "public" ?>
        <?cs call:print_row(lang.survey_info_detail.status, lang.survey_info_detail.public) ?>
   <?cs elif:info.state == "released" ?>
        <?cs call:print_row(lang.survey_info_detail.status, lang.survey_info_detail.mymanhattan_delivered) ?>
   <?cs elif:info.state == "www" ?>
        <?cs call:print_row(lang.survey_info_detail.status, lang.survey_info_detail.www_delivered) ?>
   <?cs else ?>
         <?cs call:print_row(lang.survey_info_detail.status, info.state) ?>
   <?cs /if ?> 

    <?cs call:print_row(lang.survey_info_detail.author, info.author + " (" + info.author_id + ")") ?> 
    <?cs call:print_row(lang.survey_info_detail.path, info.survey_domain) ?> 
    <?cs call:print_delivered_info() ?>
    <?cs call:print_shared_users() ?> 

    <?cs call:print_delete_button() ?>
   </table>
    <?cs call:print_close_win() ?>
 </td></tr>
</table>
</body>
</html>
<?cs call:runtime() ?>
