Advertisement
Guest User

get_data_dashboard.php

a guest
Feb 8th, 2017
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.08 KB | None | 0 0
  1. <?php
  2.     include "connection.php";
  3.     $id_tr        = $_REQUEST['id_tr'];         //header dashboard
  4.     $id_tr_widget = $_REQUEST['id_tr_widget'];  //id tr widget
  5.     $id_tr_dt     = $_REQUEST['id_tr_dt'];      //id tr detail
  6.     $width        = $_REQUEST['width'];         //width
  7.     $height       = $_REQUEST['height'];        //height
  8.     $mw_wg    = mysqli_fetch_object(mysqli_query($con,"select * from tr_widget where id_tr_widget='".$id_tr_widget."'"));
  9.     $my_konek = mysqli_fetch_object(mysqli_query($con,"select * from connection where id_con='".$mw_wg->id_con."'"));
  10.     $sql_view = mysqli_fetch_object(mysqli_query($con,"SELECT query  from sql_view where  id_sql_view='".$mw_wg->id_sql_view."'"));
  11.    
  12.     $id_type_widget = $mw_wg->id_type_widget;
  13.         if($my_konek->port=="" or $my_konek->port==null)
  14.         {
  15.             $mydb = new mysqli($my_konek->host,$my_konek->username,$my_konek->pwd,$my_konek->database_name);
  16.                 if($mydb->connect_errno > 0){
  17.                         die('Unable to connect to database' . $mydb->connect_error);
  18.                 }
  19.         }
  20.         else
  21.         {
  22.             $mydb = new mysqli($my_konek->host,$my_konek->username,$my_konek->pwd,$my_konek->database_name,$my_konek->port);
  23.                 if($mydb->connect_errno > 0){
  24.                         die('Unable to connect to database' . $mydb->connect_error);
  25.                 }
  26.         }
  27.         // Image Slider
  28.          if($id_type_widget=="9"){
  29.          $RandomAccountNumber = uniqid();
  30.          ?>
  31.                
  32.                             <center><div id="owl-demo_<?php echo $id_tr?>_<?php echo $id_tr_dt?>_<?php echo $RandomAccountNumber ?>" class="owl-carousel">
  33.                                 <?php
  34.                                    $list_value  = $mw_wg->file_name;
  35.                                    $var=explode('***zzz****',$list_value);
  36.                                    $count = count($var);
  37.                                    foreach($var as $row) {
  38.                                     if (--$count <= 0) {
  39.                                         break;
  40.                                     }  
  41.                                     ?>
  42.                                         <div class="item"><img onerror="this.onerror=null;this.src='images/no_image.png';" style="height:<?php echo $height?>px; width:<?php echo $width?>px" src="images/images_video/<?php echo $row?>"></div>
  43.                                 <?php } ?> 
  44.                             </div></center>
  45.                            
  46.                             <script>
  47.                              $(document).ready(function() {
  48.                                   $("#owl-demo_<?php echo $id_tr?>_<?php echo $id_tr_dt?>_<?php echo $RandomAccountNumber ?>").owlCarousel({
  49.                                   autoPlay   : true,   
  50.                                   navigation : false,
  51.                                   singleItem : true,
  52.                                   pagination: false
  53.                                   });
  54.                                 });
  55.                             </script>
  56.                
  57.         <?php }
  58.         // Video
  59.         else if($id_type_widget=="7"){
  60.         $ext_file     = end((explode(".",$mw_wg->file_name)))
  61.          ?>
  62.                
  63.                         <head>
  64.                           <link href="dist/js/videojs/video-js.css" rel="stylesheet">
  65.  
  66.                           <!-- If you'd like to support IE8 -->
  67.                           <script src="dist/js/videojs/videojs-ie8.min.js"></script>
  68.                         </head>
  69.  
  70.                         <body>
  71.                           <video  controls loop autoplay preload="auto" id="my-video" class="video-js" controls preload="auto" style="height:<?php echo $height?>px; width:<?php echo $width?>px" data-setup="{}" poster="images/fff.png">
  72.                             <source src="images/images_video/<?php echo $mw_wg->file_name; ?>" type='video/<?php echo $ext_file?>'>
  73.                           </video>
  74.  
  75.                           <script src="dist/js/videojs/video.js"></script>
  76.                         </body>
  77.                
  78.         <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement