<?php

include_once "./sys/functions.php";
isLogged();
$logged_user = getLoggedUser();
$server_name = getServerProperty("server_name");
$fast_packages = json_decode(getServerProperty("fast_packages"), true);
$sales = getSalesShart($logged_user);
?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title><?php $server_name; ?> :: Office</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
  <!-- Morris chart -->
  <link rel="stylesheet" href="bower_components/morris.js/morris.css">
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
<?php injectCustomCss(); ?>
</head>
<body class="hold-transition <?php echo getServerProperty("theme_color", "skin-red"); ?> sidebar-mini">
<div class="wrapper">
  <header class="main-header">
    <!-- Logo -->
    <a href="dashboard.php" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini"><img src="dist/img/logo_small.png" width="50" height="50"></span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg"><img src="dist/img/logo_medium.png" height="50"></span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">Toggle navigation</span>
      </a>

      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!-- User Credits -->
          <li class="dropdown messages-menu">
            <a href="#" class="dropdown-toggle">
              <i class="fa fa-dollar"></i>
              <span class="label label-success"><?php echo $logged_user["credits"]; ?>
			  </span>
            </a>
          </li>
          <!-- Control Sidebar Toggle Button -->
<?php 
if (isAdmin($logged_user)) {
?>         <li>
            <a href="settings.php"><i class="fa fa-gears"></i></a>
          </li>
<?php 
}
?>       </ul>
      </div>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- sidebar menu: : style can be found in sidebar.less -->
      <ul class="sidebar-menu" data-widget="tree">
        <li class="header">MENU PRINCIPAL</li>
        <li class="active">
          <a href="dashboard.php">
            <i class="fa fa-dashboard"></i> <span>Painel</span>
          </a>
        </li>
        <li>
          <a href="informations.php">
            <i class="fa fa-align-left"></i> <span>Informações</span>
          </a>
        </li>
		  <li> <a href="log_client.php"><i class="fa fa-align-left"></i> <span>Log de Créditos/Linhas</span></a></li>
        <li class="treeview">
          <a href="#">
            <i class="fa fa-bug"></i>
            <span>Criar teste</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="create_test.php"><i class="fa fa-circle-o"></i> Customizado</a></li>
<?php 
$packages = getPackages();
foreach ($fast_packages as $package_id) {
    $package_key = array_search($package_id, array_column($packages, "id"));
    if ($package_key !== false) {
        $current_package = $packages[$package_key];
        if ($current_package["is_trial"] == 1) {
            ?>                   <li><a href="./sys/API.php?action=create_test&package_id=<?php  $current_package["id"];?>"><i class="fa fa-circle-o"></i><?php echo $current_package["package_name"]; ?>
            </a></li>
<?php 
        }
    }
}
?>         </ul>
        </li>
