Advertisement
Guest User

Untitled

a guest
Mar 20th, 2013
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type='text/javascript'>
  2.  
  3.     $(document).ready(function() {
  4.    
  5.         var date = new Date();
  6.         var d = date.getDate();
  7.         var m = date.getMonth();
  8.         var y = date.getFullYear();
  9.        
  10.         $('#calendar').fullCalendar({
  11.             header: {
  12.                 left: 'prev,next today',
  13.                 center: 'title',
  14.                 right: 'month,agendaWeek,agendaDay'
  15.             },
  16.             editable: false,
  17.             weekends: false,
  18.             events: [
  19.                 <?php
  20.                     while ($row = pg_fetch_array($search_res)) {
  21.                         if($row['due_date'] != ""){
  22.                             // Vars
  23.                             $id         = trim($row['id']);
  24.                             $due_date   = date("m/d/y",strtotime($row['due_date']));
  25.                             $d          = date("d", strtotime($due_date));
  26.                             $m          = date("m", strtotime($due_date)) - 1;
  27.                             $customer   = shorten(trim(str_replace("'", "\'", $row['customer'])));
  28.                            
  29.                             $desc       = $row['description'];
  30.                             $desc       = trim(substr(str_replace("'", "\'", $desc), 0, 50));
  31.                             $desc       .= " (qty: ". $row['qty'] .")";
  32.                             $color      = color(intval(trim($row['job_type'])));
  33.                             $url        = "xxxxxxxxxx". $id ."xxxx";
  34.  
  35.                             // Icons
  36.                             if($row['status'] == 'S'){
  37.                                 $icon = "className: 'shipped',";
  38.                             } else {
  39.                                 $icon = "";
  40.                             }
  41.                            
  42.  
  43.                             // Output
  44.                             echo "
  45.                                 {\n
  46.                                     title:  '(". $id . ") $customer : $desc',\n
  47.                                     start: new Date(y, $m, $d),\n
  48.                                     url: '$url',\n
  49.                                     backgroundColor: '". $color ."',\n
  50.                                     borderColor: '#000000',\n
  51.                                     $icon
  52.                                 },\n
  53.                             ";
  54.                        
  55.                         }
  56.                     }
  57.                 ?>
  58.             ],
  59.            
  60.         });
  61.        
  62.     });
  63.                    
  64.     // Add in icons where necessary
  65.     $(window).load(function(){
  66.         $('a.shipped div span').prepend("<img src=\"/img/truck_white.png\" title=\"Shipped\" alt=\"Shipped\" style=\"padding:2px 5px 5px 0; vertical-align:middle;\" width=\"16\" height=\"16\" />");
  67.     });
  68.  
  69. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement