Hello Everyone,

I am having issues trying to display a grid on my page. I am not sure what I am doing wrong. I know the code is not very clean and efficient, I am just learning php and dojo. I want to display 2 graphs on a page and a grid that I had created before. The two graphs are working just fine. So I just added the grid code to this new dashboard display. See code attached:

    <!DOCTYPE html>
    <html >
    <head>
    <meta http-equiv="Content-Type" content="text/html" charset="UTF-8">

    <body class="Wetland">

    <center><img src="./images/lacrn.jpg"></center>
    <center    

    <?php
    $studynum = $_GET['studynum'];
    $datestamp = date("l, F d, Y H:i" ,time());
    $datestampnotime = date("l, F d, Y");
    echo "<center><h1>US-LA CRN OpenClinica Dashboard</h1></center>";
    echo "<center><h2>Data for Study: $studynum</h2></center>";
    echo "<center><h4>Data Current as of: $datestampnotime</h4></center>";

    //connect to database
    $db = pg_connect('host=localhost dbname=dash_xc user=postgres password=postgres') or die('Sorry, could not connect to database server');


        //total number of participants
        $query1 = "select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
    where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (3)";
        //number of participants in neoadjuvant chemoterapy
        $query2 = "select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
    where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (4)";
        //number of participants in surgery
        $query3 = "select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
    where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (5)";
        //number of participants off study
        $query4 = "select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
    where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (33)";
        //number of participants expected
        $query5 = "select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
    where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (7)";
        //number of participants unassigned
        $query6="select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
    where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (6)";


        $result1 = pg_query($query1) or die ('Could not find total');
        $res1= pg_fetch_array($result1);
        $totalp = $res1[0];
        //$totalp=json_encode($totalp);
        //echo ($totalp);

        $result2 =pg_query($query2) or die ('Could not find neo chemoterapy');
        $res2 = pg_fetch_array($result2);
        $chemop = $res2[0];
        //$chemop= json_encode($chemop);

        $result3 = pg_query($query3) or die ('Could not find surgery');
        $res3 = pg_fetch_array($result3);
        $surgeryp = $res3[0];
        //$surgeryp = json_encode($surgeryp);

        $result4 = pg_query($query4) or die ('Could not find off study');
        $res4 = pg_fetch_array($result4);
        $offp = $res4[0];
        //$offp = json_encode($offp);
        //print_r($offp);

        $result5 = pg_query($query5) or die ('Could not find expected');
        $res5 = pg_fetch_array($result5);
        $expectp = $res5[0];
        //$expectp = json_encode($expectp);
        //print_r($expectp);

        $result6 = pg_query($query6) or die ('Could not find unassigned');
        $res6 = pg_fetch_array($result6);
        $unassignp = $res6[0];
        //$unassignp= json_encode($unassignp);
        //print_r($unassignp);
    ?>

    <link rel="stylesheet" type="text/css"
     href="./dijit/themes/claro/claro.css" />

    <link rel="stylesheet" type="text/css"
     href="./dojox/grid/resources/Grid.css" />

     <link rel="stylesheet" type="text/css"
     href="./dojox/grid/resources/claroGrid.css" />

    <script>dojoConfig = {parseOnLoad: true}</script>
    <script src="//ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojo/dojo.js"
                   data-dojo-config="async: true"></script>


    <script type="text/javascript"
     src="./dojo/dojo.js" charset="utf-8"
        djConfig="parseOnLoad:true,locale:'en-us',extraLocale: ['es-es','pt-br']"></script>

    <script type="text/javascript">
        dojo.require("dojox.grid.DataGrid");
        dojo.require("dojo.data.ItemFileReadStore");
    </script>



    <?php
     // $studynum = $_GET['studynum'].'%';
       if (empty($studynum))
         $studynum = "";
        else
         $studynum = $_GET['studynum'];
    ?>

    <script type="text/javascript">
    dojo.ready(function() {
        var query99 = {
            items: [ 
            <?php require_once 'c:/webroot/lacrndb3.php';
              fquery99($studynum); ?>

                   ]
        };

        var dataStore =
        new dojo.data.ItemFileReadStore(
            { data:query99}
        );
        var grid = dijit.byId("query99");
        grid.setStore(dataStore);
    });
    </script>
    <script>
    require([
         // Require the basic chart class
        "dojox/charting/Chart", 
        // Require the theme of our choosing
        "dojox/charting/themes/MiamiNice", 
        // Charting plugins: 
        //  We want to plot Columns
        "dojox/charting/plot2d/Columns",    
        //  We want to plot StackedColumns
        "dojox/charting/plot2d/StackedColumns", 
        //  We want to use Markers
        "dojox/charting/plot2d/Markers", 
        //  We'll use default x/y axes
        "dojox/charting/axis2d/Default",    
        //we'll use Legend
        "dojox/charting/widget/SelectableLegend", 
         // Wait until the DOM is ready
        "dojo/domReady!"
    ],
     function(Chart, theme) {

        // Define the data

        var total= <?php print_r ($totalp); ?>;
        //alert(total);
        var chemo = <?php echo ($chemop); ?>;
        //alert(chemo);
        var surgery = <?php echo ($surgeryp); ?>;
        //alert(surgery);
        var offstudy = <?php echo ($offp); ?>;
        //alert(offstudy);
        var expected = <?php echo ($expectp); ?>;
        //alert(expected);
        var unassigned = <?php echo ($unassignp); ?>;
        //alert(unassigned);


        // Create the chart within it's "holding" node
        var chart = new Chart("chartNode");
        var chart2 = new Chart("chartNode2");

        // Set the theme
        chart.setTheme(theme);
        chart2.setTheme(theme);

        // Add the only/default plot
        chart.addPlot("default", {
           type: "Columns",
           markers: true,
           shadows: {dx:2, dy:2, dw:2},
           gap: 2
        });
        chart2.addPlot("default", {
           type: "Columns",
           markers: true,
           shadows: {dx:2, dy:2, dw:2},
           gap: 2
        });



        // Add axes
        chart.addAxis("x", {title:"Arms", titleOrientation: "away", minorLabels: false, labels:[{value:0, text:""}, {value:1, text:"NeoAdj Chemo"}, {value:2, text:"Surgery"},{value:3, text: "Unassigned"}, {value:4, text:"Off Study"}, {value:5, text:"Total (Actual)"}, {value:6, text:"Total (Expected)"}], rotation:-45});
        chart.addAxis("y", {title: "Participants", vertical: true, includeZero: true, ticks:true, majorLabels:true, minorLabels: false });

        chart2.addAxis("x", {title:"Arms", titleOrientation: "away", minorLabels: false, labels:[{value:0, text:""}, {value:1, text:"NeoAdj Chemo"}, {value:2, text:"Surgery"},{value:3, text: "Unassigned"}, {value:4, text:"Off Study"}, {value:5, text:"Total (Actual)"}, {value:6, text:"Total (Expected)"}], rotation:-90});
        chart2.addAxis("y", {title: "CRFs", vertical: true, includeZero: true, ticks:true, majorLabels:true, minorLabels: false });

        // Add the series of data for graph1-Participants
        chart.addSeries("NeoAdj Chemo", [chemo,0,0,0,0,0], {stroke:"#FF0099", fill:"#FEA9F3"});
        chart.addSeries("Surgery", [0,surgery,0,0,0,0], {stroke:"#FFFF00", fill:"#FFFF33"});
        chart.addSeries("Unassigned", [0,0,unassigned,0,0,0], {stroke:"#FF0000", fill:"#CC6600"});
        chart.addSeries("Off-Study", [0,0,0,offstudy,0,0], {stroke: "black", fill:"gray"});
        chart.addSeries("Total (Actual)",[0,0,0,0,total,0], {stroke:"black", fill:"black"});
        chart.addSeries("Total (Expected)", [0,0,0,0,0,expected], {stroke: "black", fill:"blue"});

        //Add the series of data for graph2-CRFs
        chart2.addSeries("NeoAdj Chemo", [chemo,0,0,0,0,0], {stroke:"#FF0099", fill:"#FEA9F3"});
        chart2.addSeries("Surgery ", [0,surgery,0,0,0,0], {stroke:"#FFFF00", fill:"#FFFF33"});
        chart2.addSeries("Unassigned ", [0,0,unassigned,0,0,0], {stroke:"#FF0000", fill:"#CC6600"});
        chart2.addSeries("Off-Study ", [0,0,0,offstudy,0,0], {stroke: "black", fill:"gray"});
        chart2.addSeries("Total(Actual)",[0,0,0,0,total,0], {stroke:"black", fill:"black"});
        chart2.addSeries("Total(Expected)", [0,0,0,0,0,expected], {stroke: "black", fill:"blue"});

        // Render the chart!
        chart.render();
        chart2.render();

        var legend1 = new dojox.charting.widget.SelectableLegend({chart: chart, horizontal:true}, "legend1");
        var legend2 = new dojox.charting.widget.SelectableLegend({chart: chart2, horizontal:true}, "legend2");


    });

    </script>


    <table BORDER="2" BORDERCOLOR="#336699" CELLPADDING="2" CELLSPACING="2" WIDTH="100%">
    <tr>
        <td> 
        <div id="chartNode" style="float:left">    
        </div>
        <div id="legend1"></div>      
        </td>
        <td> 
        <div id="chartNode2" style="float:left">    
        </div>
        <div id="legend2"></div>      
        </td>
        </tr>
    </table>

    <center>
    <table border ="2" width="100%">
    <tr>
        <td> "Testing"</td>
    </tr>
    </table>
    </center>

    <center>
        <FORM name="lacrn1" action="lacrnv3.php" method="get">
        <SELECT name="studynum">
        <?php require_once 'c:/webroot/lacrndb3.php';
        studylist();


        ?>
        </SELECT>
        <INPUT TYPE="submit" value="Submit">
        </FORM>

     <form><input type="button" value="Down Load the CSV File" onClick="window.location.href='http://lacrn-trn.ccsainc.com:8000/hello.php'"></form> 
    <table border="0" cellspacing="20px">
    <tr><td>
    <style>
    p {text-indent:30px;}
    </style>
            <br><h3><!--Subjects Enrolled to Unassigned Arm--></h3>
            <div style="width: 1150px; height: 768px">
            <table id="query99" dojoType="dojox.grid.DataGrid" escapeHTMLInData="false" canSort="function(){return false}">


                <thead>
                    <tr>
                        <th field="Parameter" width="550px">Parameter</th>
                        <th field="ar" width="80"><center><a href="https://lacrn-ar.ccsainc.com:8801/dash_ar.php">AR</a></center></th>
                    <th field="br" width="80"><center><a href="https://lacrn-br.ccsainc.com:8801/dash.php">BR</center></th>
                    <th field="cl" width="80"><center><a href="https://lacrn-cl.ccsainc.com:8801/dash.php">CL</center></th>
                                    <th field="mxjal" width="80"><center><a href="https://lacrn-mx-jal.ccsainc.com:8801/dash.php">MX-JAL</center></th>
                                    <th field="mxson" width="80"><center><a href="https://lacrn-mx-son.ccsainc.com:8801/dash.php">MX-SON</center></th>
                                    <th field="uy" width="80"><center><a href="https://lacrn-uy.ccsainc.com:8801/dash.php">UY</center></th>
                    <th field="total" width="100"><center>TOTAL</center></th>
                    </tr>
                </thead>

            </table>
        </div>

    </table>
    </center>


    <script type="text/javascript">
        dojo.require("dojox.grid.DataGrid");
        dojo.require("dojo.data.ItemFileReadStore");
    </script>


    <?php
     // $studynum = $_GET['studynum'].'%';
       if (empty($studynum))
         $studynum = "";
        else
         $studynum = $_GET['studynum'];
    ?>

    <script type="text/javascript">
    dojo.ready(function() {
        var query99 = {
            items: [ 
            <?php require_once 'c:/webroot/lacrndb3.php';
              fquery99($studynum); ?>

                   ]
        };

        var dataStore =
        new dojo.data.ItemFileReadStore(
            { data:query99}
        );
        var grid = dijit.byId("query99");
        grid.setStore(dataStore);
    });
    </script>

    </body>
    </html>

Recommended Answers

All 7 Replies

Member Avatar for LastMitch

I know the code is not very clean and efficient, I am just learning php and dojo.

Are you connected to the database?

Does javascript works?

Does PHP works?

You never mention anything regarding which language or code is working?

Sorry...Everything works but the part that displays the grid, it displays the headers for the grid but not the data. It is connected to the database.The graph is connected to the database and display with no problems, just the grid doesnt.

Member Avatar for LastMitch

Line 105 to Line 108 & Line 301 to Line 304

Where's your Brackets?

From this:

if (empty($studynum))
$studynum = "";
else
$studynum = $_GET['studynum'];

to this:

if (empty($studynum)){
$studynum = "";
} else {
$studynum = $_GET['studynum'];
}

Why did you put a = sign on line 113 & line 309?

As for line 115 & line 311 remove your C drive. It should link to the folder.

Instead of this:

c:/webroot/lacrndb3.php

It should be this:

../webroot/lacrndb3.php

I'm a bit curious why you repeat those same lines twice. You only need to used it one time.

Here it is the code after correcting the things you mentioned. It still displays the same thing as before. It display both graphs, date select form and header for the grid, but not the data in the grid. Do you think is have something to do with me having multiple functions in one file?

<!DOCTYPE html>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">

<body class="Wetland">

