fork download
  1. <?php
  2. include('header.php');
  3. if (!empty($_GET['case'])) {
  4. $case = make_safe($_GET['case']);
  5. } else {
  6. $case = '';
  7. }
  8. switch ($case) {
  9. case 'search_youtube';
  10. if (isset($_GET['search']) AND $_GET['search'] == 1) {
  11. if (isset($_GET['q'])) {
  12. $q = urlencode($_GET['q']);
  13. } else {
  14. $q = '';
  15. }
  16. if (isset($_GET['order_by'])) {
  17. $order_by = make_safe($_GET['order_by']);
  18. } else {
  19. $order_by = 'date';
  20. }
  21. if (isset($_GET['page'])) {
  22. $page = make_safe($_GET['page']);
  23. } else {
  24. $page = '';
  25. }
  26. if (isset($_GET['max_results'])) {
  27. $max_results = intval(make_safe($_GET['max_results']));
  28. } else {
  29. $max_results = 12;
  30. }
  31. if (isset($_GET['videoCategoryId'])) {
  32. $videoCategoryId = intval(make_safe($_GET['videoCategoryId']));
  33. } else {
  34. $videoCategoryId = '';
  35. }
  36. if (!empty($q)) {
  37. $baseUrl = 'https://w...content-available-to-author-only...s.com/youtube/v3/';
  38. $apiKey = $options['api_youtube_apikey'];
  39. $url = $baseUrl ."search?q=$q&maxResults=$max_results&order=$order_by&part=snippet&type=video";
  40. if (!empty($page)) {
  41. $url .= "&pageToken=$page";
  42. }
  43. if (!empty($videoCategoryId)) {
  44. $url .= "&videoCategoryId=$videoCategoryId";
  45. }
  46. $url .= "&key=$apiKey";
  47. $json = json_decode(file_get_contents($url), true);
  48. if (count($json['items']) > 0) {
  49. $search_results = true;
  50. } else {
  51. $message = notification('warning','There are no results for the Word '.$q.' in youtube.com');
  52. }
  53. } else {
  54. $message = notification('warning','Insert the Search Word Please.');
  55. }
  56. }
  57. ?>
  58. <div class="page-header page-heading">
  59. <h1 class="row"><div class="col-md-6"><i class="fa fa-search"></i> Search Youtube</div>
  60. <div class="col-md-6">
  61.  
  62. </div>
  63. </h1>
  64. </div>
  65. <div class="row">
  66. <div class="col-md-3">
  67. <div class="big-search-form">
  68. <form method="GET" action="videos.php">
  69. <input type="hidden" name="case" value="search_youtube" />
  70. <div class="form-group">
  71. <label>Search Word</label>
  72. <input type="text" name="q" class="form-control" placeholder="Search in youtube.com" value="<?php if (isset($q)) {echo urldecode($q);} ?>" />
  73. </div>
  74.  
  75.  
  76. <div class="form-group">
  77. <label>Test</label>
  78. <input type="text" name="test" class="form-control" placeholder="Test" value="<?php if (isset($test)) {echo urldecode($test);} ?>" />
  79. </div>
  80.  
  81.  
  82.  
  83. <div class="form-group">
  84. <label>Results From Category</label>
  85. <select name="videoCategoryId" class="form-control">
  86. <option value="" <?php if (!isset($_GET['videoCategoryId']) or empty($_GET['videoCategoryId'])) {echo 'SELECTED';} ?>>All Categories</option>
  87. <?php
  88. $ycats = youtube_categories();
  89. foreach ($ycats AS $key=>$value) {
  90. ?>
  91. <option value="<?php echo $key; ?>" <?php if (isset($_GET['videoCategoryId']) AND $_GET['videoCategoryId'] == $key) {echo 'SELECTED';} ?>><?php echo $value; ?></option>
  92. <?php
  93. }
  94. ?>
  95. </select>
  96. </div>
  97. <div class="form-group">
  98. <label>Order By</label>
  99. <select name="order_by" class="form-control">
  100. <option value="date" <?php if (isset($order_by) AND $order_by == 'date') {echo 'SELECTED';} ?>>By Date</option>
  101. <option value="rating" <?php if (isset($order_by) AND $order_by == 'rating') {echo 'SELECTED';} ?>>By Rating</option>
  102. <option value="relevance" <?php if (isset($order_by) AND $order_by == 'relevance') {echo 'SELECTED';} ?>>By Relevance</option>
  103. <option value="title" <?php if (isset($order_by) AND $order_by == 'title') {echo 'SELECTED';} ?>>By Title</option>
  104. <option value="viewCount" <?php if (isset($order_by) AND $order_by == 'viewCount') {echo 'SELECTED';} ?>>By View Count</option>
  105. </select>
  106. </div>
  107. <div class="form-group">
  108. <label>Max Results</label>
  109. <select name="max_results" class="form-control">
  110. <?php for($i=12;$i<49;$i=$i+6) { ?>
  111. <option value="<?php echo $i; ?>" <?php if (isset($max_results) AND $max_results == $i) {echo 'SELECTED';} ?>><?php echo $i; ?></option>
  112. <?php } ?>
  113. </select>
  114. </div>
  115. <button type="submit" name="search" value="1" class="btn btn-success btn-block">Search</button>
  116. </form>
  117. </div>
  118. <div class="big-search-form">
  119. <?php
  120. $categories = $general->categories('category_order ASC');
  121. if ($categories == 0) {
  122. echo notification('warning','Please add at least one category to import the videos in.');
  123. } else {
  124. ?>
  125. <div class="form-group">
  126. <label>Category</label>
  127. <select name="category" id="category" class="form-control">
  128. <?php
  129. foreach ($categories AS $category) {
  130. ?>
  131. <option value="<?php echo $category['id']; ?>"><?php echo $category['category']; ?></option>
  132. <?php
  133. }
  134. ?>
  135. </select>
  136. <p class="help">This is the category where the video will be saved when click <b><span class="text-danger"><i class="fa fa-refresh"></i> Import</span></b>.</p>
  137. </div>
  138. <?php
  139. }
  140. ?>
  141. </div>
  142. </div>
  143. <div class="col-md-9">
  144. <?php
  145. if (isset($message)) {
  146. echo $message;
  147. }
  148. if (isset($search_results)) {
  149. ?>
  150. <div class="alert alert-warning">There are (<b><?php echo $json['pageInfo']['totalResults']; ?></b>) Result(s) for <b><?php echo urldecode($q); ?></b> Query.</div>
  151. <form role="form" method="POST" action="">
  152. <table class="table">
  153. <thead>
  154. <tr>
  155. <th><input type="checkbox" class="parentCheckBox" /></th>
  156. <th colspan="2">Video Details</th>
  157. <th></th>
  158. <tr>
  159. </thead>
  160. <tbody>
  161. <?php
  162. foreach ($json['items'] AS $item) {
  163. ?>
  164. <tr <?php if (check_youtube_id($item['id']['videoId']) != 0) { ?>class="bg-success"<?php } ?>>
  165. <td width="15">
  166. <?php if (check_youtube_id($item['id']['videoId']) == 0) { ?>
  167. <input type="checkbox" name="myCheckboxes[]" class="childCheckBox" value="<?php echo $item['id']['videoId']; ?>" />
  168. <?php } ?>
  169. </td>
  170. <td width="75"><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $item['id']['videoId']; ?>"><img src="<?php echo $item['snippet']['thumbnails']['medium']['url']; ?>" width="75" /></a></td>
  171. <td>
  172. <div><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $item['id']['videoId']; ?>"><b><?php echo $item['snippet']['title']; ?></b></a></div>
  173. </td>
  174. <td align="right">
  175. <?php if (check_youtube_id($item['id']['videoId']) == 0) { ?>
  176. <a href="javascript:void();" class="import-single-video btn btn-warning" id="<?php echo $item['id']['videoId']; ?>" rel="d<?php echo $item['id']['videoId']; ?>"><span class="fa fa-download"></span></a>
  177. <?php } else { ?>
  178. <a href="javascript:void();" class="btn btn-success"><span class="fa fa-check"></span></a>
  179. <?php
  180. }
  181. ?>
  182. </td>
  183. </tr>
  184. <?php
  185. }
  186. ?>
  187. </tbody>
  188. </table>
  189. <div class="videos-actions">
  190. <div class="col-sm-2 col-md-3"><button type="submit" name="import_all" id="import_all" class="btn btn-warning"><span class="fa fa-download"></span> Import All</button></div>
  191. <div class="col-sm-10 col-md-9 text-right">
  192. <?php
  193. if (isset($json['prevPageToken'])) {
  194. echo '<a class="btn btn-default" href="videos.php?case=search_youtube&q='.$q.'&order_by='.$order_by.'&max_results='.$max_results.'&search=1&page='.$json['prevPageToken'].'&videoCategoryId='.$videoCategoryId.'" style="margin-right:10px;">Previews</a>';
  195. }
  196. if (isset($json['nextPageToken'])) {
  197. echo '<a class="btn btn-default" href="videos.php?case=search_youtube&q='.$q.'&order_by='.$order_by.'&max_results='.$max_results.'&search=1&page='.$json['nextPageToken'].'&videoCategoryId='.$videoCategoryId.'">Next</a>';
  198. }
  199. ?>
  200. </div>
  201. </form>
  202. </div>
  203. <?php } ?>
  204. </div>
  205. </div>
  206. <?php
  207. break;
  208.  
  209.  
  210.  
  211. case 'edit';
  212. $id = abs(intval(make_safe(xss_clean($_GET['id']))));
  213. if (isset($_POST['submit'])) {
  214. $title = make_safe(xss_clean(htmlspecialchars($_POST['title'],ENT_QUOTES)));
  215. $details = htmlspecialchars($_POST['details'],ENT_QUOTES);
  216. $category_id = make_safe(xss_clean($_POST['category_id']));
  217. $tags = htmlspecialchars($_POST['tags'],ENT_QUOTES);
  218. $published = make_safe(xss_clean(intval($_POST['published'])));
  219. if (empty($title)) {
  220. $message = notification('warning','Insert The Title Please.');
  221. } elseif (empty($details)) {
  222. $message = notification('warning','Write Some Details Please.');
  223. } elseif (empty($category_id)) {
  224. $message = notification('warning','Choose a Category Please.');
  225. } else {
  226. if (!empty($_FILES['thumbnail']['name'])) {
  227. $up = new fileDir('../upload/videos/');
  228. $thumbnail = $up->upload($_FILES['thumbnail']);
  229. $up->delete("$_POST[old_thumbnail]");
  230. } else {
  231. $thumbnail = $_POST['old_thumbnail'];
  232. }
  233. $sql = "UPDATE videos SET title='$title',details='$details',category_id='$category_id',thumbnail='$thumbnail',tags='$tags',published='$published' WHERE id='$id'";
  234. $query = $mysqli->query($sql);
  235. if ($query) {
  236. $message = notification('success','Article Edited Successfully.');
  237. } else {
  238. $message = notification('danger','Error Happened.');
  239. }
  240. }
  241. }
  242. $videos = $general->video($id);
  243. ?>
  244. <div class="page-header page-heading">
  245. <h1>Edit videos
  246. <a href="videos.php" class="btn btn-default pull-right"><span class="fa fa-arrow-right"></span></a>
  247. </h1>
  248. </div>
  249. <?php if (isset($message)) {echo $message;} ?>
  250. <form role="form" method="POST" action="" enctype="multipart/form-data">
  251. <div class="row">
  252. <div class="col-md-9">
  253. <div class="form-group">
  254. <label for="category">Title <span>*</span></label>
  255. <input type="text" class="form-control" name="title" id="title" value="<?php echo $videos['title']; ?>" />
  256. </div>
  257.  
  258. <div class="form-group">
  259. <label for="details">Details</label>
  260. <textarea class="wysiwyg form-control" name="details" id="details" rows="20"><?php echo htmlspecialchars_decode($videos['details'],ENT_QUOTES); ?></textarea>
  261. </div>
  262. </div>
  263. <div class="col-md-3">
  264. <div class="form-group">
  265. <label for="category_id">Category <span>*</span></label>
  266. <select class="form-control" name="category_id" id="category_id">
  267. <?php
  268. $categories = $general->categories('category_order ASC');
  269. foreach ($categories AS $category) {
  270. ?>
  271. <option value="<?php echo $category['id']; ?>" <?php if ($videos['category_id'] == $category['id'] AND $videos['sub_category_id'] == 0) {echo 'SELECTED';} ?>><?php echo $category['category']; ?></option>
  272. <?php
  273. }
  274. ?>
  275. </select>
  276. </div>
  277. <div class="form-group">
  278. <label for="category_id">Featured Image</label>
  279. <div class="fileinput fileinput-new input-group" data-provides="fileinput">
  280. <div class="form-control" data-trigger="fileinput"><i class="glyphicon glyphicon-file fileinput-exists"></i> <span class="fileinput-filename"></span></div>
  281. <span class="input-group-addon btn btn-default btn-file"><span class="fileinput-new">Select file</span><span class="fileinput-exists">Change</span><input type="file" name="thumbnail"></span>
  282. <a href="#" class="input-group-addon btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
  283. </div>
  284. <?php if (!empty($videos['thumbnail'])) { ?>
  285. <p>Current Image : <a href="javascript:void();" data-toggle="popover" data-placement="top" title="Current Image" data-content="<img src='../upload/videos/<?php echo $videos['thumbnail']; ?>' class='img-responsive' />"><?php echo $videos['thumbnail']; ?></a></p>
  286. <?php } ?>
  287. </div>
  288. <div class="form-group">
  289. <label for="tags">Tags <span>*</span></label>
  290. <input type="text" class="form-control tags" name="tags" id="tags" value="<?php if (isset($videos['tags'])) { echo $videos['tags']; } ?>" />
  291. </div>
  292. <div class="form-group">
  293. <input type="checkbox" name="published" id="published" value="1" <?php if ($videos['published'] == 1) {echo 'CHECKED';} ?> /> <span class="checkbox-label">Publish videos ?</span>
  294. </div>
  295.  
  296. <input type="hidden" name="old_thumbnail" value="<?php echo $videos['thumbnail']; ?>" />
  297. <button type="submit" name="submit" class="btn btn-primary">Save</button>
  298. </div>
  299. </div>
  300. </form>
  301. <?php
  302. break;
  303. case 'delete';
  304. $id = abs(intval(make_safe(xss_clean($_GET['id']))));
  305. if (isset($_POST['unpublish'])) {
  306. $delete = $mysqli->query("UPDATE videos SET deleted='1' WHERE id='$id'");
  307. $mysqli->query("DELETE FROM lists_video WHERE videos_id='$id'");
  308. if ($delete) {
  309. $message = notification('success','videos Item Has Been Unpublished Successfully.');
  310. $done = true;
  311. } else {
  312. $message = notification('danger','Error Happened.');
  313. }
  314. }
  315. if (isset($_POST['delete'])) {
  316. $sql = "SELECT * FROM videos WHERE id='$id'";
  317. $query = $mysqli->query($sql);
  318. if ($query->num_rows > 0) {
  319. $row = $query->fetch_assoc();
  320. if (!empty($row['thumbnail']) AND file_exists('../upload/videos/'.$row['thumbnail'])) {
  321. @unlink('../upload/videos/'.$row['thumbnail']);
  322. }
  323. }
  324. $mysqli->query("DELETE FROM lists_video WHERE videos_id='$id'");
  325. $delete = $mysqli->query("DELETE FROM videos WHERE id='$id'");
  326. if ($delete) {
  327. $message = notification('success','Video Deleted Successfully.');
  328. $done = true;
  329. } else {
  330. $message = notification('danger','Error Happened.');
  331. }
  332. }
  333. $videos = $general->video($id);
  334. ?>
  335. <div class="page-header page-heading">
  336. <h1>Delete Video
  337. <a href="videos.php" class="btn btn-default pull-right"><span class="fa fa-arrow-right"></span></a>
  338. </h1>
  339. </div>
  340. <?php if (isset($message)) {echo $message;} ?>
  341. <form role="form" method="POST" action="">
  342. <?php if (empty($done)) { ?>
  343. <div class="alert alert-warning">You Can Either <b>Unpublish</b> or <b>Delete</b> the Video : <b><?php echo htmlspecialchars_decode($videos['title'],ENT_QUOTES); ?></b>. If you Choose to Delete you Can't Undo this Action Later.</div>
  344. <?php } ?>
  345. <?php if ($done) { ?>
  346. <a href="videos.php" class="btn btn-default">Back To Videos</a>
  347. <?php } else { ?>
  348. <button type="submit" name="unpublish" class="btn btn-warning">Temporary Delete</button>
  349. <button type="submit" name="delete" class="btn btn-danger">Permanent Delete</button>
  350. <?php } ?>
  351. </form>
  352. <?php
  353. break;
  354. case 'search';
  355. $q = make_safe(xss_clean($_GET['q']));
  356. ?>
  357. <div class="page-header page-heading">
  358. <h1 class="row"><div class="col-md-6"><i class="fa fa-search"></i> Search For <?php echo $q; ?> In Published Videos</div>
  359. <div class="col-md-6">
  360. <div class="pull-right search-form">
  361. <form method="GET" action="videos.php">
  362. <div class="input-group">
  363. <input type="hidden" name="case" value="search" />
  364. <input type="text" name="q" class="form-control" placeholder="Search" value="<?php echo $q; ?>" />
  365. <span class="input-group-addon"><button class="btn-link"><span class="fa fa-search"></span></button></span>
  366. </div>
  367. </form>
  368. </div>
  369. <a href="videos.php?case=deleted" class="btn btn-danger pull-right" data-toggle="tooltip" data-placement="top" title="Deleted Videos"><span class="fa fa-trash"></span></a>
  370. <a href="videos.php" class="btn btn-default pull-right" data-toggle="tooltip" data-placement="top" title="Published Videos"><span class="fa fa-youtube-play"></span></a>
  371. </div>
  372. </h1>
  373. </div>
  374. <?php
  375. if (isset($message)) {echo $message;}
  376. $page = 1;
  377. $size = 20;
  378. if (isset($_GET['page'])){ $page = (int) $_GET['page']; }
  379. $sqls = "SELECT * FROM videos WHERE published='1' AND deleted='0' AND title LIKE '%$q%' ORDER BY id DESC";
  380. $query = $mysqli->query($sqls);
  381. $total_records = $query->num_rows;
  382. if ($total_records == 0) {
  383. echo notification('warning','There Are No Results.');
  384. } else {
  385. $pagination = new Pagination();
  386. $pagination->setLink("?case=search&page=%s&q=$q");
  387. $pagination->setPage($page);
  388. $pagination->setSize($size);
  389. $pagination->setTotalRecords($total_records);
  390. $get = "SELECT * FROM videos WHERE published='1' AND deleted='0' AND title LIKE '%$q%' ORDER BY id DESC ".$pagination->getLimitSql();
  391. $q = $mysqli->query($get);
  392. ?>
  393. <table class="table">
  394. <thead>
  395. <tr>
  396. <th><input type="checkbox" class="parentCheckBox" /></th>
  397. <th colspan="2">Video Details</th>
  398. <th></th>
  399. <tr>
  400. </thead>
  401. <tbody>
  402. <?php
  403. while ($row = $q->fetch_assoc()) {
  404. ?>
  405. <tr>
  406. <td width="15"><input type="checkbox" name="id[]" class="childCheckBox" value="<?php echo $row['id']; ?>" /></td>
  407. <td width="75"><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><img src="../upload/videos/<?php echo $row['thumbnail']; ?>" width="75" /></a></td>
  408. <td>
  409. <div><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><b><?php echo $row['title']; ?></b></a></div>
  410. <span><i class="fa fa-folder"></i><?php echo get_category($row['category_id']); ?></span>
  411. <span><i class="fa fa-clock-o"></i><?php echo duration($row['duration']); ?></span>
  412. </td>
  413. <td align="right">
  414. <a href="videos.php?case=edit&id=<?php echo $row['id']; ?>" class="btn btn-default btn-xs"><span class="fa fa-edit"></span></a>
  415. <a href="videos.php?case=delete&id=<?php echo $row['id']; ?>" class="btn btn-danger btn-xs"><span class="fa fa-trash"></span></a>
  416. </td>
  417. </tr>
  418. <?php
  419. }
  420. ?>
  421. </tbody>
  422. </table>
  423. <div class="videos-actions">
  424. <div class="row">
  425. <div class="col-xs-12"><?php echo $pagination->create_links(); ?></div>
  426. </div>
  427. </div>
  428. <?php
  429. }
  430. break;
  431. case 'category';
  432. $id = intval(make_safe(xss_clean($_GET['id'])));
  433. if (isset($_POST['delete']) AND isset($_POST['id'])) {
  434. $ids = $_POST['id'];
  435. $count= count($ids);
  436. for($i=0;$i<$count;$i++){
  437. $del_id = $ids[$i];
  438. $sql = "UPDATE videos SET deleted='1' WHERE id='$del_id'";
  439. $res = $mysqli->query($sql);
  440. $mysqli->query("DELETE FROM lists_video WHERE videos_id='$del_id'");
  441. if ($res) {
  442. $message = notification('success','The Selected videos Items Was Deleted Successfully.');
  443. } else {
  444. $message = notification('error','Error Happened');
  445. }
  446. }
  447. }
  448. $category = $general->category($id);
  449. ?>
  450. <div class="page-header page-heading">
  451. <h1><i class="fa fa-reorder"></i> Videos About <?php echo $category['category']; ?></h1>
  452. </div>
  453. <?php
  454. if (isset($message)) {echo $message;}
  455. $page = 1;
  456. $size = 20;
  457. if (isset($_GET['page'])){ $page = (int) $_GET['page']; }
  458. $sqls = "SELECT * FROM videos WHERE published='1' AND deleted='0' AND category_id='$id' ORDER BY id DESC";
  459. $query = $mysqli->query($sqls);
  460. $total_records = $query->num_rows;
  461. if ($total_records == 0) {
  462. echo notification('warning','There Are No Published Videos About '.$category['category'].'.');
  463. } else {
  464. $pagination = new Pagination();
  465. $pagination->setLink("?case=category&id=$id&page=%s");
  466. $pagination->setPage($page);
  467. $pagination->setSize($size);
  468. $pagination->setTotalRecords($total_records);
  469. $get = "SELECT * FROM videos WHERE published='1' AND deleted='0' AND category_id='$id' ORDER BY id DESC ".$pagination->getLimitSql();
  470. $q = $mysqli->query($get);
  471. ?>
  472. <form role="form" method="POST" action="">
  473. <table class="table">
  474. <thead>
  475. <tr>
  476. <th><input type="checkbox" class="parentCheckBox" /></th>
  477. <th colspan="2">Video Details</th>
  478. <th></th>
  479. <tr>
  480. </thead>
  481. <tbody>
  482. <?php
  483. while ($row = $q->fetch_assoc()) {
  484. ?>
  485. <tr>
  486. <td width="15"><input type="checkbox" name="id[]" class="childCheckBox" value="<?php echo $row['id']; ?>" /></td>
  487. <td width="75"><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><img src="../upload/videos/<?php echo $row['thumbnail']; ?>" width="75" /></a></td>
  488. <td>
  489. <div><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><b><?php echo $row['title']; ?></b></a></div>
  490. <span><i class="fa fa-folder"></i><?php echo get_category($row['category_id']); ?></span>
  491. <span><i class="fa fa-clock-o"></i><?php echo duration($row['duration']); ?></span>
  492. </td>
  493. <td align="right">
  494. <a href="videos.php?case=edit&id=<?php echo $row['id']; ?>" class="btn btn-default btn-xs"><span class="fa fa-edit"></span></a>
  495. <a href="videos.php?case=delete&id=<?php echo $row['id']; ?>" class="btn btn-danger btn-xs"><span class="fa fa-trash"></span></a>
  496. </td>
  497. </tr>
  498. <?php
  499. }
  500. ?>
  501. </tbody>
  502. </table>
  503. <div class="videos-actions">
  504. <div class="row">
  505. <div class="col-sm-3 col-md-4">
  506. <button type="submit" name="delete" class="btn btn-danger"><span class="fa fa-trash"></span> Delete</button>
  507. </div>
  508. <div class="col-sm-9 col-md-8"><?php echo $pagination->create_links(); ?></div>
  509. </div>
  510. </div>
  511. </form>
  512. <?php
  513. }
  514. break;
  515. case 'channel';
  516. $id = intval(make_safe(xss_clean($_GET['id'])));
  517. if (isset($_POST['delete']) AND isset($_POST['id'])) {
  518. $ids = $_POST['id'];
  519. $count= count($ids);
  520. for($i=0;$i<$count;$i++){
  521. $del_id = $ids[$i];
  522. $sql = "UPDATE videos SET deleted='1' WHERE id='$del_id'";
  523. $res = $mysqli->query($sql);
  524. $mysqli->query("DELETE FROM lists_video WHERE videos_id='$del_id'");
  525. if ($res) {
  526. $message = notification('success','The Selected Videos Was Deleted Successfully.');
  527. } else {
  528. $message = notification('error','Error Happened');
  529. }
  530. }
  531. }
  532. $channel = $general->channel($id);
  533. ?>
  534. <div class="page-header page-heading">
  535. <h1><i class="fa fa-th-large"></i> <?php if ($id == 0) { echo 'Single Videos'; } else { echo 'Imported Videos From '.$channel['title']; } ?></h1>
  536. </div>
  537. <?php
  538. if (isset($message)) {echo $message;}
  539. $page = 1;
  540. $size = 20;
  541. if (isset($_GET['page'])){ $page = (int) $_GET['page']; }
  542. $sqls = "SELECT * FROM videos WHERE published='1' AND deleted='0' AND channel_id='$id' ORDER BY id DESC";
  543. $query = $mysqli->query($sqls);
  544. $total_records = $query->num_rows;
  545. if ($total_records == 0) {
  546. echo notification('warning','There Are No Published Videos From '.$channel['title'].'.');
  547. } else {
  548. $pagination = new Pagination();
  549. $pagination->setLink("?case=channel&id=$id&page=%s");
  550. $pagination->setPage($page);
  551. $pagination->setSize($size);
  552. $pagination->setTotalRecords($total_records);
  553. $get = "SELECT * FROM videos WHERE published='1' AND deleted='0' AND channel_id='$id' ORDER BY id DESC ".$pagination->getLimitSql();
  554. $q = $mysqli->query($get);
  555. ?>
  556. <form role="form" method="POST" action="">
  557. <table class="table">
  558. <thead>
  559. <tr>
  560. <th><input type="checkbox" class="parentCheckBox" /></th>
  561. <th colspan="2">Video Details</th>
  562. <th></th>
  563. <tr>
  564. </thead>
  565. <tbody>
  566. <?php
  567. while ($row = $q->fetch_assoc()) {
  568. ?>
  569. <tr>
  570. <td width="15"><input type="checkbox" name="id[]" class="childCheckBox" value="<?php echo $row['id']; ?>" /></td>
  571. <td width="75"><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><img src="../upload/videos/<?php echo $row['thumbnail']; ?>" width="75" /></a></td>
  572. <td>
  573. <div><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><b><?php echo $row['title']; ?></b></a></div>
  574. <span><i class="fa fa-folder"></i><?php echo get_category($row['category_id']); ?></span>
  575. <span><i class="fa fa-clock-o"></i><?php echo duration($row['duration']); ?></span>
  576. </td>
  577. <td align="right">
  578. <a href="videos.php?case=edit&id=<?php echo $row['id']; ?>" class="btn btn-default btn-xs"><span class="fa fa-edit"></span></a>
  579. <a href="videos.php?case=delete&id=<?php echo $row['id']; ?>" class="btn btn-danger btn-xs"><span class="fa fa-trash"></span></a>
  580. </td>
  581. </tr>
  582. <?php
  583. }
  584. ?>
  585. </tbody>
  586. </table>
  587. <div class="videos-actions">
  588. <div class="row">
  589. <div class="col-sm-3 col-md-4">
  590. <button type="submit" name="delete" class="btn btn-danger"><span class="fa fa-trash"></span> Delete</button>
  591. </div>
  592. <div class="col-sm-9 col-md-8"><?php echo $pagination->create_links(); ?></div>
  593. </div>
  594. </div>
  595. </form>
  596. <?php
  597. }
  598. break;
  599. case 'awaiting_review';
  600. if (isset($_POST['delete']) AND isset($_POST['id'])) {
  601. $ids = $_POST['id'];
  602. $count= count($ids);
  603. for($i=0;$i<$count;$i++){
  604. $del_id = $ids[$i];
  605. $sql = "UPDATE videos SET deleted='1' WHERE id='$del_id'";
  606. $res = $mysqli->query($sql);
  607. if ($res) {
  608. $message = notification('success','The Selected videos Items Was Deleted Successfully.');
  609. } else {
  610. $message = notification('error','Error Happened');
  611. }
  612. }
  613. }
  614. if (isset($_POST['publish']) AND isset($_POST['id'])) {
  615. $ids = $_POST['id'];
  616. $count= count($ids);
  617. for($i=0;$i<$count;$i++){
  618. $del_id = $ids[$i];
  619. $sql = "UPDATE videos SET published='1' WHERE id='$del_id'";
  620. $res = $mysqli->query($sql);
  621. if ($res) {
  622. $message = notification('success','The Selected videos Items Was Published Successfully.');
  623. } else {
  624. $message = notification('error','Error Happened');
  625. }
  626. }
  627. }
  628. ?>
  629. <div class="page-header page-heading">
  630. <h1><i class="fa fa-reorder"></i> Awaiting Review Videos</h1>
  631. </div>
  632. <?php
  633. if (isset($message)) {echo $message;}
  634. $page = 1;
  635. $size = 20;
  636. if (isset($_GET['page'])){ $page = (int) $_GET['page']; }
  637. $sqls = "SELECT * FROM videos WHERE published='0' AND deleted='0' ORDER BY id DESC";
  638. $query = $mysqli->query($sqls);
  639. $total_records = $query->num_rows;
  640. if ($total_records == 0) {
  641. echo notification('warning','There Are No Videos awaiting for review');
  642. } else {
  643. $pagination = new Pagination();
  644. $pagination->setLink("?case=awaiting_review&page=%s");
  645. $pagination->setPage($page);
  646. $pagination->setSize($size);
  647. $pagination->setTotalRecords($total_records);
  648. $get = "SELECT * FROM videos WHERE published='0' AND deleted='0' ORDER BY id DESC ".$pagination->getLimitSql();
  649. $q = $mysqli->query($get);
  650. ?>
  651. <form role="form" method="POST" action="">
  652. <table class="table">
  653. <thead>
  654. <tr>
  655. <th><input type="checkbox" class="parentCheckBox" /></th>
  656. <th colspan="2">Video Details</th>
  657. <th></th>
  658. <tr>
  659. </thead>
  660. <tbody>
  661. <?php
  662. while ($row = $q->fetch_assoc()) {
  663. ?>
  664. <tr>
  665. <td width="15"><input type="checkbox" name="id[]" class="childCheckBox" value="<?php echo $row['id']; ?>" /></td>
  666. <td width="75"><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><img src="../upload/videos/<?php echo $row['thumbnail']; ?>" width="75" /></a></td>
  667. <td>
  668. <div><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><b><?php echo $row['title']; ?></b></a></div>
  669. <span><i class="fa fa-folder"></i><?php echo get_category($row['category_id']); ?></span>
  670. <span><i class="fa fa-clock-o"></i><?php echo duration($row['duration']); ?></span>
  671. </td>
  672. <td align="right">
  673. <a href="videos.php?case=edit&id=<?php echo $row['id']; ?>" class="btn btn-default btn-xs"><span class="fa fa-edit"></span></a>
  674. <a href="videos.php?case=delete&id=<?php echo $row['id']; ?>" class="btn btn-danger btn-xs"><span class="fa fa-trash"></span></a>
  675. </td>
  676. </tr>
  677. <?php
  678. }
  679. ?>
  680. </tbody>
  681. </table>
  682. <div class="videos-actions">
  683. <div class="row">
  684. <div class="col-sm-3 col-md-4">
  685. <button type="submit" name="publish" class="btn btn-success"><span class="fa fa-check"></span> Publish</button>
  686. <button type="submit" name="delete" class="btn btn-danger"><span class="fa fa-trash"></span> Delete</button>
  687. </div>
  688. <div class="col-sm-9 col-md-8"><?php echo $pagination->create_links(); ?></div>
  689. </div>
  690. </div>
  691. </form>
  692. <?php
  693. }
  694. break;
  695. case 'deleted_videos';
  696. if (isset($_POST['restore']) AND isset($_POST['id'])) {
  697. $ids = $_POST['id'];
  698. $count= count($ids);
  699. for($i=0;$i<$count;$i++){
  700. $del_id = $ids[$i];
  701. $sql = "UPDATE videos SET deleted='0' AND published='1' WHERE id='$del_id'";
  702. $res = $mysqli->query($sql);
  703. if ($res) {
  704. $message = notification('success','The Selected videos Items Was Restored Successfully.');
  705. } else {
  706. $message = notification('error','Error Happened');
  707. }
  708. }
  709. }
  710. if (isset($_POST['delete']) AND isset($_POST['id'])) {
  711. $ids = $_POST['id'];
  712. $count= count($ids);
  713. for($i=0;$i<$count;$i++){
  714. $del_id = $ids[$i];
  715. $sql = "SELECT * FROM videos WHERE id='$del_id'";
  716. $query = $mysqli->query($sql);
  717. $row = $query->fetch_assoc();
  718. if (!empty($row['thumbnail']) AND file_exists('../upload/videos/'.$row['thumbnail'])) {
  719. @unlink('../upload/videos/'.$row['thumbnail']);
  720. }
  721. $mysqli->query("DELETE FROM lists_video WHERE videos_id='$row[id]'");
  722. $delete = $mysqli->query("DELETE FROM videos WHERE id='$row[id]'");
  723. }
  724. if ($delete) {
  725. $message = notification('success','Video Deleted Successfully.');
  726. } else {
  727. $message = notification('danger','Error Happened.');
  728. }
  729. }
  730. ?>
  731. <div class="page-header page-heading">
  732. <h1><i class="fa fa-trash"></i> Deleted Videos</h1>
  733. </div>
  734. <?php
  735. if (isset($message)) {echo $message;}
  736. $page = 1;
  737. $size = 20;
  738. if (isset($_GET['page'])){ $page = (int) $_GET['page']; }
  739. $sqls = "SELECT * FROM videos WHERE deleted='1' ORDER BY id DESC";
  740. $query = $mysqli->query($sqls);
  741. $total_records = $query->num_rows;
  742. if ($total_records == 0) {
  743. echo notification('warning','There Are No Deleted Videos.');
  744. } else {
  745. $pagination = new Pagination();
  746. $pagination->setLink("?case=deleted_videos&page=%s");
  747. $pagination->setPage($page);
  748. $pagination->setSize($size);
  749. $pagination->setTotalRecords($total_records);
  750. $get = "SELECT * FROM videos WHERE deleted='1' ORDER BY id DESC ".$pagination->getLimitSql();
  751. $q = $mysqli->query($get);
  752. ?>
  753. <form role="form" method="POST" action="">
  754. <table class="table">
  755. <thead>
  756. <tr>
  757. <th><input type="checkbox" class="parentCheckBox" /></th>
  758. <th colspan="2">Video Details</th>
  759. <th></th>
  760. <tr>
  761. </thead>
  762. <tbody>
  763. <?php
  764. while ($row = $q->fetch_assoc()) {
  765. ?>
  766. <tr>
  767. <td width="15"><input type="checkbox" name="id[]" class="childCheckBox" value="<?php echo $row['id']; ?>" /></td>
  768. <td width="75"><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><img src="../upload/videos/<?php echo $row['thumbnail']; ?>" width="75" /></a></td>
  769. <td>
  770. <div><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><b><?php echo $row['title']; ?></b></a></div>
  771. <span><i class="fa fa-folder"></i><?php echo get_category($row['category_id']); ?></span>
  772. <span><i class="fa fa-clock-o"></i><?php echo duration($row['duration']); ?></span>
  773. </td>
  774. <td align="right">
  775. <a href="videos.php?case=edit&id=<?php echo $row['id']; ?>" class="btn btn-default btn-xs"><span class="fa fa-edit"></span></a>
  776. <a href="videos.php?case=delete&id=<?php echo $row['id']; ?>" class="btn btn-danger btn-xs"><span class="fa fa-trash"></span></a>
  777. </td>
  778. </tr>
  779. <?php
  780. }
  781. ?>
  782. </tbody>
  783. </table>
  784. <div class="videos-actions">
  785. <div class="row">
  786. <div class="col-sm-3 col-md-4">
  787. <button type="submit" name="restore" class="btn btn-success"><span class="fa fa-check"></span> Restore</button>
  788. <button type="submit" name="delete" class="btn btn-danger"><span class="fa fa-trash"></span> Permanent Delete</button>
  789. </div>
  790. <div class="col-sm-9 col-md-8"><?php echo $pagination->create_links(); ?></div>
  791. </div>
  792. </div>
  793. </form>
  794. <?php
  795. }
  796. break;
  797. case 'review';
  798. if (isset($_POST['publish']) AND isset($_POST['id'])) {
  799. $ids = $_POST['id'];
  800. $count= count($ids);
  801. for($i=0;$i<$count;$i++){
  802. $del_id = $ids[$i];
  803. $sql = "UPDATE videos SET deleted='0' AND published='1' WHERE id='$del_id'";
  804. $res = $mysqli->query($sql);
  805. if ($res) {
  806. $message = notification('success','The Selected videos Items Was Published Successfully.');
  807. } else {
  808. $message = notification('error','Error Happened');
  809. }
  810. }
  811. }
  812. if (isset($_POST['delete']) AND isset($_POST['id'])) {
  813. $ids = $_POST['id'];
  814. $count= count($ids);
  815. for($i=0;$i<$count;$i++){
  816. $del_id = $ids[$i];
  817. $sql = "SELECT * FROM videos WHERE id='$del_id'";
  818. $query = $mysqli->query($sql);
  819. $row = $query->fetch_assoc();
  820. if (!empty($row['thumbnail']) AND file_exists('../upload/videos/'.$row['thumbnail'])) {
  821. @unlink('../upload/videos/'.$row['thumbnail']);
  822. }
  823. $mysqli->query("DELETE FROM lists_video WHERE videos_id='$row[id]'");
  824. $delete = $mysqli->query("DELETE FROM videos WHERE id='$row[id]'");
  825. }
  826. if ($delete) {
  827. $message = notification('success','Video Deleted Successfully.');
  828. } else {
  829. $message = notification('danger','Error Happened.');
  830. }
  831. }
  832. ?>
  833. <div class="page-header page-heading">
  834. <h1><i class="fa fa-trash"></i> Need Review Videos</h1>
  835. </div>
  836. <?php
  837. if (isset($message)) {echo $message;}
  838. $page = 1;
  839. $size = 20;
  840. if (isset($_GET['page'])){ $page = (int) $_GET['page']; }
  841. $sqls = "SELECT * FROM videos WHERE deleted='0' AND published='0' ORDER BY id DESC";
  842. $query = $mysqli->query($sqls);
  843. $total_records = $query->num_rows;
  844. if ($total_records == 0) {
  845. echo notification('warning','There Are No Videos Need Review.');
  846. } else {
  847. $pagination = new Pagination();
  848. $pagination->setLink("?case=deleted_videos&page=%s");
  849. $pagination->setPage($page);
  850. $pagination->setSize($size);
  851. $pagination->setTotalRecords($total_records);
  852. $get = "SELECT * FROM videos WHERE deleted='0' AND published='0' ORDER BY id DESC ".$pagination->getLimitSql();
  853. $q = $mysqli->query($get);
  854. ?>
  855. <form role="form" method="POST" action="">
  856. <table class="table">
  857. <thead>
  858. <tr>
  859. <th><input type="checkbox" class="parentCheckBox" /></th>
  860. <th colspan="2">Video Details</th>
  861. <th></th>
  862. <tr>
  863. </thead>
  864. <tbody>
  865. <?php
  866. while ($row = $q->fetch_assoc()) {
  867. ?>
  868. <tr>
  869. <td width="15"><input type="checkbox" name="id[]" class="childCheckBox" value="<?php echo $row['id']; ?>" /></td>
  870. <td width="75"><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><img src="../upload/videos/<?php echo $row['thumbnail']; ?>" width="75" /></a></td>
  871. <td>
  872. <div><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><b><?php echo $row['title']; ?></b></a></div>
  873. <span><i class="fa fa-folder"></i><?php echo get_category($row['category_id']); ?></span>
  874. <span><i class="fa fa-clock-o"></i><?php echo duration($row['duration']); ?></span>
  875. </td>
  876. <td align="right">
  877. <a href="videos.php?case=edit&id=<?php echo $row['id']; ?>" class="btn btn-default btn-xs"><span class="fa fa-edit"></span></a>
  878. <a href="videos.php?case=delete&id=<?php echo $row['id']; ?>" class="btn btn-danger btn-xs"><span class="fa fa-trash"></span></a>
  879. </td>
  880. </tr>
  881. <?php
  882. }
  883. ?>
  884. </tbody>
  885. </table>
  886. <div class="videos-actions">
  887. <div class="row">
  888. <div class="col-sm-3 col-md-4">
  889. <button type="submit" name="publish" class="btn btn-success"><span class="fa fa-check"></span> Publish</button>
  890. <button type="submit" name="delete" class="btn btn-danger"><span class="fa fa-trash"></span> Permanent Delete</button>
  891. </div>
  892. <div class="col-sm-9 col-md-8"><?php echo $pagination->create_links(); ?></div>
  893. </div>
  894. </div>
  895. </form>
  896. <?php
  897. }
  898. break;
  899. default;
  900. if (isset($_POST['delete']) AND isset($_POST['id'])) {
  901. $ids = $_POST['id'];
  902. $count= count($ids);
  903. for($i=0;$i<$count;$i++){
  904. $del_id = $ids[$i];
  905. $delete = $mysqli->query("UPDATE videos SET deleted='1' WHERE id='$del_id'");
  906. $mysqli->query("DELETE FROM lists_video WHERE videos_id='$del_id'");
  907. if ($delete) {
  908. $message = notification('success','The Selected videos Items Were Assigned as Deleted.');
  909. } else {
  910. $message = notification('error','Error Happened');
  911. }
  912. }
  913. }
  914. ?>
  915. <div class="page-header page-heading">
  916. <h1 class="row"><div class="col-md-6"><i class="fa fa-youtube-play"></i> Published Videos</div>
  917. <div class="col-md-6">
  918. <div class="pull-right search-form">
  919. <form method="GET" action="videos.php">
  920. <div class="input-group">
  921. <input type="hidden" name="case" value="search" />
  922. <input type="text" name="q" class="form-control" placeholder="Search">
  923. <span class="input-group-addon"><button class="btn-link"><span class="fa fa-search"></span></button></span>
  924. </div>
  925. </form>
  926. </div>
  927. <a href="videos.php?case=deleted_videos" class="btn btn-danger pull-right" data-toggle="tooltip" data-placement="top" title="Deleted Videos"><span class="fa fa-trash"></span></a>
  928. <a href="videos.php?case=review" class="btn btn-default pull-right" data-toggle="tooltip" data-placement="top" title="Need Review Videos"><span class="fa fa-edit"></span></a>
  929. <a href="videos.php?case=search_youtube" class="btn btn-default pull-right" data-toggle="tooltip" data-placement="top" title="Search in YouTube"><span class="fa fa-youtube"></span></a>
  930. </div>
  931. </h1>
  932. </div>
  933. <?php
  934. if (isset($message)) {echo $message;}
  935. $page = 1;
  936. $size = 20;
  937. if (isset($_GET['page'])){ $page = (int) $_GET['page']; }
  938. $sqls = "SELECT * FROM videos WHERE published='1' AND deleted='0' ORDER BY id DESC";
  939. $query = $mysqli->query($sqls);
  940. $total_records = $query->num_rows;
  941. if ($total_records == 0) {
  942. echo notification('warning','There Are No Published Videos.');
  943. } else {
  944. $pagination = new Pagination();
  945. $pagination->setLink("?page=%s");
  946. $pagination->setPage($page);
  947. $pagination->setSize($size);
  948. $pagination->setTotalRecords($total_records);
  949. $get = "SELECT * FROM videos WHERE published='1' AND deleted='0' ORDER BY id DESC ".$pagination->getLimitSql();
  950. $q = $mysqli->query($get);
  951. ?>
  952. <form role="form" method="POST" action="">
  953. <table class="table">
  954. <thead>
  955. <tr>
  956. <th><input type="checkbox" class="parentCheckBox" /></th>
  957. <th colspan="2">Video Details</th>
  958. <th></th>
  959. <tr>
  960. </thead>
  961. <tbody>
  962. <?php
  963. while ($row = $q->fetch_assoc()) {
  964. ?>
  965. <tr>
  966. <td width="15"><input type="checkbox" name="id[]" class="childCheckBox" value="<?php echo $row['id']; ?>" /></td>
  967. <td width="75"><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><img src="../upload/videos/<?php echo $row['thumbnail']; ?>" width="75" /></a></td>
  968. <td>
  969. <div><a href="javascript:void();" data-toggle="ajax-modal" data-url="ajax.php?case=video_details&id=<?php echo $row['youtube_id']; ?>"><b><?php echo $row['title']; ?></b></a></div>
  970. <span><i class="fa fa-folder"></i><?php echo get_category($row['category_id']); ?></span>
  971. <span><i class="fa fa-clock-o"></i><?php echo duration($row['duration']); ?></span>
  972. </td>
  973. <td align="right">
  974. <a href="videos.php?case=edit&id=<?php echo $row['id']; ?>" class="btn btn-default btn-xs"><span class="fa fa-edit"></span></a>
  975. <a href="videos.php?case=delete&id=<?php echo $row['id']; ?>" class="btn btn-danger btn-xs"><span class="fa fa-trash"></span></a>
  976. </td>
  977. </tr>
  978. <?php
  979. }
  980. ?>
  981. </tbody>
  982. </table>
  983. <div class="videos-actions">
  984. <div class="row">
  985. <div class="col-sm-2 col-md-3"><button type="submit" name="delete" class="btn btn-danger"><span class="fa fa-trash"></span> Delete</button></div>
  986. <div class="col-sm-10 col-md-9"><?php echo $pagination->create_links(); ?></div>
  987. </div>
  988. </div>
  989. </form>
  990. <?php
  991. }
  992. }
  993. include('footer.php');
  994. ?>
