<?php 
$this->load->view('site/templates/commonheader');
$this->load->view('site/templates/shop_header'); //$checkloginIDarr=$this->session->all_userdata(); echo "<pre>"; print_r($checkloginIDarr);
?>


    	
      <div style="   background: none repeat scroll 0 0 #FFFFFF;    border-bottom: 1px solid #DDDDDD;    border-top: 1px solid #DDDDDD;    padding: 20px 0;" class="add_shop">
    	<div class="main">  	
           
            <div  class="shop_details">
            <form action="your-shop" name="shop_name_form" id="shop_name_form" method="post" onsubmit="return check_shopname(this);">
            	<span class="shop_title"> <?php if($this->lang->line('comm_shopname') != '') { echo stripslashes($this->lang->line('comm_shopname')); } else echo 'Shop Name'; ?> </span>
                <p><?php if($this->lang->line('shop_name') != '') { echo stripslashes($this->lang->line('shop_name')); } else echo 'Your shop name appears with your items in the'; ?> <?php echo $this->config->item('email_title'); ?> <?php if($this->lang->line('shop_marketplace') != '') { echo stripslashes($this->lang->line('shop_marketplace')); } else echo "marketplace. Pick a name that has personal significance or helps identify what's in your shop"; ?>.</p>
                <div style="width: 97%; padding: 30px 10px;" class="shop_name_save">
                	<label><?php if($this->lang->line('comm_shopname') != '') { echo stripslashes($this->lang->line('comm_shopname')); } else echo 'Shop Name'; ?></label>
                   <!-- <input type="text" class="checkout_txt" name="seller_businessname" id="seller_businessname" value="<?php  echo stripslashes($selectSeller_details[0]['seller_businessname']); ?>" autocomplete="off"  onchange="return check_shopname()" style="width:425px; height:27px" />-->
                   
                   
                   <!--onkeypress="return blockSpecialChar(event)"-->
                    <input type="text" class="checkout_txt" name="seller_businessname" id="seller_businessname" value="<?php  echo stripslashes($selectSeller_details[0]['seller_businessname']); ?>" autocomplete="off" onCopy="return false" onDrag="return false" onDrop="return false" onPaste="return false"
  onblur="return check_shopname(this);"  onkeyup="return check_shopname(this);" style="width:425px; height:27px" />
                    <div id="errMsg" style="color:#FF3333"></div>
                    <span class="note"><?php if($this->lang->line('shop_change') != '') { echo stripslashes($this->lang->line('shop_change')); } else echo 'You can change your shop name later'; ?>.</span>
                </div>
               <!--<input type="submit" style="display:none" value="Save" id="submitName" class="save_btn" />-->
                <input type="button" onclick="return check_shopname(this);" id="save-btn" value="<?php if($this->lang->line('user_save') != '') { echo stripslashes($this->lang->line('user_save')); } else echo 'Save'; ?>" class="save_btn" />
              
                </form>
                 
            </div>
           
            
    	</div>
        </div>
 
 
 
 <script>
function check_shopname(val) {
	blockSpecialChar(); 
		var shopname=$('#seller_businessname').val();  //^[a-zA-Z0-9]\s{2,20}$
		if(shopname.trim()=="" || shopname.trim()==null){
			  $("#errMsg").html('Enter Your Shop name.');
			  return false;
		 } 
		 
		$.get('site/shop/Load_ajax_shopName_check?s_name='+shopname, function(data) {
			 if(data == 'exist'){ 
			 $("#errMsg").html('Sorry! This shop name already exist,Please enter another name');
			 return false;
			 } else {
			 $("#errMsg").html('');
			 var checksbt=val.id; // alert(checksbt);
				 if(checksbt == 'save-btn')	{
				 $("#shop_name_form").submit();
				 }
				
			 }
		});
		
}


</script>

 <script type="text/javascript">
        function blockSpecialChar() {  
            //var k = e.keyCode;
            //return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8   || (k >= 48 && k <= 57) || (k >= 106 && k <= 111));
			$('#seller_businessname').val($('#seller_businessname').val().replace(/[^A-Za-z0-9]/g, ''))
			
        }
</script>
 
 
     
  <?php 
$this->load->view('site/templates/footer');
?>