<center><img src="./images/lacrn.jpg"></center>
<center    

<?php
$studynum = $_GET['studynum'];
$datestamp = date("l, F d, Y H:i" ,time());
$datestampnotime = date("l, F d, Y");
echo "<center><h1>US-LA CRN OpenClinica Dashboard</h1></center>";
echo "<center><h2>Data for Study: $studynum</h2></center>";
echo "<center><h4>Data Current as of: $datestampnotime</h4></center>";

//connect to database
$db = pg_connect('host=localhost dbname=dash_xc user=postgres password=postgres') or die('Sorry, could not connect to database server');


    //total number of participants
    $query1 = "select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (3)";
    //number of participants in neoadjuvant chemoterapy
    $query2 = "select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (4)";
    //number of participants in surgery
    $query3 = "select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (5)";
    //number of participants off study
    $query4 = "select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (33)";
    //number of participants expected
    $query5 = "select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (7)";
    //number of participants unassigned
    $query6="select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (6)";


    //total number of CRFs
    $query7="select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (9)";
    //number of neo chemo CRFs
    $query8="select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (10)";
    //number of surgery CRFs
    $query9="select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (11)";
    //number of CRFs expected
    $query11="select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (7)";
    //number of unassigned CRFs
    $query12="select ar from data_review.dash_pivot_metadata m, data_review.dash_pivot_history d
