<?php 
	$header_file=APPPATH.'views/include/header.php';
	require($header_file);
	$sidenav_file=APPPATH.'views/include/sidenav.php';
	require($sidenav_file);	?>
   
    <!-- BEGIN: Content-->
    <div class="app-content content">
      <div class="content-overlay"></div>
      <div class="content-wrapper">
        <div class="content-header row">
          <div class="content-header-left col-md-12 col-12 mb-2 breadcrumb-new">
            <h3 class="content-header-title mb-0 d-inline-block">Supplier </h3>
            <div class="row breadcrumbs-top d-inline-block">
              <div class="breadcrumb-wrapper col-12">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item"><a href="#">Home</a>
                  </li>
                  <li class="breadcrumb-item"><a href="#">Supplier</a>
                  </li>
                  <li class="breadcrumb-item active">Supplier Update
                  </li>
                </ol>
              </div>
            </div>
          </div>
          
        </div>
        <div class="content-body"><!-- Basic form layout section start -->
<section id="basic-form-layouts">
	



	<div class="row justify-content-md-center">
		<div class="col-md-12">
			<div class="card">
				<div class="card-header">
					<h4 class="card-title" id="basic-layout-form-center">Supplier Update</h4>
					<a class="heading-elements-toggle"><i class="la la-ellipsis-v font-medium-3"></i></a>
					<div class="heading-elements">
						<ul class="list-inline mb-0">
							<li><a data-action="collapse"><i class="ft-minus"></i></a></li>
							<li><a data-action="reload"><i class="ft-rotate-cw"></i></a></li>
							<li><a data-action="expand"><i class="ft-maximize"></i></a></li>
							<li><a data-action="close"><i class="ft-x"></i></a></li>
						</ul>
					</div>
				</div>
				<?php foreach($supplier as $data) ?>
				<div class="card-content collapse show">
					<div class="card-body">
						<form class="form" enctype="multipart/form-data" autocomplete="off" action="<?php echo site_url('Master/edtSupplier');?>" method="post">
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Supplier Name</label>
											<input type="text" class="form-control" id="sname" name="sname" value="<?php echo $data->company_name; ?>" required placeholder="Supplier Name">
											<input type="hidden" class="form-control" id="vref" name="vref" value="<?php echo $data->vender_ref_no; ?>" >
											<input type="hidden" class="form-control" id="sub_mod_id" name="sub_mod_id" value="<?php //echo $submod_id; ?>" >
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Address</label>
											<input type="text" class="form-control" id="address" name="address" value="<?php echo $data->address; ?>"  placeholder="Address">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">City</label>
											<input type="text" class="form-control" id="city" name="city" value="<?php echo $data->address1; ?>" placeholder="City">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Postal Code</label>
											<input type="text" class="form-control" id="postal_code" name="postal_code" value="<?php echo $data->postal_code; ?>" >
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">State</label>
											<input type="text" class="form-control" id="state" name="state" value="<?php echo $data->state; ?>" placeholder="State">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Country</label>
											<input type="text" class="form-control" id="country" name="country" value="<?php echo $data->country; ?>" placeholder="Country">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Area Code Phone</label>
											<input type="text" class="form-control" id="area_code_phone" name="area_code_phone" value="<?php echo $data->area_code_phone; ?>" placeholder="Area Code Phone">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Phone Landline</label>
											<input type="text" class="form-control" id="landline" name="landline" value="<?php echo $data->land_phone; ?>" placeholder="Phone Landline">
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Email ID</label>
											<input type="text" class="form-control" id="email_id" name="email_id" value="<?php echo $data->email_id; ?>" placeholder="Email ID">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Contact Person</label>
											<input type="text" class="form-control" id="contact_person" name="contact_person" value="<?php echo $data->contact_person; ?>" placeholder="Contact Person">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Designation</label>
											<input type="text" class="form-control" id="designation" name="designation" value="<?php echo $data->designation; ?>" placeholder="Designation">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Department</label>
											<input type="text" class="form-control" id="dept" name="dept" value="<?php echo $data->department; ?>" placeholder="Department">
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Contact Mobile</label>
											<input type="text" class="form-control" id="contact_no" name="contact_no" value="<?php echo $data->contact_no; ?>" placeholder="Contact Mobile">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Fax No</label>
											<input type="text" class="form-control" id="fax_no" name="fax_no" value="<?php echo $data->fax_no; ?>" placeholder="Fax No">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Bank Name</label>
											<input type="text" class="form-control" id="bank_name" name="bank_name" value="<?php echo $data->bank_name; ?>" placeholder="Bank Name">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Beneficiary Name for Payment</label>
											<input type="text" class="form-control" id="benificiary_name" name="benificiary_name" value="<?php echo $data->benificiary_name; ?>" placeholder="Beneficiary Name for Payment">
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Branch Address</label>
											<input type="text" class="form-control" id="branch_addr" name="branch_addr" value="<?php echo $data->bank_branch; ?>" placeholder="Branch Address">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Bank Account No</label>
											<input type="text" class="form-control" id="bank_acc_no" name="bank_acc_no" value="<?php echo $data->bank_acc_no; ?>" placeholder="Bank Account No">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">IFSC Code</label>
											<input type="text" class="form-control" id="ifsc_code" name="ifsc_code" value="<?php echo $data->ifsc_code; ?>" placeholder="IFSC Code">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">PAN No</label>
											<input type="text" class="form-control" id="pan_no" name="pan_no" value="<?php echo $data->pan_no; ?>" placeholder="PAN No">
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">GSTIN No</label>
											<input type="text" class="form-control" id="gstin_no" name="gstin_no" value="<?php echo $data->gstin_no; ?>" placeholder="GSTIN No">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">MOP</label>
											<select name="mop" id="mop" class="form-control select2" >
												<option value="">Select MOP</option>
												<option <?php if($data->mop == 'Cash') echo 'selected="selected"'?> value="Cash">Cash</option>
												<option <?php if($data->mop == 'Bank') echo 'selected="selected"'?> value="Bank">Bank</option>
											</select>
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Payment terms From Invoice date</label>
											<input type="text" class="form-control" id="crt_period" name="crt_period" value="<?php echo $data->cr_prd; ?>" placeholder="Payment terms">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-4">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Registered Under MSME</label>
											<input type="radio" name="rgst_msme" id="ryes" value="Yes" style="margin-left:15px;" <?php if($data->rgst_msme == 'Yes') echo 'checked="checked"'; ?> />Yes
											<input type="radio" name="rgst_msme" id="rno" value="No" <?php if($data->rgst_msme == 'No') echo 'checked="checked"'; ?> />No 
										</div>
									</div>
								</div>
								<div class="col-md-3" id="mrgst_no" style="display:none;">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">MSME Registration No</label>
											<input type="text" class="form-control" id="msme_rgst_no" name="msme_rgst_no" value="<?php echo $data->rgst_msme_no; ?>" placeholder="MSME Registration No">
										</div>
									</div>
								</div>
							<!--	<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Branch</label>
											<select name="branch[]" id="branch" class="form-control select2" required multiple="multiple" >
												
												<?php  /*foreach($branch as $row)
													{
														echo '<option value="'.$row->branch_id.'">'.$row->branch_name.'</option>';
													} */
												?>
												
												<?php
												/*	$branch_name = array();
													$branch_id = array();
													foreach($branch as $br)
													{
														$branch_name[] = $br->branch_name;
														$branch_id[] = $br->branch_id;
													}
													//$updated_in = array('CW1','CW2','CW3','CW4');
													//$brn = $data->branchname;
													//$br_name = explode(",", $brn);
													//$br_count = count($br_name);
													$brn = array();
													foreach($supplierbr as $key => $sup){
														
														$brn[] = $sup->branchname;
													}
													for($j=0;$j<count($branch_name);$j++)
													{
														if(in_array($branch_name[$j],$brn))
														{
															?>
															<option value="<?php echo $branch_id[$j]?>" selected="selected" ><?php echo $branch_name[$j]?></option>
															<?php
														}
														else
														{
													?>
															<option value="<?php echo $branch_id[$j]?>"><?php echo $branch_name[$j]?></option>
													<?php
														}
													} */
												?>
											</select>
											<input type="hidden" id="branch_name" name="branch_name"  >
										</div>
									</div>
								</div>-->
								<div class="col-md-2">
									<div class="form-body">
										<div class="form-group">
											
										</div>
									</div>
								</div>
							</div>
							<div class="form-actions text-center">
								<button type="reset" class="btn btn-warning mr-1">
									<i class="ft-x"></i> Cancel
								</button>
								<button type="submit" class="btn btn-primary">
									<i class="la la-check-square-o"></i> Save
								</button>
							</div>
						</form>	
					</div>
				</div>
			</div>
		</div>
	</div>

</section>
<!-- // Basic form layout section end -->
        </div>
      </div>
    </div>
    <?php //require('include/theme_customizer.php');?>

   <?php 
  $footer_file=APPPATH.'views/include/footer.php';
	require($footer_file);
	?>
	<script type="text/javascript">
		$(function () {
			$('#branch').multiselect({
				includeSelectAllOption: true
			});
		});
	</script>
	<script>
		$("#branch").change(function(){
			   //var branch = $('#branch option:selected').text();
			var branch = $("#branch option:selected").map(function () {
			return $(this).text();
			}).get().join(',');
			//alert(branch);
			$('#branch_name').val(branch);
		});
	</script>
	<script>
	    $("input[name='rgst_msme']").click(function() {
			if($('#ryes').is(':checked'))
			{
				$('#mrgst_no').show();
			}
			else
			{
				$('#mrgst_no').hide();
			}
		});
	</script>

  </body>
  <!-- END: Body-->

<!-- Mirrored from pixinvent.com/modern-admin-clean-bootstrap-4-dashboard-html-template/html/ltr/vertical-modern-menu-template/form-layout-basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Apr 2020 09:38:02 GMT -->
</html>