<?php 
if (isAdmin($logged_user) || isUltra($logged_user) || isMaster($logged_user)) {
?>       <li class="treeview">
          <a href="#">
            <i class="fa fa-users"></i>
            <span>Sub-Revendas</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="resellers.php"><i class="fa fa-cogs"></i> Gerir Revendas</a></li>
            <li><a href="create_reseller.php"><i class="fa fa-user-plus"></i> Criar Revenda</a></li>
          </ul>
        </li>
<?php 
}
?>       <li class="treeview">
          <a href="#">
            <i class="fa fa-users"></i>
            <span>Usuários</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="online.php"><i class="fa fa-circle"></i> Usuários Online</a></li>
            <li><a href="clients.php"><i class="fa fa-cogs"></i> Gerir Usuários</a></li>
            <li><a href="create_client.php"><i class="fa fa-user-plus"></i> Criar Usuário</a></li>
          </ul>
        </li>
        <li>
          <a href="shortener.php">
            <i class="fa fa-link"></i> <span>Encurtador</span>
          </a>
        </li>
        <li>
          <a href="tools.php">
            <i class="fa fa-wrench"></i> <span>Ferramentas</span>
          </a>
        </li>
        <li class="treeview">
          <a href="#">
            <i class="fa fa-film"></i>
            <span>Conteúdo Novo</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="new_channels.php"><i class="fa fa-circle-o"></i> Novos Canais</a></li>
            <li><a href="new_movies.php"><i class="fa fa-circle-o"></i> Novos Filmes</a></li>
            <li><a href="new_series.php"><i class="fa fa-circle-o"></i> Novas Series</a></li>
          </ul>
        </li>
        <li class="treeview">
          <a href="#">
            <i class="fa fa-ticket"></i>
            <span>Ticket Suporte</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="create_ticket.php"><i class="fa fa-circle-o"></i> Criar Ticket</a></li>
            <li><a href="manage_tickets.php"><i class="fa fa-circle-o"></i> Gerenciar Tickets</a></li>
          </ul>
        </li>
        <li>
          <a href="profile.php">
            <i class="fa fa-user-circle"></i> <span>Perfil</span>
          </a>
        </li>
        <li>
          <a href="logout.php">
            <i class="fa fa-power-off"></i> <span>Desconectar</span>
          </a>
        </li>
      </ul>
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Dashboard
        <small>Version 2.0</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="dashboard.php"><i class="fa fa-dashboard"></i> Painel</a></li>
        <li class="active">Dashboard</li>
      </ol>
    </section>
    <!-- Main content -->
    <section class="content">
     

<section id="main" class="column">
               <article class="module width_full">
		<header><h3 class="tabs_involved">Import Multiple Movies</h3>
		</header>

            
            
        <form method="post" id="form" action="import_movies.php?action=import_movies">
        <div class="module_content">	
						<fieldset>
                            <legend><b>Import Multiple Movies</b></legend>
                            <table id="settings">
                            <tr>
                                
							 <td>Movie location</td>
							  <td>
                                <select name="movie_location" id="movie_location">
                                <option value="">-</option>
                                <option value="29">FILMES</option>  
                                <option value="remote">Remote in other server</option>
                                </select>
                              </td>
                            </tr> 

                            <tr id="movie_source_form" style="display:none">
							     <td>Movies Folder / Directory Listing</td>
							     <td><div id="local"><a href="#" class="button_4" onclick="openfileDialog('movie_source',document.getElementById('movie_location').value);">Pick</a><br /></div><input type="text" name="movie_source" id="movie_source" /></td>
                            </tr>  

                            <tr id="movies_select_form" style="display: none;">
							 <td>Select Movies To Import</td>
							  <td>
                                <select name="movies_select[]" size="15" id="movies_select" multiple required>
                                </select>
                              </td>
                              
                            </tr> 
                            
                            
                            <tr id="category_select">
							 <td>Category Name</td>
							  <td>
                                <select name="category_id" id="category_id" >
                                    <option value="">Don't Use Category</option>
                                    <option value='2'>General Movies</option>                                </select>
                              </td>
                              
                            </tr>    

                            <tr>
							 <td>
                                <a href="#" class="tooltip-right" data-tooltip="Select the Servers you want the movie to be saved to. Load balancing will be used."><img src='../templates/images/question.png'></a>                                Select Load Balancer Servers</td>
							  <td>
                                    <select name="load_balancer_servers[]" multiple="true" size="5" required>
                                    <option value="29">FILMES</option>                                    </select>
                              </td>
                            </tr>   

                            <tr>
							 <td>
                                <a href="#" class="tooltip-right" data-tooltip="If you set this to NO, IPTV Panel will read the input as fast as possible. Any process should be executed faster, however your CPU usage may increase, especially when you are transcoding. It is recommended to enable this if you are transcoding, otherwise set this to NO."><img src='../templates/images/question.png'></a>                                Read Input Source in Native Frames</td>
							  <td>
                                  <input type="radio" name="read_native" value="1" /> Yes<br />
                                  <input type="radio" name="read_native" value="0" checked /> No                              </td>
                            </tr>                                                   


                            <tr>
							 <td>
                                <a href="#" class="tooltip-right" data-tooltip="IPTV Panel will try to guess the movie name from the filename. If the guessed filename exists in the IMDB records IPTV Panel will get all the information associated with the movie."><img src='../templates/images/question.png'></a>                                Fetch movie details from IMDB, if can be found</td>
							  <td>
                                  <input type="radio" name="import_imdb_details" value="1" checked/> Yes<br />
                                  <input type="radio" name="import_imdb_details" value="0" /> No                              </td>
                            </tr>      


                            <tr>
							 <td>
                                <a href="#" class="tooltip-right" data-tooltip="Select a movie container."><img src='../templates/images/question.png'></a>                                Select Movie Container Format</td>
							  <td>
                                    <select name="target_container_id" required>
                                        <option value="3">MKV</option><option value="1">MP4</option>                                    </select>
                              </td>
                            </tr> 
                            
                                                                                                                                                                                                                             
                            </table>
						</fieldset> 
                        <br />                              
