Mini Shell

Direktori : /home/rizant5/public_html_old/development/admin/
Upload File :
Current File : /home/rizant5/public_html_old/development/admin/edit-comment.php

<?php 

require_once("../config.php");

require_once("function-file.php");

require_once("function-menu.php");

cookiecheck();

if(isset($_POST['save']))

{

  $text = htmlspecialchars($_POST['comment'],ENT_QUOTES);
  $blog_id = $_GET['blog_id'];
  if(isset($_POST['cid'])){
    $cid = $_POST['cid'];
    $conn->exec("update blog_comment SET message='$text' where commentid='$cid' ");
  }else{
    $rid = $_POST['rid'];
    $conn->exec("update blog_answer SET reply='$text' where blogans_id='$rid' ");
  }
  header("location:blogs-view.php?blog_id=".$blog_id);
  // $db=$conn->prepare("select * from blog_comment where commentid='$cid'");
  // $db=$conn->prepare("select * from blog_answer where blogans_id='$rid'");

  // $conn->exec("insert into answers (que_id,datetime,text) values ('$queid',NOW(),'$text')");
	// $conn->exec("update answers SET text='$text' where ans_id='$ansid' ");

	// $conn->exec("update question SET check_status='1',approve='1',text='$question' where que_id='$queid' ");

	// header("location:answer.php?topic_id=".$topic_id."&queid=".$queid."#answer");

}

?>

<!DOCTYPE html>

<html>

  <head>

    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>Edit Comment</title>

    <!-- Tell the browser to be responsive to screen width -->

    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <?php  cssfile();?>

    <style>iframe{width: 100% !Important;}</style>

  </head>

  <body class="hold-transition skin-blue layout-top-nav">

    <!-- Site wrapper -->

    <div class="wrapper">

<?php headermenu();?>

      <!-- =============================================== -->

      <!-- Content Wrapper. Contains page content -->

      <div class="content-wrapper">

        <!-- Content Header (Page header) -->

        <!-- Main content -->

        <section class="content">

          <div class="box box-primary">

            <div class="box-body">

            <form action="#" method="post">

              <div class="row form-group" id="answer">      

                    <div class="col-sm-12">

              <!-- The time line -->

              <ul class="timeline">

                <!-- timeline time label -->

                <?php
                if(isset($_GET['cid'])){
                  $cid = $_GET['cid'];
                  $db=$conn->prepare("select * from blog_comment where commentid='$cid'");
                }elseif(isset($_GET['rid'])){
                  $rid = $_GET['rid'];
                  $db=$conn->prepare("select * from blog_answer where blogans_id='$rid'");
                }

        $db->execute();$rows=$db->fetch();?>

                <!-- timeline item -->

                <li>

                  <i class="fa fa-envelope bg-blue"></i>

                  <div class="timeline-item">

                    <span class="time "><?php echo date('d M. Y',strtotime($rows['datetime']));?> - <i class="fa fa-clock-o"></i>  <?php echo date('h:i A',strtotime($rows['datetime']));?></span>

                    <h3 class="timeline-header"><?php //echo $rows['stu_name'];?></h3>

                    <div class="timeline-body">

                    <?php if(isset($cid)){ ?>
                      <input type="hidden" name="cid" value="<?php echo $cid; ?>">
                      <textarea name="comment" class="form-control" required><?php echo $rows['message'];?></textarea>
                    <?php }else{ ?>
                      <input type="hidden" name="rid" value="<?php echo $rid; ?>">
                      <textarea name="comment" class="form-control" required><?php echo $rows['reply'];?></textarea>
                    <?php } ?>

                    </div>

                  </div>

                </li>

                <!-- END timeline item -->

              </ul>

              </div>

            </div>

            


                    <div class="row form-group"><div class="col-sm-12" align="center"><button type="submit" name="save" class="btn btn-success">Update</button></div></div>

            </div>

            </form>

          </div><!-- /.box -->

        </section><!-- /.content -->

      </div></div><!-- /.content-wrapper -->

      <?php footer();?>

    </div><!-- ./wrapper -->

   <?php jsfile();ratenum();?>

   

  </body>

</html>


Zerion Mini Shell 1.0