pop out using fancybox not working in Datatable

pop out using fancybox not working in Datatable

ksonia90ksonia90 Posts: 2Questions: 2Answers: 0

Hi, I just started using Datatables for my Order list and it works fine. the problem is my SET NEXT STATUS link which using fancybox not working. Could someone please help me? Thanks :)

here is the page that using Datatable plugin:


<?php require_once ('common/isLogin.php'); //(($nature == 1)||($nature == 2)||($nature == 3)||($nature == 5)||($nature == 6)||($nature == 9) ) ? "": die("<div class='error'>No access rights</div>"); (($nature == 1)||($nature == 10) ) ? "": die("<div class='error'>No access rights</div>"); <?php > ?> <?php require_once ('database.php'); require_once ('common/order_status.php'); $result = mysql_query("SELECT * FROM orders WHERE STATUS = '3' OR STATUS = '18' ORDER BY orders.id desc"); <?php > ?> <ul id="crumbs"> <li><a href="index.php?Request=admin_main">Assembling</a></li> </ul> <link rel="stylesheet" type="text/css" href="plugin/media/css/jquery-ui.css"> <link rel="stylesheet" type="text/css" href="plugin/media/css/dataTables.jqueryui.css"> <script type="text/javascript" language="javascript" src="plugin/media/js/jquery.js"></script> <script type="text/javascript" language="javascript" src="plugin/media/js/jquery.dataTables.min.js"></script> <script type="text/javascript" language="javascript" src="plugin/media/js/dataTables.jqueryui.js"></script> <style> *{ font-family: arial; } </style> <script type="text/javascript" > $(document).ready(function(){ $('#datatables').dataTable({ "sPaginationType":"full_numbers", "aaSorting":[[2, "desc"]], "bJQueryUI":true, }); }); </script> <br /> <table id="datatables" class="display"> <thead> <tr><td colspan = '14' style='border:0;white;background:#4f6b72;height:40px;color:white;font-weight:bolder;font-size:16px;'>ASSEMBLING</td></tr> <tr> <th>Order ID</th> <th>Logistic ID</th> <th>Order Date</th> <th>Products</th> <th>Quantity</th> <th>Quantity Packed</th> <th style="width:10px">Order Remarks</th> <th style="width:10px">To Pack Remarks</th> <th>Status</th> <th>Action</th> <th>Set Next Status</th> </tr> </thead> <tbody> <?php while ($row = mysql_fetch_array($result)) { $status = $row['status']; $order_id = $row['id']; ?> <tr> <td><?=$row['id']?></td> <td><?=displayLogisticId($row['id'])?></td> <td><?=ConvertDate($row['date'])?></td> <td><?=truncateProduct($row['id'])?></td> <td><?=truncateQuantity($row['id'])?></td> <td><?=quantityPack($row['id'])?></td> <td><?=$row['remarks']?></td> <td><?=$row['to_pack_remarks']?></td> <td><?=displayStatus($row['status'])?></td> <td><a href=index.php?Request=packer_view&sec_code=<?=$row['sec_code']?>><img src='images/edit.jpeg' height='20' weight='20' border='0' alt='View' title='View'></a></td> <td><?=((($row['current_status']!==12)||($row['current_status']!==17)) && (($nature == 1)||($nature == 10)) ) ? displayStatusLink($status,$order_id,''):"Not Available";?></td> </tr> <?php } ?> </tbody> </tbody> </table>

the SET NEXT STATUS link is from my 'common/order_satus.php'

 <script type="text/javascript">
        $(document).ready(function() {


            $("a#example3").fancybox({
                'overlayShow'   : true,
                'hideOnOverlayClick' :true,
                'width'         : '45%',
                'height'        : '70%',
                'autoScale'     : true,
                'transitionIn'  : 'elastic',
                'transitionOut' : 'elastic',                                
                'type'          : 'iframe',
                'onClosed'      : function() {
                 parent.location.reload(true); ;
                }
                                
            });

            $("a#example5").fancybox({
                'overlayShow'   : true,
                'hideOnOverlayClick' :true,
                'width'         : '55%',
                'height'        : '80%',
                'autoScale'     : true,
                'transitionIn'  : 'elastic',
                'transitionOut' : 'elastic',
                'type'          : 'iframe',
                                
            });

            $("a#example4").fancybox({
                'overlayShow'   : true,
                'hideOnOverlayClick' :true,
                'width'         : '32%',
                'height'        : '35%',
        
                'transitionIn'  : 'elastic',
                'transitionOut' : 'elastic',
                'type'          : 'iframe',
                'onClosed'      : function() {
                parent.location.reload(true); ;
              }
                                
            });
            
        });
</script>



<?php 


function displayStatusLink($id, $order_id, $notice,$nature,$logistic_id){
    $notice = '"Are you sure? "';
    
    switch($id){
        
            
        case 3: //to pack
            echo "<a href='packaging/partial_pack.php?id=$order_id' id='example3'>Pack</a>&nbsp;|&nbsp;";
       break;
     
        case 18: //partially packed 
        echo "<a href='packaging/partial_pack.php?id=$order_id' id='example3'>Pack</a>&nbsp;|&nbsp;";
        echo "<a href='admin/ship.php?id=$order_id' id='example3'>Ship</a>&nbsp;|&nbsp;";
       
                break;
      
        default: 
            return "";
            
    }
}

  
             }
            }
          mysql_free_result($sql);







}

//get server name
$server_name = $_SERVER['HTTP_HOST'];


<?php
>
?>


This discussion has been closed.