Changeset 87
- Timestamp:
- 07/13/07 17:08:55 (1 year ago)
- Files:
-
- branch/controllers/events_controller.php (modified) (2 diffs)
- branch/controllers/venues_controller.php (modified) (2 diffs)
- branch/db.sql (modified) (18 diffs)
- branch/views/events/admin_edit.ctp (modified) (1 diff)
- branch/views/layouts/default.ctp (modified) (2 diffs)
- branch/views/venues/add.ctp (added)
- branch/views/venues/admin_add.ctp (modified) (1 diff)
- branch/views/venues/admin_edit.ctp (modified) (1 diff)
- branch/views/venues/admin_index.ctp (modified) (1 diff)
- branch/views/venues/admin_view.ctp (modified) (1 diff)
- branch/views/venues/edit.ctp (added)
- branch/views/venues/index.ctp (added)
- branch/views/venues/view.ctp (added)
- branch/webroot/js/jquery.gmapp.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branch/controllers/events_controller.php
r85 r87 29 29 } 30 30 } 31 $tags = $this->Event->Tag->generateList(); 32 $venues = $this->Event->Venue->generateList(); 31 $venues = $this->Event->Venue->generateList(null, 'name ASC'); 33 32 $eventTypes = $this->Event->EventType->generateList(); 34 33 $users = $this->Event->User->generateList(); … … 98 97 } 99 98 } 100 $tags = $this->Event->Tag->generateList(); 101 $venues = $this->Event->Venue->generateList(); 99 $venues = $this->Event->Venue->generateList(null, 'name ASC'); 102 100 $eventTypes = $this->Event->EventType->generateList(); 103 101 $users = $this->Event->User->generateList(); 104 102 $subjects = $this->Event->Subject->generateList(); 105 $this->set(compact(' tags', 'venues', 'eventTypes', 'users', 'subjects'));103 $this->set(compact('venues', 'eventTypes', 'users', 'subjects')); 106 104 } 107 105 branch/controllers/venues_controller.php
r84 r87 1 1 <?php 2 class VenuesController extends AppController 3 { 4 //var $scaffold; 2 class VenuesController extends AppController { 3 5 4 var $name = 'Venues'; 6 var $helpers = array('Html', 'Form', 'Ajax', 'Javascript','GoogleMap' ); 5 var $helpers = array('Html', 'Form' ); 6 7 function index() { 8 $this->Venue->recursive = 0; 9 $this->set('venues', $this->paginate()); 10 } 11 12 function view($id = null) { 13 if (!$id) { 14 $this->Session->setFlash('Invalid Venue.'); 15 $this->redirect(array('action'=>'index'), null, true); 16 } 17 $this->set('venue', $this->Venue->read(null, $id)); 18 } 19 20 function add() { 21 if (!empty($this->data)) { 22 $this->cleanUpFields(); 23 $this->Venue->create(); 24 if ($this->Venue->save($this->data)) { 25 $this->Session->setFlash('The Venue has been saved'); 26 $this->redirect(array('action'=>'index'), null, true); 27 } else { 28 $this->Session->setFlash('The Venue could not be saved. Please, try again.'); 29 } 30 } 31 } 32 33 function edit($id = null) { 34 if (!$id && empty($this->data)) { 35 $this->Session->setFlash('Invalid Venue'); 36 $this->redirect(array('action'=>'index'), null, true); 37 } 38 if (!empty($this->data)) { 39 $this->cleanUpFields(); 40 if ($this->Venue->save($this->data)) { 41 $this->Session->setFlash('The Venue saved'); 42 $this->redirect(array('action'=>'index'), null, true); 43 } else { 44 $this->Session->setFlash('The Venue could not be saved. Please, try again.'); 45 } 46 } 47 if (empty($this->data)) { 48 $this->data = $this->Venue->read(null, $id); 49 } 50 } 51 52 function delete($id = null) { 53 if (!$id) { 54 $this->Session->setFlash('Invalid id for Venue'); 55 $this->redirect(array('action'=>'index'), null, true); 56 } 57 if ($this->Venue->del($id)) { 58 $this->Session->setFlash('Venue #'.$id.' deleted'); 59 $this->redirect(array('action'=>'index'), null, true); 60 } 61 } 62 7 63 8 64 function admin_index() { … … 24 80 $avg_lon = $avg_lon/$count; 25 81 $this->set('default', $avg_lat . "," . $avg_lon); 26 $this->set('points', $points); 82 $this->set('venues', $this->paginate()); 83 } 84 85 function admin_view($id = null) { 86 if (!$id) { 87 $this->Session->setFlash('Invalid Venue.'); 88 $this->redirect(array('action'=>'index'), null, true); 89 } 90 $this->set('venue', $this->Venue->read(null, $id)); 27 91 } 28 92 29 93 function admin_add() { 30 if(empty($this->data)) { 31 $this->render(); 32 } else { 33 $this->cleanUpFields(); 34 if($this->Venue->save($this->data)) { 94 if (!empty($this->data)) { 95 $this->cleanUpFields(); 96 $this->Venue->create(); 97 if ($this->Venue->save($this->data)) { 35 98 $this->Session->setFlash('The Venue has been saved'); 36 $this->redirect( '/venues/index');99 $this->redirect(array('action'=>'index'), null, true); 37 100 } else { 38 $this->Session->setFlash(' Please correct errors below.');101 $this->Session->setFlash('The Venue could not be saved. Please, try again.'); 39 102 } 40 103 } 41 104 } 42 105 43 function admin_edit($id) { 44 if(empty($this->data)) { 106 function admin_edit($id = null) { 107 if (!$id && empty($this->data)) { 108 $this->Session->setFlash('Invalid Venue'); 109 $this->redirect(array('action'=>'index'), null, true); 110 } 111 if (!empty($this->data)) { 112 $this->cleanUpFields(); 113 if ($this->Venue->save($this->data)) { 114 $this->Session->setFlash('The Venue saved'); 115 $this->redirect(array('action'=>'index'), null, true); 116 } else { 117 $this->Session->setFlash('The Venue could not be saved. Please, try again.'); 118 } 119 } 120 if (empty($this->data)) { 45 121 $this->data = $this->Venue->read(null, $id); 46 } else {47 $this->cleanUpFields();48 49 $address = $this->data;50 unset(51 $this->data['name'],$this->data['description'],52 $this->data['latitude'], $this->data['longitude'],53 $this->data['zoom']54 );55 vendor('googlegeo');56 $googleGeo = new GoogleGeo($address);57 $geo = $googleGeo->geo();58 $this->data = array_merge($this->data,$geo);59 60 if($this->Venue->save($this->data)) {61 $this->Session->setFlash('The Venue has been saved');62 $this->redirect('/venues/index');63 } else {64 $this->Session->setFlash('Please correct errors below.');65 }66 122 } 67 123 } 68 124 69 function admin_view($id) { 70 $this->layout = "map"; 71 $this->set('point', $this->Venue->read(null, $id)); 72 } 73 74 function admin_delete($id) { 75 if($this->Venue->del($id)) { 76 $this->Session->setFlash('The Venue deleted: id '.$id.''); 77 $this->redirect('/venues/index'); 125 function admin_delete($id = null) { 126 if (!$id) { 127 $this->Session->setFlash('Invalid id for Venue'); 128 $this->redirect(array('action'=>'index'), null, true); 78 129 } 79 } 80 81 function venuesjson() 82 { 83 $this->layout = "ajax"; 84 $this->Venue->recursive = 0; 85 $this->set('points', $this->Venue->findAll()); 130 if ($this->Venue->del($id)) { 131 $this->Session->setFlash('Venue #'.$id.' deleted'); 132 $this->redirect(array('action'=>'index'), null, true); 133 } 86 134 } 87 135 branch/db.sql
r79 r87 4 4 -- 5 5 -- Host: localhost 6 -- Generation Time: Jul 06, 2007 at 03:29PM6 -- Generation Time: Jul 13, 2007 at 06:06 PM 7 7 -- Server version: 5.0.38 8 8 -- PHP Version: 5.2.1 … … 436 436 `event_time` time default NULL, 437 437 `event_url` varchar(255) default NULL, 438 `event_ticket1` varchar(255) default NULL, 439 `event_ticket2` varchar(255) default NULL, 440 `event_price` varchar(255) NOT NULL, 438 441 `body` text, 439 442 `tags` varchar(255) NOT NULL, … … 444 447 `modified` datetime NOT NULL, 445 448 PRIMARY KEY (`id`) 446 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;449 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; 447 450 448 451 -- 449 452 -- Dumping data for table `events` 450 453 -- 454 455 INSERT INTO `events` (`id`, `venue_id`, `event_type_id`, `event_date`, `event_time`, `event_url`, `event_ticket1`, `event_ticket2`, `event_price`, `body`, `tags`, `user_id`, `subject_id`, `published`, `created`, `modified`) VALUES 456 (1, 3, 3, '2007-07-08', '11:55:00', 'http://www.tinthepark.com', NULL, NULL, '', 'The Hedrons will be on the King Tut''s Stage', 'The Hedrons, T In The Park, Summer Festivals, Festival, King Tuts', 0, 2, 1, '2007-07-06 16:21:10', '2007-07-06 16:21:10'), 457 (2, 1, 1, '2007-07-20', '20:00:00', 'http://www.kingtuts.com', NULL, NULL, '', 'King Tuts', 'The Hedrons', 0, 2, 1, '2007-07-12 14:05:45', '2007-07-12 14:05:45'), 458 (3, 8, 1, '2007-07-31', '20:00:00', 'http://www.metro.com', NULL, NULL, '', NULL, 'The Hedrons, London', 0, 2, 1, '2007-07-12 14:48:18', '2007-07-12 14:48:18'); 451 459 452 460 -- -------------------------------------------------------- … … 467 475 -- 468 476 477 INSERT INTO `events_tags` (`event_id`, `tag_id`) VALUES 478 (1, 1), 479 (1, 2), 480 (1, 3), 481 (1, 4), 482 (1, 5), 483 (2, 1), 484 (3, 1), 485 (3, 6); 486 469 487 -- -------------------------------------------------------- 470 488 … … 483 501 `modified` datetime NOT NULL, 484 502 PRIMARY KEY (`id`) 485 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;503 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 486 504 487 505 -- … … 508 526 `modified` datetime NOT NULL, 509 527 PRIMARY KEY (`id`) 510 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;528 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 511 529 512 530 -- … … 628 646 `modified` datetime default NULL, 629 647 PRIMARY KEY (`id`) 630 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;648 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 631 649 632 650 -- … … 693 711 `modified` datetime NOT NULL, 694 712 PRIMARY KEY (`id`) 695 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 2;713 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=44 ; 696 714 697 715 -- … … 740 758 (39, 'Manage Playlists', '/admin/playlists/', 31, NULL, 29, 1, 900, 1, '2007-06-04 22:55:27', '2007-06-04 22:55:27'), 741 759 (40, 'Add Playlist', '/admin/playlists/add', 32, NULL, 39, 1, 900, 1, '2007-06-04 22:56:09', '2007-06-04 22:56:09'), 742 (41, 'Manage Tags', '/admin/tags', 1, NULL, 35, 1, 900, 1, '2007-06-20 16:02:08', '2007-06-20 16:02:08'); 760 (41, 'Manage Tags', '/admin/tags', 1, NULL, 35, 1, 900, 1, '2007-06-20 16:02:08', '2007-06-20 16:02:08'), 761 (42, 'Manage Venues', '/admin/venues/', 3, NULL, 30, 1, 900, 1, '2007-07-06 15:48:34', '2007-07-06 15:48:34'), 762 (43, 'Add Venue', '/admin/venues/add', 0, NULL, 42, 1, 900, 1, '2007-07-06 15:49:05', '2007-07-06 15:49:05'); 743 763 744 764 -- -------------------------------------------------------- … … 763 783 `modified` datetime NOT NULL, 764 784 PRIMARY KEY (`id`) 765 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;785 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 766 786 767 787 -- … … 832 852 `comments` varchar(255) collate utf8_unicode_ci NOT NULL, 833 853 PRIMARY KEY (`id`) 834 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;854 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; 835 855 836 856 -- … … 881 901 `modified` datetime default NULL, 882 902 PRIMARY KEY (`id`) 883 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;903 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 884 904 885 905 -- 886 906 -- Dumping data for table `posts` 887 907 -- 908 888 909 889 910 -- -------------------------------------------------------- … … 903 924 -- Dumping data for table `posts_tags` 904 925 -- 926 905 927 906 928 -- -------------------------------------------------------- … … 921 943 `modified` datetime NOT NULL, 922 944 PRIMARY KEY (`id`) 923 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;945 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 924 946 925 947 -- … … 1063 1085 INSERT INTO `subjects` (`id`, `title`, `posts_count`, `pages_count`, `events_count`, `feeds_count`, `images_count`, `galleries_count`, `videos_count`, `created`, `modified`) VALUES 1064 1086 (1, 'Uncatagorised', 1, 0, 2, 0, 0, 0, 0, '2007-05-01 17:05:55', '2007-05-01 17:05:55'), 1065 (2, 'The Hedrons', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2007-07-06 14:33:59', '2007-07-06 14:33:59'),1087 (2, 'The Hedrons', NULL, NULL, 3, NULL, NULL, NULL, NULL, '2007-07-06 14:33:59', '2007-07-06 14:33:59'), 1066 1088 (3, 'Wet Wet Wet', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2007-07-06 14:34:09', '2007-07-06 14:34:09'); 1067 1089 … … 1077 1099 `tag` varchar(255) collate utf8_unicode_ci NOT NULL, 1078 1100 PRIMARY KEY (`id`) 1079 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;1101 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ; 1080 1102 1081 1103 -- 1082 1104 -- Dumping data for table `tags` 1083 1105 -- 1106 1107 INSERT INTO `tags` (`id`, `tag`) VALUES 1108 (1, 'The Hedrons'), 1109 (2, 'T In The Park'), 1110 (3, 'Summer Festivals'), 1111 (4, 'Festival'), 1112 (5, 'King Tuts'), 1113 (6, 'London'); 1084 1114 1085 1115 -- -------------------------------------------------------- … … 1234 1264 `id` int(8) NOT NULL auto_increment, 1235 1265 `name` varchar(255) collate utf8_unicode_ci NOT NULL, 1236 `description` text collate utf8_unicode_ci NOT NULL,1237 `street` varchar(255) collate utf8_unicode_ci NOTNULL,1238 `city` varchar(255) collate utf8_unicode_ci NOTNULL,1266 `description` text collate utf8_unicode_ci, 1267 `street` varchar(255) collate utf8_unicode_ci default NULL, 1268 `city` varchar(255) collate utf8_unicode_ci default NULL, 1239 1269 `state` varchar(255) collate utf8_unicode_ci default NULL, 1240 `postcode` varchar(255) collate utf8_unicode_ci NOTNULL,1241 `latitude` floatNOT NULL,1242 `longitude` floatNOT NULL,1243 `zoom` int(11) NOT NULL ,1270 `postcode` varchar(255) collate utf8_unicode_ci default NULL, 1271 `latitude` decimal(20,15) NOT NULL, 1272 `longitude` decimal(20,15) NOT NULL, 1273 `zoom` int(11) NOT NULL default '12', 1244 1274 `created` datetime default NULL, 1245 1275 `modified` datetime default NULL, 1246 1276 PRIMARY KEY (`id`) 1247 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;1277 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=24 ; 1248 1278 1249 1279 -- 1250 1280 -- Dumping data for table `venues` 1251 1281 -- 1282 1283 INSERT INTO `venues` (`id`, `name`, `description`, `street`, `city`, `state`, `postcode`, `latitude`, `longitude`, `zoom`, `created`, `modified`) VALUES 1284 (1, 'King Tuts', 'King Tuts club in Glasgow', '272a St Vincent St', 'Glasgow', 'Glasgow', 'G2 5RL', 55.862529754638670, -4.265317916870117, 12, '2007-07-06 16:13:18', '2007-07-13 14:09:16'), 1285 (3, 'T In The Park', 'T In The park', 'Balado', 'Kinross', 'Fife', 'KY13', 56.207641601562500, -3.467989921569824, 12, '2007-07-06 16:18:55', '2007-07-13 14:09:31'), 1286 (9, 'Water Street Music Hall', 'Water Street Music Hall', '204 N. Water Street', 'Rochester', 'NY', '14604', 43.160435004700986, -77.611788511276250, 12, '2007-07-13 14:06:08', '2007-07-13 14:09:00'), 1287 (10, 'Nectar''s', 'Nectar''s', '188 Main St.', 'Burlington', 'VT', '05401', 44.475900338720756, -73.212525844573970, 12, '2007-07-13 14:23:07', '2007-07-13 14:23:07'), 1288 (11, 'Quebec City International Summer Fest', 'Quebec City International Summer Fest', NULL, 'Quebec', 'Quebec', NULL, 46.812984012678640, -71.228141784667970, 12, '2007-07-13 14:48:57', '2007-07-13 14:48:57'), 1289 (12, 'The Boat', 'The Boat', '158 Augusta Avenue', 'Toronto', 'ON', NULL, 43.653248574034730, -79.401519298553470, 12, '2007-07-13 14:51:50', '2007-07-13 14:51:50'), 1290 (13, 'The Legendary Horseshoe Tavern', 'The Legendary Horseshoe Tavern', '370 Queen Street West', 'Toronto', 'Ontario', 'M5V 2A2', 43.648823705297730, -79.395875930786130, 12, '2007-07-13 14:53:36', '2007-07-13 14:53:36'), 1291 (14, 'The Annex', 'The Annex on The Lower East Side', '150 Orchard St', 'New York', 'NY', NULL, 40.720591366423290, -73.988950252532960, 12, '2007-07-13 14:58:18', '2007-07-13 14:58:18'), 1292 (15, 'Great Scott', 'Great Scott', '1222 Commonwealth Ave', 'Allston, Boston', 'MA', '02134', 42.350226896549096, -71.130638122558600, 12, '2007-07-13 15:01:52', '2007-07-13 15:01:52'), 1293 (16, 'The State Theatre', 'The State Theatre', '220 N. Washington', 'Falls Church', 'VA', '22046-4517', 38.883224495209410, -77.169739007949830, 12, '2007-07-13 15:05:13', '2007-07-13 15:05:13'), 1294 (17, 'North Star Bar', 'North Star Bar', '2639 Poplar Street', 'Philadelphia', 'PA', '19130', 39.972811886948640, -75.180366039276120, 12, '2007-07-13 15:15:48', '2007-07-13 15:15:48'), 1295 (18, 'The Dame', 'The Dame', '156 West Main Street', 'Lexington', 'Kentucky', '40507', 38.046914549925850, -84.497625231742860, 12, '2007-07-13 15:43:18', '2007-07-13 15:48:17'), 1296 (19, 'Radio Radio', 'Radio Radio', '1119 E. Prospect Street', ' Indianapolis', 'IN', '46203', 39.752320727309480, -86.139442920684810, 12, '2007-07-13 15:58:48', '2007-07-13 15:58:48'), 1297 (20, 'Wicker Park Festival', 'Wicker Park Festival', 'N. Wicker Park Ave', 'Chicago', 'Il', NULL, 41.907658914284650, -87.676724195480350, 12, '2007-07-13 16:04:35', '2007-07-13 16:04:35'), 1298 (21, 'Metro', 'Metro', '3730 N. Clark St.', 'Chicago', 'IL', '60613', 41.949771967936680, -87.658581733703610, 12, '2007-07-13 16:08:32', '2007-07-13 16:08:32'), 1299 (22, 'Caird Hall', 'Caird Hall', 'City Square', 'Dundee', 'Angus', 'DD1 3BB', 56.465033295055020, -2.969806194305420, 12, '2007-07-13 16:18:12', '2007-07-13 16:18:12'), 1300 (23, 'Darvel Town Hall', 'Darvel Town Hall', NULL, 'Darvel', NULL, NULL, 55.609731000000000, -4.281818000000000, 12, '2007-07-13 16:32:58', '2007-07-13 16:32:58'); 1252 1301 1253 1302 -- -------------------------------------------------------- … … 1273 1322 `modified` datetime NOT NULL, 1274 1323 PRIMARY KEY (`id`) 1275 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;1324 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 1276 1325 1277 1326 -- 1278 1327 -- Dumping data for table `videos` 1279 1328 -- 1329 branch/views/events/admin_edit.ctp
r79 r87 1 1 <div class="event"> 2 <?php echo $form->create('Event');?>2 <?php echo $form->create('Event');?> 3 3 <fieldset> 4 4 <legend><?php __('Event Details');?></legend> branch/views/layouts/default.ctp
r85 r87 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"2 "http://www.w3.org/TR/html4/strict.dtd">3 <html >1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> 4 4 <head> 5 5 <title><?php echo $title_for_layout;?></title> 6 6 7 <?php echo $html->charset();?> 7 8 … … 16 17 <?php echo $html->css('../js/wymeditor/skins/default/screen');?> 17 18 <?php e($this->element('js_include'));?> 19 18 20 </head> 19 21 <body class="jamal"> branch/views/venues/admin_add.ctp
r83 r87 1 <h2>New Point</h2>2 1 <?php e($javascript->codeBlock('$j().ready(function(){$j("#gmap").gmapp();});'));?> 3 <div id="gmap" style="float:left;width:800px;height:400px;"></div>4 2 5 <div style="float:left;width:15%"> 6 <p> 7 Please enter the postcode or address of the point you want to add. 8 </p> 9 3 <div class="venue"> 4 5 <div id="gmap" style="width:99%; height: 400px;"></div> 10 6 <?php e($form->input('address'));?> 11 <?php e($form->submit('findaddress', array('id'=>'findaddress')));?> 12 13 <div id="gmapp-info"></div> 14 15 <?php e($form->create('Venue'));?> 16 17 <?php e($form->input('name'));?> 18 <?php e($form->input('description'));?> 19 <?php e($form->input('street'));?> 20 <?php e($form->input('city'));?> 21 <?php e($form->input('state'));?> 22 <?php e($form->input('postcode'));?> 23 <?php e($form->input('latitude'));?> 24 <?php e($form->input('longitude'));?> 25 <?php e($form->input('zoom'));?> 26 <?php e($form->submit());?> 27 28 <ul class="actions"> 29 <li><?php echo $html->link('List points', '/points/index')?></li> 30 </ul> 7 <?php e($form->submit('Find Address', array('id'=>'findaddress')));?> 8 9 <?php echo $form->create('Venue');?> 10 <fieldset> 11 <legend><?php __('Add');?> <?php __('Venue');?></legend> 12 <?php 13 echo $form->input('name'); 14 echo $form->input('description'); 15 echo $form->input('street'); 16 echo $form->input('city'); 17 echo $form->input('state'); 18 echo $form->input('postcode'); 19 echo $form->input('latitude'); 20 echo $form->input('longitude'); 21 echo $form->input('zoom'); 22 ?> 23 </fieldset> 24 <?php echo $form->end('Submit');?> 31 25 </div> 26 <div class="actions"> 27 <ul> 28 <li><?php echo $html->link(__('List', true).' '.__('Venues', true), array('action'=>'index'));?></li> 29 <li><?php echo $html->link(__('List', true).' '.__('Events', true), array('controller'=> 'events', 'action'=>'index')); ?> </li> 30 <li><?php echo $html->link(__('New', true).' '.__('Event', true), array('controller'=> 'events', 'action'=>'add')); ?> </li> 31 </ul> 32 </div> branch/views/venues/admin_edit.ctp
r79 r87 1 < h2>New Point</h2>1 <?php e($javascript->codeBlock('$j().ready(function(){$j("#gmap").gmapp();});'));?> 2 2 3 <div style="float:left;width:800px;"> 4 <?php 5 $default = array('type'=>'2','zoom'=>13,'lat'=>'55.868272','long'=>'-4.271121'); 6 echo $googleMap->map($default, $style = 'width:100%; height: 600px' ); 7 //if(isset($points)){ 8 echo $googleMap->addMarkers($points); 9 // } 3 <div class="venue"> 10 4 5 <div id="gmap" style="width:99%; height: 400px;"></div> 6 <?php e($form->input('address'));?> 7 <?php e($form->submit('Find Address', array('id'=>'findaddress')));?> 11 8 12 ?> 9 <?php echo $form->create('Venue');?> 10 <fieldset> 11 <legend><?php __('Edit');?> <?php __('Venue');?></legend> 12 <?php 13 echo $form->input('id'); 14 echo $form->input('name'); 15 echo $form->input('description'); 16 echo $form->input('street'); 17 echo $form->input('city'); 18 echo $form->input('state'); 19 echo $form->input('postcode'); 20 echo $form->input('latitude'); 21 echo $form->input('longitude'); 22 echo $form->input('zoom'); 23 ?> 24 </fieldset> 25 <?php echo $form->end('Submit');?> 13 26 </div> 14 15 <div style="float:left;width:15%"> 16 <p> 17 Please enter the postcode or address of the point you want to add. 18 </p> 19 20 21 22 <?php e($form->input('findaddress', array('label'=>'Enter Address or Postcode')));?> 23 <input type="submit" onclick="javascript:usePointFromPostcode(document.getElementById('Findaddress').value, setCenterToPoint)" value="Locate on Map"/> 24 <br /> 25 <input id="lat" /><input id="lng" /> 26 27 <?php e($form->create('Venue'));?> 28 <?php e($form->input('id'));?> 29 <?php e($form->input('name'));?> 30 <?php e($form->input('description'));?> 31 <?php e($form->input('street'));?> 32 <?php e($form->input('city'));?> 33 <?php e($form->input('state'));?> 34 <?php e($form->input('postcode'));?> 35 <?php e($form->input('zoom'));?> 36 <?php e($form->submit());?> 37 38 <ul class="actions"> 39 <li><?php echo $html->link('List points', '/points/index')?></li> 40 </ul> 27 <div class="actions"> 28 <ul> 29 <li><?php echo $html->link(__('Delete', true), array('action'=>'delete', $form->value('Venue.id')), null, __('Are you sure you want to delete', true).' #' . $form->value('Venue.id')); ?></li> 30 <li><?php echo $html->link(__('List', true).' '.__('Venues', true), array('action'=>'index'));?></li> 31 <li><?php echo $html->link(__('List', true).' '.__('Events', true), array('controller'=> 'events', 'action'=>'index')); ?> </li> 32 <li><?php echo $html->link(__('New', true).' '.__('Event', true), array('controller'=> 'events', 'action'=>'add')); ?> </li> 33 </ul> 41 34 </div> branch/views/venues/admin_index.ctp
r84 r87 1 < h2>List Venues</h2>1 <?php e($javascript->codeBlock('$j().ready(function(){$j("#gmap").gmapp({center: ['. $default .'], zoom: 2});});'));?> 2 2 3 <?php e($javascript->codeBlock('$j().ready(function(){$j("#gmap").gmapp(); $j("#gmap")[0].GMap2.setCenter(new GLatLng(' . $default . '), 2)});'));?> 3 <div class="venues"> 4 <h2><?php __('Venues');?></h2> 4 5 5 <div id="gmap" style=" float:left;width:800px;height:400px;"></div>6 <div id="gmap" style="width:99%; height: 400px;"></div> 6 7 7 <div style="float:left;width:15%">8 <span style="font-size:12pt;font-weight:bold;background:#239855;"><?php echo $html->link('Create A New Venue', '/points/add'); ?></span>9 8 <table cellpadding="0" cellspacing="0"> 10 9 <tr> 11 <th>Name</th> 12 <th>City</th> 13 <th>State</th> 10 <th><?php echo $paginator->sort('id');?></th> 11 <th><?php echo $paginator->sort('name');?></th> 12 <th><?php echo $paginator->sort('description');?></th> 13 <th><?php echo $paginator->sort('street');?></th> 14 <th><?php echo $paginator->sort('city');?></th> 15 <th><?php echo $paginator->sort('state');?></th> 16 <th><?php echo $paginator->sort('postcode');?></th> 17 <th><?php echo $paginator->sort('latitude');?></th> 18 <th><?php echo $paginator->sort('longitude');?></th> 19 <th><?php echo $paginator->sort('zoom');?></th> 20 <th><?php echo $paginator->sort('created');?></th> 21 <th><?php echo $paginator->sort('modified');?></th> 22 <th class="actions"><?php __('Actions');?></th> 14 23 </tr> 15 <?php foreach ($points as $point): ?> 16 <tr> 17 <td><?php echo $point['Venue']['name'] ?></td> 18 <td><?php echo $point['Venue']['city'] ?></td> 19 <td><?php echo $point['Venue']['state'] ?></td> 20 </tr> 24 <?php 25 $i = 0; 26 foreach ($venues as $venue): 27 28 e($javascript->codeBlock('$j().ready(function(){$("#gmap").addPoint("' . $venue['Venue']['latitude'] . '","' . $venue['Venue']['longitude'] . '","' . $venue['Venue']['name'] . '<br />' . $venue['Venue']['street'] . '<br />' . $venue['Venue']['city'] . ',' . $venue['Venue']['postcode'] . '");});')); 29 30 $class = null; 31 if ($i++ % 2 == 0) { 32 $class = ' class="altrow"'; 33 } 34 ?> 35 <tr<?php echo $class;?>> 36 <td> 37 <?php echo $venue['Venue']['id']?> 38 </td> 39 <td> 40 <?php echo $venue['Venue']['name']?> 41 </td> 42 <td> 43 <?php echo $venue['Venue']['description']?> 44 </td> 45 <td> 46 <?php echo $venue['Venue']['street']?> 47 </td> 48 <td> 49 <?php echo $venue['Venue']['city']?> 50 </td> 51 <td> 52 <?php echo $venue['Venue']['state']?> 53 </td> 54 <td> 55 <?php echo $venue['Venue']['postcode']?> 56 </td> 57 <td> 58 <?php echo $venue['Venue']['latitude']?> 59 </td> 60 <td> 61 <?php echo $venue['Venue']['longitude']?> 62 </td> 63 <td> 64 <?php echo $venue['Venue']['zoom']?> 65 </td> 66 <td> 67 <?php echo $venue['Venue']['created']?> 68 </td> 69 <td> 70 <?php echo $venue['Venue']['modified']?> 71 </td> 72 <td class="actions"> 73 <?php echo $html->link(__('View', true), array('action'=>'view', $venue['Venue']['id'])); ?> 74 <?php echo $html->link(__('Edit', true), array('action'=>'edit', $venue['Venue']['id'])); ?> 75 <?php echo $html->link(__('Delete', true), array('action'=>'delete', $venue['Venue']['id']), null, __('Are you sure you want to delete', true).' #' . $venue['Venue']['id']); ?> 76 </td> 77 </tr> 21 78 <?php endforeach; ?> 22 79 </table> 23 80 </div> 81 <div class="paging"> 82 <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> 83 | <?php echo $paginator->numbers();?> 84 <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?> 85 </div> 86 <div class="actions"> 87 <ul> 88 <li><?php echo $html->link(__('New', true).' '.__('Venue', true), array('action'=>'add')); ?></li> 89 <li><?php echo $html->link(__('List', true).' '.__('Events', true), array('controller'=> 'events', 'action'=>'index')); ?> </li> 90 <li><?php echo $html->link(__('New', true).' '.__('Event', true), array('controller'=> 'events', 'action'=>'add')); ?> </li> 91 </ul> 92 </div> branch/views/venues/admin_view.ctp
r79 r87 1 <h2>View Venues</h2> 2 <div style="float:left;width:80%;"> 3 <?php 4 $default = array('type'=>'2','zoom'=>$point['Venue']['zoom'],'lat'=>$point['Venue']['latitude'],'long'=>$point['Venue']['longitude']); 5 $draw[0]['Venue']['latitude'] = $point['Venue']['latitude']; 6 $draw[0]['Venue']['longitude'] = $point['Venue']['longitude']; 7 $draw[0]['Venue']['title'] = $point['Venue']['name']; 8 $draw[0]['Venue']['html'] = $point['Venue']['street'] . ",<br />" . $point['Venue']['city'] . ",<br />" . $point['Venue']['postcode']; 1 <?php e($javascript->codeBlock('$j().ready(function(){$j("#gmap").gmapp({center: ['. $venue['Venue']['latitude'] .','. $venue['Venue']['longitude'] .']});});'));?> 2 <?php e($javascript->codeBlock('$j().ready(function(){$("#gmap").addPoint("' . $venue['Venue']['latitude'] . '","' . $venue['Venue']['longitude'] . '","' . $venue['Venue']['name'] . '<br />' . $venue['Venue']['street'] . '<br />' . $venue['Venue']['city'] . ',' . $venue['Venue']['postcode'] . '");});'));?> 9 3 4 <div id="gmap" style="width:50%; height: 400px;float:left;"></div> 10 5 11 echo $googleMap->map($default, $style = 'width:100%; height: 800px' ); 12 //if(isset($points)){ 13 echo $googleMap->addMarkers($draw); 14 // } 15 ?> 6 <div class="venue" style="float:left;width:50%"> 7 <h2><?php __('Venue');?></h2> 8 <dl> 9 <dt class="altrow">Id</dt> 10 <dd class="altrow"> 11 <?php echo $venue['Venue']['id']?> 12 13 </dd> 14 <dt>Name</dt> 15 <dd> 16 <?php echo $venue['Venue']['name']?> 17 18 </dd> 19 <dt class="altrow">Description</dt> 20 <dd class="altrow"> 21 <?php echo $venue['Venue']['description']?> 22 23 </dd> 24 <dt>Street</dt> 25 <dd> 26 <?php echo $venue['Venue']['street']?> 27 28 </dd> 29 <dt class="altrow">City</dt> 30 <dd class="altrow"> 31 <?php echo $venue['Venue']['city']?> 32 33 </dd> 34 <dt>State</dt> 35 <dd> 36 <?php echo $venue['Venue']['state']?> 37 38 </dd> 39 <dt class="altrow">Postcode</dt> 40 <dd class="altrow"> 41 <?php echo $venue['Venue']['postcode']?> 42 43 </dd> 44 <dt>Latitude</dt> 45 <dd> 46 <?php echo $venue['Venue']['latitude']?> 47 48 </dd> 49 <dt class="altrow">Longitude</dt> 50 <dd class="altrow"> 51 <?php echo $venue['Venue']['longitude']?> 52 53 </dd> 54 <dt>Zoom</dt> 55 <dd> 56 <?php echo $venue['Venue']['zoom']?> 57 58 </dd> 59 <dt class="altrow">Created</dt> 60 <dd class="altrow"> 61 <?php echo $venue['Venue']['created']?> 62 63 </dd> 64 <dt>Modified</dt> 65 <dd> 66 <?php echo $venue['Venue']['modified']?> 67 68 </dd> 69 </dl> 16 70 </div> 71 <div class="actions"> 72 <ul> 73 <li><?php echo $html->link(__('Edit', true).' '.__('Venue', true), array('action'=>'edit', $venue['Venue']['id'])); ?> </li> 74 <li><?php echo $html->link(__('Delete', true).' '.__('Venue', true), array('action'=>'delete', $venue['Venue']['id']), null, __('Are you sure you want to delete', true).' #' . $venue['Venue']['id'] . '?'); ?> </li> 75 <li><?php echo $html->link(__('List', true).' '.__('Venues', true), array('action'=>'index')); ?> </li> 76 <li><?php echo $html->link(__('New', true).' '.__('Venue', true), array('action'=>'add')); ?> </li> 77 <li><?php echo $html->link(__('List', true).' '.__('Events', true), array('controller'=> 'events', 'action'=>'index')); ?> </li> 78 <li><?php echo $html->link(__('New', true).' '.__('Event', true), array('controller'=> 'events', 'action'=>'add')); ?> </li> 79 </ul> 80 </div> 81 <div class="related"> 82 <h3><?php __('Related');?> <?php __('Events');?></h3> 83 <?php if (!empty($venue['Event'])):?> 84 <table cellpadding = "0" cellspacing = "0"> 85 <tr> 86 <th>Id</th> 87 <th>Venue Id</th> 88 <th>Event Type Id</th> 89 <th>Event Date</th> 90 <th>Event Time</th> 91 <th>Event Url</th> 92 <th>Event Ticket1</th> 93 <th>Event Ticket2</th> 94 <th>Event Price</th> 95 <th>Body</th> 96 <th>Tags</th> 97 <th>User Id</th> 98 <th>Subject Id</th> 99 <th>Published</th> 100 <th>Created</th> 101 <th>Modified</th> 102 <th class="actions"><?php __('Actions');?></th> 103 </tr> 104 <?php 105 $i = 0; 106 foreach ($venue['Event'] as $event): 107 $class = null; 108 if ($i++ % 2 == 0) { 109 $class = ' class="altrow"'; 110 } 111 ?> 112 <tr<?php echo $class;?>> 113 <td><?php echo $event['id'];?></td> 114 <td><?php echo $event['venue_id'];?></td> 115 <td><?php echo $event['event_type_id'];?></td> 116 <td><?php echo $event['event_date'];?></td> 117 <td><?php echo $event['event_time'];?></td> 118 <td><?php echo $event['event_url'];?></td> 119 <td><?php echo $event['event_ticket1'];?></td> 120 <td><?php echo $event['event_ticket2'];?></td> 121 <td><?php echo $event['event_price'];?></td> 122 <td><?php echo $event['body'];?></td> 123