Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "connection.php";
- $id_tr = $_REQUEST['id_tr']; //header dashboard
- $id_tr_widget = $_REQUEST['id_tr_widget']; //id tr widget
- $id_tr_dt = $_REQUEST['id_tr_dt']; //id tr detail
- $width = $_REQUEST['width']; //width
- $height = $_REQUEST['height']; //height
- $mw_wg = mysqli_fetch_object(mysqli_query($con,"select * from tr_widget where id_tr_widget='".$id_tr_widget."'"));
- $my_konek = mysqli_fetch_object(mysqli_query($con,"select * from connection where id_con='".$mw_wg->id_con."'"));
- $sql_view = mysqli_fetch_object(mysqli_query($con,"SELECT query from sql_view where id_sql_view='".$mw_wg->id_sql_view."'"));
- $id_type_widget = $mw_wg->id_type_widget;
- if($my_konek->port=="" or $my_konek->port==null)
- {
- $mydb = new mysqli($my_konek->host,$my_konek->username,$my_konek->pwd,$my_konek->database_name);
- if($mydb->connect_errno > 0){
- die('Unable to connect to database' . $mydb->connect_error);
- }
- }
- else
- {
- $mydb = new mysqli($my_konek->host,$my_konek->username,$my_konek->pwd,$my_konek->database_name,$my_konek->port);
- if($mydb->connect_errno > 0){
- die('Unable to connect to database' . $mydb->connect_error);
- }
- }
- // Image Slider
- if($id_type_widget=="9"){
- $RandomAccountNumber = uniqid();
- ?>
- <center><div id="owl-demo_<?php echo $id_tr?>_<?php echo $id_tr_dt?>_<?php echo $RandomAccountNumber ?>" class="owl-carousel">
- <?php
- $list_value = $mw_wg->file_name;
- $var=explode('***zzz****',$list_value);
- $count = count($var);
- foreach($var as $row) {
- if (--$count <= 0) {
- break;
- }
- ?>
- <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>
- <?php } ?>
- </div></center>
- <script>
- $(document).ready(function() {
- $("#owl-demo_<?php echo $id_tr?>_<?php echo $id_tr_dt?>_<?php echo $RandomAccountNumber ?>").owlCarousel({
- autoPlay : true,
- navigation : false,
- singleItem : true,
- pagination: false
- });
- });
- </script>
- <?php }
- // Video
- else if($id_type_widget=="7"){
- $ext_file = end((explode(".",$mw_wg->file_name)))
- ?>
- <head>
- <link href="dist/js/videojs/video-js.css" rel="stylesheet">
- <!-- If you'd like to support IE8 -->
- <script src="dist/js/videojs/videojs-ie8.min.js"></script>
- </head>
- <body>
- <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">
- <source src="images/images_video/<?php echo $mw_wg->file_name; ?>" type='video/<?php echo $ext_file?>'>
- </video>
- <script src="dist/js/videojs/video.js"></script>
- </body>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement