//$golf_course_cards = $golf_course_cards[0]; $golf_course_id = get_input('golf_course_id'); $hole = get_input('hole'); $tee = get_input('tee'); $golf_score_id = get_input('golf_score_id'); //Test //$golf_course_id = 1; //$hole = 1; //$tee = 'gold'; $score = elgg_get_golf_score(array('golf_course_id' => $golf_course_id)); $score = $score[0]; $golf_course_cards = elgg_get_golf_course_card(array('golf_course_id' => $golf_course_id, 'hole' => $hole)); $golf_course_card = $golf_course_cards[0]; $golf_course_card_id = $golf_course_card->golf_course_card_id; $map = $golf_course_card->map; $attrs = getTeeAttributes($tee ? $tee : 'gold', $golf_course_card); $tee_x = $attrs['tee_x'] ? $attrs['tee_x'] : 466; $tee_y = $attrs['tee_y'] ? $attrs['tee_y'] : 135; $hole_x = $golf_course_card->hole_x ? $golf_course_card->hole_x : 51; $hole_y = $golf_course_card->hole_y ? $golf_course_card->hole_y : 138; $distance = $attrs['distance'] ? $attrs['distance'] : 396; $fname = explode('.', $map); ?> <div id="map"> <canvas id="myCanvas" width="380" height="570" style="position: absolute;top:0;left:0; z-index: 10"></canvas> <img src="<?php echo elgg_get_site_url(); ?> _graphics/hole/<?php echo $map; ?>
<script type="text/javascript" src="http://localhost:8090/mdg-social-elgg/vendors/jquery/jquery-ui-1.8.16.min.js"></script> <script type="text/javascript" src="http://localhost:8090/mdg-social-elgg/js/elgg.0.js?view=default"></script> <script type="text/javascript" src="http://localhost:8090/mdg-social-elgg/mod/igolf_map/js/map.js"></script> <?php $golf_course_id = get_input('golf_course_id'); $hole = get_input('hole'); $tee = get_input('tee'); //Test $golf_course_id = 1; $hole = 1; $tee = 'gold'; $cards = elgg_get_golf_course_card(array('golf_course_id' => $golf_course_id, 'hole' => $hole)); $card = $cards[0]; $golf_course_card_id = $card->golf_course_card_id; $map = $card->map; $attrs = getTeeAttributes($tee, $card); $tee_x = $attrs['tee_x'] ? $attrs['tee_x'] : 0; $tee_y = $attrs['tee_y'] ? $attrs['tee_y'] : 0; $hole_x = $attrs['hole_x'] ? $attrs['hole_x'] : 98; $hole_y = $attrs['hole_y'] ? $attrs['hole_y'] : 884; $distance = $attrs['distance'] ? $attrs['distance'] : 400; ?> <div id="map"> <img src="<?php echo elgg_get_site_url(); ?> mod/igolf_map/graphics/<?php echo $map; ?> " />