where d.date_imported = '$studynum' and  m.sequences=d.sequences and d.sequences in (13)";

    $result1 = pg_query($query1) or die ('Could not find total');
    $res1= pg_fetch_array($result1);
    $totalp = $res1[0];
    //$totalp=json_encode($totalp);
    //echo ($totalp);

    $result2 =pg_query($query2) or die ('Could not find neo chemoterapy');
    $res2 = pg_fetch_array($result2);
    $chemop = $res2[0];
    //$chemop= json_encode($chemop);

    $result3 = pg_query($query3) or die ('Could not find surgery');
    $res3 = pg_fetch_array($result3);
    $surgeryp = $res3[0];
    //$surgeryp = json_encode($surgeryp);

    $result4 = pg_query($query4) or die ('Could not find off study');
    $res4 = pg_fetch_array($result4);
    $offp = $res4[0];
    //$offp = json_encode($offp);
    //print_r($offp);

    $result5 = pg_query($query5) or die ('Could not find expected');
    $res5 = pg_fetch_array($result5);
    $expectp = $res5[0];
    //$expectp = json_encode($expectp);
    //print_r($expectp);

    $result6 = pg_query($query6) or die ('Could not find unassigned');
    $res6 = pg_fetch_array($result6);
    $unassignp = $res6[0];
    //$unassignp= json_encode($unassignp);
    //print_r($unassignp);

    $result7 = pg_query($query7) or die ('Could not find total CRF');
    $res7 = pg_fetch_array($result7);
    $totalp1 = $res7[0];

    $result8 = pg_query($query8) or die ('Could not find neo chemo CRF');
    $res8 = pg_fetch_array($result8);
    $chemop1 = $res8[0];

    $result9 = pg_query($query9) or die ('Could not find surgery CRF');
    $res9 = pg_fetch_array($result9);
    $surgeryp1 = $res9[0];

    $result11 = pg_query($query11) or die ('Could not find expected CRF');
    $res11 = pg_fetch_array($result11);
    $expectp1 = $res11[0];

    $result12 = pg_query($query12) or die ('Could not find unassigned CRF');
    $res12 = pg_fetch_array($result12);
    $unassignp1 = $res12[0];
