369 lines
15 KiB
PHP
369 lines
15 KiB
PHP
<!-- Body page content -->
|
|
<script src="<?php echo base_url(); ?>/assets/default/jquery/dist/jquery.min.js"></script>
|
|
<script type="text/javascript" src="<?php echo base_url(); ?>/assets/jquery.multi-select.js"></script>
|
|
|
|
|
|
<style type="text/css">
|
|
.multi-select-container {
|
|
display: inline-block;
|
|
position: relative;
|
|
width: 100%;
|
|
}
|
|
|
|
.multi-select-menu {
|
|
position: absolute;
|
|
left: 0;
|
|
top: 2em;
|
|
z-index: 1;
|
|
float: left;
|
|
min-width: 100%;
|
|
background: #fff;
|
|
margin: 1em 0;
|
|
border: 1px solid #aaa;
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
display: none;
|
|
}
|
|
|
|
.multi-select-menuitem {
|
|
display: block;
|
|
font-size: 0.875em;
|
|
padding: 0.6em 1em 0.6em 30px;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.multi-select-menuitem--titled:before {
|
|
display: block;
|
|
font-weight: bold;
|
|
content: attr(data-group-title);
|
|
margin: 0 0 0.25em -20px;
|
|
}
|
|
|
|
.multi-select-menuitem--titledsr:before {
|
|
display: block;
|
|
font-weight: bold;
|
|
content: attr(data-group-title);
|
|
border: 0;
|
|
clip: rect(0 0 0 0);
|
|
height: 1px;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
padding: 0;
|
|
position: absolute;
|
|
width: 1px;
|
|
}
|
|
|
|
.multi-select-menuitem+.multi-select-menuitem {
|
|
padding-top: 0;
|
|
}
|
|
|
|
.multi-select-presets {
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
|
|
.multi-select-menuitem input {
|
|
position: absolute;
|
|
margin-top: 0.25em;
|
|
margin-left: -20px;
|
|
}
|
|
|
|
.multi-select-button {
|
|
display: block;
|
|
margin-top: 2px;
|
|
width: 100%;
|
|
max-width: 100% !important;
|
|
font-size: 0.875em;
|
|
padding: 0.85em 0.6em;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
vertical-align: -0.5em;
|
|
background-color: #fff;
|
|
border: 1px solid #aaa;
|
|
cursor: default;
|
|
}
|
|
|
|
.multi-select-button:after {
|
|
content: "";
|
|
position: absolute;
|
|
display: inline-block;
|
|
width: 0;
|
|
height: 0;
|
|
border-style: solid;
|
|
border-width: 0.4em 0.4em 0 0.4em;
|
|
border-color: #999 transparent transparent transparent;
|
|
margin-left: 0.4em;
|
|
vertical-align: 0.1em;
|
|
right: 5px;
|
|
top: 17px;
|
|
}
|
|
|
|
.multi-select-container--open .multi-select-menu {
|
|
display: block;
|
|
}
|
|
|
|
.multi-select-container--open .multi-select-button:after {
|
|
border-width: 0 0.4em 0.4em 0.4em;
|
|
border-color: transparent transparent #999 transparent;
|
|
}
|
|
|
|
.multi-select-container--positioned .multi-select-menu {
|
|
/* Avoid border/padding on menu messing with JavaScript width calculation */
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.multi-select-container--positioned .multi-select-menu label {
|
|
/* Allow labels to line wrap when menu is artificially narrowed */
|
|
white-space: normal;
|
|
}
|
|
</style>
|
|
|
|
|
|
<div class="">
|
|
<div class="page-title">
|
|
|
|
<div class="title_left">
|
|
<h3>Edit Business</h3>
|
|
</div>
|
|
|
|
<a class="btn btn-sm btn-primary" style="float: right;"
|
|
href="<?php echo base_url();?>Business/business_list">Business List</a>
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
<div class="row">
|
|
<div class="col-md-12 col-sm-12 ">
|
|
<div class="x_panel">
|
|
<div class="x_title">
|
|
|
|
<ul class="nav navbar-right panel_toolbox">
|
|
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
|
|
</li>
|
|
</ul>
|
|
<h6>Business Information</h6>
|
|
<div class="clearfix"></div>
|
|
</div>
|
|
<div class="x_content">
|
|
<br />
|
|
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post"
|
|
action="<?php echo base_url();?>Business/edit_business" enctype="multipart/form-data">
|
|
|
|
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>"
|
|
value="<?php echo $this->security->get_csrf_hash();?>">
|
|
<input type="hidden" name="id" value="<?php echo $businessData->id; ?>">
|
|
<input type="hidden" name="uid" value="<?php echo $businessData->uid; ?>">
|
|
|
|
|
|
<div class="item form-group">
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">Business Name<a
|
|
style="color:red;">*</a> </label>
|
|
<div class="col-md-3 col-sm-3">
|
|
<input type="text" id="business_name" name="business_name"
|
|
value="<?php echo $businessData->business_name; ?>" required="required"
|
|
class="form-control">
|
|
</div>
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="last-name">Email<a
|
|
style="color:red;">*</a> </label>
|
|
<div class="col-md-3 col-sm-3">
|
|
<input type="email" id="email" name="email" value="<?php echo $businessData->email; ?>"
|
|
required="required" class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)" />
|
|
</div>
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Phone<a
|
|
style="color:red;">*</a> </label>
|
|
<div class="col-md-3 col-sm-3">
|
|
<input id="phone" type="text" pattern="[6-9]{1}[0-9]{9}"
|
|
title="Phone number with 6-9 and remaing 9 digit with 0-9" name="phone"
|
|
value="<?php echo $businessData->phone; ?>" required="required"
|
|
class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)" />
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="item form-group">
|
|
|
|
<?php if(is_superadmin()) { ?>
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="last-name">Select Modules</label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<select id="people" name="module_id[]" class="form-control select2_multiple" multiple>
|
|
<?php
|
|
|
|
$modulesArray = [];
|
|
|
|
foreach ($businessModuleData as $object) {
|
|
if (isset($object->modules)) {
|
|
$modulesArray[] = $object->modules;
|
|
}
|
|
|
|
}
|
|
|
|
foreach ($ModuleData as $key => $data) { ?>
|
|
<?php if(in_array($data->modules, $modulesArray)) { ?>
|
|
<option value="<?php echo $data->id; ?>" selected> <?php echo $data->modules; ?></option>
|
|
<?php } else { ?>
|
|
<option value="<?php echo $data->id; ?>"><?php echo $data->modules;?> </option>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
</select>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="last-name">Select Logo</label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input id="logo" name="logo" class="typeFile" type="file"
|
|
value="<?php echo $businessData->logo; ?>">
|
|
</div>
|
|
</div>
|
|
|
|
<br />
|
|
<!-- <div class="x_title"> </div> <br /> --><br /><br />
|
|
|
|
|
|
<div class="item form-group">
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">Address</label>
|
|
<div class="col-md-5 col-sm-5">
|
|
<input id="address" name="address" value="<?php echo $businessData->address; ?>"
|
|
class="form-control" type="text">
|
|
</div>
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">City</label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input id="city" name="city" value="<?php echo $businessData->city; ?>"
|
|
required="required" class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="item form-group">
|
|
<label class="control-label col-md-1 col-sm-1 " for="last-name">State</label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<select id="state" name="state" class="form-control">
|
|
<option value="<?php echo $businessData->state; ?>">
|
|
<?php echo $businessData->state_name; ?> </option>
|
|
<?php foreach ($stateData as $key => $value) { ?>
|
|
<option value="<?php echo $value->id; ?>"><?php echo $value->name;?></option>
|
|
<?php } ?>
|
|
</select>
|
|
</div>
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">country</label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input id="country" name="country" value="<?php echo $businessData->country; ?>"
|
|
class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="item form-group">
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">Pin code</label>
|
|
<div class="col-md-5 col-sm-5">
|
|
<input id="pincode" name="pincode" value="<?php echo $businessData->pincode; ?>"
|
|
class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<br /><br /><br />
|
|
<div class="x_title">
|
|
<div class="clearfix"></div>
|
|
<h6>Mail Configurations</h6>
|
|
</div><br />
|
|
|
|
|
|
|
|
<div class="item form-group">
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">HostName</label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input id="address" name="mail_hostname" class="form-control" type="text" value="<?php echo $businessData->mail_hostname; ?>">
|
|
</div>
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">Port Number</label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input id="city" name="mail_port_no" class="form-control" type="text" value="<?php echo $businessData->mail_port_no; ?>">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="item form-group">
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">UserName</label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input id="city" name="mail_username" class="form-control" type="text" value="<?php echo $businessData->mail_username; ?>">
|
|
</div>
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">Password</label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input id="country" name="mail_password" class="form-control" type="text" value="<?php echo $businessData->mail_password; ?>">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="item form-group">
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">Sender Mail</label>
|
|
<div class="col-md-5 col-sm-5">
|
|
<input id="pincode" name="sender_mail" class="form-control" type="text" value="<?php echo $businessData->sender_mail; ?>" >
|
|
</div>
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">Security Type</label>
|
|
<div class="col-md-5 col-sm-5">
|
|
<input id="pincode" name="mail_security" class="form-control" type="text" placeholder="ssl or tsl" value="<?php echo $businessData->mail_security; ?>">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="ln_solid"></div>
|
|
<div class="item form-group">
|
|
<div class="offset-md-8">
|
|
<a href="<?php echo base_url();?>Business/business_list" class="btn btn-secondary">Cancel</a>
|
|
<button type="submit" class="btn btn-success">Update</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
|
|
|
|
function check_if_exists(id, value, name) {
|
|
// alert(name);
|
|
// var data = $(this).val();
|
|
$.ajax({
|
|
type:"get",
|
|
url: "<?php echo base_url(); ?>Business/checkUniqueBusinessData",
|
|
data: { value: value, name: name },
|
|
success:function(response)
|
|
{
|
|
if (response == true)
|
|
{
|
|
new PNotify({
|
|
title: 'Warning',
|
|
text: 'That given details Already Exists',
|
|
styling: 'bootstrap3'
|
|
});
|
|
$("#"+id).val('');
|
|
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
jQuery(document).ready(function($) {
|
|
$('#people').multiSelect();
|
|
});
|
|
|
|
var selected = [];
|
|
for (var option of document.getElementById('people').options) {
|
|
if (option.selected) {
|
|
selected.push(option.value);
|
|
}
|
|
}
|
|
</script>
|
|
</div>
|
|
</div>
|
|
<!-- /Body page content -->
|