<?php require('config.php'); require('SRC/macros.php');
list ($home,$url,$users,$assign,$msg,$host,$sql,$MYCookie,$applet,$os)=courseAll();
$user_nbr=getaUserNbr($$MYCookie);
list ($user_name,$user_home,$user_url,$user_profile)=userid($user_nbr);

if ($user_nbr>99) {	                        # Registered user
  $db = SQLconnect($host,$sql);
  $cmd = "SELECT user_passed,admin_payed FROM users WHERE user_nbr=$user_nbr;";
  $users=SQLquery($db,$cmd);
  $user=SQLobject($users,0);
  SQLclose($db);
}
myheader('Download service','..',$myPermit);
?>

It is not necessary, not even useful, to download the source files if you 
want to compile your own schemes and execute them in our web-browser; 
for that, you better 
<a href=register.php onMouseover="window.status=' # register'; return true"
>register</A> for an account on our server.
The material download below is intended for individuals who want to study 
from home without always maintaining an Internet connection, registered 
students who want to print their own solutions on paper and users who want 
to download the APPLET source code to compile it independently on their own 
computer. You need to 
<a href=../login.php onMouseover="window.status=' # login'; return true"
>login</a> to be given access to some of the documents.


<h4>Syllabus (for everyone, to study off-line)</h4>
<?php if (1==1) { 
  echo "<form action=fetch.php method=post> \n".
       "  <SELECT NAME=selectSyllabus>\n".
       "  <OPTION SELECTED>java-powered syllabus (UNIX tar.gz)\n".
       "  <OPTION>java-powered syllabus (Windows zip)\n".
       "  <OPTION>printed syllabus (Postscript)\n".
       "  <OPTION>printed syllabus (Acrobat PDF)\n".
       "</SELECT>\n".
       "<input type=submit value=Select>\n</form>\n";
} ?>

If you work from home and you want to access the material quickly without 
being too tough on your telephone bill, you may want to download once for 
all the compressed version of the syllabus and browse directly from your 
hard drive (3.5 Mbytes).

<h4>Solutions / course certificate (for registered and qualifying users)</h4>
<?php 
if ($user_nbr>99) { 
  echo "<form action=print.php method=post>\n".
       "<SELECT NAME=action>\n".
       "    <OPTION SELECTED>solutions compile\n".
       "    <OPTION>solutions (TeX source)\n".
       "    <OPTION>solutions (Acrobat PDF)\n".
       "    <OPTION>solutions (Postscript)\n".
       "    <OPTION>solutions (UNIX tex.gz)\n".
       "    <OPTION>solutions (UNIX ps.gz)\n";
  if (strstr($user->user_passed,'passed') ||
      strstr($user->user_passed,'Teacher')) { 
    echo "    <OPTION>certificate (Acrobat PDF)\n";
  }
  echo "</SELECT>\n".
       "<input type=submit value=Select>\n".
       "</form>\n";

#      "    <OPTION>solutions (Acrobat PDF)\n".

} ?>

Registered users may <i>compile</i> their own solutions into an electric 
document ready to be sent to a printer. Best is to choose the <i>pdf</i> 
or compressed <i>gz</i> format, but a TeX source is also provided if your 
own errors prevent the compiler to complete the work - allowing you finish 
the work on your own computer.


<h4>JBONE source code (V1.0 for registered users, up to V4.0 for qualifying users)</h4>
To promote the exchange of educational material, we have been distributing
the JBONE-1.0 source code <b>free of charge</b> for personal use ever since 
this course went on-line in 1999. 
To add a motivation to fulfill the course requirements, we also distribute 
the latest version available at the time of registration (now JBONE-4.2) 
with the modifications performed in the user project.
For this, local students must <i>pass</i> and distance-learning student must 
pay the fee helping us to further develop this material.

<?php 
if ($user_nbr>99 && ( strstr($user->user_passed,'passed') || 
                      strstr($user->admin_payed,'paid')  || 
                      strstr($user->user_passed,'Teacher') || 
                      strstr($user->user_passed,'Assistant') ) ) { 
  echo "
   Your profile entitles you to download the <b>new</b> JBONE-V4.0 source 
   code.
   <form action=fetch.php method=post>
   <SELECT NAME=selectApplet>
       <OPTION>Your project JBONE (UNIX make tar.gz)
       <OPTION>Your project JBONE (java listing)
   </SELECT>
   <input type=submit value=Select><br>
   <input type=checkbox name=publish checked value=t>
   We may publish your registration as a 
   <a href=users.php onMouseover=\"window.status=' # users'; return true\"
   >downloader of this course</a> (your email will not be exposed)<br>
   <input type=checkbox name=announcements checked value=t>
      Please keep me informed about new releases.
   </form>\n";
} else if ($user_nbr>99) {
  echo "
   Your profile entitles you to download the <b>old</b> JBONE-V1.0 
   free of charge (43 kBytes gzipped).
   <form action=fetch.php method=post>
   <SELECT NAME=selectApplet>
       <OPTION>JBONE-1.0 (UNIX make tar.gz)
       <OPTION>JBONE-1.0 (java listing)
   </SELECT>
   <input type=submit value=Select><br>
   <input type=checkbox name=publish checked value=t>
   We may publish your registration as a 
   <a href=users.php onMouseover=\"window.status=' # users'; return true\"
   >downloader of this course</a> (your email will not be exposed)<br>
   <input type=checkbox name=announcements checked value=t>
      Please keep me informed about new releases.
   </form>";
} else {
  echo "You need to login to be given access to this service.";
}
echo "<br><p>";
myfooter($user_nbr,'..',$myPermit);
?>