?>

<link rel="stylesheet" type="text/css"
 href="./dijit/themes/claro/claro.css" />

<link rel="stylesheet" type="text/css"
 href="./dojox/grid/resources/Grid.css" />

 <link rel="stylesheet" type="text/css"
 href="./dojox/grid/resources/claroGrid.css" />

<script>dojoConfig = {parseOnLoad: true}</script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojo/dojo.js"
               data-dojo-config="async: true"></script>


<script type="text/javascript"
 src="./dojo/dojo.js" charset="utf-8"
    djConfig="parseOnLoad:true,locale:'en-us',extraLocale: ['es-es','pt-br']"></script>

<script type="text/javascript">
    dojo.require("dojox.grid.DataGrid");
    dojo.require("dojo.data.ItemFileReadStore");
</script>



<?php
 // $studynum = $_GET['studynum'].'%';
   if (empty($studynum)){
     $studynum = "";
    }else{
     $studynum = $_GET['studynum'];}
?>

<script type="text/javascript">
dojo.ready(function() {
    var query99{
        items: [ 
        <?php require_once '../webroot/lacrndb3.php';
          fquery99($studynum); ?>

               ]
    };

    var dataStore =
    new dojo.data.ItemFileReadStore(
        { data:query99}
    );
    var grid = dijit.byId("query99");
    grid.setStore(dataStore);
});
</script>
<script>
require([
     // Require the basic chart class
    "dojox/charting/Chart", 
    // Require the theme of our choosing
    "dojox/charting/themes/MiamiNice", 
    // Charting plugins: 
    //  We want to plot Columns
    "dojox/charting/plot2d/Columns",    
    //  We want to plot StackedColumns
    "dojox/charting/plot2d/StackedColumns", 
    //  We want to use Markers
    "dojox/charting/plot2d/Markers", 
    //  We'll use default x/y axes
    "dojox/charting/axis2d/Default",
    //We'll use highlight
    "dojox/charting/action2d/Highlight",
    //we'll use tooltip
    "dojox/charting/action2d/Tooltip",  
    //we'll use Legend
    "dojox/charting/widget/Legend", 
     // Wait until the DOM is ready
    "dojo/domReady!"
],
 function(Chart, theme, Highlight, Tooltip) {

    // Define the data

    var total= <?php print_r ($totalp); ?>;
    //alert(total);
    var chemo = <?php echo ($chemop); ?>;
    //alert(chemo);
    var surgery = <?php echo ($surgeryp); ?>;
    //alert(surgery);
    var offstudy = <?php echo ($offp); ?>;
    //alert(offstudy);
    var expected = <?php echo ($expectp); ?>;
    //alert(expected);
    var unassigned = <?php echo ($unassignp); ?>;
    //alert(unassigned);

    var total1= <?php print_r ($totalp1); ?>;
    //alert(total);
    var chemo1 = <?php echo ($chemop1); ?>;
    //alert(chemo);
    var surgery1 = <?php echo ($surgeryp1); ?>;
    //alert(surgery);
    var expected1 = <?php echo ($expectp1); ?>;
    //alert(expected);
    var unassigned1 = <?php echo ($unassignp1); ?>;
    //alert(unassigned);


    // Create the chart within it's "holding" node
    var chart = new Chart("chartNode");
    var chart2 = new Chart("chartNode2");

    // Set the theme
    chart.setTheme(theme);
    chart2.setTheme(theme);

    // Add the only/default plot
    chart.addPlot("default", {
       type: "Columns",
       markers: true,
       shadows: {dx:2, dy:2, dw:2},
       gap: 2
    });
    chart2.addPlot("default", {
       type: "Columns",
       markers: true,
       shadows: {dx:2, dy:2, dw:2},
       gap: 2
    });



    // Add axes
    chart.addAxis("x", {title:"Arms", titleOrientation: "away", minorLabels: false, labels:[{value:0, text:""}, {value:1, text:"NeoAdj Chemo"}, {value:2, text:"Surgery"},{value:3, text: "Unassigned"}, {value:4, text:"Off Study"}, {value:5, text:"Total (Actual)"}, {value:6, text:"Total (Expected)"}], rotation:-45});
    chart.addAxis("y", {title: "Participants", vertical: true, includeZero: true, ticks:true, majorLabels:true, minorLabels: false });

    chart2.addAxis("x", {title:"Arms", titleOrientation: "away", minorLabels: false, labels:[{value:0, text:""}, {value:1, text:"NeoAdj Chemo"}, {value:2, text:"Surgery"},{value:3, text: "Unassigned"}, {value:4, text:"Total (Actual)"}, {value:5, text:"Total (Expected)"}], rotation:-45});
    chart2.addAxis("y", {title: "CRFs", vertical: true, includeZero: true, ticks:true, majorLabels:true, minorLabels: false });

    // Add the series of data for graph1-Participants
    chart.addSeries("NeoAdj Chemo", [chemo,0,0,0,0,0], {stroke:"#FF0099", fill:"#FEA9F3"});
    chart.addSeries("Surgery", [0,surgery,0,0,0,0], {stroke:"#FFFF00", fill:"#FFFF33"});
    chart.addSeries("Unassigned", [0,0,unassigned,0,0,0], {stroke:"#FF0000", fill:"#CC6600"});
        chart.addSeries("Off-Study", [0,0,0,offstudy,0,0], {stroke: "black", fill:"gray"});
    chart.addSeries("Total (Actual)",[0,0,0,0,total,0], {stroke:"black", fill:"black"});
    chart.addSeries("Total (Expected)", [0,0,0,0,0,expected], {stroke: "black", fill:"blue"});

   //Add the series of data for graph2-CRFs
    chart2.addSeries("NeoAdj Chemo", [chemo1,0,0,0,0], {stroke:"#FF0099", fill:"#FEA9F3"});
    chart2.addSeries("Surgery ", [0,surgery1,0,0,0], {stroke:"#FFFF00", fill:"#FFFF33"});
    chart2.addSeries("Unassigned ", [0,0,unassigned1,0,0], {stroke:"#FF0000", fill:"#CC6600"});
    chart2.addSeries("Total(Actual)",[0,0,0,total1,0], {stroke:"black", fill:"black"});
    chart2.addSeries("Total(Expected)", [0,0,0,0,expected1], {stroke: "black", fill:"blue"});



    var mag = new dojox.charting.action2d.Highlight(chart,"default");
    var mag2 = new dojox.charting.action2d.Highlight(chart2,"default");

   // new Tooltip(chart, "default");
   // new Tooltip(chart2, "default");
    // Render the chart!
    chart.render();
    chart2.render();



    //var legend1 = new dojox.charting.widget.Legend({chart: chart, horizontal:true}, "legend1");
    //var legend2 = new dojox.charting.widget.Legend({chart: chart2, horizontal:true}, "legend2");


});

