برای فراخوانی این موارد از بانک اطلاعاتی چه کار کنم ؟
سلام
من یک صفحه دارم که کاربر تاریخ رو به صورت شمسی وارد می کنه ، بعد موضوع مورد بررسی رو هم انتخاب می کنه .( ممکنه یک موضوع رو انتخاب کنه و شاید هم دو یا سه یا همه را ) . بعد می خواهم تمام مطالبی که موضوعشون ، موضوعات انتخاب شده است و تاریخشون تاریخ وارد شده است ، نشان داده بشه . اما هر کاری کردم ، فقط تونستم موضوعاتی رو نشون بدم که تاریخشون با تاریخ وارد شده یکی است . حالا از شما تقاضا دارم من رو راهنمایی کنید . با تشکر ( یکم ضروریه ) کد صفحه ارسال به صورت زیر است :
[HTML]
<?
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>.:: head ::.</title>
</head>
<body>
<form action="do.php" method="post">
<p>
<label></label>
<br /></p>
<p align="center">
<?
if($_SESSION["MSG"])
{
echo $_SESSION["MSG"];
$_SESSION["MSG"]="";
}
?>
</p>
<p align="center"> </p>
<table width="200" border="1">
<tr>
<td>سال</td>
<td>ماه </td>
<td>روز </td>
</tr>
<tr>
<td colspan="3"><label></label> <label></label> <label>
<input type="text" name="txtDate" value="<?=$_SESSION["txtDate"];?>"/>
</label></td>
</tr>
<tr>
<td><label>
<input name="all" type="checkbox" id="all" value="1">
All
</label></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><input name="category1" type="checkbox" id="category1" value="1" <?=$_SESSION["category1"]? "checked":"" ?>>
Category1</td>
<td><input name="category2" type="checkbox" id="category2" value="1" <?=$_SESSION["category2"]? "checked":"" ?>>
Category2</td>
<td><label>
<input name="category3" type="checkbox" id="category3" value="1" <?=$_SESSION["category3"]? "checked":"" ?>>
Category3</label></td>
</tr>
<tr>
<td><input name="category4" type="checkbox" id="category4" value="1" <?=$_SESSION["category4"]? "checked":"" ?>>
Category4</td>
<td><input name="category5" type="checkbox" id="category5" value="1" <?=$_SESSION["category5"]? "checked":"" ?>>
Category5</td>
<td><input name="category6" type="checkbox" id="category6" value="1" <?=$_SESSION["category6"]? "checked":"" ?>>
Category6</td>
</tr>
</table>
<input name="" type="submit" />
</form>
</body>
</html>
[/HTML]
اینم کد صفحه نمایش :
[PHP]
session_start();
include("jalali.php");
$jdate=$_SESSION["txtDate"]=trim($_POST["txtDate"]);
$category1=$_SESSION["category1"]=$_POST["category1"];
$category2=$_SESSION["category2"]=$_POST["category2"];
$category3=$_SESSION["category3"]=$_POST["category3"];
$category4=$_SESSION["category4"]=$_POST["category4"];
$category5=$_SESSION["category5"]=$_POST["category5"];
$category6=$_SESSION["category6"]=$_POST["category6"];
list( $jyear, $jmonth, $jday ) = preg_split ( '/\//', $jdate );
list( $gyear, $gmonth, $gday ) = jalali_to_gregorian($jyear, $jmonth, $jday);
$gdate = $gyear."-".$gmonth."-".$gday;
settype($gyear,integer);
settype($gmonth,integer);
settype($gday,integer);
;
$result=mysql_query($sql);
while($row=@mysql_fetch_assoc($result))
{
$members[]=$row;
}
?>
<table width="200" border="1">
<tr>
<td>News title</td>
<td>Category</td>
</tr>
<?php
for($i=0;$i<count($members);$i++)
{
$member=$members[$i];
if($member["category"]==1) $category="category1";
if($member["category"]==2) $category="category2";
if($member["category"]==3) $category="category3";
if($member["category"]==4) $category="category4";
if($member["category"]==5) $category="category5";
if($member["category"]==6) $category="category6";
?>
<tr>
<td><?=$member["title"]?>
</td>
<td><p><?=$category ?></p></td>
</tr>
<?
}
?>
</table>
</body>
</html>
[/PHP]