function child_personnel($id = 0, $department_id = null, $department_title = null) { $CI =& get_instance(); $sql = "select *\n\t\t\t\t\tfrom personnel\n\t\t\t\t\twhere personnel.status = '1' and personnel.department_id = '" . $department_id . "' and personnel.parent_id = '" . $id . "' order by personnel.orders asc"; $tmp = $CI->db->query($sql)->result(); if (count($tmp) != 0) { if ($id == '0') { echo '<div align="center" ><div style="border: 2px solid #b5d9ea;background#cde7ee">' . $department_title . '</div></div>'; } foreach ($tmp as $item) { $col = count($tmp); if ($col > 4) { $col = 3; } $photo = chk_image_path($item->image_path) ? $item->image_path : 'images/no_images.png'; echo '<div style="display:inline-block; width:' . (100 / $col - 1) . '%; text-align:center; vertical-align:top;">'; echo '<div class="manager_box" style="text-align:center; padding:5px 5px;">'; echo '<div align="center">'; echo '<img src="' . $photo . '" style="width:100px;height:120px"><br />'; echo '<label style="margin-top:10px; background:#CCC; border-radius:4px; font-size:11px; font-weight:bold; padding:10px 5px; line-heigth:30px; width:220px;">'; echo $item->fname . ' ' . $item->lname; echo empty($item->position) ? '' : '<br />' . $item->position; echo '</label>'; echo '</div>'; echo '</div> <BR><BR>'; child_personnel($item->id, $item->department_id); echo '</div>'; } } return @$rs; }
<ul class="thumbnails" > <?php foreach ($variable as $key => $value) { ?> <li class="span2" > <div class="thumbnail" > <a href="galleries/view/<?php echo $value->slug; ?> " title="<?php echo $value->title; ?> " target="_blank" > <img src="<?php echo chk_image_path($value->image_path) ? $value->image_path : ($value->image->get(1)->image_path ? $value->image->get(1)->image_path : "images/no-image.jpg"); ?> " alt="<?php echo $value->title; ?> " /> <div class="caption" > <?php echo $value->title; ?> </div> </a> </div> </li> <?php }
<div class="row" style="padding-left:20px;"> <?php foreach ($variable as $key => $value) { ?> <div class="col-md-4"> <a class="pull-left" href="contents/view/<?php echo $value->slug; ?> " title="<?php echo strip_tags($value->title); ?> "> <img src="<?php echo chk_image_path($value->image_path) ? $value->image_path : "images/no-image.jpg"; ?> " alt="ข่าวประชาสัมพันธ์" class="thumbnail" style="width: 117px; height: 76px;" > </a> <a href="contents/view/<?php echo $value->slug; ?> " title="<?php echo strip_tags($value->title); ?> "> <h6 class="list-group-item-heading titlenews"><?php echo strip_tags($value->title); ?> </h6> </a>