</script>


<table BORDER="2" BORDERCOLOR="#336699" CELLPADDING="2" CELLSPACING="2" WIDTH="100%">
<tr>
    <td> 
    <div id="chartNode" style="float:left">    
    </div>

    </td>
    <td> 
    <div id="chartNode2" style="float:left">    
    </div>

    </td>
    </tr>
</table>

<center>
<table border ="2" width="100%" heightt="10">
<tr>
    <td> "Testing"</td>
</tr>
</table>
</center>

<center>
    <FORM name="lacrn1" action="lacrnv3.php" method="get">
    <SELECT name="studynum">
    <?php require_once '../webroot/lacrndb3.php';
    studylist();


    ?>
    </SELECT>
    <INPUT TYPE="submit" value="Submit">
    </FORM>

 <form><input type="button" value="Download the CSV File" onClick="window.location.href='http://lacrn-trn.ccsainc.com:8000/hello.php'"></form> 
<table border="0" cellspacing="20px">
<tr><td>
<style>
p {text-indent:30px;}
</style>
        <br><h3><!--Subjects Enrolled to Unassigned Arm--></h3>
        <div style="width: 1150px; height: 768px">
        <table id="query99" dojoType="dojox.grid.DataGrid" escapeHTMLInData="false" canSort="function(){return false}">


            <thead>
                <tr>
                    <th field="Parameter" width="550px">Parameter</th>
                    <th field="ar" width="80"><center><a href="https://lacrn-ar.ccsainc.com:8801/dash_ar.php">AR</a></center></th>
                <th field="br" width="80"><center><a href="https://lacrn-br.ccsainc.com:8801/dash.php">BR</center></th>
                <th field="cl" width="80"><center><a href="https://lacrn-cl.ccsainc.com:8801/dash.php">CL</center></th>
                                <th field="mxjal" width="80"><center><a href="https://lacrn-mx-jal.ccsainc.com:8801/dash.php">MX-JAL</center></th>
                                <th field="mxson" width="80"><center><a href="https://lacrn-mx-son.ccsainc.com:8801/dash.php">MX-SON</center></th>
                                <th field="uy" width="80"><center><a href="https://lacrn-uy.ccsainc.com:8801/dash.php">UY</center></th>
                <th field="total" width="100"><center>TOTAL</center></th>
                </tr>
            </thead>

        </table>
    </div>

