aquababies is an open source project powered by Assembla

Assembla offers free public and private SVN/Git repositories and project hosting with bug/issue tracking and collaboration tools.

aquababies

Commit 17

User picture
  • Author: 1985mars
  • 2011-01-05 01:20 (over 3 years ago)

[Web] New booking demo unit

Files Affected

 
1617
221
Account details:
221
Account details:
222
mBIZNES 33 1140 2004 0000 3202 7049 1737
222
mBIZNES 33 1140 2004 0000 3202 7049 1737
223
]]></text1>
223
]]></text1>
224
        <name_copy>Name:</name_copy>
224
        <first_name>first_name</first_name>
225
        <name_input_default>Type your name here</name_input_default>
225
        <first_name_default>first_name_default</first_name_default>
226
        <email_phone>Email/Telephone:</email_phone>
226
        <second_name>second_name</second_name>
227
        <email_phone_input_default>Type your email or telephone</email_phone_input_default>
227
        <second_name_default>second_name_default</second_name_default>
228
        <venue_course>Venue and course:</venue_course>
228
        <babys_name>babys_name</babys_name>
229
        <drop_down_default_copy>Click here to select course</drop_down_default_copy>
229
        <babys_name_default>babys_name_default</babys_name_default>
 
 
230
        <babys_bdate>babys_bdate</babys_bdate>
 
 
231
        <babys_bdate_default>babys_bdate_default</babys_bdate_default>
 
 
232
        <babys_sex>babys_sex</babys_sex>
 
 
233
        <babys_sex_default>babys_sex_default</babys_sex_default>
 
 
234
        <medical_info>medical_info</medical_info>
 
 
235
        <medical_info_default>medical_info_default</medical_info_default>
 
 
236
        <email>email</email>
 
 
237
        <email_default>email</email_default>
 
 
238
        <telephone>telephone</telephone>
 
 
239
        <telephone_default>telephone_default</telephone_default>
 
 
240
        
230
        <transfer_copy>Amount:</transfer_copy>
241
        <transfer_copy>Amount:</transfer_copy>
231
    </copy>
242
    </copy>
232
    <copy id ='0'>
243
    <copy id ='0'>
...
 
...
 
233
        <name>booking_step_copy</name>
244
        <name>booking_step_copy</name>
234
        <text>Step</text>
245
        <text>Step</text>
235
    </copy>
246
    </copy>
 
 
247
    <copy id ='0'>
 
 
248
        <name>booking_total_textfield</name>
 
 
249
        <text0>You have got [order] item in your basket for total price of [price]zl</text0>
 
 
250
        <text1>You have got [order] items in your basket for total price of [price]zl</text1>
 
 
251
    </copy>
236
</data>
252
</data>
1617
141
        <drop_down_default_copy>Naciśnij tutaj aby wybrać kurs</drop_down_default_copy> 
141
        <drop_down_default_copy>Naciśnij tutaj aby wybrać kurs</drop_down_default_copy> 
142
        <transfer_copy>Na kwotę:</transfer_copy> 
142
        <transfer_copy>Na kwotę:</transfer_copy> 
143
    </copy> 
143
    </copy> 
 
 
144
    <copy id ='0'>
 
 
145
        <name>booking_step_copy</name>
 
 
146
        <text>Krok</text>
 
 
147
    </copy>
 
 
148
    <copy id ='0'>
 
 
149
        <name>booking_total_textfield</name>
 
 
150
        <text0>Masz [order] rzecz w koszyku na kwote [price]zl</text0>
 
 
151
        <text1>Masz [order] rzeczy w koszyku na kwote [price]zl</text1>
 
 
152
    </copy>
144
</data> 
153
</data> 
1617
25
        public static var REGION:String = 'en';
25
        public static var REGION:String = 'en';
26
 
26
 
27
        public const PROJECT_NAME:String = 'aquababies_website';
27
        public const PROJECT_NAME:String = 'aquababies_website';
28
<<<<<<< .mine
 
 
29
        public const VERSION:Number = 0.3;
 
 
30
        public static var FOLDER_PATH:String = '';
 
 
31
=======
 
 
32
        public const VERSION:Number = 0.2;
28
        public const VERSION:Number = 0.2;
33
        public static var FOLDER_PATH:String = '';
29
        public static var FOLDER_PATH:String = '';
34
>>>>>>> .r15
 
 
35
        public var FOLDER_PATH:String = '';
30
        public var FOLDER_PATH:String = '';
36
        public static var DEBUG_MODE:Boolean = true;
31
        public static var DEBUG_MODE:Boolean = true;
37
        public var DEBUG_MODE:Boolean = true;
32
        public var DEBUG_MODE:Boolean = true;
1617
75
            _msk.graphics.endFill();
75
            _msk.graphics.endFill();
76
            main_frame_holder.addChild(_msk);
76
            main_frame_holder.addChild(_msk);
77
 
77
 
78
            MonsterDebugger.trace(this,'main_frame_holder.width '+main_frame_holder.width+ ' :: '+main_frame_holder.height);
 
 
79
            
 
 
80
            _msk.x = 6;
78
            _msk.x = 6;
81
            _msk.y = 6;
79
            _msk.y = 6;
82
 
80
 
...
 
...
 
86
        }
84
        }
87
 
85
 
88
        public function load_main_frame(_url:String) : void {
86
        public function load_main_frame(_url:String) : void {
89
            MonsterDebugger.trace(this, _url);
 
 
90
            if(_image_holder.numChildren>1){
87
            if(_image_holder.numChildren>1){
91
                if(_image_holder.getChildAt(_image_holder.numChildren-1) is video_player_cmp){
88
                if(_image_holder.getChildAt(_image_holder.numChildren-1) is video_player_cmp){
92
                    video_player_cmp(_image_holder.getChildAt(_image_holder.numChildren-1)).stop_video();
89
                    video_player_cmp(_image_holder.getChildAt(_image_holder.numChildren-1)).stop_video();
1617
16
            this.info_arr = info_arr;
16
            this.info_arr = info_arr;
17
            this._mdl = _mdl;
17
            this._mdl = _mdl;
18
            for (var i:int = 0; i < info_arr.length; i++){
18
            for (var i:int = 0; i < info_arr.length; i++){
19
                var bbookgrid:bBookGridItem = new bBookGridItem(info_arr[i]);
19
                var bbookgrid:bLocationTableItem = new bLocationTableItem(info_arr[i]);
20
                bbookgrid.y = i * 80;
20
                bbookgrid.y = i * 80;
21
                addChild(bbookgrid);
21
                addChild(bbookgrid);
22
            }
22
            }
 
 
23
 
 
 
24
 
23
        }
25
        }
24
        public function destroy():void {
26
        public function destroy():void {
25
 
27
 
Show contents
1617
82
                input.x = 20;
82
                input.x = 20;
83
                background_holder.addChild(input);
83
                background_holder.addChild(input);
84
                addChild(background_holder);
84
                addChild(background_holder);
 
 
85
                background_holder.x -=120;
 
 
86
                background_holder.y =20;
85
            }
87
            }
86
 
88
 
87
            addChild(label_holder);
89
            addChild(label_holder);
1617
153
                this.scaleX = this.scaleY = 0.6;
153
                this.scaleX = this.scaleY = 0.6;
154
            }
154
            }
155
        }
155
        }
