使用php和mysql数据库的javascript活动监控流程图

yptwkmov  于 2021-06-15  发布在  Mysql
关注(0)|答案(0)|浏览(282)

当我上传.csv文件到数据库,我需要使活动监控流程图如下所示。
预期输出示例:

我在这里做了一些事情,但我得到下面的输出。
我的输出:

每一条连接线都表示电缆敷设、摄像机安装等活动。
获得精确输出的最简单方法是什么?任何人给我一个想法或样本代码进行进一步。
有样品吗?
我的示例数据库:

我的php代码

<div>          
        <?php
        $start = "SELECT * FROM plot_points where sub='strat'";
        $query0 = mssql_query($start);
        $row0 = mssql_fetch_array($query0);
        if ($query0 > 0 && $row0['postion'] == '0') {
            ?>
            <!--                <div class="start">
                                <img  src="img/tri.jpg" alt="" style="float: left;" />
                                   <div class="" id="progressbar1"  style=" float: left;width:100px; padding-top: 15px; margin-left: -15px;   "></div>                       
                            </div>-->

            <?php
        }
        $sql = "SELECT * FROM plot_points ";
        $query = mssql_query($sql);
        echo '<div class="start">';
        $i = 1;
        $top = 0;
        $ml = 70;

        while ($row = mssql_fetch_array($query)) {
            if ($row['sub'] == 'strat') {
                ?>
                <span style=" position: fixed; font-size: 13px; margin-top: -20px;"><?php echo $row['points']; ?></span>

                <img id="<?php echo $row['points']; ?><?php echo $row['pid']; ?>" src="img/start.png" alt="" style="float: left; height: 50px; width:50px;" />

                <div class="progressbar<?php echo $i + 1; ?>"  style=" float: left;width:100px; padding-top: 20px;   margin-left: 0px;   "></div>                       
                <div class="progressbar<?php echo $i + 1; ?>"  style=" float: left;width:100px;margin-top:10px;   margin-left: -100px;   "></div>  
                <div class="progressbar<?php echo $i + 1; ?>"  style=" float: left;width:100px; margin-top:30px;   margin-left: -100px;   "></div>  
                <?php
            } else {
                if ($row['postion'] == '0' && $row['sub'] != 'strat') {
                    ?>  

                    <span style=" position: fixed; font-size: 13px; top:-7px; margin-left: 8px;"><?php echo $row['points']; ?></span>
                    <img id="<?php echo $row['points']; ?><?php echo $row['pid']; ?>" src="img/tri.jpg" alt="" style="float: left;" />
                    <div class="progressbar<?php echo $i + 1; ?>"  style=" float: left;width:100px; padding-top: 15px; margin-left: -15px;   "></div> 

                    <?php
                } elseif ($row['postion'] == '90') {
                    $mtop = '-120px';
                    ?>
                   <span style=" position: fixed; font-size: 13px;  margin-left:-140px; margin-top:-90px;"><?php echo $row['points']; ?></span>
                    <img id="<?php echo $row['points']; ?><?php echo $row['pid']; ?>" src="img/tri.jpg" alt="" style="float: left; margin-left:-140px; margin-top:-90px;" />
                    <div class="progressbar<?php echo $i + 1; ?>"  style=" float: left;width:50px; transform: rotate(90deg); margin-left:-155px;  margin-top:-35px; ; ">fdg</div> 

                    <?php
                    $q = mssql_query("SELECT *  FROM  plot_points WHERE  sub ='" . $row['points'] . "'");
                    $sstop = 90;
                    $t = 1;
                    $top1 = 0;
                    while ($row1 = mssql_fetch_array($q)) {
                        // echo $row1['postion'];
                        if ($row1['postion'] == '90') {

                            $mttop = $sstop + 90;
                            $ttp = '-' . $mttop . 'px';
                            $ttp5 = '-' . $mttop + 50 . 'px';
                            $left = 140;
                            $le = '-' . $left . 'px';
                            $ttptop = '-' . $mttop-10 . 'px';
                            $sstop = $mttop;
                            ?>
                            <span style=" position: fixed; font-size: 13px;margin-left:<?php echo $le; ?>; margin-top:<?php echo $ttptop; ?> ;"><?php echo $row1['next_points']; ?></span>

                            <img id="<?php echo $row['points']; ?><?php echo $row['pid']; ?>" src="img/<?php echo $row1['icons'] ?>" alt="" style="float: left; margin-left:<?php echo $le; ?>; margin-top:<?php echo $ttp; ?> ;" />
                            <div class="progressbar<?php echo $i + 1; ?>"  style=" float: left;width:50px; transform: rotate(90deg); margin-left:-155px;  margin-top:<?php echo $ttp5; ?> ; "></div> 

                        <?php } elseif ($row1['postion'] == '180') { ?>
                            <?php
                            $q1 = mssql_query("SELECT *  FROM  plot_points WHERE  points ='" . $row1['points'] . "'");

                            while ($row2 = mssql_fetch_array($q1)) {
                                $mttop1 = $top1 + 90;
                                $ttp1 = '-' . $mttop1 . 'px';
                                $ttp2 = '-' . $mttop1 - 10 . 'px';
                                $ttp3 = '-' . $mttop1 - 20 . 'px';
                                $ttpb = '-' . $mttop1-10 . 'px';
                                if ($row2['postion'] == '180') {
                                    ?>
                              <span style=" position: fixed; font-size: 13px;margin-left:-290px; margin-top:<?php echo $ttpb; ?> ;"><?php echo $row2['next_points']; ?></span>

                                    <img id="<?php echo $row['points']; ?><?php echo $row['pid']; ?>" src="img/<?php echo $row2['icons'] ?>" alt="" style="float: left; margin-left:-270px; margin-top:<?php echo $ttp1; ?> ;" />
                                    <div class="progressbar<?php echo $i + 1; ?>"  style=" float: left;width:100px; transform: rotate(180deg); margin-left:-230px;  margin-top:<?php echo $ttp1; ?> ; "></div> 
                                    <div class="progressbar<?php echo $i + 1; ?>"  style=" float: left;width:100px; transform: rotate(180deg); margin-left:-230px;  margin-top:<?php echo $ttp2; ?> ; "></div> 
                                    <div class="progressbar<?php echo $i + 1; ?>"  style=" float: left;width:100px; transform: rotate(180deg); margin-left:-230px;  margin-top:<?php echo $ttp3; ?> ; "></div> 
                                <?php } else { ?>

                                <?php }
                                ?>

                            <?php }$top1 = 90;
                            ?>
                        <?php } ?>

                        <?php
                        $top += 90;

                        $t++;
                    }
                    ?>
                    <?php
                } elseif ($row['postion'] == '270') {
                    $mtop = '90px';
                    ?>
                    <img id="<?php echo $row['points']; ?><?php echo $row['pid']; ?>" src="img/<?php echo $row['icons'] ?>" alt="" style="float: left; margin-left:-140px;margin-top:<?php echo $mtop; ?> " />
                    <div class="progressbar<?php echo $i + 1; ?>"  style=" float: left;width:57px; transform: rotate(270deg); margin-left:-125px;  margin-top:45px; ; "></div> 
                    <span style=" position: fixed; font-size: 13px;margin-left:-140px;margin-top:130px; "><?php echo $row['next_points']; ?></span>
                        <?php
                } elseif ($row['postion'] == '180') {
                    //echo 'vbn';
                }
                ?>

            <?php }
            ?>

            <?php
            $i++;
        }
        echo ' </div> ';
        ?>

    </div>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题