<fieldset>
							<legend><b>Transcode Movie</b></legend>
                            <table id="settings">
                            <tr>
                                <td>
                                 <a href="#" class="tooltip-right" data-tooltip="Sometimes, in order to make a stream compatible with most devices, it must be transcoded. Please note that the transcode will only be applied to the server(s) that take the stream directly from the source, all other servers attached to the transcoding server will not transcode the stream."><img src='../templates/images/question.png'></a>                             
                                Select Transcode Profile</td>
                                <td>
                                    <select id="transcode_profile_id" name="transcode_profile_id">
                                        <option value="0">No Transcode</option>
                                                                                 <option value="-1">Custom Transcoding Options</option>
                                    </select>
                                </td>
                            </tr>

                            </table>
                             <div id="transcode_form" style="display: none;">
                            <table id="settings">

                                  
                                <tr>
                                    <td>Video Codec</td>
                                    <td>
                                            <select name="transcode_attributes[-vcodec]" id="video_codec">
                                            <option value="0">Copy Codec [ Associated Transcoding Options Will not work ]</option><option value="apng">APNG (Animated Portable Network Graphics) image</option><option value="cavs">Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile) (encoders: libxavs )</option><option value="cinepak">Cinepak</option><option value="ffv1">FFmpeg video codec #1</option><option value="flashsv">Flash Screen Video v1</option><option value="flashsv2">Flash Screen Video v2</option><option value="flv1">FLV / Sorenson Spark / Sorenson H.263 (Flash Video) (decoders: flv ) (encoders: flv )</option><option value="gif">GIF (Graphics Interchange Format)</option><option value="h261">H.261</option><option value="h263">H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2</option><option value="h263p">H.263+ / H.263-1998 / H.263 version 2</option><option value="h264">H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (encoders: libx264 libx264rgb )</option><option value="hevc">H.265 / HEVC (High Efficiency Video Coding) (encoders: libx265 )</option><option value="mpeg1video">MPEG-1 video</option><option value="mpeg2video">MPEG-2 video (decoders: mpeg2video mpegvideo )</option><option value="mpeg4">MPEG-4 part 2 (encoders: mpeg4 libxvid )</option><option value="msmpeg4v2">MPEG-4 part 2 Microsoft variant version 2</option><option value="msmpeg4v3">MPEG-4 part 2 Microsoft variant version 3 (decoders: msmpeg4 ) (encoders: msmpeg4 )</option><option value="msvideo1">Microsoft Video 1</option><option value="png">PNG (Portable Network Graphics) image</option><option value="qtrle">QuickTime Animation (RLE) video</option><option value="roq">id RoQ video (decoders: roqvideo ) (encoders: roqvideo )</option><option value="rv10">RealVideo 1.0</option><option value="rv20">RealVideo 2.0</option><option value="snow">Snow</option><option value="svq1">Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1</option><option value="theora">Theora (encoders: libtheora )</option><option value="vp8">On2 VP8 (decoders: vp8 libvpx ) (encoders: libvpx )</option><option value="vp9">Google VP9 (decoders: vp9 libvpx-vp9 ) (encoders: libvpx-vp9 )</option><option value="wmv1">Windows Media Video 7</option><option value="wmv2">Windows Media Video 8</option><option value="zmbv">Zip Motion Blocks Video</option>                                            </select>
                                    </td>
                                </tr>       
                                <tr>
                                    <td>Audio Codec</td>
                                    <td>
                                            <select name="transcode_attributes[-acodec]" >
                                            <option value="0">Copy Codec [ Associated Transcoding Options Will not work ]</option><option value="aac">AAC (Advanced Audio Coding) (decoders: aac aac_fixed )</option><option value="ac3">ATSC A/52A (AC-3) (decoders: ac3 ac3_fixed ) (encoders: ac3 ac3_fixed )</option><option value="adpcm_adx">SEGA CRI ADX ADPCM</option><option value="adpcm_g722">G.722 ADPCM (decoders: g722 ) (encoders: g722 )</option><option value="adpcm_g726">G.726 ADPCM (decoders: g726 ) (encoders: g726 )</option><option value="adpcm_ima_qt">ADPCM IMA QuickTime</option><option value="adpcm_ima_wav">ADPCM IMA WAV</option><option value="adpcm_ms">ADPCM Microsoft</option><option value="adpcm_swf">ADPCM Shockwave Flash</option><option value="adpcm_yamaha">ADPCM Yamaha</option><option value="comfortnoise">RFC 3389 Comfort Noise</option><option value="dts">DCA (DTS Coherent Acoustics) (decoders: dca ) (encoders: dca )</option><option value="eac3">ATSC A/52B (AC-3, E-AC-3)</option><option value="g723_1">G.723.1</option><option value="mp2">MP2 (MPEG audio layer 2) (decoders: mp2 mp2float ) (encoders: mp2 mp2fixed )</option><option value="mp3">MP3 (MPEG audio layer 3) (decoders: mp3 mp3float ) (encoders: libmp3lame )</option><option value="nellymoser">Nellymoser Asao</option><option value="opus">Opus (Opus Interactive Audio Codec) (decoders: opus libopus ) (encoders: libopus )</option><option value="pcm_alaw">PCM A-law / G.711 A-law</option><option value="pcm_mulaw">PCM mu-law / G.711 mu-law</option><option value="ra_144">RealAudio 1.0 (14.4K) (decoders: real_144 ) (encoders: real_144 )</option><option value="roq_dpcm">DPCM id RoQ</option><option value="vorbis">Vorbis (decoders: vorbis libvorbis ) (encoders: vorbis libvorbis )</option><option value="wavpack">WavPack</option><option value="wmav1">Windows Media Audio 1</option><option value="wmav2">Windows Media Audio 2</option>                                            </select>
                                    </td>
                                </tr> 
                                 
                                <tr>
                                    <td>
                                    <a href="#" class="tooltip-right" data-tooltip="A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). This means that, for example, if you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. Similarly, for constant quality encoding, you will simply save bitrate by choosing a slower preset."><img src='../templates/images/question.png'></a>                                    Preset</td>
                                    <td>
                                            <select name="transcode_attributes[-preset]">
                                            <option value="">Use Default Medium</option><option value="ultrafast">Ultra Fast</option><option value="superfast">Super Fast</option><option value="veryfast">Very Fast</option><option value="faster">Faster</option><option value="fast">Fast</option><option value="slow">Slow</option><option value="slower">Slower</option><option value="veryslow">Very Slow</option><option value="placebo">Placebo</option>                                            </select>
                                    </td>
                                </tr> 
                                <tr>
                                    <td>
                                    <a href="#" class="tooltip-right" data-tooltip="If you want your videos to have highest compatibility with target devices (older iOS versions or all Android devices)"><img src='../templates/images/question.png'></a>                                    Video Profile</td>
                                    <td>
                                            <select name="transcode_attributes[-profile:v]">
                                            <option value="">Don't Use Profile</option><option value="baseline -level 3.0">All devices</option><option value="baseline -level 3.1">iPhone 3G and later, iPod touch 2nd generation and later</option><option value="main -level 3.1">iPad (all versions), Apple TV 2 and later, iPhone 4 and late</option><option value="main -level 4.0">Apple TV 3 and later, iPad 2 and later, iPhone 4s and later</option><option value="high -level 4.0">Apple TV 3 and later, iPad 2 and later, iPhone 4s and later</option><option value="high -level 4.1">iPad 2 and later, iPhone 4s and later, iPhone 5c and later</option><option value="high -level 4.2">iPad Air and later, iPhone 5s and later</option>                                            </select>
                                    </td>
                                </tr>
                                                                                
                                </table>
                                <table id="settings" width="100%">
    							<tr><td><a href="#" class="tooltip-right" data-tooltip="With this you can change the bitrate of the target video. It is very useful in case you want your video to be playable on slow internet connections"><img src='../templates/images/question.png'></a> Average Video Bit Rate</td><td><input type="text" name="arguments[3]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="Change Audio Bitrate"><img src='../templates/images/question.png'></a> Average Audio Bitrate</td><td><input type="text" name="arguments[4]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="-minrate FFmpeg argument. Specify the minimum bitrate tolerance here. Specify in kbps. Enter INT number."><img src='../templates/images/question.png'></a> Minimum Bitrate Tolerance</td><td><input type="text" name="arguments[5]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="-maxrate FFmpeg argument. Specify the maximum bitrate tolerance here.Specify in kbps. Enter INT number. "><img src='../templates/images/question.png'></a> Maximum Bitrate Tolerance</td><td><input type="text" name="arguments[6]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="-bufsize is the rate control buffer. Basically it is assumed that the receiver/end player will buffer that much data so its ok to fluctuate within that much. Specify in kbps. Enter INT number."><img src='../templates/images/question.png'></a> Buffer Size</td><td><input type="text" name="arguments[7]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="The range of the quantizer scale is 0-51: where 0 is lossless, 23 is default, and 51 is worst possible. A lower value is a higher quality and a subjectively sane range is 18-28. Consider 18 to be visually lossless or nearly so: it should look the same or nearly the same as the input but it isnt technically lossless. The range is exponential, so increasing the CRF value +6 is roughly half the bitrate while -6 is roughly twice the bitrate. General usage is to choose the highest CRF value that still provides an acceptable quality. If the output looks good, then try a higher value and if it looks bad then choose a lower value"><img src='../templates/images/question.png'></a> CRF Value</td><td><input type="text" name="arguments[8]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="Change the Width & Height of the target Video. (Eg. 320:240 ) .  If we'd like to keep the aspect ratio, we need to specify only one component, either width or height, and set the other component to -1. (eg 320:-1)"><img src='../templates/images/question.png'></a> Scaling</td><td><input type="text" name="arguments[9]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="Change the target Video Aspect. (eg 16:9)"><img src='../templates/images/question.png'></a> Aspect</td><td><input type="text" name="arguments[10]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="Set the frame rate"><img src='../templates/images/question.png'></a> Target Video FrameRate</td><td><input type="text" name="arguments[11]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="Set the Audio Sample rate in Hz"><img src='../templates/images/question.png'></a> Audio Sample Rate</td><td><input type="text" name="arguments[12]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="Specify Audio Channels"><img src='../templates/images/question.png'></a> Audio Channels</td><td><input type="text" name="arguments[13]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="With this filter you can remove sensitive parts in your video. You will just specifiy the x & y pixels where there is a sensitive area and the width and height that will be removed. Example Use: x=0:y=0:w=100:h=77:band=10 "><img src='../templates/images/question.png'></a> Remove Sensitive Parts (delogo filter)</td><td><input type="text" name="arguments[14]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="Specify the number of threads you want to use for the transcoding process. Entering 0 as value will make FFmpeg to choose the most optimal settings"><img src='../templates/images/question.png'></a> Threads</td><td><input type="text" name="arguments[15]" value="" /></td></tr><tr><td><a href="#" class="tooltip-right" data-tooltip="Add your Own Logo to the stream. The logo will be placed in the upper left. Please be sure that you have selected H.264 as codec otherwise this option won't work. Note that adding your own logo will consume A LOT of cpu power"><img src='../templates/images/question.png'></a> Logo Path</td><td><input type="text" name="arguments[16]" value="" /></td></tr>                                  
                                </table>
                            </div>              
                        </fieldset>                                                                                   	
				</div>                                                                         
 			<footer>
				<div class="submit_link">
					<input type="submit" value="Import Multiple Movies" class="alt_btn">
				</div>
			</footer>
    </form>
 </article>        
            
	<div class="spacer"></div>
    </section>



    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <div class="row">
      <div class="text-left col-md-6">
        <strong>Copyright &copy; <?php echo date("Y"); ?> <a href="#"><?php echo $server_name; ?> </a>.</strong> All rights reserved.
      </div>
      <div class="text-right col-md-6">Office. <?php echo KOFFICE_PANEL_VERSION; ?> - 2019</div>
    </div>
  </footer>
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="bower_components/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
  $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Clipboard -->
