<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>IRMMW-THz 2008 :: Paper Submission</title>

<script language='JavaScript' type='text/javascript' src='ref_submit_pdf_check_only.js'></script>


<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="The International Conference on Infrared and Millimeter Waves/THz Electronics (IRMMW-THz), now in its 37th year, is the oldest and largest continuous forum specifically devoted to the field of ultra high frequency electronics and applications.">
<meta name="keywords" content="irmmw, irmmw 2008, ir, milimeter wave, infrared and millimeter wave, ir and thz conference">
<meta name="robots" content="all" />
<link rel="stylesheet" type="text/css" href="http://www.irmmw-thz2008.org/global1.css" title="IRMMW-THz 2008, Registration" />
</head>
<body onload="MM_preloadImages('http://www.irmmw-thz2008.org/goFig1_f2.gif')">
<a name="top" id="top"></a>

<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="435" rowspan="2" align="left" valign="top"><a href="../home/index.html"><img src="http://www.irmmw-thz2008.org/graphics/body/subpage-header2.jpg" alt="Welcome!" width="435" height="192" border="0" /></a></td>
    <td width="345" height="39" align="right" valign="middle"><script language="JavaScript" type="text/javascript">

   <!--
   var contact = "Email"
   var email = "irmmw-thz2008"
   var emailHost = "caltech.edu"
   document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+ 
">" + contact + "</a>")
   //-->

              </script>
      | <a href="../LOC-secure/index.html">LOC Secure</a></td>
  </tr>
  <tr>
    <td align="left" valign="top"><p class="subhd1">33rd International Conference on Infrared, Millimeter, and Terahertz Waves</p>
        <p class="subhd1"><span class="subhd4"><strong>September 15 &ndash; 19, 2008</strong></span><br />
          California Institute of Technology<br />
          Pasadena . California<br />
    USA </p>
    <p class="subhd1">&nbsp;</p></td>
  </tr>
</table>
<table width="780" border="0" align="center" cellpadding="8" cellspacing="0">
  <tr>
    <td width="250" align="left" valign="top"><table width="95%" border="0" cellspacing="0" cellpadding="1">
      <tr bgcolor="#99CCCC">
        <td bgcolor="#0099ff"><table width="100%" border="0" cellspacing="0" cellpadding="7" bgcolor="#000">
            <tr>
              <td align="left" valign="top"><a href="http://www.irmmw-thz2008.org/home/index.html" class="superlink">Home</a><a href="http://www.irmmw-thz2008.org/home/index.html#news" class="sublink2">Announcements</a><br />
                  <a href="http://www.irmmw-thz2008.org/news/index.html" class="sublink2">News Archive</a><br />
                  </a><a href="http://www.irmmw-thz2008.org/index.html" class="sublink2">Gateway Page</a>
                  <p><a href="http://www.irmmw-thz2008.org/program/index.html" class="superlink">Program</a><a href="http://www.irmmw-thz2008.org/program/keydates.html" class="sublink2">Key Dates</a><br />
                      <a href="http://www.irmmw-thz2008.org/program/index.html#schedule" class="sublink2">Schedule</a> <br />
                      </a><a href="http://www.irmmw-thz2008.org/program/major-topics.html" class="sublink2">Major Topics</a><br />
                  </p>
                <p><a href="http://www.irmmw-thz2008.org/registration/index.html" class="superlink">Registration</a><a href="http://www.irmmw-thz2008.org/registration/fees.html" class="sublink2">Fees</a><br />
                      <a href="http://www.irmmw-thz2008.org/abs-sub/index.html" class="sublink2">Abstract Submission</a><br />
                      <a href="http://www.irmmw-thz2008.org/exhibitors/index.html" class="sublink2">Exhibitors</a><br />
                  </p>
                <p><a href="http://www.irmmw-thz2008.org/travel/index.html" class="superlink">Travel FAQ</a><a href="http://www.irmmw-thz2008.org/travel/index.html#accomodations" class="sublink2">Accommodations</a><br />
                      <a href="http://www.irmmw-thz2008.org/travel/index.html#visa" class="sublink2">Visa Requirements</a><br />
                      <a href="http://www.irmmw-thz2008.org/travel/pasadena.html" class="sublink2">Pasadena, California</a><br />
                    <a href="http://www.irmmw-thz2008.org/travel/index.html#parking" class="sublink2">Parking</a></p>
                <p><a href="http://www.irmmw-thz2008.org/people/index.html" class="superlink">People</a><a href="http://www.irmmw-thz2008.org/people/index.html" class="sublink2">Organizing Committees</a><a href="../people/hosts-sponsors.html" class="sublink2"><br />
                    </a><a href="http://www.irmmw-thz2008.org/people/contact.html" class="sublink2">Contact Information<br />
                  </a></p>
                <p><a href="http://www.irmmw-thz2008.org/links/index.html" class="superlink">Links</a><br />
                </p></td>
            </tr>
        </table></td>
      </tr>
    </table>
      <br />
    <p>&nbsp;</p></td>
    <td width="530" align="left" valign="top"><p><span class="superhd4">Paper Upload</span><br />
        </p>
      <p>
        <?php

global $input_fields, $top_level_folder, $notify_email, $submit_response, $dest_folder;
	$last	= $_POST['applicant_last_name'];
	$first	= $_POST['applicant_first_name'];

$top_level_folder			= "/mnt/data1/marionne/public_html/uploads/file_submit/irmmw";
$dest_folder				= "/mnt/data1/eas1/octopus/local/irmmw/apps";
$notify_email				= "irmmw-thz2008@caltech.edu";
$submit_response			= "<p>Thank you for your pdf submission.</p>

<p>Corresponding author: " . $first . " <br>
Paper ID number: " . $last . " </p>

<p>The final step of this process is (was) to <a href=\"http://www.beatricia.caltech.edu/irmmw-thz2008/registration/ieee1.html\">submit your paper information to the IEEE for copyright</a>.</p>

<p>If you have any questions, please direct them to <a href=\"mailto:no6b@no6b.jpl.nasa.edu\">Robert Dengler (no6b@no6b.jpl.nasa.edu).</a></p>

<p>Sincerely,</p>

<p>The Conference Organizers<br>
IRMMW-THz 2008<br>
September 15 - 19, 2008<br>
California Institute of Technology<br>
Pasadena, CA 91125</p>\n";


	
$input_fields				= 
	array(
	"PDF Paper"=>"input1",	
	);

function show_file_submit_form()
{
	global $input_fields, $top_level_folder, $notify_email;
	$applicant_last_name = $_GET['applicant_last_name'];
	$applicant_first_name = $_GET['applicant_first_name'];
	$submit_email = $_GET['submit_email'];
	
	echo "<div id='file_submit_content'>\n";

	echo "<div id='file_submit_form'>\n";

	echo "<form enctype='multipart/form-data' action='ref_submit.php' method='post' onsubmit='return test_submit_form()' id='host_submit_form'>\n";
	echo "<input type='hidden' name='MAX_FILE_SIZE' value='5000000'>\n";

	echo "<table>\n";

	echo "<tr align=\"left\" valign=\"top\">\n";
	echo "<td class='submit_input_label'>Paper ID</td>\n";
	echo "<td>\n";
	echo "<input name='applicant_last_name' class='submit_input_field' value=$applicant_last_name>\n";
	echo "</td>\n";
	echo "</tr>\n";

	echo "<tr align=\"left\" valign=\"top\">\n";
	echo "<td class='submit_input_label'>Last Name of Corr Auth</td>\n";
	echo "<td>\n";
	echo "<input name='applicant_first_name' class='submit_input_field' value=$applicant_first_name>\n";

	echo "<tr align=\"left\" valign=\"top\">\n";
	echo "<td class='submit_input_label'>Email Address</td>\n";
	echo "<td>\n";
	echo "<input name='submit_email' class='submit_input_field' value=$submit_email>\n";

	echo "<hr></td>\n";
	echo "</tr>\n";

	foreach($input_fields as $label=>$value)
		{
		echo "<tr>\n";
		echo "<td class='submit_input_label'>$label</td>\n";
		echo "<td>\n";
		echo "<input type=file name=$value class='submit_input_field'>\n";
		echo "</td>\n";
		echo "</tr>\n";
		}

	echo "<tr>\n";
	echo "<td> </td>\n";
	echo "<td id='submit_input_button'>\n";
	echo "<hr><input type=submit name='submit_button' value='Submit'>\n";
	echo "</td>\n";
	echo "</tr>\n";

	echo "</table>\n";

	echo "</div>\n";

	echo "</div>\n";
}

function setup_upload_dir()
{
	global $top_level_folder, $dest_folder;
	$last	= $_POST['applicant_last_name'];
	$first	= $_POST['applicant_first_name'];
	$submit_last = $_POST['submit_last_name'];


	$upload_dir			= $top_level_folder . "/" . $last . "_" . $first . "_" . $submit_last;
	$dest_submit_dir	= $dest_folder . "/" . $last . "_" . $first . "_" . $submit_last;

	$test_dir		= $upload_dir;
	$test_dest_dir	= $dest_submit_dir;
	for ($i = 1; $i <= 100; $i++)
		{		
		if (is_dir($test_dir) || is_dir($test_dest_dir))
			{
			$test_dir		= $upload_dir . "_" . $i;
			$test_dest_dir	= $dest_submit_dir . "_" . $i;
			}
		else
			{
			mkdir($test_dir, 0755);
			return $test_dir;
			}
		}
		
	return $test_dir;
}

function process_file_submit_form()
{
  global $input_fields, $submit_response, $notify_email;
  $submit_email   = $_POST['submit_email'];
  $submit_last = $_POST['submit_last_name'];
  
  $upload_dir	= setup_upload_dir();
  
  foreach($input_fields as $key=>$value)
    {
      $name	= $upload_dir . "/" .  $_FILES[$value]['name'];
      if ($name != "")
	{
	  move_uploaded_file($_FILES[$value]['tmp_name'], "$name");
	}
    }
  
# we need to create an emtpy file that tells the cron job whether
# or not the transfer is complete. if this file exists, then the
# transfer is complete.
  
  $transfer_finished_flag_file	= $upload_dir . "/.eas1_file_submit_transfer_finished";
  $handle	= fopen($transfer_finished_flag_file, 'w');
  fclose($handle);
  
  $last	= $_POST['applicant_last_name'];
  $first	= $_POST['applicant_first_name'];
  
  $from		= "From: irmmw-2008@caltech.edu\r\n";
  $subject	= "Paper Submission: ID " . $last . ", " . $first;
  
  mail($notify_email, $subject, $subject, $from);
  mail($submit_email, $subject, strip_tags($submit_response), $from);
  
  echo "<span id='submit_response'>$submit_response</span>\n";
}

if (array_key_exists('applicant_first_name', $_POST))
	{
	process_file_submit_form();
	}
else
	{
	
?>
      Please upload your pdf file that meets the formatting guidelines required. Papers that do not meet the formatting guidelines will be rejected.</p>
      <p>
        <?php	


	show_file_submit_form();
	}


?>
      </p>
      <p>&nbsp;</p>
      <p><a href="#top"></a></p>    </td></tr>
  <tr>
    <td colspan="2" align="right" valign="top"><a href="http://www.caltech.edu/copyright/" class="sublink3">&copy;2007
          California Institute of Technology. All Rights Reserved.</a>&nbsp;&nbsp;&nbsp;<span class="posted">last
          update:
         <!-- #BeginDate format:Am3 -->05/15/2008<!-- #EndDate -->
          </span></td>
  </tr>
</table>

<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

<map name="Map" id="Map"><area shape="rect" coords="22,92,755,118" href="#" /></map></body>
</html>
