Server : LiteSpeed
System : Linux terra.hostitbro.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64
User : outerorb ( 1091)
PHP Version : 8.1.34
Disable Function : mail
Directory :  /home2/outerorb/dev.outerorbittech.com/oot/admin/

📁 Create New:
⬆️ Upload File:
Current Dir [ Writable ] Root [ Writable ]


OR Upload from URL:
URL: Save as:

📄 File: manage_blog.php

Path: /home2/outerorb/dev.outerorbittech.com/oot/admin/manage_blog.php

Size: 10.5 KB

Permissions: 0644

<?php
include_once("../include/main.inc.php");
check_session('MyCpanel','index.php');

################ Paging Starts From Here ##################
@extract($_REQUEST);
$start = (intval($start)==0 or $start=="")?$start=0:$start;
$pagesize = intval($pagesize)==0?$pagesize=100:$pagesize;
if($parentID=="") {
	$parentID=0;
}

$heading="Manage blog";
$record_type="blog";
$script_name="manage_blog.php";
$table_name="blog_tbl";
#################### DELETE Record ##################

if($id=="delete_record") {
	
		
		$categoryRes=getResult($table_name," where catID='$catID'");
		$filename=$categoryRes['catImage'];
		if($filename!="") {
			$file=SITE_DIR_PATH."/uploaded-files/blog/images/".$filename;
			if(file_exists($file)) {
				unlink($file);
			}
			
			$file_thumb=SITE_DIR_PATH."/uploaded-files/blog/images/thumbs/".$filename;
			if(file_exists($file_thumb)) {
				unlink($file_thumb);
			}
		}
			
		mysqli_query($dbconn,"delete from $table_name where catID='$catID'");
		$_SESSION['session_message']=$record_type.' has been deleted successfully';
	
	
	header("Location: ".SITE_ADMIN_URL."/".$script_name."?start=".$start."&parentID=".$parentID."&catID=".$catID."&pagesize=".$pagesize);
	exit;	 
}

if($id=="deactivate_record") {
	updateTable($table_name," status='N' where catID='$catID' and status='Y' ");
	$_SESSION['session_message']=$record_type.' has been deactivated successfully.';
	header("Location: ".SITE_ADMIN_URL."/".$script_name."?start=".$start."&parentID=".$parentID."&catID=".$catID."&pagesize=".$pagesize);
	exit;
}

if($id=="activate_record") {
	updateTable($table_name," status='Y' where catID='$catID' and status='N' ");
	$_SESSION['session_message']=$record_type.' has been activated successfully.';
	header("Location: ".SITE_ADMIN_URL."/".$script_name."?start=".$start."&parentID=".$parentID."&catID=".$catID."&pagesize=".$pagesize);
	exit;
}

if($id=="set_top_business_category") {
	updateTable($table_name," topBusinessCategory='Y', status='Y' where catID='$recordID'");
	$_SESSION['session_message']=$record_type.' has been set as top business category successfully.';
	header("Location: ".SITE_ADMIN_URL."/".$script_name."?start=".$start."&parentID=".$parentID."&catID=".$catID."&pagesize=".$pagesize);
	exit;
}

if($id=="unset_top_business_category") {
	
	$homeCnt=getCount($table_name," where topBusinessCategory='Y' and parentID='0'");
	if ($homeCnt < 4) {
		$_SESSION['session_message']=$record_type.' is required hence can not be unset as top business category.';
		header("Location: ".SITE_ADMIN_URL."/".$script_name."?start=".$start."&parentID=".$parentID."&catID=".$catID."&pagesize=".$pagesize);
		exit;
	}
	
	updateTable($table_name," topBusinessCategory='N' where catID='$recordID'");
	$_SESSION['session_message']=$record_type.' has been unset as top business category successfully.';
	header("Location: ".SITE_ADMIN_URL."/".$script_name."?start=".$start."&parentID=".$parentID."&catID=".$catID."&pagesize=".$pagesize);
	exit;	
}

########################################################
admin_header("Manage $record_type");	
?>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" valign="top">
 <tr>
	<td align="left" width="50%" class="myTitle"><?=$heading;?></td>
	<td align="right">
	 <form name="pagesize_form" action="<?=$PHP_SELF?>" method="post" style="margin:0px;padding:0px;">
	 <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" valign="top">
	  <tr>
	   <td align="right">Records Per Page:
	    <select name="pagesize" onchange="this.form.submit();">
	     <option value="0">Select</option>
	     <?php
	     foreach($_GLOBALS['pgsize_arr'] as $val) {
		     if(trim($pagesize)==trim($val)) {
			     echo '<option value="'.$val.'" selected>'.$val.'</option>';
		     }
		     else{
			     echo '<option value="'.$val.'">'.$val.'</option>';
		     }
	     }
	     ?>
	    </select>
	    <input type="hidden" name="catID" value="<?=$catID;?>">
	    <input type="hidden" name="parentID" value="<?=$parentID;?>">
		 </td>
		</tr>
	 </table>
	 </form>
	</td>
 </tr>
