<table style="width:100%;">
     <?php
      $c=0;
      $re = $wpdb->get_results( " SELECT * FROM ".$wpdb->prefix."clickbar " );
      $wpdb->query( $sql );
      foreach ( $re as $ro ){
                                         
                                         $C_ID=$ro->C_ID;
                                         $ClickBarName=$ro->ClickBarName;
                                         
                                         $Options="<button style='font-weight:900;' onclick=\"window.location='".admin_url()."admin.php?page=clickbar&p=n&v=$C_ID';\"> Edit </button>&nbsp;";
                                         
                                         $Options=$Options."<button style='font-weight:900; color:#990000;' onclick=\"deletebar('$C_ID');\"> Delete </button>&nbsp;";
                                         
                                         
                                         
                                         echo "
                                               <tr>
                                                <td width='40'>
                                                 <a href='#' onclick=\"stats('$C_ID'); return false;\"><img src='$PGPath"."images/graph.png' border='0' title='View stats for this bar.'></a>
                                                </td>
                                                <td>
                                                   ".stripslashes($ClickBarName)."
                                                </td>
                                                
                                                <td>
                                                 [clickbar id=\"".$C_ID."\"]
                                                </td>
                                                
                                                <td style='width:150px;'>
                                                 $Options
                                                </td>
                                               </tr> 
                                              ";
                                        }
     ?>
    </table>
    
    <script type='text/javascript'>
    function deletebar(V){
                          var Y=window.confirm('Are you sure you want to delete this bar?');
                          if (Y){
                                 window.location='<?php echo $PGPath; ?>delete.php?v='+V;
                                }
                         }
    function stats(I){
                     $.post('<?php echo $PGPath; ?>stats.php',{I:I},
                                                  function(data) {
                                                                  
                                                                  $('#ContentPopUp').html(data);
                                                                  $('#Blanket').css('display','block');
                                                                  $('#ContentPopUpContainer').css('display','block');
                                                                  window.scrollTo(0,0);
                                                                 });
                   }                       
    </script>                     