예제 #1
0
					<th>نام</th>
                    <th>ایمیل</th>
					<th>متن کامنت</th>
					<th>تاریخ ثبت</th>
                    <th>شماره پست</th>
                    <th>فعال</th>
                    <th>عملیات</th>
				</tr>
<?php 
if (isset($_POST['edit'])) {
    DatabaseHandler::execute("UPDATE `comments` SET `activate` = !`activate` WHERE `id` = '{$_POST['comment_id']}' ; ");
}
$comments = COMMENTS::comments_SelectAll();
$i = 1;
foreach ($comments as $comment) {
    $comment["add_time"] = jdate("Y/m/d", $comment["add_time"]);
    $checked = "";
    if ($comment["activate"]) {
        $comment["activate"] = "<span style='color:green'>فعال</span>";
        $checked = "checked";
    } else {
        $comment["activate"] = "<span style='color:red'>غیر فعال</span>";
    }
    $blog = BLOGS::blogs_SelectRow($comment["blog_id"]);
    echo "\n\t\t  <tr>\n\t\t  \t\t\t<td>{$i}</td>\n\t\t\t\t\t<td>{$comment['full_name']}</td>\n\t\t\t\t\t<td>{$comment['mail']}</td>\n\t\t\t\t\t<td>{$comment['text']}</td>\n\t\t\t\t\t<td>{$comment['add_time']}</td>\n\t\t\t\t\t<td>{$blog['title']}</td>\n\t\t\t\t\t<td>{$comment['activate']} <form method='post' id='form{$comment['id']}'><input type='hidden' name='comment_id' value='{$comment['id']}'><input  onchange='\$(" . '"#form' . $comment["id"] . '"' . ").submit();' type='checkbox' name='edit' class='edit'></form></td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<a href='#'>پاسخ</a>\n\t\t\t\t\t</td>\t\n\t\t  </tr>";
    $i++;
}
?>
 
</table>
예제 #2
0
        //                $audience = explode("-", $audience);
        //                B_A::b_a_Insert($blog_id, $audience['1']);
        //            }
        //        }
        $result = '<div class="col-lg-12 col-md-6">
                        <div class="alert alert-success alert-dismissable">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            ویرایش / افزودن بلاگ با موفقیت انجام شد. بلاگ مورد نظر غیر فعال بوده و برای فعال شدن از <a href="index.php?page=blog_list">لیست بلاگ ها</a> اقدام نمایید.
                            <br>
                            همچنین شما می توانید از <a href="../blog/detail.php?title=' . $title_en . '">این لینک</a> پیش نمایش بلاگ وارد شده را ببینید.
                        </div>
                    </div>';
    }
}
if (isset($_GET["id"])) {
    $update_blog = BLOGS::blogs_SelectRow($_GET["id"]);
    $keywords = DatabaseHandler::GetAll("SELECT * FROM blog_keywords WHERE blog_id = '{$_GET['id']}' ; ");
    foreach ($keywords as $keyword) {
        $keywords_input .= $keyword["keyword"] . ' , ';
    }
    $title_input = $update_blog['title'];
    $title_en_input = $update_blog['title_en'];
    $image_input = $update_blog["image"];
    $text_input = $update_blog['text'];
    $source_input = $update_blog['source'];
    $video_input = $update_blog['video'];
    $description_input = $update_blog['description'];
    $read_time_input = $update_blog['read_time'];
    $submit = "update";
    $page_title = "ویرایش بلاگ";
}