//11
Ext.BLANK_IMAGE_URL = '/themes/en/images/s.gif';
Ext.namespace("Waps.modules")
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'under';
String.prototype.stripHTML = function(){
    // What a tag looks like
    var matchTag = /<(?:.|\s)*?>/g; // tag that start with '<' and end with '>' like <p>, <td> etc
    var matchTag2 = /&(?:.|\s)*?;/g; // tags that start with '&'  and end with ';' like &nbsp;, &amp; etc
    var ret = this.replace(matchTag2, "");
    var ret = ret.replace(matchTag, "");
    return ret
};

var ExpandCollapse = function(id, minId, caller){

    Ext.get(minId).enableDisplayMode()
    Ext.get(id).enableDisplayMode()
    
    if (!Ext.get(minId).isDisplayed()) {
        Ext.get(minId).toggle(true)
        caller.innerHTML = "read more";
    }
    else 
        Ext.get(minId).toggle()
    
    if (!Ext.get(id).isDisplayed()) {
        Ext.get(id).toggle(true)
        caller.innerHTML = "collapse";
    }
    else 
        Ext.get(id).toggle()
    
    //
    //Ext.get(id).toggle(true)
    //console.log(Ext.get(minId))
}

Ext.override(Ext.form.CheckboxGroup, {

    afterRender: function(){
        var that = this;
        this.items.each(function(i){
            that.relayEvents(i, ['check']);
        });
        
        Ext.form.CheckboxGroup.superclass.afterRender.call(this)
    }

});
Ext.override(Ext.form.RadioGroup, {

    afterRender: function(){
        var group = this;
        this.items.each(function(field){
            field.on("check", function(self, checked){
                if (checked) 
                    group.fireEvent('change', group, self.getRawValue());
            });
        });
        Ext.form.RadioGroup.superclass.afterRender.call(this)
    }
});

Waps.modules.Contact = function(options){
    this.options = options
    
    Ext.onReady(function(){
        if (this.options.ContactFormat == 1) 
            this.CreateContactForm()
        else 
            alert("contact form method not implemented.")
    }, this)
}

Ext.form.VTypes['phone'] = function(Z, v){
    //var E = /^(\d{3}[-]?){1,2}(\d{4})$/;
    var E = /^(\+[1-9][0-9]*(\([0-9]*\)|-[0-9]*-))?[0]?[1-9][0-9\- ]*$/;
    return E.test(Z);
}
Ext.form.VTypes.phoneText = "Not a valid phone number. Number can contain only digits, hyphen (-), space( ). Valid formats are +971(4)123-4567 | +971-4-123 4567 | 04-123-45-67";
Ext.form.VTypes.phoneMask = /[\d-+\s]/;

