masih bingung menggunakan if

mau nanya gan ada du tb priode untuk menampil halaman(tagihan) dan tb_bill isi tagihan tb priode terdiri dari id,name,month_pay,total,status,date dan bill terdiri dari id,stockno,item_name,country,price,jan,feb,mar,apr,dan seterusnya.. yang mau ditanyakan ketika halaman tagihan dibuat misalnya bulan januari(jan) dan febuari(feb) setelah di buat saya kesulitan ketika halaman jan/feb di klick hasilnya error terurrr mohan pencerahannya contoh kodenya

mengambi data dari tb_priode saya tandai tanda panah panjang

 <?php
include('security.php');

?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <!-- META SECTION -->
        <title>HOMEPAGE</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />

        <link rel="icon" href="favicon.ico" type="image/x-icon" />
        <!-- END META SECTION -->

        <!-- CSS INCLUDE -->
        <link rel="stylesheet" type="text/css" id="theme" href="css/theme-default.css"/>
        <!-- EOF CSS INCLUDE -->
    </head>
    <body>
        <!-- START PAGE CONTAINER -->
        <div class="page-container">

            <!-- START PAGE SIDEBAR -->
            <div class="page-sidebar">
               <?php
               include('nav.php');
               ?>
            </div>
            <!-- END PAGE SIDEBAR -->

            <!-- PAGE CONTENT -->
            <div class="page-content">

                <!-- START X-NAVIGATION VERTICAL -->
                <ul class="x-navigation x-navigation-horizontal x-navigation-panel">
                    <!-- TOGGLE NAVIGATION -->
                    <li class="xn-icon-button">
                        <a href="#" class="x-navigation-minimize"><span class="fa fa-dedent"></span></a>
                    </li>
                    <!-- END TOGGLE NAVIGATION -->
                </ul>
                <!-- END X-NAVIGATION VERTICAL -->

                <!-- START BREADCRUMB -->
                <ul class="breadcrumb">
                    <li><a href="#">Link</a></li>
                    <li class="active">Active</li>
                </ul>
                <!-- END BREADCRUMB -->

                <div class="page-title">
                    <h2></span>TABLE</h2>
                </div>
                <?php
                include_once '../connection.php';


                ?>
                <!-- PAGE CONTENT WRAPPER -->
                <div class="page-content-wrap">
                     <div class="col-md-12">
                    <div class="row">

                        <?php

                             $sql=mysql_query('select * from priode')or die(mysql_error());
                            while($result=mysql_fetch_array($sql)){
                            $id = ''.$result['id'].'';
                            $name = ''.$result['name'].'';
							$month_pay = ''.$result['month_pay'].'';
							$total = ''.$result['total'].'';
                            $status = ''.$result['status'].'';
                            $date = ''.$result['date'].'';





                            ?>

                            <div class="col-md-3">
                            <!-- START WIDGET REGISTRED ------------------------------------------------------------------------------------------->

                            <div class="widget widget-default widget-item-icon" onclick="location.href='#' ;">
                                <?php
                                if($total == "0")
                                {
                                echo'<div class="widget-item-left">';
                                echo'<span class="fa fa-ban"></span>';
                                echo'</div> ';
								echo'<div class="widget-data"> ';
								echo"<div class='widget-int num-count'><h4>no bills yet '". $result["total"] ."'</h4></div> ";
								echo"<div class='widget-title'>" . $result["name"] ."</div> ";
								echo'</div> ';


                                }
                                else
                                {

									if($total > "0")
                               echo'<div class="widget-item-left">';
							   echo'<a href="pay.php?month_pay='.$result['month_pay'].'"><span class="fa fa-group"></span></a>';
                                echo'</div> ';
								echo'<div class="widget-data"> ';
								echo"<div class='widget-int num-count'><h4>Total Bill '". $result["total"] ."'</h4></div> ";
								echo"<div class='widget-title'>" . $result["name"] ."</div> ";
								echo'</div> ';
                                }

                                ?>

                                <div class="widget-data">


                                    <?php
                                    if($total =="0")
                                    {
                                        echo'<div class="widget-subtitle"><font color="red">'.$status.'</font></div>';
                                    }
                                    else
                                    {
                                          echo'<div class="widget-subtitle"><font color="blue">Active</div>';
                                    }
                                    ?>

                                </div>
                                <div class="widget-controls">
                                    <a href="#" class="widget-control-right widget-remove" data-toggle="tooltip" data-placement="top" title="Remove Widget"><span class="fa fa-times"></span></a>
                                </div>
                            </div>
                            <!-- END WIDGET REGISTRED -->

                        </div>

                            <?php
                            }
                            ?>


                    </div>
                    </div>

                </div>
                <!-- END PAGE CONTENT WRAPPER -->
            </div>
            <!-- END PAGE CONTENT -->
        </div>
        <!-- END PAGE CONTAINER -->



        <!-- START PRELOADS -->
        <audio id="audio-alert" src="audio/alert.mp3" preload="auto"></audio>
        <audio id="audio-fail" src="audio/fail.mp3" preload="auto"></audio>
        <!-- END PRELOADS -->

    <!-- START SCRIPTS -->
        <!-- START PLUGINS -->
        <script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
        <script type="text/javascript" src="js/plugins/jquery/jquery-ui.min.js"></script>
        <script type="text/javascript" src="js/plugins/bootstrap/bootstrap.min.js"></script>
        <!-- END PLUGINS -->

        <!-- THIS PAGE PLUGINS -->

        <!-- END PAGE PLUGINS -->

        <!-- START TEMPLATE -->
        <script type="text/javascript" src="js/plugins.js"></script>
        <script type="text/javascript" src="js/actions.js"></script>
        <!-- END TEMPLATE -->
    <!-- END SCRIPTS -->
    </body>
