- Timestamp:
- 01/26/09 14:58:56 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/calendar/inc/hourReport.php
r602 r626 20 20 var MainDiv = document.getElementById('MainDiv'); 21 21 var showTable = document.createElement('TABLE'); 22 showTable.style.color = "#000066" 23 showTable.style.background = "#F7F7F7"; 24 showTable.style.border = "1px solid #CCCCCC"; 25 showTable.width = "75%"; 26 showTable.align = "center"; 22 27 var trLine = document.createElement('TR'); 23 28 var tdVal = document.createElement('TD'); … … 27 32 tdVal.innerHTML = "Descricao"; 28 33 trLine.appendChild(tdVal); 34 tdVal = document.createElement('TD'); 35 tdVal.innerHTML = "Data"; 36 trLine.appendChild(tdVal); 29 37 tdVal = document.createElement('TD'); 30 38 tdVal.innerHTML = "Horas"; … … 37 45 trLine = document.createElement('TR'); 38 46 tdVal = document.createElement('TD'); 39 tdVal.innerHTML = Eelement.childNodes[0].innerHTML; 47 var cal_id = Eelement.childNodes[4].innerHTML; 48 tdVal.innerHTML = "<a href='../../index.php?menuaction=calendar.uicalendar.view&cal_id="+cal_id+"'>"+Eelement.childNodes[0].innerHTML+"</a>"; 40 49 trLine.appendChild(tdVal); 41 50 tdVal = document.createElement('TD'); 42 51 tdVal.innerHTML = Eelement.childNodes[1].innerHTML; 52 trLine.appendChild(tdVal); 53 tdVal = document.createElement('TD'); 54 var today = new Date(); 55 today.setTime(parseInt(Eelement.childNodes[2].innerHTML)*1000); 56 tdVal.innerHTML = (today.getDate()+"/"+(today.getMonth()+1)+"/"+(today.getYear()+1900)); 43 57 trLine.appendChild(tdVal); 44 58 tdVal = document.createElement('TD'); … … 61 75 trLine.appendChild(tdDes); 62 76 trLine.appendChild(document.createElement('TD')); 77 trLine.appendChild(document.createElement('TD')); 63 78 trLine.appendChild(tdVal); 64 79 var tbody = document.createElement('tbody'); 65 80 tbody.appendChild(trLine); 66 81 showTable.appendChild(tbody); 67 showTable.className = "calendar_print_main";68 82 MainDiv.parentNode.appendChild(showTable); 69 83 } … … 81 95 $_SESSION['calendar']['server']['db_type'] 82 96 ); 83 84 97 if (IsSet($_POST['CAT'])){ 85 98 if (!preg_match("/[a-zA-Z0-9]+/i",$_POST['CAT'][0])){ … … 109 122 110 123 111 foreach($_POST['CAT'] as $catid) 112 if(!$db->query("select cal_id,title,description,datetime,edatetime from phpgw_cal where ".(!$_POST['NORM']?"cal_type = 'H' and":" is_public = 1 and ")." owner = ".$user_id." and (category like '%,".$catid.",%' or category like '%,".$catid."' or category like '".$catid.",%' or category = '".$catid."')".(IsSet($initDate)?" and datetime > ".$initDate:""))){ 124 foreach($_POST['CAT'] as $catid){ 125 $query = "select cal_id,title,description,datetime,edatetime from phpgw_cal where ".(!$_POST['NORM']?"cal_type = 'H' and":" is_public = 1 and ")." owner = ".$user_id." and (category like '%,".$catid.",%' or category like '%,".$catid."' or category like '".$catid.",%' or category = '".$catid."')".(IsSet($initDate)?" and datetime > ".$initDate:""); 126 if(!$db->query($query)){ 113 127 print("<br>Query failed at host:<br>".$_SESSION['calendar']['server']['db_user']."@".$_SESSION['calendar']['server']['db_host'].":".$_SESSION['calendar']['server']['db_port']."<br>"); 114 128 return; … … 118 132 $entry = $db->row(); 119 133 $repeated = false; 134 if (!empty($result_)) 120 135 foreach($result_ as $value){ 121 136 if ($value['cal_id'] == $entry['cal_id']) … … 126 141 } 127 142 } 143 } 128 144 echo "<div id='MainDiv' style='display: none;'>"; 145 if (!empty($result_)) 129 146 foreach($result_ as $ind => $entry){ 130 echo "<div id=\"entry_".$ind."\"><div id=\"title_".$ind."\">". $entry['title']."</div><div id=\"description_".$ind."\">".$entry['description']."</div><div id=\"datetime_".$ind."\">".$entry['datetime']."</div><div id=\"edatetime_".$ind."\">".$entry['edatetime']."</div></div>";147 echo "<div id=\"entry_".$ind."\"><div id=\"title_".$ind."\">".htmlspecialchars($entry['title'])."</div><div id=\"description_".$ind."\">".htmlspecialchars($entry['description'])."</div><div id=\"datetime_".$ind."\">".$entry['datetime']."</div><div id=\"edatetime_".$ind."\">".$entry['edatetime']."</div><div>".$entry['cal_id']."</div></div>"; 131 148 } 132 149 echo "</div><script type=\"text/javascript\"> show_table();</script>";
Note: See TracChangeset
for help on using the changeset viewer.