���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/vidoe.top/admin_new/mod/ |
<?php class movie2{ var $path = 'banner/'; var $max_fsize = 1000000; var $image_size = 190; function movie2 (){ global $CORE; //if (!$CORE->user['g_supmod'] && !$CORE->user['g_access_cp']) return; $mid = array(); switch($CORE->input['code']){ default : $this -> goList(); break; case 'post' : $this -> goPost(); break; case 'del' : $this -> goDel($mid); break; case 'cid_type' : $this -> cidType(); break; } } function cidType(){ global $CORE,$DB; $type = $CORE->input['type']; $query = $DB->query("SELECT cid,cname FROM NNCCMS_moviecat WHERE `type`='$type'"); $html = '<select name="cid[]" multiple="multiple" style="width:200px; height:250px;">'; while($row = $DB->fetch_row($query)){ $html .= '<option value="'.$row['cid'].'">'.$row['cname'].'</option>'; } $html .= '</select>'; echo $html; exit(); } function goList(){ global $CORE,$DB,$smarty,$print,$func; $smarty->assign('section','list'); $smarty->assign('module_name','Quản lý phim đề cử'); $smarty->assign('title','Movies2'); $smarty->assign('status',$CORE->input['status']); $kw = $CORE->input['kw']; $kw2 = $func->bodau_normal($kw); $kw3 = str_ireplace('d','đ',$kw); $kw4 = str_ireplace('D','Đ',$kw); $where = ''; if($kw!=''){ $where = ' WHERE title LIKE "%'.$kw.'%" OR title LIKE "%'.$kw2.'%" OR title LIKE "%'.$kw3.'%" OR title LIKE "%'.$kw4.'%" '; } $pageSize = 24; $pageNum = ($_GET['pageNum']>0) ? intval($_GET['pageNum']) : 1; $from = ($pageNum * $pageSize) - $pageSize; $queryt= $DB->fetch_row($DB->query("SELECT count(*) as total FROM NNCCMS_movie2 ".$where)); $total = $queryt['total']; $totalPage = ceil($total / $pageSize); $query = $DB->query("SELECT * FROM NNCCMS_movie2 $where ORDER BY id DESC LIMIT $from, $pageSize"); $haverec = ($DB->get_num_rows($query)==0) ? 0 : 1; $smarty->assign('haverec',$haverec); while ($row = $DB->fetch_row($query)){ $a_home[] = $row; } if(is_null($a_home)) $a_home= array(); //$TBS->MergeBlock('blogC',$blogC); $smarty->assign('a_home',$a_home); $nav = $print->Pagination($totalPage,$pageNum,'phim','index.php?act=movie2&kw='.$kw); $smarty->assign('nav',$nav); //del multi movie $arr_mid = $CORE->input['mid_for_del']; if(!empty($arr_mid)){ $this->goDel($arr_mid); } } function goPost(){ global $CORE, $DB, $func, $smarty, $print; $smarty->assign('section','post'); $id = intval($CORE->input['id']); if($_SESSION['error']) unset($CORE->input['bsubmit']); // Show post ----------------------------------------------------------------------- if(!$CORE->input['bsubmit']){ if ($_SESSION['error']) $prevError = $_SESSION['error']; unset($_SESSION['error']); if ($_SESSION['state']) $prevState = $_SESSION['state']; unset($_SESSION['state']); if($prevState!=NULL){ $data = $prevState; $id = $data['id']; }else{ if($id==0){ $data['active'] = 1; }else{ $query = $DB->query("SELECT * FROM NNCCMS_movie2 WHERE id='".$id."'"); $data = $DB->fetch_row($query); } } $data['title'] = html_entity_decode($data['title']); $data['url'] = html_entity_decode($data['url']); $data['des'] = $func->editor_admin('des',$data['des'],20); $error[] = $prevError; //$post[] = $data; $smarty->assign('error',$error); $smarty->assign('post',$data); // Do post ------------------------------------------- }else{ //process bar $id = $state['id'] = $CORE->input['id']; $mid = $state['mid'] = $CORE->input['mid']; $cid = $state['cid'] = $CORE->input['cid']; $title = $state['title'] = html_entity_decode($CORE->input['title']); $des = $CORE->input['des']; $img = $state['img'] = $CORE->input['img']; $type = $state['type'] = $CORE->input['type']; $type2 = $state['type2'] = $CORE->input['type2']; $time = $CORE->time; $body = $_REQUEST['body']; $body1 = $_REQUEST['body1']; $body2 = $_REQUEST['body2']; $top = $CORE->input['top']; if(!empty($cid)){ $cid = implode(',',$cid); } // -------------- check ------------------------- if($title=='') $error['title']=1; // Adding - if no images uploaded then return error // If detects any errors then return to the postform with errors if($error!=''){ $_SESSION['error'] = $error; $_SESSION['state'] = $state; return $this->goPost();; } if($id==0){ // Do Add ------------------ if($top==1){ $DB->query("INSERT INTO `NNCCMS_movie2` (`mid` ,`cid` ,`type` ,`type2` ,`title`, `des`,`body` ,`body1` ,`body2` ,`img` ,`hit` ,`time`) VALUES ( '$mid', '$cid', '$type', '$type2', '$title', '$des', '$body', '$body1','$body2','$img', '1', '$time');"); }else{ $DB->query("INSERT INTO `NNCCMS_movie2` (`mid` ,`cid` ,`type` ,`type2` ,`title`, `des`,`body` ,`body1` ,`body2`,`img` ,`hit` ,`time`) VALUES ( '$mid', '$cid', '$type', '$type2', '$title', '$des', '$body', '$body1', '$body2','$img', '1', '1');"); } $print->refresh('index.php?act=movie2&status=add_success'); }else{ // Do Edit ----------------- if($top==1){ if(!empty($cid)){ $DB->query("UPDATE `NNCCMS_movie2` SET `cid` = '$cid' WHERE `id`='$id' ;"); } $DB->query("UPDATE `NNCCMS_movie2` SET `mid` = '$mid',`type` = '$type',`type2` = '$type2',`title` = '$title',`des`='$des',`body` = '$body',`body1` = '$body1',`body2` = '$body2',`img` = '$img',`time` = '$time' WHERE `id`='$id' ;"); }else{ if(!empty($cid)){ $DB->query("UPDATE `NNCCMS_movie2` SET `cid` = '$cid' WHERE `id`='$id' ;"); } $DB->query("UPDATE `NNCCMS_movie2` SET `mid` = '$mid',`type` = '$type',`type2` = '$type2',`title` = '$title',`des`='$des',`body` = '$body',`body1` = '$body1',`body2` = '$body2',`img` = '$img' WHERE `id`='$id' ;"); } $print->refresh('index.php?act=movie2&code=post&status=edit_success&id='.$id); //$DB->query("UPDATE `NNCCMS_movie2` SET `title` = '$title', `url` = '$url',`pos` = '$pos', `active` = '$active' WHERE `id`=$id"); } }//end main if } function goDel($arr_mid){ global $CORE, $DB, $print; if(empty($arr_mid)){ $id = $CORE->input['id']; $DB->query("DELETE FROM NNCCMS_movie2 WHERE id='".$id."'"); }else{ foreach($arr_mid as $val){ $DB->query("DELETE FROM NNCCMS_movie2 WHERE id='".$val."'"); } } $print->refresh('index.php?act=movie2&status=del_success'); } } $run = new movie2(); ?>