Runtime error #stdin #stdout #stderr 0s 82560KB
stdin
Standard input is empty
stdout
<div class="page-header page-heading">
	<h1 class="row"><div class="col-md-6"><i class="fa fa-youtube-play"></i> Published Videos</div>
	<div class="col-md-6">
	<div class="pull-right search-form">
	<form method="GET" action="videos.php">
		<div class="input-group">
		  <input type="hidden" name="case" value="search" />
		  <input type="text" name="q" class="form-control" placeholder="Search">
		  <span class="input-group-addon"><button class="btn-link"><span class="fa fa-search"></span></button></span>
		</div>
	</form>
	</div>
	<a href="videos.php?case=deleted_videos" class="btn btn-danger pull-right" data-toggle="tooltip" data-placement="top" title="Deleted Videos"><span class="fa fa-trash"></span></a>
	<a href="videos.php?case=review" class="btn btn-default pull-right" data-toggle="tooltip" data-placement="top" title="Need Review Videos"><span class="fa fa-edit"></span></a>
	<a href="videos.php?case=search_youtube" class="btn btn-default pull-right" data-toggle="tooltip" data-placement="top" title="Search in YouTube"><span class="fa fa-youtube"></span></a>
	</div>
	</h1>
</div>
stderr
PHP Warning:  include(header.php): failed to open stream: No such file or directory in /home/dKpBUZ/prog.php on line 2
PHP Warning:  include(): Failed opening 'header.php' for inclusion (include_path='.:/usr/share/php') in /home/dKpBUZ/prog.php on line 2
PHP Notice:  Undefined variable: mysqli in /home/dKpBUZ/prog.php on line 939
PHP Fatal error:  Uncaught Error: Call to a member function query() on null in /home/dKpBUZ/prog.php:939
Stack trace:
#0 {main}
  thrown in /home/dKpBUZ/prog.php on line 939