pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

HTML pastebin - collaborative debugging tool View Help


Posted by Andy on Thu 14 Aug 17:20
report abuse | View followups from Andy and Andy | download | new post

  1. <?
  2.         session_start();
  3.         if(!session_is_registered('username'))
  4.         {
  5.                 header("location: loginform.php");
  6.         }
  7. ?>
  8.         <head>
  9.                 <title>Project Management</title>
  10.                 <style type="text/css">
  11.                         @import "css/style.css";
  12.                         @import "../../lib/dojo/resources/dojo.css";
  13.                 </style>
  14.                 <script type="text/javascript"> djConfig = { isDebug: false, parseOnLoad: true };</script>
  15.                 <script type="text/javascript" src="../../lib/dojo/dojo.js"></script>
  16.                 <script type="text/javascript">                
  17.                         dojo.require("dojox.gfx.move");
  18.                         dojo.require("dojox.gfx.utils");
  19.                         dojo.require("dojo._base.Color");
  20.                         dojo.require("dojox.gfx._base");
  21.                         dojo.require("dojox.gfx.shape");
  22.                         dojo.require("dojox.gfx.path");
  23.                         dojo.require("dojox.gfx.arc");
  24.                         dojo.require("dojox.gfx");
  25.                         dojo.require("dojo.colors");
  26.                         dojo.require("dijit.Tooltip");
  27.                         dojo.require("dojo.parser");
  28.  
  29.                         var container = null, surface = null, surface_size = null, circleX = 0, circleY = 0, i = 0, j = 0, h = 0,
  30.                                 myId = 0, dbCounter = 0, browserName = navigator.appName, tooltip = {}, tooltipGFX = {}, myTooltip = {}, foo = {};
  31.  
  32.                         function makeCircles(myColor, myDetails, myDueDate, myProjectID, myName, circleX, circleY)
  33.                         {
  34.                                 var circle = { cx: circleX, cy: circleY, r: 20 };
  35.                                 var circleCreate = surface.createCircle(circle)
  36.                                         .setFill(myColor)
  37.                                         .setStroke({color: "black", width: 1, cap: "butt", join: 4});
  38.                                 circleCreate.getEventSource().id = h;
  39.                                 myTooltip[h] = h;
  40.                                 foo[h] = h;
  41.                                 tooltip[h] = new dijit.Tooltip({'id':myTooltip[h], 'label': 'testing...', 'connectId':[foo[h]]});
  42.                                 tooltipGFX[h] = dojo.byId("gfx_holder");
  43.                                 alert("foo: " + foo[h] + " myTooltip: " + myTooltip[h] + " tooltip: " + tooltip[h]);
  44.                                 h++;
  45.                         }
  46.  
  47.                         function setCircleY(num)
  48.                         {
  49.                                 circleY = circleY + num;
  50.                         }
  51.                        
  52.                         function setCircleX(num)
  53.                         {
  54.                                 circleX = num;
  55.                         }
  56.                 </script>
  57.         </head>
  58.         <body>
  59.                 <div id="gfx_holder" style="width: 1024px; height: 768px;"></div>
  60.                 <div id="buttons">
  61.                         <a href="index.php">Home</a> |
  62.                         <a href="logout.php">Logout</a>
  63.                 </div>
  64.                 <script type="text/javascript">
  65.                         container = dojo.byId("gfx_holder");
  66.                         surface = dojox.gfx.createSurface(container, 1024, 768);
  67.                         surface_size = {width: 1024, height: 768};
  68.                 </script>       
  69.                 <?php
  70.                         $connection = mysql_connect("server", "user", "pw") or die("Cannot connect");
  71.                         mysql_select_db("db", $connection) or die("Cannot select DB");
  72.        
  73.                         // Get Andy Daykin's info
  74.                         $sql = "SELECT * FROM greenprojectinfo WHERE owner = 'adaykin'";
  75.                         $greenResult = mysql_query($sql) or die("Could not select andy daykin's info");
  76.                        
  77.                         $resultInfo = array();
  78.                         while($row = mysql_fetch_row($greenResult))
  79.                         {
  80.                                 $results = array($row[1], $row[2], $row[3], $row[4]);
  81.                                 $resultInfo[] = ($results);
  82.                         }
  83.                        
  84.                         $dbCounter = 0;
  85.                         echo "<script type='text/javascript'>circleY = 165; circleX = 45;</script>";
  86.                         foreach($resultInfo as $current)
  87.                         {
  88.                                 if($dbCounter % 3 == 0 && $dbCounter != 0)
  89.                                 {
  90.                                         echo "<script type='text/javascript'>
  91.                                         setCircleX(45); setCircleY(45);
  92.                                         var details = '".addslashes($current[0])."';
  93.                                         var duedate = '".addslashes($current[1])."';
  94.                                         var projectid = '".addslashes($current[2])."';
  95.                                         var name = '".addslashes($current[3])."';
  96.                                         dojo.addOnLoad(makeCircles('green', details, duedate, projectid, name, circleX, circleY));
  97.                                         </script>";
  98.                                 }
  99.                                 else
  100.                                 {
  101.                                         echo "<script type='text/javascript'>
  102.                                         var details = '".addslashes($current[0])."';
  103.                                         var duedate = '".addslashes($current[1])."';
  104.                                         var projectid = '".addslashes($current[2])."';
  105.                                         var name = '".addslashes($current[3])."';
  106.                                         dojo.addOnLoad(makeCircles('green', details, duedate, projectid, name, circleX, circleY));
  107.                                         circleX = circleX + 45;
  108.                                         </script>";
  109.                                 }                              
  110.                                 $dbCounter++;                  
  111.                         }
  112.                 ?>     
  113.         </body>
  114. </html>

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me