</table>
</center>



</body>
</html>
Member Avatar for LastMitch

Do you think is have something to do with me having multiple functions in one file?

You mean repeat? Yes, you do repeat alot. Is there an error when you run the code?

This is the Grid Code:

<script type="text/javascript">
dojo.ready(function() {
var query99{
items: [
<?php require_once '../webroot/lacrndb3.php';
fquery99($studynum); ?>
]
};

var dataStore =
new dojo.data.ItemFileReadStore(
{ data:query99}
);
var grid = dijit.byId("query99");
grid.setStore(dataStore);
});
</script>

I notice there's something wrong with your PHP code and it has nothing do with your dojo code.

What error did you get from your PHP code? There should be an error because you forgot to put something.

I notice this line (you need to put an extra period in the CCS file):

From this:

<link rel="stylesheet" type="text/css" href="./dojox/grid/resources/Grid.css" />

To this:

<link rel="stylesheet" type="text/css" href="../dojox/grid/resources/Grid.css" />

Hi, LastMitch. That same grid code I have works just fine in a separate file, it displays the data with no problems. The issue seems to be when I combine both codes the grid code and graph code. Something prevents the grid from being displayed, it does show the headers but not the data. I wonder were in the code the grid display get interrupted. Maybe I should had called the resource files in a different order. Maybe the call to the grid should come after the graph. I am not sure...I keep moving things around and it still displays the same thing (only the graphs and grid header). When I take a look at the code using the inspect element, it shows that is capturing the data for the grid, no issues there. The problem is strictly the grid display. I changed the './' to '../' like you mentioned, but still no changes.

Can anyone help me?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.