Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

254 lines
7.5 KiB

  1. <%@LANGUAGE=javascript%>
  2. <!--#INCLUDE FILE='Global_DBUtils.asp' -->
  3. <!--#include file='global_serverutils.asp'-->
  4. <table id="tblUserBuckets" width="100%" class="clsTableInfo" border="0" cellpadding="2" cellspacing="1">
  5. <%
  6. if ( Session("Authenticated") != "Yes" )
  7. Response.Redirect("privacy/authentication.asp?../DBGPortal_Main.asp?" + Request.QueryString() )
  8. //this is the number of milliseconds in a day
  9. var dayVal = 86400000
  10. var BucketID = Request.QueryString("BucketID")
  11. var g_DBConn = GetDBConnection ( Application("CRASHDB3") )
  12. var length = new String( Request.QueryString("Length" ) )
  13. var interval = new String( Request.QueryString("Interval" ) )
  14. var range = new String( Request.QueryString("range") )
  15. var startOffset = 2 //number of days from present to go back to start the chart
  16. //var RemoveZero = new String( Request.QueryString( "chkRemoveZero" ) )
  17. if ( length.toString() == "undefined" )
  18. length = 30
  19. if ( interval.toString() == "undefined" )
  20. interval = 3
  21. if ( range.toString() == "undefined" )
  22. range = 1
  23. //if ( RemoveZero.toString() == "undefined" )
  24. //RemoveZero = false
  25. //else
  26. //RemoveZero = true
  27. //Need to prime the date value so that it doesn't use today's date, it will skew the data
  28. var endDate = new Date()
  29. endDate = new Date( endDate.valueOf() - (startOffset*dayVal) )
  30. var chartValues = ""
  31. var chartDate = ""
  32. for ( var i=0 ; i< length ; i++ )
  33. {
  34. endDate = endDate.valueOf()
  35. startDate = endDate - (dayVal*(range-1))
  36. endDate = new Date( endDate )
  37. startDate = new Date( startDate )
  38. nextDate = endDate - ( dayVal*interval )
  39. endDate = (endDate.getMonth()+1) + "-" + (endDate.getDate()) + "-" + endDate.getYear()
  40. startDate = (startDate.getMonth()+1) + "-" + (startDate.getDate()) + "-" + startDate.getYear()
  41. //endDate = endDate
  42. //startDate = startDate + " 00:00:00.001"
  43. //Response.Write(" nextdate: " + nextDate + "<BR>" )
  44. var Query = "DBGPortal_GetCrashCountByDate '" + startDate + " 00:00:00.001" + "','" + endDate + " 23:59:59.999" + "','" + BucketID + "'"
  45. //Response.Write( Query + "<BR>" )
  46. //continue
  47. var rsBuckets = g_DBConn.Execute( Query )
  48. var count = new String( rsBuckets("CrashCount") )
  49. //if( !(count.toString() == "0") )
  50. {
  51. var endDate = new Date( endDate )
  52. var startDate = new Date( startDate )
  53. var chartValues = rsBuckets("CrashCount") + "\t" + chartValues
  54. //Response.Write(" Number: " + rsBuckets("CrashCount") + "<BR>" )
  55. if ( range > 1 )
  56. chartDate = (endDate.getMonth()+1)+ "/" + endDate.getDate() + "-" + (startDate.getMonth()+1) + "/" + startDate.getDate() + '\t' + chartDate
  57. else
  58. chartDate = (endDate.getMonth()+1)+ "/" + endDate.getDate() + '\t' + chartDate
  59. }
  60. var endDate = new Date( nextDate )
  61. }
  62. //Response.Write( Request.QueryString() )
  63. //Response.Write("chart: " + chartDate + "<BR>" )
  64. //Response.Write("vals: " + chartValues + "<BR>" )
  65. %>
  66. </table>
  67. <head>
  68. <link rel="stylesheet" TYPE="text/css" HREF="/main.css">
  69. <link rel="stylesheet" TYPE="text/css" HREF="/CustomStyles.css">
  70. </head>
  71. <body bgcolor='#ffffff' topmargin='0' leftmargin='0' marginheight='0' marginwidth='0' tabindex='0' OnreSize = "fnSizeChart()" OnLoad="fnSizeChart()">
  72. <form method='get' action='DBgPortal_Histogram.asp'>
  73. <input type='hidden' name='BucketID' id='BucketID' value='<%=BucketID%>'>
  74. <table id='tblNoFollowup'>
  75. <tr>
  76. <td>
  77. <p class='clsPTitle'>Crash Histogram</p>
  78. </td>
  79. </tr>
  80. <tr>
  81. <td>
  82. <p>Select how many data points that you want to sample. This will determine how many columns will appear on the chart.<p>
  83. </td>
  84. <td>
  85. <select id='length' name='length'>
  86. <option value='15'>15</option>
  87. <option value='30' selected>30</option>
  88. <option value='40'>40</option>
  89. <option value='50'>50</option>
  90. <option value='60'>60</option>
  91. </select>
  92. </td>
  93. </tr>
  94. <tr>
  95. <td>
  96. <p>Select how many days you would like in between each data sample.</p>
  97. </td>
  98. <td>
  99. <select id='interval' name='interval'>
  100. <option value='1'>1 Day</option>
  101. <option value='2'>2 Days</option>
  102. <option value='3' selected>3 Days</option>
  103. <option value='4'>4 Days</option>
  104. <option value='5'>5 Days</option>
  105. <option value='6'>6 Days</option>
  106. <option value='7'>7 Days</option>
  107. <option value='8'>8 Days</option>
  108. <option value='9'>9 Days</option>
  109. <option value='10'>10 Days</option>
  110. <option value='15'>15 Days</option>
  111. <option value='20'>20 Days</option>
  112. <option value='25'>25 Days</option>
  113. <option value='30'>30 Days</option>
  114. </select>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td>
  119. <p>Select how many days you want to sample per data point. For example, a value of 3 would sum the total number of crashes over a three day period.</p>
  120. </td>
  121. <td>
  122. <select id='range' name='range'>
  123. <option value='1' selected>1 Day</option>
  124. <option value='2'>2 Days</option>
  125. <option value='3'>3 Days</option>
  126. <option value='4'>4 Days</option>
  127. <option value='5'>5 Days</option>
  128. <option value='6'>6 Days</option>
  129. <option value='7'>7 Days</option>
  130. <option value='8'>8 Days</option>
  131. <option value='9'>9 Days</option>
  132. <option value='10'>10 Days</option>
  133. </select>
  134. </td>
  135. </tr>
  136. <tr>
  137. <td style='padding-left:16px'>
  138. <input type='submit' value='Create Chart'>
  139. </td>
  140. </tr>
  141. <tr>
  142. <td>
  143. <p>
  144. Currently displaying a total of <%=length%> days data, over <%=range%> day(s) with <%=interval%> day(s) between each sample.
  145. </p>
  146. </td>
  147. </tr>
  148. </table>
  149. </form>
  150. <!--<object height='1000px' width=100% CLASSID="clsid:0002E500-0000-0000-C000-000000000046" ID="objUserChart" codebase="\\products\public\Products\Applications\User\OfficeXP\Internal\cd1\owc10.msi" VIEWASTEXT></object> -->
  151. <object height='1000px' width=100% CLASSID="clsid:0002E500-0000-0000-C000-000000000046" ID="objUserChart" codebase="file:\\dbgportal\owc\owc10.msi" VIEWASTEXT>
  152. <table>
  153. <tr>
  154. <td class='clsTDWarning'>
  155. <b>Warning: Could not build chart</b>
  156. </td>
  157. <tr>
  158. <td class=clsTDWarning>
  159. <p>In order to display the crash histrogram, you must download the <a href="\\products\public\Products\Applications\User\OfficeXP\Internal\cd1\owc10.msi">Office Web Components</a>. </p>
  160. </td>
  161. </tr>
  162. </table>
  163. </object>
  164. <script language=javascript>
  165. try
  166. {
  167. objUserChart.Clear()
  168. var objChart = objUserChart.Charts.Add()
  169. var c = objUserChart.Constants
  170. //objChart.Type=c.chChartTypeBarStacked
  171. //objChart.Type=c.chChartTypeColumnClustered
  172. objChart.Type=c.chChartTypeArea
  173. objSeries1 = objChart.SeriesCollection.Add()
  174. objSeries1.SetData( c.chDimCategories, c.chDataLiteral, "<%=chartDate%>" )
  175. objSeries1.SetData( c.chDimValues, c.chDataLiteral, "<%=chartValues%>" )
  176. var trend = objSeries1.Trendlines.Add()
  177. trend.IsDisplayingRSquared = false
  178. //objChart.FirstSliceAngle = 90
  179. objChart.HasTitle = true
  180. objChart.Title.Caption = "Crash Rate Histogram - Bucket <%=BucketID%>"
  181. var DataLabel = objSeries1.DataLabelsCollection.Add()
  182. //DataLabel.NumberFormat = "0%"
  183. DataLabel.Position = c.chLabelPositionRight
  184. objChart.HasLegend=false
  185. }
  186. catch ( err )
  187. {
  188. }
  189. function fnSizeChart()
  190. {
  191. if( (document.body.clientHeight - 230) > 0 )
  192. objUserChart.style.height = (document.body.clientHeight - 230)
  193. }
  194. </script>
  195. </body>