کدهای کامل فایل کلاس :
<?php
require_once 'config/config.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="description" content="وب سايت تخصصي فناوري اطلاعات ، برنامه نويسي ،گرافيک، الکترونيک و مخابرات">
<meta name="keywords" content="فناوري اطلاعات,برنامه نويسي,گرافيک,الکترونيک,مخابرات">
<meta name="author" content="Payam Hayati">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>فناوري اطلاعات,برنامه نويسي,گرافيک,الکترونيک,مخابرات</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link href="css/style.css" rel="stylesheet">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<?php
class read {
//Read Content Design (Sub_slideshow)
function read_summary_design(&$saveID) {
echo '<div class="content_sub">';
//start save id
$resultid = mysqli_query($GLOBALS['conn'], "SELECT n_id FROM note WHERE n_categorie='طراحی و پیاده سازی' ORDER BY n_id DESC LIMIT 1");
//SELECT IncidntNum, Date, Time FROM pd_incidents WHERE PdDistrict = 'Southern' ORDER BY Time, Date LIMIT 5
if (!$resultid) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$rowid = mysqli_fetch_row($resultid);
$saveID = $rowid[0];
//echo $saveID;
//echo $row[0]; // 42
//echo $row[1]; // the email value
//static save id
$sql = "SELECT n_title, n_summary FROM note WHERE n_categorie='طراحی و پیاده سازی' ORDER BY n_id DESC LIMIT 1";
$result = mysqli_query($GLOBALS['conn'], $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
while ($row = mysqli_fetch_assoc($result)) {
//echo "title: " . $row["n_title"] . " - summary: " . $row["n_summary"] . "<br>";
echo '<h4>' . $row['n_title'] . '</h4>';
echo '<p>' . $row['n_summary'] . '</p>';
}
} else {
echo "0 results";
}
//mysqli_close($GLOBALS['conn']);
return $saveID;
echo '</div>';
}
function read_full_design() {
echo '
<div class="container">
<div class="row">
<div class="con_design" style="width:97.5%;">
';
$sql = "SELECT * FROM note WHERE n_categorie='طراحی و پیاده سازی' ORDER BY n_id DESC LIMIT 1";
$result = mysqli_query($GLOBALS['conn'], $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
while ($row = mysqli_fetch_assoc($result)) {
//echo "title: " . $row["n_title"] . " - summary: " . $row["n_summary"] . "<br>";
echo '
<div class="rw_head">
<div class="title pull-right">
<h4><i class="fa fa-comments-o " aria-hidden="true"></i> ' . $row['n_title'] . '</h4>
</div>
<div class="writer pull-right">
<h4><i class="fa fa-user-o " aria-hidden="true"></i> ' . $row['n_writer'] . '</h4>
</div>
';
$time_con = $row['n_time'];
$tcon = jdate('l d F Y', $time_con);
echo '
<div class="date pull-right">
<h4><i class="fa fa-calendar-check-o " aria-hidden="true"></i> ' . $tcon . '</h4>
</div>
</div>';
echo '<div class="clr"></div>';
echo '<img class="img-responsive pull-left" width="130" height="130" src="include/admin/uploads/' . $row['n_image'] . '">';
echo '<p>' . $row['n_summary'] . '</p>';
echo '<p>' . $row['n_descrip'] . '</p>';
}
} else {
echo "0 results";
}
echo '<div class="clr"></div>';
echo '<hr />';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<br />';
}
//Read Content IT (Sub_slideshow)
function read_summary_it() {
echo '<div class="content_sub">';
//start save id
$resultid = mysqli_query($GLOBALS['conn'], "SELECT n_id FROM note WHERE n_categorie='فناوری اطلاعات و ارتباطات' ORDER BY n_id DESC LIMIT 1");
if (!$resultid) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$rowid = mysqli_fetch_row($resultid);
$saveID = $rowid[0];
$sql = "SELECT n_title, n_summary FROM note WHERE n_categorie='فناوری اطلاعات و ارتباطات' ORDER BY n_id DESC LIMIT 1";
$result = mysqli_query($GLOBALS['conn'], $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
while ($row = mysqli_fetch_assoc($result)) {
//echo "title: " . $row["n_title"] . " - summary: " . $row["n_summary"] . "<br>";
echo '<h4>' . $row['n_title'] . '</h4>';
echo '<p>' . $row['n_summary'] . '</p>';
}
} else {
echo "0 results";
}
//mysqli_close($GLOBALS['conn']);
echo '</div>';
}
function read_full_it() {
echo '
<div class="container">
<div class="row">
<div class="con_design" style="">
';
$sql = "SELECT * FROM note WHERE n_categorie='فناوری اطلاعات و ارتباطات' ORDER BY n_id DESC LIMIT 1";
$result = mysqli_query($GLOBALS['conn'], $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
while ($row = mysqli_fetch_assoc($result)) {
//echo "title: " . $row["n_title"] . " - summary: " . $row["n_summary"] . "<br>";
echo '
<div class="rw_head">
<div class="title pull-right">
<h4><i class="fa fa-comments-o " aria-hidden="true"></i> ' . $row['n_title'] . '</h4>
</div>
<div class="writer pull-right">
<h4><i class="fa fa-user-o " aria-hidden="true"></i> ' . $row['n_writer'] . '</h4>
</div>
';
$time_con = $row['n_time'];
$tcon = jdate('l d F Y', $time_con);
echo '
<div class="date pull-right">
<h4><i class="fa fa-calendar-check-o " aria-hidden="true"></i> ' . $tcon . '</h4>
</div>
</div>';
echo '<div class="clr"></div>';
echo '<p>' . $row['n_summary'] . '</p>';
echo '<p>' . $row['n_descrip'] . '</p>';
echo '<div align="center"><img class="img-responsive" style="border: solid 1px #CCC;" src="include/admin/uploads/' . $row['n_image'] . '"></div>';
}
} else {
echo "0 results";
}
//mysqli_close($GLOBALS['conn']);
echo '<div class="clr"></div>';
echo '<hr />';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<br />';
}
//Read Content Products (Sub_slideshow)
function read_summary_product() {
echo '<div class="content_sub">';
$resultid = mysqli_query($GLOBALS['conn'], "SELECT n_id FROM note WHERE n_categorie='محصولات' ORDER BY n_id DESC LIMIT 1");
if (!$resultid) {
echo 'Could not run query';
exit;
}
$rowid = mysqli_fetch_row($resultid);
$saveID = $rowid[0];
$sql = "SELECT n_title, n_summary FROM `note` WHERE n_categorie='محصولات' ORDER BY n_id DESC LIMIT 1";
$result = mysqli_query($GLOBALS['conn'], $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
while ($row = mysqli_fetch_assoc($result)) {
echo '<h4>' . $row['n_title'] . '</h4>';
echo '<p>' . $row['n_summary'] . '</p>';
}
} else {
echo "0 results";
}
//mysqli_close($GLOBALS['conn']);
echo '</div>';
}
function read_full_product() {
echo '
<div class="container">
<div class="row">
<div class="con_design" style="">
';
$sql = "SELECT * FROM note WHERE n_categorie='محصولات' ORDER BY n_id DESC LIMIT 1";
$result = mysqli_query($GLOBALS['conn'], $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
while ($row = mysqli_fetch_assoc($result)) {
//echo "title: " . $row["n_title"] . " - summary: " . $row["n_summary"] . "<br>";
echo '
<div class="rw_head">
<div class="title pull-right">
<h4><i class="fa fa-comments-o " aria-hidden="true"></i> ' . $row['n_title'] . '</h4>
</div>
<div class="writer pull-right">
<h4><i class="fa fa-user-o " aria-hidden="true"></i> ' . $row['n_writer'] . '</h4>
</div>
';
$time_con = $row['n_time'];
$tcon = jdate('l d F Y', $time_con);
echo '
<div class="date pull-right">
<h4><i class="fa fa-calendar-check-o " aria-hidden="true"></i> ' . $tcon . '</h4>
</div>
</div>';
echo '<div class="clr"></div>';
echo '<img class="img-responsive pull-left" style="margin:5px;" width="130" height="130" src="include/admin/uploads/' . $row['n_image'] . '">';
echo '<p>' . $row['n_summary'] . '</p>';
echo '<p>' . $row['n_descrip'] . '</p>';
}
} else {
echo "0 results";
}
//mysqli_close($GLOBALS['conn']);
echo '<div class="clr"></div>';
echo '<hr />';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<br />';
}
}
class bingo {
function read_test() {
echo 'Bingo';
}
}
?>
<!--jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> -->
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>