Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type='text/javascript'>
- $(document).ready(function() {
- var date = new Date();
- var d = date.getDate();
- var m = date.getMonth();
- var y = date.getFullYear();
- $('#calendar').fullCalendar({
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month,agendaWeek,agendaDay'
- },
- editable: false,
- weekends: false,
- events: [
- <?php
- while ($row = pg_fetch_array($search_res)) {
- if($row['due_date'] != ""){
- // Vars
- $id = trim($row['id']);
- $due_date = date("m/d/y",strtotime($row['due_date']));
- $d = date("d", strtotime($due_date));
- $m = date("m", strtotime($due_date)) - 1;
- $customer = shorten(trim(str_replace("'", "\'", $row['customer'])));
- $desc = $row['description'];
- $desc = trim(substr(str_replace("'", "\'", $desc), 0, 50));
- $desc .= " (qty: ". $row['qty'] .")";
- $color = color(intval(trim($row['job_type'])));
- $url = "xxxxxxxxxx". $id ."xxxx";
- // Icons
- if($row['status'] == 'S'){
- $icon = "className: 'shipped',";
- } else {
- $icon = "";
- }
- // Output
- echo "
- {\n
- title: '(". $id . ") $customer : $desc',\n
- start: new Date(y, $m, $d),\n
- url: '$url',\n
- backgroundColor: '". $color ."',\n
- borderColor: '#000000',\n
- $icon
- },\n
- ";
- }
- }
- ?>
- ],
- });
- });
- // Add in icons where necessary
- $(window).load(function(){
- $('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\" />");
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement