[ Index ]
 

Code source de WebCalendar 1.0.5

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables | Statistiques

title

Body

[fermer]

/ -> availability.php (source)

   1  <?php
   2  /*
   3   * Page Description:
   4   *    Display a timebar view of a single day.
   5   *
   6   * Input Parameters:
   7   *    month (*) - specify the starting month of the timebar
   8   *    day (*) - specify the starting day of the timebar
   9   *    year (*) - specify the starting year of the timebar
  10   *    users (*) - csv of users to include
  11   *    (*) required field
  12      *
  13   * Security:
  14   *    Must have "allow view others" enabled ($allow_view_other) in
  15   *      System Settings unless the user is an admin user ($is_admin).
  16   */
  17  
  18  include_once  'includes/init.php';
  19  
  20  // Don't allow users to use this feature if "allow view others" is
  21  // disabled.
  22  if ( $allow_view_other == "N" && ! $is_admin ) {
  23    // not allowed...
  24    exit;
  25  }
  26  
  27  // input args in URL
  28  // users: list of comma-separated users
  29  if ( empty ( $users ) ) {
  30    echo "Program Error: No users specified!"; exit;
  31  } else if ( empty ( $year ) ) {
  32    echo "Program Error: No year specified!"; exit;
  33  } else if ( empty ( $month ) ) {
  34    echo "Program Error: No month specified!"; exit;
  35  } else if ( empty ( $day ) ) {
  36    echo "Program Error: No day specified!"; exit;
  37  }
  38  
  39  $INC = array ( 'js/availability.php' );
  40  print_header($INC, '', "onload=\"focus();\"", true );
  41  
  42  $span = ($WORK_DAY_END_HOUR - $WORK_DAY_START_HOUR) * 3 + 1;
  43  if (strlen($month) == 1) $month = '0'.$month;   // add leading zeros
  44  if (strlen($day) == 1) $day = '0'.$day;         // add leading zeros
  45  $date = $year.$month.$day;
  46  $time = mktime(0,0,0,$month,$day,$year);
  47  $wday = strftime ( "%w", $time );
  48  $base_url = "?users=$users";
  49  $prev_url = $base_url."&amp;year=".  strftime('%Y', $time - 86400)
  50                       ."&amp;month=". strftime('%m', $time - 86400)
  51                       ."&amp;day=".   strftime('%d', $time - 86400);
  52  $next_url = $base_url."&amp;year=".  strftime('%Y', $time + 86400)
  53                       ."&amp;month=". strftime('%m', $time + 86400)
  54                       ."&amp;day=".   strftime('%d', $time + 86400);
  55  
  56  $users = explode(",",$users);
  57  ?>
  58  
  59  <div style="border-width:0px; width:99%;">
  60  <a title="<?php etranslate("Previous")?>" class="prev" href="<?php echo $prev_url ?>"><img src="leftarrow.gif" class="prevnext" alt="<?php etranslate("Previous")?>" /></a>
  61  <a title="<?php etranslate("Next")?>" class="next" href="<?php echo $next_url ?>"><img src="rightarrow.gif" class="prevnext" alt="<?php etranslate("Next")?>" /></a>
  62  <div class="title">
  63  <span class="date"><?php 
  64    printf ( "%s, %s %d, %d", weekday_name ( $wday ), month_name ( $month - 1 ), $day, $year ); 
  65  ?></span><br />
  66  </div></div>
  67  <br />
  68  
  69  <form action="availability.php" method="post">
  70  <?php daily_matrix($date,$users); ?>
  71  </form>
  72  
  73  <?php print_trailer ( false, true, true ); ?>
  74  
  75  </body></html>


Généré le : Fri Nov 30 19:09:19 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics