403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/b2bzend/application/views/scripts/supplier/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2bzend/application/views/scripts/supplier/supplier-overview.phtml
<?php
$arrSupplierTypes = $this->arrSupplierTypes;
$arrSupplierServices = $this->arrSupplierServices;
$salutionArr = unserialize(CONST_SALUTION);
$SupplierList = $this->SupplierList;
$supplierTypeMasking = $this->supplierTypeMasking;
$servicesMasking = $this->servicesMasking;
$countryArray = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getAllCountryCode();
$countryshortcode = Zend_Controller_Action_HelperBroker::getStaticHelper('General')->countryshortcode(($SupplierList['countrycode'] !=null)?str_replace('+','',trim($SupplierList['countrycode'])):'91');
$checkforall = $SupplierList['IscheckForAllCountry'];
//echo '<pre>'; 
//print_r($SupplierList);
//var_dump($countryshortcode); die;


?>

<form id="overviewRegForm" class="ls_form" role="form" autocomplete="off" method="POST">
    <div class="col-md-12 " id="dispMessage"></div>
    <div class="col-md-12">
        <div class="panel panel-default"> 
            <div class="panel-heading">
                <h3 class="panel-title">Supplier Overview</h3>
            </div>                               
            <div class="panel-body">

                <div class="col-md-12 no-padding">
                    <div class="col-md-4">
                        <div class="form-group">
                            <label>Company Name<?php echo MANDATORY_SIGN; ?></label>
                            <div class="col-md-12 no-padding">
                                <input type="text" name="companyName" maxlength="50" id="companyName" value="<?php echo @trim($SupplierList['CompanyName']) ? trim($SupplierList['CompanyName']) : @trim($SupplierList['SupplierName']) ?>" class="form-control whbg">                       </div>
                        </div>
                    </div>

                    <div class="col-md-4">
                        <label>GST Register</label><br /> 
                        <label><input type="radio" name="checkRadio" class="checkgst yes" value="yes" <?=(trim($SupplierList['GstApplicable']) ==1?'checked="checked"':'')?> > Yes</label>
                        <label><input type="radio" name="checkRadio" class="checkgst no" value="no" <?=(trim($SupplierList['GstApplicable']) ==0?'checked="checked"':'')?>> No</label>
                    </div>
                    <div class="check">
                        <label>Registration Scheme</label> <br />
                        <label><input type="radio" class="selectRadio nor" name="selectRadio" value="normal" <?=(trim($SupplierList['RegisrationScheme']) =='normal'?'checked="checked"':'')?>>Normal Registration Scheme</label><br />
                        <label><input type="radio" class="selectRadio com" name="selectRadio" value="composition" <?=(trim($SupplierList['RegisrationScheme']) =='composition'?'checked="checked"':'')?>>Composition Scheme</label>
                    </div>
                    <div class="box1" >
                        <div class="form-group">
                            <label>GST No.</label>
                            <div class="col-md-12 no-padding">
                                <input type="text" name="gstNumber" maxlength="50" id="gstNumber" value="<?php echo @trim($SupplierList['GSTNo']) ? trim($SupplierList['GSTNo']) : @trim($SupplierList['GSTNo']) ?>" class="form-control whbg">                       
                            </div>
                        </div>
                    </div>
                    
                    
                    
                    

                </div>  

                <!--<div class="col-md-4">
                        <div class="form-group">
                            <label>GST No.</label>
                            <div class="col-md-12 no-padding">
                                <input type="text" name="gstNumber" maxlength="50" id="gstNumber" value="<?php echo @trim($SupplierList['GSTNo']) ? trim($SupplierList['GSTNo']) : @trim($SupplierList['GSTNo']) ?>" class="form-control whbg">                       
                            </div>
                        </div>
                    </div>-->





                <div class="col-md-3">
                    <div class="form-group">
                        <label>Salutation</label>
                        <div class="col-md-12 no-padding"><select id="salution" name="salution" class="demo-default select-country" placeholder="Select">
                                <?php
                                if (is_array($salutionArr)) {

                                    foreach ($salutionArr as $salution) {
                                        $selected = @(trim($SupplierList['Salution']) == $salution) ? 'selected' : '';
                                        echo "<option value='$salution' $selected>$salution.</option>";
                                    }
                                }
                                ?>       
                            </select>                       
                        </div></div>
                </div>

                <div class="col-md-3">
                    <div class="form-group">
                        <label>First Name<?php echo MANDATORY_SIGN; ?></label>
                        <div class="col-md-12 no-padding"> <input type="text" maxlength="20" name="firstName" value="<?php echo @trim($SupplierList['FirstName']) ? trim($SupplierList['FirstName']) : trim($SupplierList['ContactPerson']) ?>" maxlength="50" id="firstName" class="form-control whbg noSpecialChars">  </div>                     
                    </div>
                </div>

                <div class="col-md-3">
                    <div class="form-group">
                        <label>Last Name</label>
                        <div class="col-md-12 no-padding"><input type="text" maxlength="20" id="lastName" name="lastName" value="<?php echo @trim($SupplierList['LastName']) ? trim($SupplierList['LastName']) : '' ?>" maxlength="50" class="form-control whbg noSpecialChars"> </div>
                    </div>
                </div>

                <div class="col-md-3">
                    <div class="form-group">
                        <label>Designation<?php echo MANDATORY_SIGN; ?></label>
                        <div class="col-md-12 no-padding"><input type="text" id="designation" name="designation" value="<?php echo @trim($SupplierList['Designation']) ? trim($SupplierList['Designation']) : '' ?>" maxlength="50" class="form-control whbg noSpecialChars">  </div>
                    </div>
                </div>


                <div class="col-md-3">
                    <div class="form-group">
                        <label>Email<?php echo MANDATORY_SIGN; ?></label>
                        <div class="col-md-12 no-padding"><input type="text" name="email" id="email" maxlength="50" value="<?php echo @trim($SupplierList['EmailId']) ? trim($SupplierList['EmailId']) : '' ?>" class="form-control whbg">                       </div>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="form-group no-margin">
                        <label>Mobile Number <?php echo MANDATORY_SIGN; ?> </label>
                        <div class="input-group textfieldMain_mobile">
                           <div class="country_details">
                                <div id="iti-flag" class="iti-flag <?=($countryshortcode !=null)?$countryshortcode:'in'?>"></div>
                                <div class="iti-arrow"></div>   
                            </div>
                            <div class="country_dropdown">
                                <div class="search_country">
                                        <input type="text" name="" class="txtfield form-control" placeholder="Search countries" id="countries_list">
                                        <div class="search_icon"></div>
                                </div>
                                <ul class="allcountries"></ul>
                            </div>
                            <div class="input-group-input">
                                <input type="text" class="country_code form-control codeborder" readonly="readonly" id="mobile_code" name="countrycode" value="<?=($SupplierList['countrycode'] !=null)?$SupplierList['countrycode']:'+91'?>" style="padding:0px;">
                                <input type="hidden" class="txtfield code_icons" id="code_icons" name="code_icons" value="<?=($SupplierList['code_icons'] !=null)?$SupplierList['code_icons']:'in'?>">
                            </div>
                            <input type="text" name="mobileno" id="mobileno" maxlength="15" value="<?php echo @trim($SupplierList['ContactNo']) ? trim($SupplierList['ContactNo']) : '' ?>" class="form-control whbg codeborder" >
                        </div>
                    </div>
                </div>
                
                
                <div class="col-md-3">
                    <div class="form-group">
                        <label>Address Line 1<?php echo MANDATORY_SIGN; ?></label>
                        <div class="col-md-12 no-padding">
                            <input name="address1" id="address1" class="form-control whbg noSpecialChars" type="text" value="<?php echo @trim($SupplierList['address1']) ? trim($SupplierList['address1']) : '' ?>"  maxlength="200" />
                        </div>
                    </div>
                </div>
                
                <div class="col-md-2">
                    <div class="form-group">
                        <label>Address Line 2</label>
                        <div class="col-md-12 no-padding">
                            <input name="address2" id="address2" class="form-control whbg noSpecialChars" type="text" value="<?php echo @trim($SupplierList['address2']) ? trim($SupplierList['address2']) : '' ?>"  maxlength="200" />
                        </div>   
                    </div>
                </div>
                
                <div class="col-md-3">
                    <div class="form-group">
                        <label>Country<?php echo MANDATORY_SIGN; ?></label>
                        <div class="col-md-12 no-padding">
                            <input name="country" id="country" onkeyup="get_country_autosuggest('country', 'hidden_selected_country_id');" type="text"  value="<?php echo @trim($SupplierList['CountryName']) ? trim($SupplierList['CountryName']) : '' ?>" maxlength="35"  class="form-control whbg" />
                        </div>
                        <input type="hidden" name="country_id" id="hidden_selected_country_id" value="<?php echo @trim($SupplierList['ContId']) ? trim($SupplierList['ContId']) : '' ?>"/>
                    </div>
                </div>
                
                <div class="col-md-3">
                    <div class="form-group">
                        <label>State<?php echo MANDATORY_SIGN; ?></label>
                        <div class="col-md-12 no-padding">
                            <input name="state" id="state" disabled="" onkeyup="get_states_autosuggest('state', 'hidden_selected_states_id');" type="text"  value="<?php echo @trim($SupplierList['StateName']) ? trim($SupplierList['StateName']) : '' ?>" maxlength="35"  class="form-control whbg" />
                        </div>
                        <input type="hidden" name="state_id" id="hidden_selected_states_id" value="<?php echo @trim($SupplierList['StateId']) ? trim($SupplierList['StateId']) : '' ?>"/>
                    </div>
                </div>



                <div class="col-md-3">
                    <div class="form-group">
                        <label>City<?php echo MANDATORY_SIGN; ?></label>
                        <div class="col-md-12 no-padding">
                            <input name="city" id="city" class="form-control whbg citychange" type="text" value="<?php echo @trim($SupplierList['CityName']) ? trim($SupplierList['CityName']) : '' ?>" onkeyup="get_city_autosuggest('city', 'hidden_selected_city_id', 'hidden_selected_country_id');"  maxlength="35" />
                        </div>                 
                        <input type="hidden" name="city_id" id="hidden_selected_city_id" value="<?php echo @trim($SupplierList['CitySysId']) ? trim($SupplierList['CitySysId']) . '__' . trim($SupplierList['CityName']) : 'NA' ?>" />
                    </div>
                </div>
                
                <div class="col-md-3">
                    <div class="form-group" id="otherlocationcityDiv">
                        <label>Other Location : City</label>
                        <div class="col-md-12 no-padding">
                            <?php
                            $cityArray = array();
                            if (!empty($this->otherlocationcity) ) {
                                foreach ($this->otherlocationcity as $cityList) {
                                    $cityArray[] = array('CityId' => trim($cityList['CityId']), 'Title' => trim($cityList['Title']) . "(" . trim($cityList['Country']) . ")");
                                }
                            }
                            $cityArrayData = '';
                            if (!empty($cityArray) ) {
                                //$cityArrayData=implode(',',$cityArray);
                                $cityArrayData = json_encode($cityArray);
                            }else{
                                $cityArrayData = json_encode($cityArray);
                            }
                            //echo '<pre>';print_r($cityArray);
                            //echo '<pre>';print_r($cityArrayData);
                            ?>
                            <input name="otherlocationcity" id="otherlocationcity" class="form-control whbg otherlocationcity" data-selectize-values='<?php echo $cityArrayData; ?>' value=''  type="text" onkeyup="other_loc_city_multiautosuggest('otherlocationcity');" /> 
                        </div>                 
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="form-group">
                        <label>Category<?php echo MANDATORY_SIGN; ?></label>
                        <div class="col-md-12 no-padding"><select id="suppliertype" name="suppliertype[]" multiple class="demo-default select-theme">
                                <?php
                                if (is_array($arrSupplierTypes)) {
                                    foreach ($arrSupplierTypes as $SupplierTypes) {
                                        @$selected = (in_array($SupplierTypes['SupplierTypeSysId'], @$supplierTypeMasking)) ? 'selected' : '';
                                        echo "<option value='$SupplierTypes[SupplierTypeSysId]' $selected>$SupplierTypes[Title]</option>";
                                    }
                                }
                                ?>
                            </select>   </div>                    
                    </div>
                </div>

                <div class="col-md-3">
                    <div class="form-group">
                        <label>Services<?php echo MANDATORY_SIGN; ?></label>
                        <div class="col-md-12 no-padding">  <select id="supplierservices" name="supplierservices[]" multiple class="demo-default select-theme" >
                                <?php
                                if (is_array($arrSupplierServices)) {
                                    foreach ($arrSupplierServices as $SupplierServices) {
                                        @$selected = (in_array($SupplierServices['SupplierSerSysId'], $servicesMasking)) ? 'selected' : '';
                                        echo "<option value='$SupplierServices[SupplierSerSysId]' $selected>$SupplierServices[Title]</option>";
                                    }
                                }
                                ?>                                                      
                            </select> </div>                        
                    </div>
                </div>
                
                <div class="col-md-6">
                    <div class="form-group">
                        <label>Comments</label>
                        <div class="col-md-12 no-padding">
                            <textarea name="comments" id="comments" cols="" rows="" class="form-control whbg noSpecialChars"><?php echo @trim($SupplierList['comments']) ? trim($SupplierList['comments']) : '' ?></textarea>
                        </div>   
                    </div>
                </div>
                
            </div>
            <div class="panel-heading">
                <h3 class="panel-title">Destination Offered</h3>
            </div>
            <div class="panel-body">
                <div class="col-md-12 no-padding">
                    
                    <div class="col-md-4" style="display: none;">
                        <div class="form-group">
                            <label>Regions</label>
                            <div class="col-md-12 no-padding">  
                                <?php $Regions = isset($SupplierList['Regions']) && !empty($SupplierList['Regions']) ? explode(',', $SupplierList['Regions']) : array(); ?>
                                <select id="Regions" name="Regions[]" multiple class="demo-default select-theme" >
                                    <option value='1' <?=in_array('1',$Regions)? 'selected' : ''?>>Region 1</option>
                                    <option value='2' <?=in_array('2',$Regions)? 'selected' : ''?>>Region 2</option>
                                    <option value='3' <?=in_array('3',$Regions)? 'selected' : ''?>>Region 3</option>
                                </select> </div>
                        </div>
                    </div>
                    
                    <div class="col-md-2">
                        <div class="form-group">
                            <label>&nbsp;</label>
                            <div class="col-md-12 no-padding">  
                                <label><input type="checkbox" id="checkforall_" <?=($checkforall ==1)?'checked':''?> name="checkforall" class="checkgst checkforall" value="1"> Check for all country</label>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label>Expertise In (Geography) : Country</label>
                            <div class="col-md-12 no-padding">
                                <?php 
                                    $abc = array(array('ContId'=>'All','Title'=>'All'));
                                    $countryListArr = (array_merge($this->countryList,$abc));
                                    if($checkforall == 1){
                                        $countryArray = isset($SupplierList['OldExpertiseCountriesId']) && !empty($SupplierList['OldExpertiseCountriesId']) ? explode(',', $SupplierList['OldExpertiseCountriesId']) : array();
                                    }else{
                                        $countryArray = isset($SupplierList['ExpertiseCountriesId']) && !empty($SupplierList['ExpertiseCountriesId']) ? explode(',', $SupplierList['ExpertiseCountriesId']) : array();
                                    }
                                    //echo '<pre>';print_r($countryArray);echo '</pre>';
                                ?>
                                <div class="hideshowCountry">
                                   <select id="geographyCountry" name="geographyCountry[]" multiple class="demo-default selectCountry" >
                                    <?php
                                    
                                    foreach ($this->countryList as $countryList) {
                                        @$selected = (in_array($countryList['ContId'], $countryArray)) ? 'selected' : '';
                                        //echo "<option value='$SupplierServices[SupplierSerSysId]' $selected>$SupplierServices[Title]</option>";
                                        echo "<option value='$countryList[ContId]'  $selected>$countryList[Title]</option>";
                                    }
                                    ?>                                                      
                                    </select>
                                </div>
                                    
                                <div class="hideshowCountry2">
                                <select id="geographyCountry2" name="geographyCountry2[]" multiple class="demo-default selectCountry2" >
                                    
                                    <option value='All' selected="">All</option>
                                                                                       
                                </select>
                                </div>
                                    
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group" id="expertisecityDiv">
                            <label>Expertise In (Geography) : City</label>
                            <div class="col-md-12 no-padding">
                                <?php
                                $cityArray = array();
                                if (!empty($this->selectedCityList) ) {
                                    foreach ($this->selectedCityList as $cityList) {
                                        $cityArray[] = array('CityId' => trim($cityList['CityId']), 'Title' => trim($cityList['Title']) . "(" . trim($cityList['Country']) . ")");
                                    }
                                }
                                $cityArrayData = '';
                                if (!empty($cityArray) ) {
                                    //$cityArrayData=implode(',',$cityArray);
                                    $cityArrayData = json_encode($cityArray);
                                }else{
                                    $cityArrayData = json_encode($cityArray);
                                }
                               
                                ?>
                                <input name="expertisecity" id="expertisecity" class="form-control whbg" data-selectize-value='<?php echo $cityArrayData; ?>' value=''  type="text" onkeyup="get_city_multiautosuggest('expertisecity');" /> 
                            </div>                 
                        </div>
                    </div>
                </div>    
            </div>
        </div>
    </div>
    <div class="col-md-12 no-padding no-margin">
        <div class="panel-footer text-right">
            <img class="loaderimg" style="display: none;" id="loaderimg" src="<?php echo $this->baseUrl('public/images/load1.gif'); ?>"/>
            <a href="<?php echo $this->baseUrl('supplier'); ?>" class="btn btn-primarygray btn-sm" type="cancel">Cancel</a>
            <button class="btn btn-sm btn-warning ">Next</button>
        </div>
    </div>