</html>


mengambi data dari tb_bill saya tandai tanda panah panjang

<?php
 include_once '../connection.php';
     include("security.php");

?>
					  <?php
              if(isset($_GET['month_pay'])){
              $month_pay = ($_GET['month_pay']);

              }




              ?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <!-- META SECTION -->
        <title>TITLE</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />

        <link rel="icon" href="favicon.ico" type="image/x-icon" />
        <!-- END META SECTION -->

        <!-- CSS INCLUDE -->
        <link rel="stylesheet" type="text/css" id="theme" href="css/theme-default.css"/>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
        <!-- EOF CSS INCLUDE -->

        <style type="text/css">
            .foo {
  float: left;
  width: 20px;
  height: 20px;
  margin: 1px;
  border: 1px solid rgba(0, 0, 0, .2);
}

.white {
  background: #fdfbfb;
}

.red {
  background: #fd343d;
}

.yellow {
  background: #e9fb6c;
}
        </style>
    </head>
    <body>
        <!-- START PAGE CONTAINER -->
        <div class="page-container">

            <!-- START PAGE SIDEBAR -->
            <div class="page-sidebar">
                <!-- START X-NAVIGATION -->
                <?php
               include("nav.php");

               ?>
                <!-- END X-NAVIGATION -->
            </div>
            <!-- END PAGE SIDEBAR -->

            <!-- PAGE CONTENT -->
            <div class="page-content">

                <!-- START X-NAVIGATION VERTICAL -->
                <ul class="x-navigation x-navigation-horizontal x-navigation-panel">
                    <!-- TOGGLE NAVIGATION -->
                    <li class="xn-icon-button">
                        <a href="#" class="x-navigation-minimize"><span class="fa fa-dedent"></span></a>
                    </li>
                    <!-- END TOGGLE NAVIGATION -->
                </ul>
                <!-- END X-NAVIGATION VERTICAL -->

                <!-- START BREADCRUMB -->
                <ul class="breadcrumb">
                    <li><a href="#">Link</a></li>
                    <li class="active">Active</li>
                </ul>
                <!-- END BREADCRUMB -->


                <!-- PAGE CONTENT WRAPPER -->
                <div class="page-content-wrap">

                    <div class="row">
                        <div class="col-md-12">

                                <!-- START DEFAULT DATATABLE -->
                            <div class="panel panel-default">

                                <div class="panel-heading">
                                    <h3 class="panel-title">Tables</h3>
                                    <ul class="panel-controls">
                                        <li><a href="#" class="panel-collapse"><span class="fa fa-angle-down"></span></a></li>
                                        <li><a href="#" class="panel-refresh"><span class="fa fa-refresh"></span></a></li>
                                        <li><a href="#" class="panel-remove"><span class="fa fa-times"></span></a></li>
                                    </ul>
                                </div>
      <!-- START DEFAULT DATATABLE ----------------------------------------------------------------------------------------------------------------------->

              <?php $sql=mysql_query('select * from priode
                                where month_pay = "'.$month_pay.'"')or die(mysql_error());
                                while($result=mysql_fetch_array($sql)){

                                $month_pay = ''.$result['month_pay'].'';

                                }
                                ?>


                                 <?php

                                      echo '<div class="panel-body">';
                                        $result1 = mysql_query("SELECT * from stock_in");

                                            echo '<br> ';


                                            echo '<table class="table datatable">';

                                            echo '<thead>';

                                            echo '<tr>';
                                            echo '<th width="7%">No.</th>';
                                            echo '<th width="9%">ID</th>';
                                            echo ' <th width="30%">NAME</th>';
                                            echo '<th width="7%">LOC</th> ';
											echo '<th width="9%">COUNTRY</th> ';
											echo '<th width="10%">QTY</th> ';
                                            echo '<th width="10%">ACTION</th> ';
                                            echo '</tr>';
                                            echo '</thead>';
                                            echo '<tbody>';
                                            while($row = mysql_fetch_array($result1)){
                                            echo '<tr>';
                                             $beg = ''.$row["stockno"] .'';

                                            echo "<td >" . $row["id"] . "</td>";
                                            echo "<td>" . $row["stockno"] . "</td>";
                                            echo "<td>" . $row["item_name"] . "</td>";
											echo "<td>" . $row["p_status"] ."</td>";
											echo "<td>" . $row["country"] ."</td>";


if($month_pay == "jan")
                                {
                              echo "<td>" . $row["jan"] ."</td>";


                                }
                                else
                                {
if($month_pay == "feb")
                               echo "<td>" . $row["feb"] ."</td>";
                                }

if($month_pay == "mar")
                                {
                              echo "<td>" . $row["mar"] ."</td>";


                                }
                                else
                                {
if($month_pay == "apr")
                              echo "<td>" . $row["apr"] ."</td>";

                                }

if($month_pay == "mei")
                                {
                              echo "<td>" . $row["mei"] ."</td>";

                                }
                                else
                                {
if($month_pay == "jun")
                             echo "<td>" . $row["jun"] ."</td>";
                                }

if($month_pay == "jul")
                                {
                              echo "<td>" . $row["jul"] ."</td>";


                                }
                                else
                                {
if($month_pay == "ags")
                              echo "<td>" . $row["ags"] ."</td>";
                                }

if($month_pay == "sep")
                                {
                               echo "<td>" . $row["sep"] ."</td>";


                                }
                                else
                                {
if($month_pay == "oct")
                               echo "<td>" . $row["oct"] ."</td>";
                                }

if($month_pay == "nov")
                                {
                              echo "<td>" . $row["nov"] ."</td>";


                                }
                                else
                                {
if($month_pay == "des")
                               echo "<td>" . $row["des"] ."</td>";
                                }



                                            echo "<td><a href='#myModal'id='custId' data-toggle='modal' data-id=".$row['id'].">
                                            EDIT </a> |  <a href='delete.php?stockno=".$row['stockno']."'>DELETE</a></td>";
                                            echo'</tr>';
                                            }
                                  echo'</tbody>';
                                echo'</table>';
                              echo'</div>';
                            echo'</div>';
                            ?>
                            <!-- END DEFAULT DATATABLE -->
                    </div>
                    </div>

                </div>
                <!-- END PAGE CONTENT WRAPPER -->
            </div>
            <!-- END PAGE CONTENT -->
        </div>
        <!-- END PAGE CONTAINER -->

        <!-- MESSAGE BOX-->
        <div class="message-box animated fadeIn" data-sound="alert" id="mb-signout">
            <div class="mb-container">
                <div class="mb-middle">
                    <div class="mb-title"><span class="fa fa-sign-out"></span> Log <strong>Out</strong> ?</div>
                    <div class="mb-content">
                        <p>Are you sure you want to log out?</p>
                        <p>Press No if youwant to continue work. Press Yes to logout current user.</p>
                    </div>
                    <div class="mb-footer">
                        <div class="pull-right">
                            <a href="pages-login.html" class="btn btn-success btn-lg">Yes</a>
                            <button class="btn btn-default btn-lg mb-control-close">No</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- END MESSAGE BOX-->



        <!-- START POPUP MODAL EDIT ITEM-->
         <div id="myModal" class="modal fade" role="dialog">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">×</button>
                    <h4 class="modal-title"><span class="fa fa-user-secret" style="font-size:50px"> Detail Client</span></h4>
                </div>
                <div class="modal-body">
                    <div class="fetched-data"></div>
                </div>
                <div class="modal-footer">

                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div>
        </div>
    </div>

                             <!-- END POPUP MODAL EDIT ITEM-->











        <!-- START PRELOADS -->
        <audio id="audio-alert" src="audio/alert.mp3" preload="auto"></audio>
        <audio id="audio-fail" src="audio/fail.mp3" preload="auto"></audio>
        <!-- END PRELOADS -->

    <!-- START SCRIPTS -->
        <!-- START PLUGINS -->
        <script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
        <script type="text/javascript" src="js/plugins/jquery/jquery-ui.min.js"></script>
        <script type="text/javascript" src="js/plugins/bootstrap/bootstrap.min.js"></script>
        <!-- END PLUGINS -->

            <!-- THIS PAGE PLUGINS -->
        <script type='text/javascript' src='js/plugins/icheck/icheck.min.js'></script>
        <script type="text/javascript" src="js/plugins/mcustomscrollbar/jquery.mCustomScrollbar.min.js"></script>

        <script type="text/javascript" src="js/plugins/datatables/jquery.dataTables.min.js"></script>
        <!-- END PAGE PLUGINS -->

        <!-- START TEMPLATE -->
        <script type="text/javascript" src="js/plugins.js"></script>
        <script type="text/javascript" src="js/actions.js"></script>
        <!-- END TEMPLATE -->

        <!-- pop up EDIT -->

  <script type="text/javascript">
    $(document).ready(function(){
        $('#myModal').on('show.bs.modal', function (e) {
            var rowid = $(e.relatedTarget).data('id');
            //menggunakan fungsi ajax untuk pengambilan data
            $.ajax({
                type : 'post',
                url : 'edit.php',
                data :  'rowid='+ rowid,
                success : function(data){
                $('.fetched-data').html(data);//menampilkan data ke dalam modal
                }
            });
         });
    });
  </script>

    <!-- pop up EDIT -->





    <!-- END SCRIPTS -->
    </body>
</html>


avatar maulanamahdi
@maulanamahdi

109 Kontribusi 0 Poin

Diperbarui 5 tahun yang lalu

4 Jawaban:

Boleh liat contoh erornya kaya gimana?

avatar samsularifin05
@samsularifin05

114 Kontribusi 13 Poin

Dipost 5 tahun yang lalu

Undefined Index

avatar maulanamahdi
@maulanamahdi

109 Kontribusi 0 Poin

Dipost 5 tahun yang lalu

SOK ATUH GAN BERI PENERANGANNNYA ,.,.,.,LAGI BELAJAR

avatar maulanamahdi
@maulanamahdi

109 Kontribusi 0 Poin

Dipost 5 tahun yang lalu

SOLVED,.SALAH NGAMBIL Tb bill bukan tb stock_in <pre> $result1 = mysql_query("SELECT * from stock_in"); </pre> thank atas waktunyaa

avatar maulanamahdi
@maulanamahdi

109 Kontribusi 0 Poin

Dipost 5 tahun yang lalu

Login untuk ikut Jawaban