name : table_project.php
<?php 

if(isset($_POST['p'])){
  $p = $_POST['p'];
}
                        include('config/config.php');
                        $sql = "SELECT projects.*,types.*,categorys.* 
                        FROM projects 
                        LEFT JOIN types on (types.t_id = projects.p_t_id)  
                        LEFT JOIN categorys on (categorys.c_id = projects.p_c_id)
                        WHERE p_status = 1 and p_t_id = '".$p."' ";
                        if(isset($_POST['q'])){
                           $q = $_POST['q'];
                          if($q == 'C000'){
                            $sql .= "";
                          }else if($q == 'C001'){
                            $sql .= " and p_c_id = 'C001' ";                     
                          }else if($q == 'C002'){
                            $sql .= " and p_c_id = 'C002' ";                     
                          }else if($q == 'C003'){
                            $sql .= " and p_c_id = 'C003' ";                     
                          }else if($q == 'C004'){
                            $sql .= " and p_c_id = 'C004' ";                     
                          }else if($q == 'C005'){
                            $sql .= " and p_c_id = 'C005' ";                     
                          }else if($q == 'C006'){
                            $sql .= " and p_c_id = 'C006' ";                     
                          }
                        }
                        
                        $res = $conn->query($sql);
                        $num_rows = $res->num_rows;
                        if($num_rows > 0 ){
                        while($row = $res->fetch_assoc()){
                          $check_title =  substr($row['p_tt'],0,6);
                        ?>
                        	<div class="post">
                            <a href="IV_PROJECT.php?q=<?php echo $row['p_id'];  ?>">
                              <div class="hovereffect">
                              <img src="<?php echo $row['p_im_show']; ?>">
                                <div class="overlay">
                                  <p class="info"><?php echo $row['c_name']; ?></p>
                                </div>
                              </div>
                            </a>
                            <div class="title_project"> 
                              <p class="title_content"><?php echo $row['p_name']; ?> </p>
                              <p class="content"><?php echo $row['p_location']; ?></p>
                            </div>
                          </div>
                        <?php 
                            }
                          }else{
                        ?>
                          <div class="col-md-12">
                          <h1 class="text-center">---------  No Project  ----------</h1>
                          </div>
                        <?php
                          
                          }
                        ?>
                        <script>
                        jQuery(window).load(function () {

	var gutter = parseInt(jQuery('.post').css('marginBottom'));
	var container = jQuery('#posts');

	container.masonry({
		gutter: gutter,
		itemSelector: '.post',
		columnWidth: '.post'
	});
	
	jQuery(window).bind('resize', function () {
		if (!jQuery('#posts').parent().hasClass('container')) {
			
			
			post_width = jQuery('.post').width() + gutter;
			jQuery('#posts, body > #grid').css('width', 'auto');

			
			posts_per_row = jQuery('#posts').innerWidth() / post_width;
			floor_posts_width = (Math.floor(posts_per_row) * post_width) - gutter;
			ceil_posts_width = (Math.ceil(posts_per_row) * post_width) - gutter;
			posts_width = (ceil_posts_width > jQuery('#posts').innerWidth()) ? floor_posts_width : ceil_posts_width;
			if (posts_width == jQuery('.post').width()) {
				posts_width = '100%';
			}
			jQuery('#posts, #grid').css('width', posts_width);
			jQuery('#grid').css({'margin': '0 auto'});

		}
	}).trigger('resize');
});
                        </script>

© 2024 UnknownSec