<link rel="stylesheet" href="{$data.base_url}assets/ui/jquery-ui.css">
<section id="main" class="container-fluid" style="padding-top: 3px;">
	<div class="row">
		<section id="content-wrapper" class="form-elements">
			
		</section>
	 	<div class="content" >
	 		<div class="row">
	 		{if $data.message neq ''}
	 		<div class="col-sm-12">
	            <div class="alert alert-success alert-dismissible fade in" role="alert">
					<button type="button" class="close" data-dismiss="alert" aria-label="Close">
						<span aria-hidden="true">×</span>
					</button>
					<strong>{$data.message}.</strong>
				</div>
			</div>
            {/if}
				<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12">	
					{if $data.contact_details eq ''}
						<h2>New Contact</h2>
						<form class="form-horizontal" name="services-form" id="services-form" enctype="multipart/form-data" method="post" action="{$data.base_url}contact/create">
							<div class="panel panel-default">
								<div class="col-sm-6">
									<div class="panel-heading">
				                        <h3 class="panel-title">
				                        	<b>PERSONAL DETAILS</b>
				                        </h3>
				                    </div>
				                    <div class="panel-body">
			                        	<div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">CATEGORY <span>*</span></label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<select class="form-control select" name="categoryid[]" id="categoryid"  multiple="">
														<option value="">Select Category Name</option>
														{section name = i loop = $data.category}
															<option value="{$data.category[i].id}" data-tokens="{$data.category[i].name}" >{$data.category[i].name|upper}</option>
														{/section}
												</select>
			                                	
			                                </div>
			                            </div>
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">NAME <span>*</span></label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		<input  class="form-control" type="text" id="contactname" name="data[name]" maxlength="100"  required onblur="return detailsfill(this.value);">
			                                	</div>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">ADDRESS <span>*</span></label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		 <textarea  class="form-control" id="address" name="data[address]"  required required=""></textarea>
			                                	</div>
			                                </div>
			                            </div>
			                            
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">CITY <span>*</span></label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		 <input  class="form-control" type="text" id="city" name="data[city]" maxlength="100">
			                                	</div>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">MOBILE <span>*</span></label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		  
			                                   		  <input  class="form-control" type="text" id="mobile" name="data[mobile]"  >
			                                	</div>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">EMAIL</label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		  <input  class="form-control" type="email"   id="email" name="data[email]" >
			                                	</div>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">IS MULTIPLE</label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<input type="checkbox"   
			                                    	id="is_multiple" name="data[is_multiple]" value="1" > Yes
			                                	</div>
			                                </div>
			                            </div>
			                        </div>
			                    </div>
			                    <div class="col-sm-6">
									<div class="panel-heading">
				                        <h3 class="panel-title">
				                        	<b>BUSINESS DETAILS</b>
				                        </h3>
				                    </div>
				                    <div class="panel-body">
			                        	
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">FIRM NAME </label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		<input  class="form-control" type="text" id="bname" name="data[bname]" maxlength="100" >
			                                	</div>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">PHONE (O) </label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		 <input  class="form-control" type="number" id="bphone" name="data[bphone]" maxlength="15">
			                                	</div>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">FAX NO <span>*</span></label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		 <input  class="form-control" type="text" id="bfaxno" name="data[bfaxno]" maxlength="15">
			                                	</div>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">WEBSITE <span>*</span></label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		  <input  class="form-control" type="text" id="bwebsite" name="data[bwebsite]" maxlength="100" >
			                                	</div>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">EMAIL</label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		 <input  class="form-control" type="email" id="bemail" name="data[bemail]" maxlength="100" >
			                                	</div>
			                                </div>
			                            </div>
			                            <div class="form-group">
				                            <div class=" col-sm-12">
												<b>BANK DETAILS</b>
											</div>
										</div>
										<div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">BANK NAME </label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		<input  class="form-control" type="text" id="bbankname" name="data[bbankname]" maxlength="100" >
			                                	</div>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">BANK ACC NO</label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		<input  class="form-control" type="number" id="bbankaccno" name="data[bbankaccno]" maxlength="55">
			                                	</div>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                        	 	<label class="col-sm-3 col-xs-12 control-label">IFSC CODE</label>
			                        	 	<div class="col-sm-9 col-xs-12"> 
			                        	 		<div class="input-group">
			                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
			                                   		<input  class="form-control" type="text" id="bbankifsc" name="data[bbankifsc]" maxlength="15">
			                                	</div>
			                                </div>
			                            </div>
			                        </div>
			                    </div>
			                    <div class="panel-footer">
			                        <input type="submit" class="btn btn-primary pull-right" value="Save" name="contact">
			                    </div>
								
							</div>
						</form>
		                
	                {else}
	                <form class="form-horizontal" name="services-form" id="services-form" enctype="multipart/form-data" method="post" action="{$data.base_url}contact/update">
	                <input type="hidden" id="id" name="data[id]" value="{$data.contact_details.id}">
						<div class="panel panel-default">
							<div class="col-sm-6">
								<div class="panel-heading">
			                        <h3 class="panel-title">
			                        	<b>Edit Contact Details</b>
			                        </h3>
			                    </div>
			                    <div class="panel-body">
		                        	<div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">CATEGORY<span>*</span></label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<select class="form-control select" name="categoryid[]" id="categoryid" multiple="">
													<option value="">Select Category Name</option>
													{section name = i loop = $data.category}
														<option value="{$data.category[i].id}" data-tokens="{$data.category[i].name} " 
														{if $data.category[i].id|in_array:$data.cat_select}
														selected=""
														{/if}>{$data.category[i].name|upper}</option>
													{/section}
											</select>
		                                	
		                                </div>
		                            </div>
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">NAME <span>*</span></label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		<input  class="form-control" type="text" id="name" name="data[name]" value="{$data.contact_details.name}" maxlength="100"  required>
		                                	</div>
		                                </div>
		                            </div>
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">ADDRESS <span>*</span></label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		 <textarea  class="form-control" id="address" name="data[address]"  required required="">{$data.contact_details.address}</textarea>
		                                	</div>
		                                </div>
		                            </div>
		                            
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">CITY <span>*</span></label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		 <input  class="form-control" type="text" id="city" name="data[city]" value="{$data.contact_details.city}" maxlength="100">
		                                	</div>
		                                </div>
		                            </div>
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">MOBILE <span>*</span></label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		  <input  class="form-control" type="text" id="mobile" name="data[mobile]" value="{$data.contact_details.mobile}">
		                                   		  
		                                	</div>
		                                </div>
		                            </div>
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">EMAIL</label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		  <input  class="form-control" type="email"   id="email" name="data[email]" value="{$data.contact_details.email}" >
		                                	</div>
		                                </div>
		                            </div>
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">IS MULTIPLE</label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<input type="checkbox"   
		                                    	id="is_multiple" {if $data.contact_details.is_multiple eq '1'} checked="" {/if} name="data[is_multiple]" value="1" > Yes
		                                	</div>
		                                </div>
		                            </div>
		                        </div>
		                    </div>
		                    <div class="col-sm-6">
								<div class="panel-heading">
			                        <h3 class="panel-title">
			                        	<b>BUSINESS DETAILS</b>
			                        </h3>
			                    </div>
			                    <div class="panel-body">
		                        	
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">FIRM NAME </label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		<input  class="form-control" type="text" id="bname" name="data[bname]" value="{$data.contact_details.bname}" maxlength="100" >
		                                	</div>
		                                </div>
		                            </div>
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">PHONE (O) </label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		 <input  class="form-control" type="number" id="bphone" name="data[bphone]" value="{$data.contact_details.bphone}" maxlength="15">
		                                	</div>
		                                </div>
		                            </div>
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">FAX NO <span>*</span></label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		 <input  class="form-control" type="text" id="bfaxno" name="data[bfaxno]" value="{$data.contact_details.bfaxno}" maxlength="15">
		                                	</div>
		                                </div>
		                            </div>
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">WEBSITE <span>*</span></label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		  <input  class="form-control" type="text" id="bwebsite" name="data[bwebsite]" value="{$data.contact_details.bwebsite}" maxlength="100" >
		                                	</div>
		                                </div>
		                            </div>
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">EMAIL</label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		 <input  class="form-control" type="email" id="bemail" name="data[bemail]" value="{$data.contact_details.bemail}" maxlength="100" >
		                                	</div>
		                                </div>
		                            </div>
		                            <div class="form-group">
			                            <div class=" col-sm-12">
											<b>BANK DETAILS</b>
										</div>
									</div>
									<div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">BANK NAME </label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		<input  class="form-control" type="text" id="bbankname" name="data[bbankname]" value="{$data.contact_details.bbankname}" maxlength="100" >
		                                	</div>
		                                </div>
		                            </div>
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">BANK ACC NO</label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		<input  class="form-control" type="number" id="bbankaccno" name="data[bbankaccno]" maxlength="55" value="{$data.contact_details.bbankaccno}">
		                                	</div>
		                                </div>
		                            </div>
		                            <div class="form-group">
		                        	 	<label class="col-sm-3 col-xs-12 control-label">IFSC CODE</label>
		                        	 	<div class="col-sm-9 col-xs-12"> 
		                        	 		<div class="input-group">
		                                    	<span class="input-group-addon"><span class="fa fa-pencil"></span></span>
		                                   		<input  class="form-control" type="text" id="bbankifsc" name="data[bbankifsc]" maxlength="15" value="{$data.contact_details.bbankifsc}">
		                                	</div>
		                                </div>
		                            </div>
		                        </div>
		                    </div>
		                    <div class="panel-footer">
		                        <input type="submit" class="btn btn-primary pull-right" value="Save" name="contact">
		                    </div>
							
						</div>
					</form>
	                	
		                
	                {/if}
	            </div>
	           	
			</div>
		</div>
	</div>
	 
