예제 #1
0
 }
 if (isset($_GET['iDisplayStart'])) {
     $start = $_GET['iDisplayStart'];
 } else {
     $start = 0;
 }
 $show = new Show();
 if (isset($_GET['sSearch']) && $_GET['sSearch']) {
     $shows = $show->getList(null, $start, $per_page, $sortby, $sortdir, $_GET['sSearch']);
 } else {
     $shows = $show->getList(null, $start, $per_page, $sortby, $sortdir);
 }
 $res = array();
 $res['sEcho'] = $echo;
 if (isset($_GET['sSearch']) && $_GET['sSearch']) {
     $res['iTotalDisplayRecords'] = $show->getShowCount($_GET['sSearch']);
 } else {
     $res['iTotalDisplayRecords'] = $show->getShowCount();
 }
 $res['iTotalRecords'] = count($shows);
 $res['aaData'] = array();
 if (count($shows)) {
     foreach ($shows as $key => $val) {
         extract($val);
         if (strlen($description['en']) > 100) {
             $description[$default_language] = substr($description[$default_language], 0, 97) . "...";
         }
         $res['aaData'][] = array('<input type="checkbox" name="row_sel" class="row_sel" value="' . $key . '" id="show_checkbox_' . $key . '" />', '<a href="' . $baseurl . '/thumbs/' . $thumbnail . '" title="" class="cbox_single thumbnail"><img alt="" src="' . $baseurl . '/thumbs/' . $thumbnail . '" style="height:70px;width:50px"></a>', '<a href="http://www.imdb.com/title/' . $imdb_id . '" target="_blank">' . $imdb_id . '</a>', $title[$default_language], $description[$default_language], $episode_count, '<a href="javascript:void(0);" onClick="deleteShow(' . $key . ')">Delete</a>', '<a href="index.php?menu=shows_new&showid=' . $key . '">Edit</a>', '<a href="index.php?menu=episodes&show_id=' . $key . '">Add episode</a><br /><a href="index.php?menu=edit_episodes&showid=' . $key . '">Episode list</a>');
     }
 }
 print json_encode($res);