</table>
<hr size="2" width="99%" color="#DA251C">
<?php
##################Product Search Option###################
?>
<form name="srch" method="post" action="" style="display:inline" enctype="multipart/form-data">
<table width="100%"  border="0" cellpadding="0" cellspacing="2">
 <tr>
  <td align="right"><b>Search Category </b> [by name etc.] :-
   <input type="text" name="keyword" value="" size="40">
   <input type="submit" class="button" value="GO">   
  </td>
 </tr>   
</table>
</form>

<?php
$cond="";
if (strlen($keyword)) {
	?>
	<br/>
	<div style="width:99%;">
	 <div style="float:left;"><strong>Search For :</strong> <?=$keyword;?></div>
	 <div style="float:right;"><a href="javascript:history.go(-1);"><strong>Go Back</strong></a></div>
	</div> 
	<?php
	$cond=" and (catName like '%$keyword%' or catDesc like '%$keyword%')";
}
$qry1= db_query("select * from $table_name where parentID='$parentID' $cond ");
$reccnt = NumRows($qry1);
$qry= db_query("select * from $table_name where parentID='$parentID' $cond order by catgType asc, catName asc limit $start, $pagesize");
echo pageNavigation($reccnt,$pagesize,$start);
print_message();
?>

<div class="row">
      <?php
   if($parentID!="" && $parentID!=0) {
	   page_nav($parentID);
   }
   ?>
    <br>
</div>
 
 <div class="form-group">
    <input type="button" onclick="window.location.href='<?=SITE_ADMIN_URL;?>/addeditblog.php?parentID=<?=$parentID;?>'" value="Add New <?=$record_type;?>" class="btn btn-primary">
</div>
<br />

<form name="formn" method="post" action="" enctype="multipart/form-data">
    <div class="table-responsive">
<table  class="lightBorder table table-bordered table-hover">
 <?php if($reccnt>0) { ?>
    <thead>
    <tr bgcolor="#EAEAEA">
  <td width="5%" height="20" align="left"><strong style="
    color: #468cd2;">S.No.</strong></td>
  <!-- <td width="40%" align="left"><strong style="
    color: #468cd2;">Blog Title</strong></td> -->
  <td width="10%" align="center"><strong style="
    color: #468cd2;">Blog Image</strong></td>
  <td width="10%" align="center"><strong style="
    color: #468cd2;">Blog Banner</strong></td>
  <td width="5%" align="center"><strong style="
    color: #468cd2;">Blog Author</strong></td>
  <td width="5%" align="center"><strong style="
    color: #468cd2;">Blog Date</strong></td>
  <td width="10%" align="left"><strong style="
    color: #468cd2;">Options</strong></td>
 </tr>
 
    </thead>

 <?php
 $sl=$start+1;
 while($arr=mysqli_fetch_array($qry)) {
	//  $arr=ms_htmlentities_decode($arr);
	 if($sl%2!=0) {
		 $color="#f9f9f9";
	 }
	 else{
		 $color="#f0f0f0";
	 }
	 
?>
	<tbody>
	 <tr  bgcolor="<?=$color;?>">
	  <td align="left"><?=$sl;?>.</td>
	  <td align="left" class="<?=$class?>">
	   <a href="<?=SITE_ADMIN_URL;?>/<?=$script_name;?>?parentID=<?=$arr['catID'];?>"><b><?=$arr['catName'];?></b>  </a> 
	   <?php
	   if($arr['status']=="N") {
		   echo "&nbsp;<span class='icon'>Inactive</span>";
	   }
	   ?>
	  </td>
	  <td class="<?=$class?>" align="center">
	   <?php
	   if($arr['catImage']!="") {
		   $file1=SITE_DIR_PATH."/uploaded-files/blog/images/".$arr['catImage'];
		   if(file_exists($file1)) {
			   $dimens=GetImageSize($file1);
			   if($dimens[0]>130) {
				   $dimens[0]=$dimens[0]+30;
				   $dimens[1]=$dimens[1]+80;
			   }
			   else{
				   $dimens[0]=200;
				   $dimens[1]=200;
			   }
			   ?>
          <a href="javascript:void(0);" onClick="openwin('<?=SITE_ADMIN_URL;?>/popup_new.php?img=blog/images/<?=$arr['catImage'];?>', '<?=$dimens[0];?>', '<?=$dimens[1];?>')" class="linkgray fontbold"><strong>View Image</strong></a>
			   <?php
		   }
	   }
	   ?>	   
	  </td>
	  <td class="<?=$class?>" align="center">
	   <?php
	   if($arr['banner1']!="") {
		   $file1=SITE_DIR_PATH."/uploaded_files/blog_banner/".$arr['banner1'];
		   if(file_exists($file1)) {
			   $dimens=GetImageSize($file1);
			   if($dimens[0]>130) {
				   $dimens[0]=$dimens[0]+30;
				   $dimens[1]=$dimens[1]+80;
			   }
			   else{
				   $dimens[0]=200;
				   $dimens[1]=200;
			   }
			   ?>
          <a href="javascript:void(0);" onClick="openwin('<?=SITE_ADMIN_URL;?>/popup.php?img=blog_banner/<?=$arr['banner1'];?>', '<?=$dimens[0];?>', '<?=$dimens[1];?>')" class="linkgray fontbold"><strong>View Image</strong></a>
			   <?php
		   }
	   }
	   ?>	   
	  </td>
	 <td><?= $arr['blog_written']?></td>
	 <td><?= $arr['blogDate']?></td>
	 <!--  <td class="<?=$class?>" align="center"><input name="order_<?=$arr['catID'];?>" class="txtfieldadmin" type="text" size="2" value="<?=$arr['catOrder'];?>"></td> -->
	  <td class="<?=$class?>" align="left">
	   <a href="<?=SITE_ADMIN_URL?>/addeditblog.php?start=<?=$start;?>&catID=<?=$arr['catID'];?>&parentID=<?=$parentID;?>&pagesize=<?=$pagesize;?>"><i class="fa fa-edit"></i></a>
	   <?php if($arr['status']=='Y' && $parentID!=0) { ?>
	   &nbsp;<a href="<?=SITE_ADMIN_URL?>/<?=$script_name;?>?id=deactivate_record&start=<?=$start;?>&catID=<?=$arr['catID'];?>&parentID=<?=$parentID;?>&pagesize=<?=$pagesize;?>"><img src="<?=SITE_ADMIN_URL?>/images/active.gif" alt="Deactivate This <?=$record_type;?>" title="Deactivate This <?=$record_type;?>" border="0"></a>
	   <?php }
	   if($arr['status']=='N' && $parentID!=0) { ?>
	   &nbsp;<a href="<?=SITE_ADMIN_URL?>/<?=$script_name;?>?id=activate_record&start=<?=$start;?>&catID=<?=$arr['catID'];?>&parentID=<?=$parentID;?>&pagesize=<?=$pagesize;?>"><img src="<?=SITE_ADMIN_URL?>/images/deactive.gif" alt="Activate This <?=$record_type;?>" title="Activate This <?=$record_type;?>" border="0"></a>
	   <?php } ?>
	   
	   <?php /*if(!anyreference($arr['catID']) && $parentID!=0) { */ ?>
	   &nbsp;<a href="<?=SITE_ADMIN_URL?>/<?=$script_name;?>?id=delete_record&start=<?=$start;?>&catID=<?=$arr['catID'];?>&parentID=<?=$parentID;?>&pagesize=<?=$pagesize;?>" onClick="return confirm('Are you sure to delete this <?=$record_type;?>...');"><i class="fa fa-trash"></i></a>
	   <?php /*} */?>
	   &nbsp;<a href="<?=SITE_ADMIN_URL?>/manage_meta_tags_category.php?start=<?=$start;?>&catID=<?=$arr['catID'];?>&parentID=<?=$parentID;?>&pagesize=<?=$pagesize;?>"><i class="fa fa-briefcase"></i></a>
	  </td>
	 </tr>
	 <?php
	 $sl++;
 }
 ?>
 
 <?php } else{ ?>
 <tr><td><b>No Record Found........</b></td></tr>
 <?php } ?>
</tbody> 
</table>
    </div>
    
    <table width="96%" align="right" cellpadding="0" cellspacing="0" border="0">
 <tbody><tr><td align="right"></td>   <td class="'.$class.'" align="right">
   <input type="submit" name="Submit" value="Update" class="btn btn-primary">
   <input type="hidden" name="action" value="Update" class="btn btn-warning">
  </td></tr>
</tbody></table>
    
        </form><br/>

<?php 
admin_footer();
exit;
?>

← Back to Directory Edit File 🔒 Chmod

WP File Manager