156
 
156
        public function show(i : int) : void {
157
        public function show(i : int) : void {
157
            if (aquababies_web.DEBUG_MODE) {
158
            TweenMax.to(holder,0.7,{alpha:1,delay:i*0.4});
158
                holder.alpha = 1;
159
            TweenMax.to(this,2,{scaleX:1,scaleY:1,ease:Elastic.easeOut,delay:i*0.4});
159
                this.scaleX = this.scaleY = 1;
 
 
160
            } else {
 
 
161
                TweenMax.to(holder,0.7,{alpha:1,delay:i*0.4});
 
 
162
                TweenMax.to(this,2,{scaleX:1,scaleY:1,ease:Elastic.easeOut,delay:i*0.4});
 
 
163
            }
160
        }
164
        }
161
    }
165
    }
162
}
166
}
1617
1
package com.aquababies.website.controller.book_now {
1
package com.aquababies.website.controller.book_now {
2
    import com.Bionic.Framework.debug.Component.DropDownMenuEvent;
 
 
3
    import flash.events.KeyboardEvent;
 
 
4
    import com.aquababies.website.component.InputTextField;
 
 
5
    import flash.net.navigateToURL;
 
 
6
    import flash.net.URLRequest;
 
 
7
    import nl.demonsters.debugger.MonsterDebugger;
2
    import nl.demonsters.debugger.MonsterDebugger;
8
 
3
 
9
    import com.Bionic.Framework.BionicEvent;
4
    import com.Bionic.Framework.BionicEvent;
10
    import com.Bionic.Framework.controller.bController;
5
    import com.Bionic.Framework.controller.bController;
11
    import com.Bionic.Framework.debug.Component.DropDownMenu;
6
    import com.Bionic.Framework.debug.Component.DropDownMenu;
 
 
7
    import com.Bionic.Framework.debug.Component.DropDownMenuEvent;
12
    import com.aquababies.website.bEvent;
8
    import com.aquababies.website.bEvent;
 
 
9
    import com.aquababies.website.component.InputTextField;
13
    import com.aquababies.website.component.bPHPFormService;
10
    import com.aquababies.website.component.bPHPFormService;
14
    import com.aquababies.website.component.text.bFrameTextBody;
11
    import com.aquababies.website.component.text.bFrameTextBody;
15
    import com.aquababies.website.view.book_now.book_now_core_v;
12
    import com.aquababies.website.view.book_now.book_now_core_v;
...
 
...
 
17
    import com.greensock.easing.Back;
14
    import com.greensock.easing.Back;
18
 
15
 
19
    import flash.display.Sprite;
16
    import flash.display.Sprite;
 
 
17
    import flash.events.KeyboardEvent;
20
    import flash.events.MouseEvent;
18
    import flash.events.MouseEvent;
 
 
19
    import flash.net.URLRequest;
21
    import flash.net.URLVariables;
20
    import flash.net.URLVariables;
 
 
21
    import flash.net.navigateToURL;
22
 
22
 
23
    /**
23
    /**
24
     * @author Martin Wojtala - Bionic Communications - 2010 - Aquababies_website
24
     * @author Martin Wojtala - Bionic Communications - 2010 - Aquababies_website
1617
1
package com.aquababies.website.controller.book_now {
1
package com.aquababies.website.controller.book_now {
2
    import flash.text.TextField;
 
 
3
    import com.aquababies.website.bEvent;
 
 
4
    import com.Bionic.Framework.BionicEvent;
2
    import com.Bionic.Framework.BionicEvent;
5
    import com.Bionic.Framework.controller.bController;
3
    import com.Bionic.Framework.controller.bController;
 
 
4
    import com.aquababies.website.bEvent;
 
 
5
    import com.aquababies.website.model.assets_m;
 
 
6
    import com.greensock.TweenMax;
6
    import com.greensock.easing.Back;
7
    import com.greensock.easing.Back;
7
    import com.greensock.TweenMax;
8
    import com.greensock.plugins.ColorMatrixFilterPlugin;
 
 
9
    import com.greensock.plugins.EndArrayPlugin;
 
 
10
    import com.greensock.plugins.TweenPlugin;
 
 
11
 
8
    import flash.display.DisplayObject;
12
    import flash.display.DisplayObject;
9
    import flash.display.MovieClip;
13
    import flash.display.MovieClip;
10
    import flash.display.Sprite;
14
    import flash.display.Sprite;
11
    import flash.events.MouseEvent;
15
    import flash.events.MouseEvent;
12
 
16
 
13
 
17
    
 
 
18
    TweenPlugin.activate([EndArrayPlugin, ColorMatrixFilterPlugin]);
14
    /**
19
    /**
15
     * @author Martin Wojtala - Bionic Communications - 2010 - Aquababies_website
20
     * @author Martin Wojtala - Bionic Communications - 2010 - Aquababies_website
16
    * BionicFrameWork 1.00  Aquababies_website/book_now_core_c.as; Created On: 27 Sep 2010; 
21
    * BionicFrameWork 1.00  Aquababies_website/book_now_core_c.as; Created On: 27 Sep 2010; 
...
 
...
 
64
            TweenMax.to(steps_mc.getChildByName('step' + arg1), 0.5, {
69
            TweenMax.to(steps_mc.getChildByName('step' + arg1), 0.5, {
65
                    scaleX:1.3,scaleY:1.3,ease:Back.easeOut
70
                    scaleX:1.3,scaleY:1.3,ease:Back.easeOut
66
                }); 
71
                }); 
 
 
72
 
 
 
73
            if(assets_m(_mdl).booking_mdl.return_basket_item_num()>0){
 
 
74
                TweenMax.to(steps_mc.getChildByName('step' + 1), 1, {colorMatrixFilter:{colorize:0x66ff00, amount:0.3}});
 
 
75
            }
 
 
76
 
 
 
77
 
67
        }
78
        }
68
 
79
 
69
        private function event_listener_ctr(childByName:DisplayObject,option:String):void 
80
        private function event_listener_ctr(childByName:DisplayObject,option:String):void 
1617
46
                        if (_current_section != e.params.option) {
46
                        if (_current_section != e.params.option) {
47
                            if (_current_section == '') {
47
                            if (_current_section == '') {
48
                                _startup_manager.init_booking_view(e.params.option);
48
                                _startup_manager.init_booking_view(e.params.option);
 
 
49
                                _current_section = e.params.option;
 
 
50
                            } else {
 
 
51
                                _current_section = e.params.option;
 
 
52
                                sendBNotification(bEvent.BOOK_EVENT, { type:'remove_section' } );                                
49
                            }
53
                            }
50
                            _current_section = e.params.option;
 
 
51
                            sendBNotification(bEvent.BOOK_EVENT, { type:'remove_section' } );
 
 
52
                        }
54
                        }
53
                    } else if (e.params.type == 'section_removed') {
55
                    } else if (e.params.type == 'section_removed') {
54
                        _startup_manager.init_booking_view(_current_section);
56
                        _startup_manager.init_booking_view(_current_section);
1617
1
package com.aquababies.website.controller.book_now {
1
package com.aquababies.website.controller.book_now {
2
    import com.aquababies.website.bEvent;
2
    import nl.demonsters.debugger.MonsterDebugger;
 
 
3
 
3
    import com.Bionic.Framework.BionicEvent;
4
    import com.Bionic.Framework.BionicEvent;
4
    import com.Bionic.Framework.controller.bController;
5
    import com.Bionic.Framework.controller.bController;
 
 
6
    import com.aquababies.website.bEvent;
 
 
7
    import com.aquababies.website.component.booking.bLocationTableItem;
 
 
8
    import com.aquababies.website.model.assets_m;
 
 
9
    import com.aquababies.website.view.book_now.booking_step1_v;
 
 
10
    import com.greensock.TweenMax;
 
 
11
    import com.greensock.easing.Back;
 
 
12
 
 
 
13
    import flash.display.MovieClip;
 
 
14
    import flash.display.Sprite;
 
 
15
    import flash.events.MouseEvent;
 
 
16
    import flash.text.TextField;
5
 
17
 
6
 
18
 
7
    /**
19
    /**
...
 
...
 
10
     '[Description here] Standard ctr class / Provide controller class description here'
22
     '[Description here] Standard ctr class / Provide controller class description here'
11
    */
23
    */
12
    public class booking_step1_c extends bController {
24
    public class booking_step1_c extends bController {
 
 
25
        private var courses : Sprite;
 
 
26
        private var total_field : TextField;
 
 
27
        private var submit_btn : Sprite;
13
 
28
 
14
        public function  booking_step1_c() 
29
        public function  booking_step1_c() 
15
        {
30
        {
...
 
...
 
16
            super([bEvent.BOOK_EVENT,bEvent.DESTROY_CURRENT_SECTION], notifiactions_handler,'booking_step1_c');
31
            super([bEvent.BOOK_EVENT,bEvent.DESTROY_CURRENT_SECTION], notifiactions_handler,'booking_step1_c');
17
        }
32
        }
18
        public function init():void{
33
        public function init():void{
 
 
34
            var section_holder:Sprite = _retriveBChild('section_holder') as Sprite;
 
 
35
            var book_now_holder:Sprite = section_holder.getChildByName('book_now_holder') as Sprite;
19
 
36
 
 
 
37
            var swf_table : MovieClip = book_now_holder.getChildByName(booking_step1_v.N_SWF_TABLE) as MovieClip;
 
 
38
            courses = Sprite(swf_table.getChildByName(booking_step1_v.N_COURSES_MC));
 
 
39
            swf_table.getChildAt(0).alpha = 0;
 
 
40
 
 
 
41
            total_field = Sprite(swf_table.getChildByName(booking_step1_v.N_TOTAL_FIELD)).getChildAt(0) as TextField;
 
 
42
            TweenMax.to(swf_table.getChildAt(0), 0.3, {alpha:1});
 
 
43
            submit_btn = swf_table.getChildByName(booking_step1_v.INAME_BOOK_NOW_SUBMIT_BTN_H) as Sprite;
 
 
44
            update_total_field();
 
 
45
            update_selection();
20
        }
46
        }
 
 
47
 
 
 
48
        private function update_selection() : void {
 
 
49
            var basket : Array = assets_m(_mdl).booking_mdl.return_basket_array();
 
 
50
            var courses_arr:Array = assets_m(_mdl).booking_mdl.return_courses_info();
 
 
51
 
 
 
52
            if (basket.length > 0) {
 
 
53
                for (var i : int = 0;i < basket.length; i++) {
 
 
54
                    for (var j:int = 0;j < courses.numChildren; j++){
 
 
55
                        if (basket[i].price == bLocationTableItem(courses.getChildAt(j)).price) {
 
 
56
                            if (basket[i].name == bLocationTableItem(courses.getChildAt(j)).course_name) {
 
 
57
                                bLocationTableItem(courses.getChildAt(j)).mark();
 
 
58
                            }
 
 
59
                        }
 
 
60
                    }
 
 
61
                }
 
 
62
            }
 
 
63
        }
21
 
64
 
22
        private function notifiactions_handler(e:BionicEvent):void{
65
        private function notifiactions_handler(e:BionicEvent):void{
23
            switch (e.type) {
66
            switch (e.type) {
...
 
...
 
24
                case bEvent.BOOK_EVENT:
67
                case bEvent.BOOK_EVENT:
25
                    if(e.params.type == 'remove_section'){
68
                    if(e.params.type == 'remove_section'){
26
                        destroy();
69
                        destroy();
 
 
70
                    } else if (e.params.type == 'table_item_selected') {
 
 
71
                        bLocationTableItem(courses.getChildAt(e.params.option)).select();
 
 
72
                    } else if (e.params.type == 'add_item_to_basket'){
 
 
73
                        var price:Number = bLocationTableItem(courses.getChildAt(e.params.option)).price;
 
 
74
                        var course_name:String= bLocationTableItem(courses.getChildAt(e.params.option)).course_name;
 
 
75
 
 
 
76
                        var basket_item : Object = {price:price, name:course_name};
 
 
77
                        assets_m(_mdl).booking_mdl.add_to_basket(basket_item);
 
 
78
 
 
 
79
                        update_total_field();
 
 
80
                    } else if (e.params.type == 'remove_item_from_basket'){
 
 
81
                        price = bLocationTableItem(courses.getChildAt(e.params.option)).price;
 
 
82
                        course_name = bLocationTableItem(courses.getChildAt(e.params.option)).course_name;
 
 
83
                        basket_item = {price:price, name:course_name};
 
 
84
                        assets_m(_mdl).booking_mdl.remove_from_basket(basket_item);
 
 
85
 
 
 
86
                        update_total_field();
27
                    }
87
                    }
28
                break;
88
                break;
29
                case bEvent.DESTROY_CURRENT_SECTION:
89
                case bEvent.DESTROY_CURRENT_SECTION:
...
 
...
 
33
                break;
93
                break;
34
            }
94
            }
35
        }
95
        }
 
 
96
 
 
 
97
        private function update_total_field() : void {
 
 
98
            if(assets_m(_mdl).booking_mdl.return_basket_item_num() == 0 || assets_m(_mdl).booking_mdl.return_basket_item_num()==1){
 
 
99
                var copy_full:String = _mdl.language_mdl.return_localised_copy('booking_total_textfield').text0.text();
 
 
100
            } else {
 
 
101
                copy_full = _mdl.language_mdl.return_localised_copy('booking_total_textfield').text1.text();
 
 
102
            }
 
 
103
            // [order] // [price]
 
 
104
            var first : String = copy_full.split('[order]')[0] + "<font color='#0000FF' size='14'>" +
assets_m(_mdl).booking_mdl.return_basket_item_num() + "</font>";
 
 
105
            var second : String = String(copy_full.split('[order]')[1]).split('[price]')[0]+"<font color='#0000FF'
size='14'>" + assets_m(_mdl).booking_mdl.return_basket_total()+"</font>";
 
 
106
            var third : String = String(copy_full.split('[order]')[1]).split('[price]')[1];
 
 
107
            var final_copy : String = first + second + third;
 
 
108
 
 
 
109
            total_field.htmlText = final_copy;
 
 
110
 
 
 
111
            update_submit_btn(assets_m(_mdl).booking_mdl.return_basket_item_num());
 
 
112
        }
 
 
113
 
 
 
114
        private function update_submit_btn(return_basket_item_num : Number) : void {
 
 
115
            if (return_basket_item_num>=1){
 
 
116
                enable_submit();
 
 
117
            } else {
 
 
118
                disable_submit();
 
 
119
            }
 
 
120
        }
 
 
121
 
 
 
122
        private function disable_submit() : void {
 
 
123
            TweenMax.to(submit_btn, 0.5, {alpha:0.7,scaleX:0.54,scaleY:0.54,ease:Back.easeIn});
 
 
124
            submit_btn.removeEventListener(MouseEvent.MOUSE_DOWN, submit_m_handler);
 
 
125
            submit_btn.removeEventListener(MouseEvent.MOUSE_OVER, submit_m_handler);
 
 
126
            submit_btn.removeEventListener(MouseEvent.MOUSE_OUT, submit_m_handler);
 
 
127
        }
 
 
128
 
 
 
129
        private function submit_m_handler(event : MouseEvent) : void {
 
 
130
            switch (event.type) {
 
 
131
                case 'mouseDown':
 
 
132
                    sendBNotification(bEvent.BOOK_EVENT, {type:'steps_event', option:'step2'});
 
 
133
                break;
 
 
134
                case 'mouseOver':
 
 
135
                    submit_btn.alpha = 1;
 
 
136
                break;
 
 
137
                case 'mouseOut':
 
 
138
                    submit_btn.alpha = 0.9;                
 
 
139
                break;
 
 
140
            }
 
 
141
        }
 
 
142
 
 
 
143
        private function enable_submit() : void {
 
 
144
            TweenMax.to(submit_btn, 0.5, {alpha:0.9,scaleX:0.64,scaleY:0.64,ease:Back.easeOut});
 
 
145
            submit_btn.addEventListener(MouseEvent.MOUSE_DOWN, submit_m_handler);
 
 
146
            submit_btn.addEventListener(MouseEvent.MOUSE_OVER, submit_m_handler);
 
 
147
            submit_btn.addEventListener(MouseEvent.MOUSE_OUT, submit_m_handler);
 
 
148
        }
 
 
149
 
 
 
150
        private function deselect_items() : void {
 
 
151
 
 
 
152
        }
36
        public function destroy():void {
153
        public function destroy():void {
37
 
154
            disable_submit();
 
 
155
            courses = null;
 
 
156
            trace('DESTROY ____');
38
            Destroy();
157
            Destroy();
39
        }
158
        }
40
    }
159
    }
1617
1
package com.aquababies.website.model {
1
package com.aquababies.website.model {
 
 
2
    import com.aquababies.website.bEvent;
2
    import br.com.stimuli.loading.BulkProgressEvent;
3
    import br.com.stimuli.loading.BulkProgressEvent;
3
    import com.aquababies.website.model.booking_m;
4
    import com.aquababies.website.model.booking_m;
4
 
5
 
5
    import com.Bionic.Framework.model.bModel;
6
    import com.Bionic.Framework.model.bModel;
6
    import com.aquababies.website.bEvent;
 
 
7
 
7
 
8
    /**
8
    /**
9
     * @author Martin Wojtala - Bionic Communications - 2010 - bubble_trouble
9
     * @author Martin Wojtala - Bionic Communications - 2010 - bubble_trouble
1617
1
package com.aquababies.website.model 
1
package com.aquababies.website.model 
2
{
2
{
 
 
3
    import nl.demonsters.debugger.MonsterDebugger;
 
 
4
 
3
    import flash.events.Event;
5
    import flash.events.Event;
4
    import flash.net.URLLoader;
6
    import flash.net.URLLoader;
5
    import flash.net.URLRequest;
7
    import flash.net.URLRequest;
...
 
...
 
11
    {
13
    {
12
        private var _mdl:assets_m;
14
        private var _mdl:assets_m;
13
 
15
 
 
 
16
        private var checkout_basket:Array = new Array();
 
 
17
 
14
        public function booking_m(_mdl:assets_m):void 
18
        public function booking_m(_mdl:assets_m):void 
15
        {
19
        {
16
            this._mdl = _mdl;
20
            this._mdl = _mdl;
17
            
 
 
18
            
 
 
19
        }
21
        }
20
        public function preload_location_xml():void {
22
        public function preload_location_xml():void {
21
            var _url_loader:URLLoader = new URLLoader(new URLRequest(_mdl.return_setting('location_php')));
23
            var _url_loader:URLLoader = new URLLoader(new URLRequest(_mdl.return_setting('location_php')));
...
 
...
 
23
        }
25
        }
24
        public function return_courses_info():Array {
26
        public function return_courses_info():Array {
25
 
27
 
26
            /*
 
 
27
             * <venue_picture>assets/images/book_now/venues/marriott.jpg</venue_picture> 
 
 
28
                <venue_name>Marriott</venue_name> 
 
 
29
                <course_description_pl>Toddlers</course_description_pl> 
 
 
30
                <course_description_en>Maluchy</course_description_en> 
 
 
31
                <course_price>22.33</course_price> 
 
 
32
                <course_spaces>3</course_spaces> 
 
 
33
                <course_capacity>6</course_capacity> 
 
 
34
                <course_dates>20/02/2011 - 10/03/2011</course_dates> 
 
 
35
             * 
 
 
36
             */
 
 
37
            
 
 
38
            var arr:Array = new Array();
28
            var arr:Array = new Array();
39
            var xml:XML = _mdl.return_xml('courses') as XML;
29
            var xml:XML = _mdl.return_xml('courses') as XML;
40
            for (var i:int = 0; i < xml.children().length(); i++) {
30
            for (var i:int = 0; i < xml.children().length(); i++) {
...
 
...
 
43
                arr[i].venue_name = xml.item[i].venue_name;
33
                arr[i].venue_name = xml.item[i].venue_name;
44
                arr[i].course_description_pl = xml.item[i].course_description_pl;
34
                arr[i].course_description_pl = xml.item[i].course_description_pl;
45
                arr[i].course_description_en = xml.item[i].course_description_en;
35
                arr[i].course_description_en = xml.item[i].course_description_en;
46
                arr[i].venue_name = xml.item[i].venue_name;
 
 
47
                arr[i].course_price = xml.item[i].course_price;
36
                arr[i].course_price = xml.item[i].course_price;
48
                arr[i].course_spaces = xml.item[i].course_spaces;
37
                arr[i].course_spaces = xml.item[i].course_spaces;
49
                arr[i].course_capacity = xml.item[i].course_capacity;
38
                arr[i].course_capacity = xml.item[i].course_capacity;
...
 
...
 
53
 
42
 
54
            return arr;
43
            return arr;
55
        }
44
        }
 
 
45
 
 
 
46
        public function add_to_basket(obj:Object) : void {
 
 
47
            checkout_basket.push(obj);
 
 
48
        }
 
 
49
        public function remove_from_basket(obj:Object):void{
 
 
50
            for (var i : int = 0;i < checkout_basket.length; i++) {
 
 
51
                if (checkout_basket[i].price==obj.price){
 
 
52
                    if (checkout_basket[i].name == obj.name ){
 
 
53
                        checkout_basket.splice(i,1);
 
 
54
                    }
 
 
55
                }
 
 
56
            }
 
 
57
        }
 
 
58
        public function return_basket_total():Number{
 
 
59
            var total:Number = 0;
 
 
60
            for (var i : int = 0;i < checkout_basket.length; i++) {
 
 
61
                total += checkout_basket[i].price;
 
 
62
            }
 
 
63
            return total;
 
 
64
        }
56
 
65
 
 
 
66
        public function return_basket_item_num() : Number {
 
 
67
            return checkout_basket.length;
 
 
68
        }
 
 
69
        public function return_basket_array() : Array{
 
 
70
            return checkout_basket;
 
 
71
        }
57
 
72
 
58
        private function create_xml(e:Event):void 
73
        private function create_xml(e:Event):void 
59
        {
74
        {
1617
77
            bHolder.addChild(_section_holder);
77
            bHolder.addChild(_section_holder);
78
            Register_bView(new polaroid_menu_v());    
78
            Register_bView(new polaroid_menu_v());    
79
            Register_bView(new sections_manager_v());
79
            Register_bView(new sections_manager_v());
80
<<<<<<< .mine
 
 
81
            Register_bView(new web_bubbles_v());
 
 
82
            //Register_bView(new website_drops_menu_v());
 
 
83
=======
 
 
84
            Register_bView(new web_bubbles_v());
80
            Register_bView(new web_bubbles_v());
85
            Register_bView(new website_drops_menu_v());
81
            Register_bView(new website_drops_menu_v());
86
        //    Register_bView(new book_test_v());
82
        //    Register_bView(new book_test_v());
87
>>>>>>> .r15
 
 
88
        }
83
        }
89
 
84
 
90
        private function notifications_handler(event : BionicEvent) : void {
85
        private function notifications_handler(event : BionicEvent) : void {
1617
1
package com.aquababies.website.view.book_now {
1
package com.aquababies.website.view.book_now {
 
 
2
    import flash.text.TextFormat;
 
 
3
    import flash.text.TextField;
 
 
4
    import flash.display.Bitmap;
 
 
5
    import com.aquababies.website.component.booking.bLocationTableItem;
 
 
6
    import com.greensock.TweenMax;
2
    import com.aquababies.website.model.assets_m;
7
    import com.aquababies.website.model.assets_m;
3
    import flash.display.MovieClip;
8
    import flash.display.MovieClip;
4
    import com.aquababies.website.bEvent;
9
    import com.aquababies.website.bEvent;
...
 
...
 
14
    */
19
    */
15
    public class booking_step1_v extends bView {
20
    public class booking_step1_v extends bView {
16
        public static const N_COURSES_MC : String = "N_COURSES_MC";
21
        public static const N_COURSES_MC : String = "N_COURSES_MC";
17
        private var sq:Sprite;
22
        public static const N_SWF_TABLE : String = "N_SWF_TABLE";
 
 
23
        public static const INAME_BOOK_NOW_SUBMIT_BTN_H : String = "INAME_BOOK_NOW_SUBMIT_BTN_H";
 
 
24
        public static const N_TOTAL_FIELD : String = "N_TOTAL_FIELD";
 
 
25
        private var sq : Sprite;
 
 
26
        private var coures_mc : Sprite;
 
 
27
        private var swf_table : MovieClip;
 
 
28
        private var submit_holder : Sprite;
 
 
29
        private var total_field_h : Sprite;
18
 
30
 
19
        public function  booking_step1_v() 
31
        public function  booking_step1_v() 
20
        {
32
        {
...
 
...
 
26
            var section_holder:Sprite = _retriveBChild('section_holder') as Sprite;
38
            var section_holder:Sprite = _retriveBChild('section_holder') as Sprite;
27
            var book_now_holder:Sprite = section_holder.getChildByName('book_now_holder') as Sprite;
39
            var book_now_holder:Sprite = section_holder.getChildByName('book_now_holder') as Sprite;
28
 
40
 
29
            var swf_table:MovieClip = assets_m(_mdl).return_movieclip_from_library('swf_table_mc', 'swf_table_mc');
41
            swf_table= assets_m(_mdl).return_movieclip_from_library('swf_table_mc', 'swf_table_mc');
30
            book_now_holder.addChild(swf_table);
42
            book_now_holder.addChild(swf_table);
31
            swf_table.x = 650;
43
            swf_table.x = 659;
32
            swf_table.y = 400;
44
            swf_table.y = 400;
33
 
45
            swf_table.name = N_SWF_TABLE;
34
            var coures_mc:Sprite= new Sprite();
46
 
 
 
47
            coures_mc= new Sprite();
35
            coures_mc.name = N_COURSES_MC;
48
            coures_mc.name = N_COURSES_MC;
36
            swf_table.addChild(coures_mc);
49
            swf_table.addChild(coures_mc);
37
            var courses:XML = _mdl.return_xml('courses');
50
            var courses:Array = assets_m(_mdl).booking_mdl.return_courses_info();
38
            //for (var i:int = 0;i < courses.children().length();i++) {
51
            for (var i:int = 0;i < courses.length;i++) {
39
            for (var i:int = 0;i < 3;i++) {
52
                var b_loc_table_item : bLocationTableItem = new bLocationTableItem(i,courses[i],_mdl);
40
                var item:MovieClip = assets_m(_mdl).return_movieclip_from_library('swf_table_mc', 'swf_item_mc');
53
                coures_mc.addChild(b_loc_table_item);
41
                coures_mc.addChild(item);
54
                b_loc_table_item.scaleX = b_loc_table_item.scaleY = 0.97;
42
                item.y = -30+(i*50);
55
                b_loc_table_item.y = -30+(i*42);
43
                item.city.selectable =false;
56
                b_loc_table_item.x = 7;
44
                item.details.selectable =false;
 
 
45
                item.price.selectable =false;
 
 
46
                item.time.selectable =false;
 
 
47
                item.size.selectable =false;
 
 
48
                item.date.selectable =false;
 
 
49
            }
57
            }
50
 
58
 
51
 
59
 
 
 
60
            submit_holder = new Sprite();
 
 
61
            submit_holder.name = INAME_BOOK_NOW_SUBMIT_BTN_H;
 
 
62
            var submitButtonBitmap:Bitmap = assets_m(_mdl).return_bitmap('submit_btn');
 
 
63
            submit_holder.buttonMode = true;
 
 
64
            submit_holder.addChild(submitButtonBitmap);
 
 
65
            submitButtonBitmap.x -=submitButtonBitmap.width/2;
 
 
66
            submitButtonBitmap.y -=submitButtonBitmap.height/2;
 
 
67
            submit_holder.x += submit_holder.width/2;
 
 
68
            submit_holder.y += submit_holder.height/2;
 
 
69
            swf_table.addChild(submit_holder);
 
 
70
 
 
 
71
            submit_holder.scaleX = 0.64;
 
 
72
            submit_holder.scaleY = 0.64;
 
 
73
 
 
 
74
            submit_holder.alpha = 0.6;
 
 
75
 
 
 
76
            submit_holder.x = 207;
 
 
77
            submit_holder.y = 98;
 
 
78
 
 
 
79
            ///  total field 
 
 
80
            create_total_field();
 
 
81
 
52
            init_ctr();
82
            init_ctr();
53
        }
83
        }
 
 
84
 
 
 
85
        private function create_total_field() : void {
 
 
86
            var _body_mc:MovieClip = _mdl.return_movieclip_from_library('website_fonts_swf', 'body_mc');
 
 
87
 
 
 
88
            total_field_h = new Sprite();
 
 
89
            total_field_h.name = N_TOTAL_FIELD;
 
 
90
            var total_field : TextField = TextField(_body_mc.textfield);
 
 
91
            total_field_h.y = 70;
 
 
92
            total_field_h.x = - 201;
 
 
93
            total_field.height = 30;
 
 
94
            total_field.width = 390;
 
 
95
            total_field_h.addChild(total_field)
 
 
96
            swf_table.addChild(total_field_h);
 
 
97
        }
54
 
98
 
55
        private function init_ctr():void
99
        private function init_ctr():void
56
        {
100
        {
...
 
...
 
58
            Register_bController(new booking_step1_c());
102
            Register_bController(new booking_step1_c());
59
        }
103
        }
60
        public function destroy():void {
104
        public function destroy():void {
61
            sendBNotification(bEvent.BOOK_EVENT, { type:'section_removed' } );
105
            TweenMax.to(swf_table, 0.3, {alpha:0, onComplete:function() : void {
 
 
106
                while (coures_mc.numChildren) {
 
 
107
                    if(coures_mc.getChildAt(0) is bLocationTableItem){
 
 
108
                        bLocationTableItem(coures_mc.getChildAt(0)).destroy();
 
 
109
                    }
 
 
110
                    coures_mc.removeChild(coures_mc.getChildAt(0));
 
 
111
                }
 
 
112
                swf_table.removeChild(coures_mc);
 
 
113
                swf_table.parent.removeChild(swf_table);
 
 
114
                sendBNotification(bEvent.BOOK_EVENT, { type:'section_removed' } );
 
 
115
            }})
 
 
116
            submit_holder.parent.removeChild(submit_holder);
 
 
117
            total_field_h.parent.removeChild(total_field_h);
62
            Destroy();
118
            Destroy();
63
        }
119
        }
64
    }
120
    }
1617
1
package com.aquababies.website.view.book_now {
1
package com.aquababies.website.view.book_now {
 
 
2
    import flash.display.MovieClip;
 
 
3
    import com.greensock.TweenMax;
 
 
4
    import flash.display.DisplayObject;
 
 
5
    import com.aquababies.website.model.assets_m;
 
 
6
    import com.aquababies.website.component.InputTextField;
2
    import com.aquababies.website.bEvent;
7
    import com.aquababies.website.bEvent;
3
    import com.aquababies.website.controller.book_now.booking_step2_c;
8
    import com.aquababies.website.controller.book_now.booking_step2_c;
4
    import com.Bionic.Framework.view.bView;
9
    import com.Bionic.Framework.view.bView;
...
 
...
 
11
     '[Description here] Standard view class of the bionic_framework_2010'
16
     '[Description here] Standard view class of the bionic_framework_2010'
12
    */
17
    */
13
    public class booking_step2_v extends bView {
18
    public class booking_step2_v extends bView {
14
        private var sq:Sprite;
19
        public static const N_STEP2_H : String = "N_STEP2_H";
 
 
20
        public static const N_INPUTS_H : String = "N_INPUTS_H";
 
 
21
        private var formArray : Array =[];
 
 
22
        private var nameInput : InputTextField;
 
 
23
        private var emailInput : InputTextField;
 
 
24
        private var swf_table2 : MovieClip;
 
 
25
        private var inputfields : Sprite;
15
 
26
 
16
        public function  booking_step2_v() 
27
        public function  booking_step2_v() 
17
        {
28
        {
...
 
...
 
22
        {
33
        {
23
            var section_holder:Sprite = _retriveBChild('section_holder') as Sprite;
34
            var section_holder:Sprite = _retriveBChild('section_holder') as Sprite;
24
            var book_now_holder:Sprite = section_holder.getChildByName('book_now_holder') as Sprite;
35
            var book_now_holder:Sprite = section_holder.getChildByName('book_now_holder') as Sprite;
 
 
36
            swf_table2= assets_m(_mdl).return_movieclip_from_library('swf_table_mc', 'swf_step2_table_mc');
 
 
37
            swf_table2.name = N_STEP2_H;
 
 
38
            book_now_holder.addChild(swf_table2);
25
 
39
 
 
 
40
            inputfields = new Sprite();
 
 
41
            inputfields.name = N_INPUTS_H;
 
 
42
            swf_table2.addChild(inputfields);
26
 
43
 
27
            sq = new Sprite();
44
            swf_table2.x = 659;
28
            sq.graphics.beginFill(0x331111);
45
            swf_table2.y = 275;
29
            sq.graphics.drawCircle(0, 0, 50);
46
            var _InputTextField : InputTextField = new InputTextField('hello', assets_m(_mdl).return_bitmap('inputfield_long_bg'));
30
            sq.graphics.endFill();
47
                        
31
            sq.x = sq.y = 500;
 
 
32
            book_now_holder.addChild(sq);
 
 
33
 
48
 
 
 
49
 
 
 
50
            create_input_field();
 
 
51
 
34
            init_ctr();
52
            init_ctr();
35
        }
53
        }
 
 
54
 
 
 
55
        private function create_input_field() : void {
 
 
56
            var lang_copy:XML = _mdl.language_mdl.return_localised_copy('book_now_copy')
 
 
57
            formArray.push(inputfield(lang_copy['first_name'],lang_copy['first_name_default'],'first_name'));
 
 
58
            formArray.push(inputfield(lang_copy['second_name'],lang_copy['second_name_default'],'second_name'));
 
 
59
            formArray.push(inputfield(lang_copy['babys_name'],lang_copy['babys_name_default'],'babys_name'));
 
 
60
            formArray.push(inputfield(lang_copy['babys_bdate'],lang_copy['babys_bdate_default'],'babys_bdate'));
 
 
61
            formArray.push(inputfield(lang_copy['email'],lang_copy['email_default'],'email'));
 
 
62
            formArray.push(inputfield(lang_copy['telephone'],lang_copy['telephone_default'],'telephone'));
 
 
63
            formArray.push(inputfield(lang_copy['babys_sex'],lang_copy['babys_sex_default'],'babys_sex'));
 
 
64
            formArray.push(inputfield(lang_copy['medical_info'],lang_copy['medical_info_default'],'medical_info'));
 
 
65
 
 
 
66
            // addChild and position        
 
 
67
            var top_padding:int = 0;
 
 
68
            var temp:DisplayObject; 
 
 
69
            var num:int = 0;
 
 
70
            for (var i:int = 0;i < formArray.length;i++) {
 
 
71
                var item:DisplayObject = formArray[i];
 
 
72
                item.scaleX = item.scaleY = 0.87;
 
 
73
                inputfields.addChild(item);
 
 
74
                if(num<4){
 
 
75
                    item.x =-68;
 
 
76
                    if(num<2){
 
 
77
                        item.y =44*num-8;
 
 
78
                    } else {
 
 
79
                        item.y =44*num+14; // gap for babies details line
 
 
80
                    }
 
 
81
                } else {
 
 
82
                    item.x =88;        
 
 
83
                    if((num-4)<2){
 
 
84
                        item.y =44*(num-4)-8;
 
 
85
                    } else {
 
 
86
                        item.y =44*(num-4)+14; // gap for babies details line
 
 
87
                    }
 
 
88
                }
 
 
89
            //    i == 0 ? top_padding = -80 : top_padding = 10; 
 
 
90
                // for d.o.b dd/mm/yy
 
 
91
            //    temp == null ? item.y = top_padding : item.y = temp.y + temp.height + top_padding;
 
 
92
                temp = item;
 
 
93
                num++;
 
 
94
            }
 
 
95
        }
 
 
96
 
 
 
97
        private function inputfield(label_text:String,field_default_text: String,id_name:String) : InputTextField {
 
 
98
            var input:InputTextField = new InputTextField(id_name, 
 
 
99
                    assets_m(_mdl).return_bitmap('inputfield_long_bg'), 
 
 
100
                    label_text, '', 120);
 
 
101
            input.value = field_default_text;
 
 
102
            return input;
 
 
103
        }
36
 
104
 
37
        private function init_ctr():void
105
        private function init_ctr():void
38
        {
106
        {
...
 
...
 
40
            Register_bController(new booking_step2_c());
108
            Register_bController(new booking_step2_c());
41
        }
109
        }
42
        public function destroy():void {
110
        public function destroy():void {
43
            sq.parent.removeChild(sq);
111
            TweenMax.to(swf_table2, 0.3, {alpha:0, onComplete:function() : void {
44
            sq = null;
112
                while (inputfields.numChildren) {
45
            sendBNotification(bEvent.BOOK_EVENT, { type:'section_removed' } );
113
                    inputfields.removeChild(inputfields.getChildAt(0));
 
 
114
                }
 
 
115
                swf_table2.removeChild(inputfields);
 
 
116
                swf_table2.parent.removeChild(swf_table2);
 
 
117
                sendBNotification(bEvent.BOOK_EVENT, { type:'section_removed' } );
 
 
118
            }})
46
            Destroy();
119
            Destroy();
47
        }
120
        }
48
    }
121
    }
1617
1
package com.aquababies.website.view.book_now {
1
package com.aquababies.website.view.book_now {
 
 
2
    import com.Bionic.Framework.view.bView;
2
    import com.aquababies.website.bEvent;
3
    import com.aquababies.website.bEvent;
3
    import com.aquababies.website.controller.book_now.booking_step3_c;
4
    import com.aquababies.website.controller.book_now.booking_step3_c;
4
    import com.Bionic.Framework.view.bView;
5
 
 
 
6
    import flash.display.Bitmap;
 
 
7
    import flash.display.MovieClip;
5
    import flash.display.Sprite;
8
    import flash.display.Sprite;
 
 
9
    import flash.text.TextField;
6
 
10
 
7
 
11
 
8
    /**
12
    /**
...
 
...
 
11
     '[Description here] Standard view class of the bionic_framework_2010'
15
     '[Description here] Standard view class of the bionic_framework_2010'
12
    */
16
    */
13
    public class booking_step3_v extends bView {
17
    public class booking_step3_v extends bView {
14
        private var sq:Sprite;
18
        public static const N_STEP3_CONFIRM : String = "N_STEP3_CONFIRM";
 
 
19
        private var sq : Sprite;
 
 
20
        private var mtransfer_sp : Sprite;
 
 
21
        private var step3_copy_h : Sprite;
15
 
22
 
16
        public function  booking_step3_v() 
23
        public function  booking_step3_v() 
17
        {
24
        {
...
 
...
 
23
            var section_holder:Sprite = _retriveBChild('section_holder') as Sprite;
30
            var section_holder:Sprite = _retriveBChild('section_holder') as Sprite;
24
            var book_now_holder:Sprite = section_holder.getChildByName('book_now_holder') as Sprite;
31
            var book_now_holder:Sprite = section_holder.getChildByName('book_now_holder') as Sprite;
25
 
32
 
26
            sq= new Sprite();
33
            var _body_mc:MovieClip = _mdl.return_movieclip_from_library('website_fonts_swf', 'body_mc');
27
            sq.graphics.beginFill(0xff66ff);
 
 
28
            sq.graphics.drawRect(0, 0, 50,50);
 
 
29
            sq.graphics.endFill();
 
 
30
            sq.x = sq.y = 500;
 
 
31
            book_now_holder.addChild(sq);
 
 
32
 
34
 
 
 
35
            step3_copy_h = new Sprite();
 
 
36
            step3_copy_h.name = N_STEP3_CONFIRM;
 
 
37
            var copy_field : TextField = TextField(_body_mc.textfield);
 
 
38
            step3_copy_h.y = 70;
 
 
39
            step3_copy_h.x = - 201;
 
 
40
            copy_field .height = 430;
 
 
41
            copy_field .width = 490;
 
 
42
            step3_copy_h.addChild(copy_field )
 
 
43
            book_now_holder.addChild(step3_copy_h);
 
 
44
            copy_field.border =true;
 
 
45
 
 
 
46
 
 
 
47
 
 
 
48
            mtransfer_sp = new Sprite();
 
 
49
            var mtranfer_link:Bitmap = _mdl.return_bitmap('mtranfer_link') as Bitmap;
 
 
50
            mtranfer_link.smoothing = true;
 
 
51
            mtransfer_sp.addChild(mtranfer_link);
 
 
52
            mtransfer_sp.scaleX = mtransfer_sp.scaleY = 0.8;
 
 
53
 
 
 
54
            mtranfer_link.x = 0;
 
 
55
            mtranfer_link.y = 240;
 
 
56
 
 
 
57
            book_now_holder.addChild(mtransfer_sp);
 
 
58
 
33
            init_ctr();
59
            init_ctr();
34
        }
60
        }
35
 
61
 
...
 
...
 
39
            Register_bController(new booking_step3_c());
65
            Register_bController(new booking_step3_c());
40
        }
66
        }
41
        public function destroy():void {
67
        public function destroy():void {
42
            sq.parent.removeChild(sq);
68
            mtransfer_sp.parent.removeChild(mtransfer_sp);
43
            sq = null;
69
            mtransfer_sp = null;
44
            sendBNotification(bEvent.BOOK_EVENT, { type:'section_removed' } );
70
            sendBNotification(bEvent.BOOK_EVENT, { type:'section_removed' } );
45
            Destroy();
71
            Destroy();
46
        }
72
        }
1617
127
            var bmp:Bitmap;
127
            var bmp:Bitmap;
128
            if(loader.getBitmapData(_id)) {
128
            if(loader.getBitmapData(_id)) {
129
                bmp = new Bitmap(loader.getBitmapData(_id).clone());
129
                bmp = new Bitmap(loader.getBitmapData(_id).clone());
 
 
130
                bmp.smoothing = true;
130
            } else {
131
            } else {
131
                throw new Error("RETURN_BITMAP ERROR\nBitmap : " + _id + " not found\n-------------\nDetails:");
132
                throw new Error("RETURN_BITMAP ERROR\nBitmap : " + _id + " not found\n-------------\nDetails:");
132
            }
133
            }