?> <h3 class="sub-header">لیست بلاگ ها</h3> <table class="table table-striped table-hover table-bordered"> <tr> <th>ردیف</th> <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++;
?> <h3 class="sub-header">لیست بلاگ ها</h3> <table class="table table-striped table-hover table-bordered"> <tr> <th>ردیف</th> <th>شماره بلاگ</th> <th width="20%">عنوان</th> <th>عنوان انگلیسی</th> <th>تاریخ ثبت</th> <th>تعداد بازدید</th> <th>فعال</th> <th>عملیات</th> </tr> <?php if (isset($_POST['edit'])) { DatabaseHandler::execute("UPDATE `blogs` SET `activate` = !`activate` WHERE `id` = '{$_POST['blog_id']}' ; "); } $blogs = BLOGS::blogs_SelectAll(); $i = 1; foreach ($blogs as $blog) { $blog["add_time"] = jdate("Y/m/d", $blog["add_time"]); $checked = ""; if ($blog["activate"]) { $blog["activate"] = "<span style='color:green'>فعال</span>"; $checked = "checked"; } else { $blog["activate"] = "<span style='color:red'>غیر فعال</span>"; } echo "\n\t\t <tr>\n\t\t \t\t\t<td>{$i}</td>\n\t\t\t\t\t<td>{$blog['id']}</td>\n\t\t\t\t\t<td>{$blog['title']}</td>\n\t\t\t\t\t<td>{$blog['title_en']}</td>\n\t\t\t\t\t<td>{$blog['add_time']}</td>\n\t\t\t\t\t<td>{$blog['hit_count']}</td>\n\t\t\t\t\t<td>{$blog['activate']} <form method='post' id='form{$blog['id']}'><input type='hidden' name='blog_id' value='{$blog['id']}'><input onchange='\$(" . '"#form' . $blog["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='?page=blog_insert&id={$blog['id']}'>ویرایش</a>\n\t\t\t\t\t</td>\t\n\t\t </tr>"; $i++; }