Your IP : 216.73.216.91


Current Path : /var/www/html/nadineandmiabeauty/admin/
Upload File :
Current File : /var/www/html/nadineandmiabeauty/admin/viewcomments.php

<?php
	require_once('autoload.php');
	include_once('header.php');
	$config = config::getAppConfig();
	$user->checklogin($config['loginPath']);
	$db = new pdocrudhandler();
	$res = $db->customSelect('SELECT c.*,b.btitle,b.bsummary FROM comment c INNER JOIN blog b on b.id=c.blog_id ORDER BY id DESC');
	if($res['status'] == 'success'){


?>

        <div class="content " id="main-cont">
		<div class="container-fluid">
		      <?php
                            require_once ('alertmsg/alerts.php');
              ?>
		  <table class="table table-hover table-striped">
		    <thead>
		      <tr>
		      	<th>ID</th>
		        <th>Name</th>
		        <th>Email</th>
		        <th>Subject</th>
		         <th>Comment</th>
		         <th>Date</th>
		         <th>Status</th>
		         <th>Blog Title</th>
		        <th>Active</th>
		        <th>Delete</th>

		      </tr>
		    </thead>
		    <tbody>
		    	<?php


		    	for ($i=0; $i < $res['rowsAffected'] ; $i++) {


		    	?>
		      <tr>

		      	<td><?php echo $i ?></td>
		        <td><?php echo  $res['result'][$i]->name; ?></td>
		        <td><?php echo  $res['result'][$i]->email; ?></td>
		        <td><?php echo  $res['result'][$i]->subject; ?></td>
		        <td><?php echo  $res['result'][$i]->comment; ?></td>
		        <td><?php echo  $res['result'][$i]->created_on; ?></td>
		        <td title="<?php echo  $res['result'][$i]->bsummary; ?>"><?php echo  $res['result'][$i]->btitle; ?></td>
		        <td><?php echo  $res['result'][$i]->active; ?></td>

		        <?php

		        if ( $res['result'][$i]->active == '0') {


		        ?>

		        <td><form method="post" action="classes/allfunctions.php?"><input type="hidden" name="action" id="action" value="updatecommentstatus">
		         <input type="hidden" name="cmt_id" value="<?php echo  $res['result'][$i]->id; ?>">
		        <button><i class="ti-location-arrow">Active</i></button></form></td>

		        <?php
		    	}elseif ( $res['result'][$i]->active == '1') {

		        ?>

		        <td><form method="post" action="classes/allfunctions.php?"><input type="hidden" name="action" id="action" value="deactivatecommentstatus">
		         <input type="hidden" name="cmt_id" value="<?php echo  $res['result'][$i]->id; ?>">
		        <button><i class="ti-location-arrow">DeActive</i></button></form></td>
		        <?php
		    }

		        ?>
		        <td><form method="post" action="classes/allfunctions.php?"><input type="hidden" name="action" id="action" value="deletecomment">
		        <input type="hidden" name="cmt_id" value="<?php echo  $res['result'][$i]->id; ?>">
		        <button><i class="ti-trash"></i></button></form></td>
		      </tr>
		      <?php

		      	}

				}
		      ?>

		    </tbody>
		  </table>



<?php
	require_once('footer.php');

?>