Waps.modules.Contact.prototype = {
    CreateContactForm: function(){
    
        Ext.namespace('Ext.staticData');
        Ext.staticData = [['Mr', 'Mr.', 'Mobile', 'Landline'], ['Miss', 'Miss.', 'Mobile', 'Mobile'], ['Mrs', 'Mrs.', 'Mobile', 'Landline']];
        Ext.staticDataPhone = [['Mobile'], ['Landline']];
        
        
        var store = new Ext.data.SimpleStore({
            fields: ['id', 'name', 'Pid', 'Pname'],
            data: Ext.staticData
        });
        var phoneType = new Ext.data.SimpleStore({
            fields: ['name'],
            data: Ext.staticDataPhone
        });
        var VisitorRegistration = function(combo, value, scope){
        
            var form = combo.findParentByType('form');
            this.visitorComments;
            if (combo.value == scope.options.visitorRegistrationForm) {
                var radioGroup = new Ext.form.RadioGroup({
                    layout: 'form',
                    border: false,
                    fieldLabel: 'Subscribe to newsletters',
                    itemCls: 'x-check-group-alt',
                    columns: 2,
					anchor: '40%',
					id: 'radioGroup',
                    vertical: true,
                    allowBlank: false,
                    labelStyle: 'color:#c1000f',
                    items: [{
                        boxLabel: 'Yes',
                        name: 'receiveNewsletter',
                        inputValue: 'Yes'
                    }, {
                        boxLabel: 'No',
                        name: 'receiveNewsletter',
                        inputValue: 'No'
                    }]
                })
                
                var Checkboxes2 = new Ext.form.CheckboxGroup({
                    layout: 'form',
                    border: false,
                    labelStyle: 'color:#c1000f',
                    fieldLabel: 'What are your interests?',
                    itemCls: 'x-check-group-alt',
                    columns: 3,
					anchor: '85%',
                    allowBlank: false,
					id: 'Checkboxes2',
                    items: [{
                        boxLabel: 'Advertising',
                        name: 'interests[]',
                        inputValue: 'Advertising'
                    }, {
                        boxLabel: 'Broadcasting',
                        name: 'interests[]',
                        inputValue: 'Broadcasting'
                    }, {
                        boxLabel: 'Entertainment',
                        name: 'interests[]',
                        inputValue: 'Entertainment'
                    }, {
                        boxLabel: 'Events',
                        name: 'interests[]',
                        inputValue: 'Events'
                    }, {
                        boxLabel: 'Marketing',
                        name: 'interests[]',
                        inputValue: 'Marketing'
                    }, {
                        boxLabel: 'Media',
                        name: 'interests[]',
                        inputValue: 'Media'
                    }, {
                        boxLabel: 'Outdoor Advertising',
                        name: 'interests[]',
                        inputValue: 'Outdoor Advertising'
                    }, {
                        boxLabel: 'Production',
                        name: 'interests[]',
                        inputValue: 'Production'
                    }, {
                        boxLabel: 'Media',
                        name: 'interests[]',
                        inputValue: 'Media'
                    }, {
                        boxLabel: 'Public Relation',
                        name: 'interests[]',
                        inputValue: 'Public Relation'
                    }, {
                        boxLabel: 'Publishing',
                        name: 'interests[]',
                        inputValue: 'Publishing'
                    }, {
                        boxLabel: 'Talent Zone',
                        name: 'interests[]',
                        inputValue: 'Talent Zone'
                    }, {
                        boxLabel: 'Others',
                        name: 'interests[]',
                        inputValue: 'Others'
                    }]
                
                })
				
                var Checkboxes2Current = form.findById('Checkboxes2');
				var radioGroupCurrent = form.findById('radioGroup');
				
                
                if (Checkboxes2Current) {
				
					Checkboxes2Current.container.up('div.x-form-item').setDisplayed(true)
					Checkboxes2Current.clearInvalid()
					Checkboxes2Current.enable()
					
					radioGroupCurrent.container.up('div.x-form-item').setDisplayed(true)
					radioGroupCurrent.clearInvalid()
					radioGroupCurrent.enable()
				}
				else {
					
					form.insert(form.items.length - 3  , radioGroup);
					form.insert(form.items.length - 3  , Checkboxes2);
				}
				form.doLayout()
            }
            else {
				
               
                var Checkboxes2Current = form.findById('Checkboxes2');
				var radioGroupCurrent = form.findById('radioGroup');
				
                
                if (Checkboxes2Current) {
                
					Checkboxes2Current.container.up('div.x-form-item').setDisplayed(false)
                    Checkboxes2Current.clearInvalid()
                    Checkboxes2Current.disable()
					
					radioGroupCurrent.container.up('div.x-form-item').setDisplayed(false)
                    radioGroupCurrent.clearInvalid()
                    radioGroupCurrent.disable()
					
                }
                
                
            }
        }
        var MapIntrestedIn = function(combo, value, scope){
            var form = combo.findParentByType('form');
            
            if (combo.value == scope.options.quoteForm && form.findById('SelectedProductsField') == null) {
            
                var SelectedProductsFieldCom = new Ext.form.TextField({
                    id: 'SelectedProductsField',
                    fieldLabel: 'intrested in',
                    allowBlank: false,
                    labelStyle: 'color:#c1000f',
                    emptyText: 'click a block in the map',
                    readOnly: true,
                    listeners: {
                        'render': {
                            fn: function(){
                                this.wrap = this.el.wrap({
                                    tag: 'div'
                                });
                                // also, wrap the field create above with the same div as the appending fields
                                this.el.wrap({
                                    tag: 'div',
                                    cls: 'x-form-append',
                                    style: 'position: relative'
                                });
                                this.wrap.createChild({
                                    tag: 'div',
                                    cls: 'x-form-helptext',
                                    html: "<span style='color:#c1000f'>Click on a block in the map as given below & select the desired area (sq. mt.).</span>"
                                });
                            }
                        }
                    }
                })
                var comboArea = {
                    xtype: 'combo',
                    displayField: 'name',
                    valueField: 'name',
                    triggerAction: 'all',
                    labelStyle: 'color:#c1000f',
                    mode: 'local',
                    disabled: false,
                    labelSeparator: '',
                    hiddenName: 'Area',
                    allowBlank: false,
                    editable: false,
                    fieldLabel: 'area required',
                    emptyText: 'select',
                    store: new Ext.data.JsonStore({
                        url: "/index.php/SiteDataService/Module,DataEddValue",
                        baseParams: {
                            FormId: 57,
                            fieldID: 0,
                            recordID: 1
                        },
                        autoLoad: true,
                        root: "data",
                        fields: ["ID", "name"]
                    }, this)
                }
                
                
            }
            if (combo.value == scope.options.quoteForm && scope.options.quoteFormFormat == 2) {
                var currentTree = form.findById('SelectedProductsField');
                var MapHolder = form.findById('MapHolder');
                
                var currentCombo = form.find('hiddenName', 'Area');
                
                if (currentTree) {
                    currentTree.container.up('div.x-form-item').setDisplayed(true)
                    currentTree.enable();
                    currentCombo[0].container.up('div.x-form-item').setDisplayed(true)
                    currentCombo[0].enable();
                    MapHolder.show()
                }
                else {
                    form.add(SelectedProductsFieldCom)
                    form.add(comboArea)
                    form.add(ShowMapWindow())
                }
            }
            
            else {
                var currentTree = form.findById('SelectedProductsField');
                var currentCombo = form.find('hiddenName', 'Area');
                var MapHolder = form.findById('MapHolder');
                if (currentTree) {
                
                    currentTree.container.up('div.x-form-item').setDisplayed(false)
                    currentTree.clearInvalid()
                    currentTree.disable()
                    currentCombo[0].container.up('div.x-form-item').setDisplayed(false)
                    currentCombo[0].clearInvalid()
                    currentCombo[0].disable()
                    MapHolder.hide()
                }
                
                
            }
            form.doLayout()
            
        }
        var drawTree = function(combo, value, scope){
        
            var form = combo.findParentByType('form');
            var Tree = Ext.tree;
            
            if (combo.value == scope.options.quoteForm && !form.findById('tree') && (scope.options.quoteFormFormat == 1 || scope.options.quoteFormFormat == '')) {
                var tree = new Tree.TreePanel({
                    id: 'tree',
                    autoScroll: true,
                    animate: false,
                    useArrows: true,
                    containerScroll: true,
                    isFormField: true,
                    fieldLabel: 'intrested in',
                    border: false,
                    //title: 'select products',
                    rootVisible: false,
                    preloadChildren: true,
                    checkModel: 'cascade',
                    onlyLeafCheckable: false,
                    //		dataUrl: '/index.php/SiteDataService/Module,RetriveCatalog',
                    loader: {
                        dataUrl: '/index.php/SiteDataService/Module,RetriveCatalog'
                        // ,uiProvider: Ext.tree.NodeCheckBox
                    
                    },
                    listeners: {
                        'checkchange': {
                            fn: function(){
                                var checked = this.getChecked();
                                var checkedJoined = new Array();
                                for (var i in checked) {
                                    if (checked[i].id) 
                                        checkedJoined.push(checked[i].id)
                                }
                                Ext.getCmp('SelectedProducts').setValue(checkedJoined.join(','))
                            },
                            scope: tree
                        },
                        'click': function(node, e){
                            this.getSelectionModel().unselect(node);
                            if (node.isLeaf()) {
                                node.getUI().toggleCheck()
                                //this.fireEvent('dblclick', node, e)
                            }
                            return false
                        },
                        render: function(){
                        
                            var tip = new Ext.ToolTip({
                                target: this.id,
                                //trackMouse:true,
                                title: 'tip',
                                //autoHide: false,
                                //closable: true,
                                html: 'please expand the tree nodes to select multiple products you are interested in'
                            })
                        }
                    },
                    root: {
                        nodeType: 'async',
                        text: 'Ext JS',
                        draggable: false,
                        id: '0'
                    }
                });
                tree.getRootNode().expand();
            }
            
            if (combo.value == scope.options.quoteForm && (scope.options.quoteFormFormat == 1 || scope.options.quoteFormFormat == '')) {
                var currentTree = form.findById('tree');
                if (currentTree) 
                    currentTree.container.up('div.x-form-item').setDisplayed(true)
                
                else {
                    form.add(tree)
                    //form.insert(form.items.length - 4, tree)
                }
            }
            else {
                var currentTree = form.findById('tree');
                if (currentTree) 
                    currentTree.container.up('div.x-form-item').setDisplayed(false)
            }
            form.doLayout()
            
            //console.log(form.items.length)
        }
        var endNodeRendere = function(value){
            return "!! " + value
        }
        var contactForm = new Ext.FormWindow({
            fieldList: [{
                //bodyStyle: 'padding:5px 0 ',
                layout: 'column',
                border: false,
                defaults: {
                    border: false
                    //bodyStyle: 'padding:5px 0 '
                },
                items: [{
                    columnWidth: 1,
                    layout: 'form',
                    border: false,
                    items: [new Ext.form.ComboBox({
                        store: new Ext.data.JsonStore({
                            url: "/index.php/SiteDataService/Module,DataEddValue",
                            baseParams: {
                                FormId: 35,
                                fieldID: 0
                            },
                            listeners: {
                                'load': {
                                    fn: function(combo, something, other){
                                    
                                        if (this.options.Reason != 0) {
                                            Ext.getCmp('reason').setValue(this.options.Reason)
                                            Ext.getCmp('reason').fireEvent('select', Ext.getCmp('reason'))
                                        }
                                    },
                                    scope: this
                                }
                            
                            },
                            autoLoad: true,
                            root: "data",
                            fields: ["ID", "name"]
                        }),
                        listeners: {
                            'select': {
                            
                                fn: function(combo, value){
                                
                                
                                    if (this.options.quoteFormFormat == 1) 
                                        drawTree(combo, value, this)
                                    if (this.options.quoteFormFormat == 2) 
                                        MapIntrestedIn(combo, value, this)
                                    if (this.options.VisitorRegistrationFormFormat == 1) 
                                        VisitorRegistration(combo, value, this)
                                    
                                },
                                scope: this
                            }
                        },
                        anchor: '55%',
                        typeAhead: true,
                        id: 'reason',
                        fieldLabel: 'reason',
                        mode: 'local',
                        labelSeparator: '',
                        allowBlank: false,
                        triggerAction: 'all',
                        editable: false,
                        emptyText: 'Select',
                        selectOnFocus: true,
                        displayField: 'name',
                        valueField: 'ID',
                        hiddenName: 'Reason'
                    })]
                }, {
                    columnWidth: .4,
                    layout: 'form',
                    items: [new Ext.form.ComboBox({
                        store: new Ext.data.JsonStore({
                            url: "/index.php/SiteDataService/Module,DataEddValue",
                            baseParams: {
                                FormId: 51,
                                fieldID: 0
                            },
                            autoLoad: true,
                            root: "data",
                            fields: ["ID", "name"]
                        }),
                        anchor: '90%',
                        typeAhead: true,
                        fieldLabel: 'name',
                        mode: 'local',
                        allowBlank: false,
                        labelSeparator: '',
                        triggerAction: 'all',
                        emptyText: 'Select',
                        selectOnFocus: true,
                        displayField: 'name',
                        valueField: 'ID',
                        hiddenName: 'Salutation',
                        editable: false
                    })]
                }, {
                    columnWidth: .3,
                    layout: 'form',
                    items: [{
                        xtype: 'textfield',
                        emptyText: 'first name',
                        allowBlank: false,
                        hideLabel: true,
                        name: 'FirstName',
                        anchor: '90%'
                    }]
                }, {
                    columnWidth: .3,
                    layout: 'form',
                    items: [{
                        xtype: 'textfield',
                        emptyText: 'last name',
                        name: 'LastName',
                        hideLabel: true,
                        allowBlank: false,
                        anchor: '90%'
                    }]
                }]
            }, {
                xtype: 'textfield',
                fieldLabel: 'position',
                name: 'Position',
                anchor: '55%'
            
                //allowBlank : false
            }, {
                ///columnWidth: .4,
                anchor: '55%',
                xtype: 'textfield',
                fieldLabel: 'company',
                name: 'Company',
                listeners: {
                    render: function(){
                    
                        var XX = this;
                        var form = XX.ownerCt.getForm()
                        
                        e = Ext.DomHelper.insertFirst(XX.container.dom.parentNode, {
                            tag: "div",
                            style: 'padding-top:5px;',
                            children: [{
                                tag: "div",
                                cls: 'x-form-item',
                                children: [{
                                    tag: 'label',
                                    html: 'organization type',
                                    style: 'width: 150px;'
                                }, {
                                    tag: 'div',
                                    cls: 'x-form-element',
                                    style: 'padding-left: 155px;',
                                    children: [{
                                        tag: "table",
                                        style: "border-collapse:collapse; padding-top:5px",
                                        children: [{
                                            tag: "tr",
                                            children: [{
                                                tag: "td",
                                                style: "padding:4px",
                                                children: [{
                                                    tag: 'input',
                                                    type: 'radio',
                                                    name: 'isBusiness',
                                                    checked: 'true',
                                                    value: 'yes',
                                                    id: 'yesIsBusiness'
                                                }, {
                                                    tag: 'label',
                                                    'for': 'yesIsBusiness',
                                                    html: 'business',
                                                    style: 'float: none; display: inline; padding-left: 10px;'
                                                }]
                                            }, {
                                                tag: "td",
                                                style: "padding:4px",
                                                children: [{
                                                    tag: 'input',
                                                    type: 'radio',
                                                    name: 'isBusiness',
                                                    value: 'no',
                                                    id: 'noIsBusiness'
                                                }, {
                                                    tag: 'label',
                                                    'for': 'noIsBusiness',
                                                    html: 'individual ',
                                                    style: 'float: none; display: inline; padding-left: 10px;'
                                                }]
                                            }]
                                        }]
                                    }]
                                }]
                            }]
                        }, true)
                        XX.wrap = e.wrap();
                        XX.ownerCt.doLayout()
                        Ext.get('yesIsBusiness').on('click', function(ele, where){
                            XX.readOnly = false;
                            XX.container.dom.childNodes[0].readOnly = false;
                            XX.allowBlank = false
                            XX.setValue('');
                            XX.getEl().up('.x-form-item').setStyle('color', '#c1000f');
                            
                        })
                        
                        Ext.get('noIsBusiness').on('click', function(ele, where){
                            XX.setValue(form.items.get(1).getRawValue() + ' ' + form.items.get(2).getValue() + ' ' + form.items.get(3).getValue())
                            XX.getEl().up('.x-form-item').setStyle('color', '#000');
                            XX.container.dom.childNodes[0].readOnly = true;
                            XX.allowBlank = true
                            
                        })
                    }
                },
                allowBlank: false
            
            }, {
                layout: 'column',
                defaults: {
                    border: false
                },
                border: false,
                items: [{
                    //bodyStyle: 'padding:5px 0 ',
                    columnWidth: .4,
                    layout: 'form',
                    items: [new Ext.form.ComboBox({
                        store: phoneType,
                        anchor: '90%',
                        typeAhead: true,
                        labelSeparator: '',
                        fieldLabel: 'primary number',
                        mode: 'local',
                        triggerAction: 'all',
                        emptyText: 'Select',
                        allowBlank: false,
                        selectOnFocus: true,
                        hiddenName: 'PType',
                        editable: false,
                        displayField: 'name',
                        valueField: 'name'
                    })]
                }, {
                    //bodyStyle: 'padding:5px 0 ',
                    columnWidth: .3,
                    layout: 'form',
                    items: [{
                        xtype: 'textfield',
                        emptyText: '+971-4-123 4567',
                        allowBlank: false,
                        hideLabel: true,
                        vtype: 'phone',
                        name: 'PhonePrimary',
                        anchor: '90%'
                    }]
                }]
            }, {
                layout: 'column',
                defaults: {
                    border: false
                },
                border: false,
                items: [{
                    //bodyStyle: 'padding:5px 0 ',
                    columnWidth: .4,
                    layout: 'form',
                    border: false,
                    items: [new Ext.form.ComboBox({
                        store: phoneType,
                        anchor: '90%',
                        typeAhead: true,
                        fieldLabel: 'secondary number',
                        mode: 'local',
                        triggerAction: 'all',
                        labelSeparator: '',
                        emptyText: 'Select',
                        selectOnFocus: true,
                        editable: false,
                        displayField: 'name',
                        valueField: 'name',
                        hiddenName: 'SType'
                    })]
                }, {
                    //bodyStyle: 'padding:5px 0 ',
                    columnWidth: .3,
                    layout: 'form',
                    border: false,
                    items: [{
                        xtype: 'textfield',
                        emptyText: '+971-4-123 4567',
                        vtype: 'phone',
                        //allowBlank : false,
                        hideLabel: true,
                        name: 'PhoneSecondary',
                        anchor: '90%'
                    }]
                }]
            }, {
                columnWidth: .4,
                border: false,
                xtype: 'textfield',
                anchor: '55%',
                fieldLabel: 'email address',
                name: 'EmailAddress',
                vtype: 'email',
                allowBlank: false
            
            }, {
                columnWidth: .4,
                border: false,
                xtype: 'textfield',
                anchor: '55%',
                fieldLabel: 'facsimile',
                name: 'Facsimile',
                allowBlank: true
                //allowBlank : false,
            
            }, {
                columnWidth: .4,
                border: false,
                xtype: 'textarea',
                anchor: '55%',
                fieldLabel: 'address',
                name: 'Address'
                //allowBlank : false,
            
            }, {
                columnWidth: .1,
                layout: 'form',
                border: false,
                items: [new Ext.form.ComboBox({
                    store: new Ext.data.JsonStore({
                        url: "/index.php/SiteDataService/Module,CountryList",
                        baseParams: {
                            FormId: 57,
                            fieldID: 0,
                            recordID: 1
                        },
                        autoLoad: true,
                        root: "data",
                        fields: ["ID", "name"]
                    }, this),
                    anchor: '55%',
                    typeAhead: true,
                    fieldLabel: 'country',
                    hiddenName: 'Country',
                    mode: 'local',
                    triggerAction: 'all',
                    labelSeparator: '',
                    emptyText: 'select',
                    selectOnFocus: true,
                    //editable: false,
                    forceSelection: true,
                    displayField: 'name',
                    valueField: 'ID'
                
                })]
            }, {
                columnWidth: .1,
                layout: 'form',
                border: false,
                items: [{
                    xtype: 'combo',
                    displayField: 'name',
                    valueField: 'ID',
                    triggerAction: 'all',
                    mode: 'local',
                    disabled: false,
                    labelSeparator: '',
                    hiddenName: 'HeardFromWhere',
                    allowBlank: false,
                    editable: false,
                    anchor: '55%',
                    fieldLabel: 'how did you hear about us? ',
                    emptyText: 'select',
                    store: new Ext.data.JsonStore({
                        url: "/index.php/SiteDataService/Module,DataEddValue",
                        baseParams: {
                            FormId: 55,
                            fieldID: 0,
                            recordID: 1
                        },
                        autoLoad: true,
                        root: "data",
                        fields: ["ID", "name"]
                    }, this)
                }]
            }, {
                columnWidth: .1,
                layout: 'form',
                border: false,
                anchor: '55%',
                fieldLabel: 'comments',
                id: 'comments',
                name: 'comment',
                xtype: 'textarea'
            }, {
                columnWidth: .1,
                layout: 'form',
                border: false,
                anchor: '55%',
                fieldLabel: 'complete the equation',
                name: 'captcha',
                xtype: 'botfield',
                tooltip: {
                    tip: 'To verify you are not a robot, please enter the value that satisfies this equation:',
                    width: 220
                }
            }, {
                columnWidth: .1,
                layout: 'form',
                border: false,
                anchor: '55%',
                id: 'SelectedProducts',
                name: 'SelectedProducts',
                xtype: 'hidden'
            }],
            formUrl: "/index.php/SiteDataSavingService/Module,SaveContact/",
            //width: Ext.get(this.options.renderTo).getComputedWidth(),
            labelWidth: this.options.LabelWidth,
            title: "Follow up",
            frame: false,
            renderTo: this.options.renderTo,
            ShowToolbar: this.options.ShowToolbar,
            submitButtonCss: this.options.submitButtonCss,
            resetButtonCss: this.options.resetButtonCss
        
        })
        contactForm.showBlank("window.location = '/index.php'")
    }
}