<script src="bower_components/clipboard.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Morris.js charts -->
<script src="bower_components/raphael/raphael.min.js"></script>
<script src="bower_components/morris.js/morris.min.js"></script>
<!-- FastClick -->
<script src="bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
<script type="text/javascript">
    $(function () {
        /* Morris.js Charts */
        // Sales chart
        if($('#revenue-chart').length > 0){
            new Morris.Area({
                element   : 'revenue-chart',
                resize    : true,
                data      : [<?php echo $sales["data"]; ?>],
                xkey      : 'y',
                ykeys     : ['item'],
                labels    : ['Novos clientes'],
                lineColors: ['#3c8dbc'],
                hideHover : 'auto'
            });
        }

        new ClipboardJS('.copytesturl');
    });
</script>


<script>
$(document).ready(function() { 
    

    
    $('#transcode_profile_id').change(function () {
        var value_transcode = $( "#transcode_profile_id" ).val(); 
        if(value_transcode == -1)
            $('#transcode_form').fadeIn();
        else
            $('#transcode_form').fadeOut();
    });
            
 
            $('#movie_location').change(function(){
                
                    $('#movie_source_form').fadeIn(); 
                    var value = $(this).val();
                    
                    if($.isNumeric(value))
                    {
                       $('#local').fadeIn(); 
                       $('#fetch_options').fadeOut();
                    }
                    else if(value == "remote")
                    {
                       $('#local').fadeOut(); 
                       $('#fetch_options').fadeIn();
                    }
                    else
                    {
                      $('#local').fadeOut();    
                      $('#fetch_options').fadeIn();
                    }
                    
                    $("#movie_source").change();
                });
                
                
        $('#movie_source').change(function () { 
            var movieSource = btoa($('#movie_source').val());
            var ServerID = $('#movie_location').val();

            if(movieSource != '')
            { 
                
                    $.ajax({
                                type: "GET",
                                url: "http://195.181.162.49:25463/import_movies.php?action=getMovies&server_id=" + ServerID + "&source=" + movieSource,   
                                cache: false,
                                success: function (result) {

                                    result = $.parseJSON(JSON.stringify(result));

                                    $('#movies_select_form').fadeIn();
                                    $('#movies_select').empty();
                                    $.each(result, function (index, value) {
                                        $('#movies_select').append('<option value="'+value+'">'+value+'</option>');
                                    });
                                },
                                 error: function(XMLHttpRequest, textStatus, errorThrown) { 
                                    alert("Status: " + textStatus); alert("Error: " + errorThrown); 
                                },
                                global: (ServerID == 'remote') ? true : false
                            });
                        
            }
            
        });
                
});
</script>


</body>
</html>