function getVideographTpl($array, $count, $prize = 0) { if (!empty($array)) { foreach ($array as $key => $value) { $count++; $id = $value['id']; $path = $value['path']; $avatar = getAvatar($value['id'], 4); $skip_id = ''; if (!empty($prize)) { $medal = 'info-kind-avatar--medal info-kind-avatar--medal-video'; $skip_id = 'data-skip="' . $prize . '"'; } $html .= ' <div class="info-kind artist-block" data-id="' . $count . '" id="pht-' . $id . '" ' . $skip_id . '> ' . $path . ' <div class="info-kind-avatar ' . $medal . '" > <img class="info-kind-avatar" width="213px" height="216px" src="img/vidgraphers/' . $value['avatar'] . '" alt=""> </div> <section class="additional-info"> <header class="clearfix"> <div class="info-main"> <h4>' . $value['name'] . '</h4> <h5>цена от ' . $value['price'] . ' рублей</h5> </div> <div class="info-contacts"> <h4>+' . $value['phone'] . '</h4> '; if (!empty($value['site'])) { $html .= '<a class="info-link" href="' . $value['site'] . '" target="_blank">сайт</a>'; } if (!empty($value['vkpage'])) { $html .= '<a class="info-vk-link" href="' . $value['vkpage'] . '" target="_blank">вконтакте</a>'; } $html .= ' </div> </header> <p class="info-desc">' . $value['desc'] . '</p> <div class="add-info-thumbs">'; $html .= ' ' . getVideoList($value['id']) . '</div>'; $html .= ' </div> '; // //return PreArray($arr_artists); } } return $html; }
<?php include_once '../functions.php'; $id = varr_int($_POST['id']); $videos = getVideoList($id); echo json_encode($videos);