All pastes #768707 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-11-10 20:54 UTC
rendered paste body
 <?php
	ob_start();
	include("../config.inc.php");
	if(!$_GET['ids']) {
	echo "לא נבחרו מודעות";
	}else{
		if($_GET['act'] == 'print_final') {
		    $user_id = (int)$_GET['user_id'];
			$ids = implode(', ', $_GET['ids']);
			$query = mysql_query("SELECT updated FROM users WHERE id='$user_id'") or die(mysql_error());
			$array_q = mysql_fetch_array($query);
			$new_updated = "".$array_q['updated'].",".$ids."";
			//echo "ids: $ids - array_q: $array_q[updated] - new_updated: $new_updated";
			$n_query = mysql_query("UPDATE users SET updated = '$new_updated' WHERE id='$user_id'") or die(mysql_error());
			?>
			<script type="text/javascript">
			window.print();
			</script>
			<?php
		}
	
?>
<html>
<head>
<title>הדפסת דירות</title>
<meta http-equiv="content-type" content="text/css; charset=windows-1255" />
<link rel="stylesheet" href="../img/style.css" type="text/css" />
<script language="javascript">
function show_hid(id) {
	Obj=document.getElementById('start_'+id);
	if (Obj.style.display=='block')  {
		Obj.style.display='none';
	} else {
		Obj.style.display='block';
	}
}
</script>
</head>
<body>
<style type="text/css">

div#nifty{ margin: 0 0%;background: #FFFBDB; width: 100%; height: 100%}

b.rtop, b.rbottom{display:block;background: #FFF}
b.rtop b, b.rbottom b{display:block;height: 1px;
    overflow: hidden; background: #FFFBDB}
b.r1{margin: 0 5px}
b.r2{margin: 0 3px}
b.r3{margin: 0 2px}
b.rtop b.r4, b.rbottom b.r4{margin: 0 1px;height: 2px}
</style>
<?php
foreach ($_GET['ids'] as $id) {
$query=mysql_query("SELECT * FROM properties WHERE id IN (".implode(', ', $_GET['ids']).")");

}
?>
<center>
<img src="http://www.kaplan1.co.il/img/kaplan.jpg" border="0" />
</center>
<br />
<table dir="rtl" align="center" valign="top" width="700">
<tr>
<td>
   <table class="tb" cellpadding="3" cellspacing="1"  width="100%">
    <tr  bgcolor="#FFFFFF" dir="rtl">
    <td align="center" style="color: #000000; font-weight: bold;">קטגוריה</td>
    <td align="center" style="color: #000000; font-weight:bold;">עיר/ישוב</td>
    <td align="center" style="color: #000000; font-weight:bold;">שכונה</td>
	<td align="center" style="color: #000000; font-weight: bold;">סוג נכס</td>
    <td align="center" width="5%" style="color: #000000; font-weight:bold;">חדרים</td>
    <td align="center" width="13%" style="color: #000000; font-weight:bold;">מחיר</td>
    <td align="center" style="color: #000000; font-weight:bold;">קומה</td>
    <td align="center" style="color: #000000; font-weight:bold;">תאריך</td>
    <td align="center" width="5%" style="color: #000000; font-weight:bold;">תמונה</td>
    <td align="center" style="color: #000000; font-weight:bold;">לפרטים</td>
</tr>

<?php 
	$x=0;
	while($array = mysql_fetch_array($query)) {
	$floor=explode(":", $array['floor']);
	$array['entry'] = str_replace("-", "/", $array['entry']);
	$array['city'] = str_replace("10", "בני ברק", $array['city']);
	$array['city'] = str_replace("211", "מודיעין עילית", $array['city']);
	$array['city'] = str_replace("213", "אלעד", $array['city']);
	$array['city'] = str_replace("22", "ירושלים", $array['city']);
	$array['category'] = str_replace("1", "השכרה", $array['category']);
	$array['category'] = str_replace("2", "מכירה", $array['category']);
	$array['type'] = str_replace("1", "דירה", $array['type']);
	$array['type'] = str_replace("2", "וילה", $array['type']);
	$array['bnia'] = str_replace("1", "יש", $array['bnia']);
	$array['bnia'] = str_replace("0", "אין", $array['bnia']);
	$array['balcony'] = str_replace("1", "יש", $array['balcony']);
	$array['balcony'] = str_replace("0", "אין", $array['balcony']);
	$array['elevator'] = str_replace("1", "יש", $array['elevator']);
	$array['elevator'] = str_replace("0", "איו", $array['elevator']);
	$array['parking'] = str_replace("1", "יש", $array['parking']);
	$array['parking'] = str_replace("0", "אין", $array['parking']);
	$array['climat'] = str_replace("1", "יש", $array['climat']);
	$array['climat'] = str_replace("0", "אין", $array['climat']);
	$array['bars'] = str_replace("1", "יש", $array['bars']);
	$array['bars'] = str_replace("0", "אין", $array['bars']);
	$array['storage_place'] = str_replace("1", "יש", $array['climat']);
	$array['storage_place'] = str_replace("0", "אין", $array['climat']);
	$x++;
	if($x % 2 == 0) { $colortable="#FFF9C2"; }else{ $colortable="#FFFBDB"; }

?>
<tr bgcolor="#FFFFFF" onclick="show_hid(<?=$x;?>)">
<td align="center"><?=$array['category'];?></td>
<td align="center"><?=$array['city'];?></td>
<td align="center"><?=$array['district'];?></td>
<td align="center"><?=$array['type'];?></td>
<td align="center"><?=$array['rooms'];?></td>
<td align="center">$ <?=$array['price'];?></td>
<td align="center"><?=$floor['0'];?></td>
<td align="center"><?=$array['entry'];?></td>
<td align="center"><? if($array['pic1'] | $array['pic2'] || $array['pic3']) { ?><a href="JavaScript:void(2)" onClick="window.open ('images.php?id=<?=$array['id'];?>','ShowPics','scrollbars=no, width=550 height=550')"><img src="img/camera.gif" alt="מאגר דירות" border="0" /></a><?php } ?></td>
<td align="center" width="9%"><a style="color: #000000; text-decoration: underline;" href='javascript:void(0)' onclick="show_hid(<?=$x;?>)" title="לפרטים">לחצו כאן</a></td>
</tr>
<tr><td width="100%" colspan="100%" style="direction: rtl; text-align: right" dir="rtl">
<strong>סוג הנכס: דירות ל</strong><?=$array['category'];?>,&nbsp;
<strong>מס' חדרים:</strong> <?=$array['rooms'];?>,&nbsp;
<strong>מחיר $:</strong> <?=$array['price'];?>,&nbsp;
<strong>רחוב:</strong> <?=$array['address'];?>,&nbsp;
<strong>שכונה:</strong> <?=$array['district'];?>,&nbsp;
<strong>עיר:</strong> <?=$array['city'];?>,&nbsp;
<strong>ת.פינוי:</strong> ,&nbsp;
<strong>מעלית:</strong> <?=$array['elevator'];?>,&nbsp;
<strong>חניה:</strong> <?=$array['parking'];?>,&nbsp;
<strong>מזגן:</strong> <?=$array['climat'];?>,&nbsp;
<strong>סורגים:</strong> <?=$array['bars'];?>,&nbsp;
<strong>מחסן:</strong> <?=$array['storage_place'];?>,&nbsp;
<strong>מרפסת:</strong> <?=$array['balcony'];?>,&nbsp;
<?php if($array['category'] !='השכרה') { ?>
<strong>ריהוט:</strong> ,&nbsp;
<?php } ?>
<strong>קומה:</strong> <?=$floor['0'];?>&nbsp;
<strong>מ"ר:</strong> <?=$array['sqv'];?>&nbsp;
<strong>כיוון:</strong>
<strong>אופציה לבניה:</strong> <? if($array['bnia']) { echo "$array[bnia]"; } ?>
<strong>טלפון 1:</strong> <?=$array['tel'];?>&nbsp;
<strong>טלפון 2:</strong>&nbsp;
<strong>שם:</strong> <?=$array['sellername'];?>&nbsp;
<br />
<strong>תיאור:</strong> <?=$array['description'];?>&nbsp;

</td></tr>
<?php } ?>
</table>
</td>
</tr>
</table>
<br /><br />
<center>
<form method="get" act="<?=$PHP_SELF;?>">

<?php
if($_GET['act'] == 'print' || $_GET['act'] == 'print_final') {
	foreach ($_GET['ids'] as $tmp_id) {
	echo "<input type=\"hidden\" name=\"ids[]\" value=\"$tmp_id\" />\n";
	}
?>
<input type="hidden" name="user_id" id="user_id" value="<?=$_GET['user_id'];?>" />
<input type="hidden" name="act" id="act" value="print_final" />
<input type="submit" value=" הדפס דף זה " />	
<?php
}else{
	foreach ($_GET['ids'] as $tmp_id) {
	echo "<input type=\"hidden\" name=\"ids[]\" value=\"$tmp_id\" />\n";
	}
?>
<input type="hidden" name="act" id="act" value="print" />
<input type="text" size="3" value="<?=$_POST['user_id'];?>" name="user_id" /> מספר לקוח
<br />
<input type="submit" value=" עבור לשלב ההדפסה " />
<?php } ?>
</form>
</center>
<?php } ?>
</body>
</html>