</form>
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/jquery-ui.css'); ?>" >

<!--selectize Library start-->
<script src="<?php echo $this->baseUrl('public/assets/js/selectize.min.js'); ?>"></script>
<!--selectize Library End-->

<!--Select & Tag demo start-->
<script src="<?php echo $this->baseUrl('public/assets/js/pages/selectTag.js'); ?>"></script>
<!--Select & Tag demo end-->
<script src="<?php echo $this->baseUrl('public/js/supplier/supplierFunction.js'); ?>"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

<!-- start : Code is added by Ranvir Singh on 30 Jan 2017 -->
<script src="<?php echo $this->baseUrl('public/assets/js/bootstrap3-typeahead.js'); ?>"></script>
<script src="<?php echo $this->baseUrl('public/assets/js/selectCityTypeahead.js'); ?>"></script>
<script src="<?php echo $this->baseUrl('public/countrycode/script.js?rv=1144'); ?>"></script>

<script>
    $('.selectCountry').selectize();
    $('.selectCountry2').selectize();
    <?php
    if($checkforall == 1){
    ?>
        $(".hideshowCountry").hide();
        $(".hideshowCountry2").show();
    <?php
    }else{
    ?>
       $(".hideshowCountry2").hide();
       $(".hideshowCountry").show(); 
    <?php
    }
    ?>
    $(".checkforall").click(function(){
        if($('#checkforall_').prop("checked") === true){
            //$("#geographyCountry2").removeAttr("disabled");
            $(".hideshowCountry").hide();
            $(".hideshowCountry2").show();
            
        }else if($('#checkforall_').prop("checked") === false){
            $(".hideshowCountry2").hide();
            $(".hideshowCountry").show();
            //$('input[id="geographyCountry2"]').removeAttr("disabled");;
        }
        //alert(values);
    });                            
    function get_country_autosuggest(inputId, hiddenInputId) {
        $('#' + inputId).typeahead({
            items: 'all',
            source: function (query, process) {
                $('#' + hiddenInputId).val('');
                return $.ajax({
                    url: '/general/suggest-country',
                    type: 'post',
                    async: false,
                    data: {query: query},
                    dataType: 'json',
                    success: function (result) {
                        var resultList = result.map(function (item) {
                            var aItem = {ContId: item.ContId, Title: item.Title};
                            return JSON.stringify(aItem);
                        });
                        return process(resultList);
                    }
                });
            },
            sorter: function (items) {
                var beginswith = [], caseSensitive = [], caseInsensitive = [], item;
                while (aItem = items.shift()) {
                    var item = JSON.parse(aItem);
                    if (!item.Title.toLowerCase().indexOf(this.query.toLowerCase()))
                        beginswith.push(JSON.stringify(item));
                    else if (~item.Title.indexOf(this.query))
                        caseSensitive.push(JSON.stringify(item));
                    else
                        caseInsensitive.push(JSON.stringify(item));
                }
                return beginswith.concat(caseSensitive, caseInsensitive)
            },
            highlighter: function (obj) {
                var item = JSON.parse(obj);
                var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
                return item.Title.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
                    return '<strong>' + match + '</strong>'
                })
            },
            updater: function (item) {
                var item = JSON.parse(item);
                if(item.ContId === '101'){
                    $('#state').removeAttr('disabled', true);
                }else{
                    $('#state').val('');
                    $('#hidden_selected_states_id').val('');
                    $('#state').attr('disabled', true);
                }
                $('#' + hiddenInputId).val(item.ContId);
                return item.Title;
            },
            minLength: 2,
            displayField: 'Title',
        });
    }

    //*State Code*//

    function get_states_autosuggest(inputId, hiddenInputId) {
        $('#' + inputId).typeahead({
            items: 'all',
            source: function (query, process) {
                $('#' + hiddenInputId).val('');
                return $.ajax({
                    url: '/general/suggest-state',
                    type: 'post',
                    async: false,
                    data: {query: query},
                    dataType: 'json',
                    success: function (result) {
                        var resultList = result.map(function (item) {
                            var aItem = {StateId: item.StateId, Title: item.Title};
                            return JSON.stringify(aItem);
                        });
                        return process(resultList);
                    }
                });
            },
            sorter: function (items) {
                var beginswith = [], caseSensitive = [], caseInsensitive = [], item;
                while (aItem = items.shift()) {
                    var item = JSON.parse(aItem);
                    if (!item.Title.toLowerCase().indexOf(this.query.toLowerCase()))
                        beginswith.push(JSON.stringify(item));
                    else if (~item.Title.indexOf(this.query))
                        caseSensitive.push(JSON.stringify(item));
                    else
                        caseInsensitive.push(JSON.stringify(item));
                }
                return beginswith.concat(caseSensitive, caseInsensitive)
            },
            highlighter: function (obj) {
                var item = JSON.parse(obj);
                var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
                return item.Title.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
                    return '<strong>' + match + '</strong>'
                })
            },
            updater: function (item) {
                var item = JSON.parse(item);
                $('#' + hiddenInputId).val(item.StateId);
                return item.Title;
            },
            minLength: 2,
            displayField: 'Title',
        });
    }
    get_city_multiautosuggest('expertisecity');

    function get_city_multiautosuggest(inputId) {
        $("#"+ inputId).selectize({
            onInitialize: function () {
                var existingOptions = JSON.parse(this.$input.attr('data-selectize-value'));
                var self = this;
                if (Object.prototype.toString.call(existingOptions) === "[object Array]") {
                    existingOptions.forEach(function (existingOption) {
                        self.addOption(existingOption);
                        self.addItem(existingOption[self.settings.valueField]);
                    });
                }
                else if (typeof existingOptions === 'object') {
                    self.addOption(existingOptions);
                    self.addItem(existingOptions[self.settings.valueField]);
                }
            },
            preload: true,
            //options: [],
            openOnFocus: false,
            valueField: 'CityId',
            labelField: 'Title',
            searchField: 'Title',
            create: false,
            render: {
                option: function (item, escape) {
                    return '<div>' + escape(item.Title) + '</div>';
                }
            },
            load: function (query, callback) {
                //var countryId = $("#geographyCountry").val();
                var countryId = '';
                $.ajax({
                    url: '/general/suggest-multi-city',
                    type: 'post',
                    data: {query: query, countryId: countryId},
                    dataType: 'json',
                    success: function (result) {
                        callback(result);
                        //console.log(result)

                        // $('#select-amini1').html( '<option value="1">Test</option>' );

                        /*var resultList = result.map(function (item) {
                         //var aItem = {  CityId: item.CityId, Title: item.Title};
                         var aItem='<div data-value="'+item.CityId+'" data-selectable="" class="option">'+item.Title+'</div>';
                         return aItem;
                         });
                         $('#expertisecityDiv .selectize-dropdown .selectize-dropdown-content').html(resultList);*/

                    }
                });
            }
        });
    }

    other_loc_city_multiautosuggest('otherlocationcity');

    function other_loc_city_multiautosuggest(inputId) {
        $("#" + inputId).selectize({
            onInitialize: function () {
                var existingOptions = JSON.parse(this.$input.attr('data-selectize-values'));
                //console.log(existingOptions);
                var self = this;
                if (Object.prototype.toString.call(existingOptions) === "[object Array]") {
                    existingOptions.forEach(function (existingOption) {
                        self.addOption(existingOption);
                        self.addItem(existingOption[self.settings.valueField]);
                    });
                }
                else if (typeof existingOptions === 'object') {
                    self.addOption(existingOptions);
                    self.addItem(existingOptions[self.settings.valueField]);
                }
            },
            preload: true,
            //options: [],
            openOnFocus: false,
            valueField: 'CityId',
            labelField: 'Title',
            searchField: 'Title',
            create: false,
            render: {
                option: function (item, escape) {
                    return '<div>' + escape(item.Title) + '</div>';
                }
            },
            load: function (query, callback) {
                var countryId = $("#hidden_selected_country_id").val();
                $.ajax({
                    url: '/general/suggest-multi-city-other',
                    type: 'post',
                    data: {query: query, countryId: countryId},
                    dataType: 'json',
                    success: function (result) {
                        callback(result);
                        //console.log(result)

                        // $('#select-amini1').html( '<option value="1">Test</option>' );

                        /*var resultList = result.map(function (item) {
                         //var aItem = {  CityId: item.CityId, Title: item.Title};
                         var aItem='<div data-value="'+item.CityId+'" data-selectable="" class="option">'+item.Title+'</div>';
                         return aItem;
                         });
                         $('#expertisecityDiv .selectize-dropdown .selectize-dropdown-content').html(resultList);*/

                    }
                });
            },
        });
    }


</script>
<!-- end : Code is added by Ranvir Singh on 30 Jan 2017 -->

Youez - 2016 - github.com/yon3zu
LinuXploit