fluxogramas de monitoramento de atividade usando banco de dados mysql e php

votos
0

Quando eu fazer upload de arquivo .csv para banco de dados, eu preciso fazer fluxogramas de monitoramento de atividade olha abaixo.

amostra de saída esperada:

Eu tenho feito algo aqui, mas eu recebo saída parece abaixo.

Minha saída:

Cada linha de conexão indica atividades como instalação de cabos, câmera de montagem assim.

qual é a maneira mais simples de obter saída exata? Alguém me dar uma idéia ou códigos de amostra para prosseguir.

Quaisquer amostras estão lá?

Minha base de dados exemplo:

Meu código 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>
Publicado 18/12/2018 em 11:05
fonte usuário
Em outras línguas...                            

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more