 <?php
/* URI SEGMENT FOR AJAX */
/* URI SEGMENT*/
helper('url');
// Get the URI object
$uri = current_url(true);
$ajax_url = $uri->getSegment(1).'/'.$uri->getSegment(2);
/* URI SEGMENT FOR AJAX END */
?>
		<!-- ============================================================== -->
        <!-- Start right Content here -->
        <!-- ============================================================== -->
        <div class="main-content">
            <div class="page-content">
                <div class="container-fluid">

                    <!-- start page title -->
                    <div class="row">
                        <div class="col-12">
                            <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                                <h4 class="mb-sm-0">Add <?php echo $heading;?></h4>
                                <div class="page-title-right">
                                    <ol class="breadcrumb m-0">
                                        <li class="breadcrumb-item"><a href="javascript: void(0);">Booking</a></li>
                                        <li class="breadcrumb-item active">Add <?php echo $heading;?></li>
                                    </ol>
                                </div>

                            </div>
                        </div>
                    </div>
                    <!-- end page title -->
                   <div class="row">
                        <div class="col-lg-12">
                            <div class="card" id="invoiceList">
                                <div class="card-header border-0">
                                    <div class="d-flex align-items-center">
                                        <h5 class="card-title mb-0 flex-grow-1"><?php //echo $heading;?></h5>
                                        <div class="flex-shrink-0">
                                            <div class="d-flex gap-2 flex-wrap">
                                            	<button class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#modalDeleteAll" id="remove-actions" onClick="getDeleteAll()"><i class="ri-delete-bin-2-line"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                
                                <div class="card-body">
                                    <div class="p-2">
									<div class="box-body">
									<div class="form-group">
									<form role="form" id="formAdd" name="formAdd" method="post">
									<div class="row">
									<!--CONTENT START-->
									<div class="col-sm-6 mb-3">
										<label>First Name <span style="color:#ff0000;">*</span></label>
										<input type="text" name="firstname" id="firstname" value="<?php echo !empty($edit[0]->firstname) ? $edit[0]->firstname : "";?>" class="form-control" required />											
										<input type="hidden" name="id" id="id" value="<?php echo !empty($edit[0]->id) ? $edit[0]->id : "";?>"/>											
									</div>
									<div class="col-sm-6 mb-3">
										<label>Last Name <span style="color:#ff0000;">*</span></label>
										<input type="text" name="lastname" id="lastname" value="<?php echo !empty($edit[0]->lastname) ? $edit[0]->lastname : "";?>" class="form-control" required />											
									</div>
									
									<div class="col-sm-6 mb-3">
										<label>Email <span style="color:#ff0000;">*</span></label>
										<input type="text" name="email" id="email" value="<?php echo !empty($edit[0]->email) ? $edit[0]->email : "";?>" class="form-control" required />											
									</div>
									<div class="col-sm-6 mb-3">
										<label>Phone <span style="color:#ff0000;">*</span></label>
										<input type="text" name="phone" id="phone" value="<?php echo !empty($edit[0]->phone) ? $edit[0]->phone : "";?>" class="form-control" required />											
									</div>
									<div class="col-sm-12 mb-3">
										<label>Address <span style="color:#ff0000;">*</span></label>
										<textarea name="address" id="address" class="form-control" required ><?php echo !empty($edit[0]->address) ? $edit[0]->address : "";?></textarea>
									</div>	
									<div class="col-sm-6 mb-3">
										<label>Country <span style="color:#ff0000;">*</span></label>
										<select class="form-control bg-light border-0" id="country" name="country" required>
										<option value="">Select</option>
										<option value="India" <?php echo !empty($edit[0]->country) ? $edit[0]->country == "India" ? "selected" : "": "";?>>India</option>
										<option value="US" <?php echo !empty($edit[0]->country) ? $edit[0]->country == "US" ? "selected" : "": "";?>>US</option>
										</select>
									</div>
									<div class="col-sm-6 mb-3">
										<label>Agree<span style="color:#ff0000;">*</span></label><br>
										<input type="checkbox" id="agree" name="agree" value="1"  <?php echo !empty($edit[0]->agree) ? "checked" : "";?>>  <label>I Agree</label>
									</div>
									<div class="col-sm-6 mb-3">
									<label>Image<span style="color:#ff0000;">*</span></label>
									<input type="file" class="form-control bg-light border-0" id="image" name="image" accept="image/png, image/gif, image/jpeg" <?php echo empty($edit[0]->image) ? "required" : "";?> />
									</div>
									<div class="col-sm-6 mb-3">
										<div id="preview" style="margin-top:10px;"></div>
										<?php if(!empty($edit[0]->image)){?>
										<div id="preview1" style="margin-top:10px;"><img src="<?php echo base_url()?>uploads/<?php echo $edit[0]->image; ?>" width="200" height="auto"></div>
										<input type="hidden" name="oldImage" id="oldImage" class="form-control" value="<?php echo $edit[0]->image; ?>" />											
										<?php } ?>
									</div>
										
									<!--CONTENT END-->
									<div class="col-sm-6 mb-3">
									<input type="submit" class="btn btn-primary" id="btnAdd" value="Submit"/>
									<input type="reset" class="btn btn-info" value="Reset"/>
									</div>
									</div>
									</form>
									</div>	
									</div><!-- /.box-body -->
                                    </div>
                                </div>
                            </div>

                        </div>
                        <!--end col-->
                    </div>
                    <!--end row-->

                </div><!-- container-fluid -->
            </div>
            <!-- End Page-content -->
        </div>
        <!-- end main content-->
		
		
