} else { ?> <a href="admin/settings/<?php echo $modules_name; ?> /form/<?php echo $row->id; ?> " class="btn btn-info" ><span class="glyphicon glyphicon-search" ></span> View</a> <?php } ?> <?php if ($perm->can_delete == 'y') { $regist = new Register_data(); $regist->where('hotel_id = ' . $row->id)->get(1); if (@$regist->id < 1) { ?> <a href="admin/settings/<?php echo $modules_name; ?> /delete/<?php echo $row->id; ?> " class="btn btn-danger btn_delete"><span class="glyphicon glyphicon-trash" ></span> Delete</a> <?php } } ?> </td> </tr>
public function ajax_rest_with_list() { $org_id = @$_POST['org_id']; $register_data_id = @$_POST['register_data_id']; $rest_with_id = @$_POST['rest_with_id']; $rest_list = new Register_data(); $rest_list->where('org_id = ' . $org_id); if ($register_data_id > 0) { $rest_list->where(' id <> ' . $register_data_id); } $select = '<select name="rest_with" class="form-control-other" style="padding-left:0px;">'; $select .= '<option value="null" selected="selected">ไม่ระบุ</option>'; $select .= $rest_with_id == '0' ? '<option value="0" selected="selected">พักคนเดียว</option>' : '<option value="0">พักคนเดียว</option>'; foreach ($rest_list as $key => $value) { $checked = $value->id == $rest_with_id ? 'checked="checked"' : ''; $select .= '<option value="' . $value->id . '" ' . $selected . '>' . $value->titulation->titulation_title . $value->firstname . ' ' . $value->lastname . '</option>'; } $select .= '</select>'; echo $select; }