| Current Path : /home/users/unlimited/www/eshop.codeskitter.site/application/views/admin/pages/forms/ |
| Current File : /home/users/unlimited/www/eshop.codeskitter.site/application/views/admin/pages/forms/seller.php |
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<!-- Main content -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h4>Add Seller</h4>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="<?= base_url('admin/home') ?>">Home</a></li>
<li class="breadcrumb-item active">Seller</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="modal fade " tabindex="-1" role="dialog" aria-hidden="true" id='set_commission_model'>
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Categories & Commission(%)</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body p-0">
<form class="form-horizontal" id="add-seller-commission-form" action="<?= base_url('admin/sellers/add-seller-commission'); ?>" method="POST" enctype="multipart/form-data">
<div class="card-body row">
<!-- dynamic section here -->
<label for="Categories" class="col-sm-2 col-form-label">Categories</label>
<div id="category_section"> </div>
<div class="form-group col-md-12 text-center">
<button type="button" id="add_category" class="btn btn-primary"> <i class="far fa-plus"></i> Add More Category </button>
</div>
<br>
<div class="form-group ">
<button type="reset" class="btn btn-warning">Reset</button>
<button type="submit" class="btn btn-success" id="save_btn">Save</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<input type="hidden" value="<?= $category_flag ?>" id="category_flag">
<div class="col-md-12">
<div class="card card-info">
<!-- form start -->
<form class="form-horizontal form-submit-event" action="<?= base_url('admin/sellers/add_seller'); ?>" method="POST" id="add_product_form">
<?php if (isset($fetched_data[0]['id'])) { ?>
<input type="hidden" name="edit_seller" value="<?= $fetched_data[0]['user_id'] ?>">
<input type="hidden" name="edit_seller_data_id" value="<?= $fetched_data[0]['id'] ?>">
<input type="hidden" name="old_address_proof" value="<?= $fetched_data[0]['address_proof'] ?>">
<input type="hidden" name="old_store_logo" value="<?= $fetched_data[0]['logo'] ?>">
<input type="hidden" name="old_authorized_signature" value="<?= $fetched_data[0]['authorized_signature'] ?>">
<input type="hidden" name="old_national_identity_card" value="<?= $fetched_data[0]['national_identity_card'] ?>">
<?php
} ?>
<div class="card-body">
<div class="form-group row">
<textarea cols="20" rows="20" id="cat_data" name="commission_data" class="d-none"></textarea>
<label for="name" class="col-sm-2 col-form-label">Name <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<input type="text" class="form-control" id="name" placeholder="Seller Name" name="name" value="<?= @$fetched_data[0]['username'] ?>">
</div>
</div>
<div class="form-group row">
<label for="mobile" class="col-sm-2 col-form-label">Mobile <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<input type="text" maxlength="16" oninput="validateNumberInput(this)" class="form-control" id="mobile" placeholder="Enter Mobile" name="mobile" value="<?= @$fetched_data[0]['mobile'] ?>">
</div>
</div>
<div class="form-group row">
<label for="email" class="col-sm-2 col-form-label">Email <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<input type="email" class="form-control" id="email" placeholder="Enter Email" name="email" value="<?= @$fetched_data[0]['email'] ?>">
</div>
</div>
<?php
if (!isset($fetched_data[0]['id'])) {
?>
<div class="form-group row ">
<label for="password" class="col-sm-2 col-form-label">Password <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<input type="password" class="form-control" id="password" placeholder="Enter Passsword" name="password" value="<?= @$fetched_data[0]['password'] ?>">
</div>
</div>
<div class="form-group row ">
<label for="confirm_password" class="col-sm-2 col-form-label">Confirm Password <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<input type="password" class="form-control" id="confirm_password" placeholder="Enter Confirm Password" name="confirm_password">
</div>
</div>
<?php
}
?>
<div class="form-group row">
<label for="address" class="col-sm-2 col-form-label">Address <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<textarea type="text" class="form-control" id="address" placeholder="Enter Address" name="address"><?= isset($fetched_data[0]['address']) ? @$fetched_data[0]['address'] : ""; ?></textarea>
</div>
</div>
<div class="form-group row">
<label for="authorized_signature" class="col-sm-2 col-form-label">Authorized Signature <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<?php if (isset($fetched_data[0]['authorized_signature']) && !empty($fetched_data[0]['authorized_signature'])) { ?>
<span class="text-danger">*Leave blank if there is no change</span>
<?php } ?>
<input type="file" class="form-control" name="authorized_signature" id="authorized_signature" accept="image/*" />
</div>
</div>
<?php if (isset($fetched_data[0]['authorized_signature']) && !empty($fetched_data[0]['authorized_signature'])) { ?>
<div class="form-group row">
<div class="mx-auto product-image"><a href="<?= base_url($fetched_data[0]['authorized_signature']); ?>" data-toggle="lightbox" data-gallery="gallery_seller"><img src="<?= base_url($fetched_data[0]['authorized_signature']); ?>" class="img-fluid rounded"></a></div>
</div>
<?php } ?>
<div class="form-group row">
<label for="commission" class="col-sm-2 col-form-label">Commission(%) <small>(Commission(%) to be given to the Super Admin on order item globally.)</small> </label>
<div class="col-sm-10">
<input type="number" max="100" min="0" class="form-control" id="global_commission" placeholder="Enter Commission(%) to be given to the Super Admin on order item." name="global_commission" value="<?= @$fetched_data[0]['commission'] ?>">
</div>
</div>
<div class="form-group row">
<?php
$category_html = get_categories_option_html($categories);
?>
<label for="commission" class="col-sm-8 col-form-label">Choose Categories & Commission(%) <small>(Commission(%) to be given to the Super Admin on order item by Category you select.If you do not set the commission beside category then it will get global commission other wise perticuler category commission will be consider.)</small> </label>
<div class="d-none" id="cat_html">
<?= $category_html ?>
</div>
</div>
<div class="form-group row">
<div class="col-sm-3 offset-2">
<a href="javascript:void(0)" id="seller_model" data-seller_id="<?= (isset($fetched_data[0]['user_id']) && !empty($fetched_data[0]['user_id'])) ? $fetched_data[0]['user_id'] : ""; ?>" data-cat_ids="<?= (isset($fetched_data[0]['id']) && !empty($fetched_data[0]['id'])) ? $fetched_data[0]['category_ids'] : ""; ?>" class=" btn btn-block btn-outline-primary btn-sm" title="Manage Categories & Commission" data-target="#set_commission_model" data-toggle="modal">Manage</a>
</div>
</div>
<?php
$pincode_wise_deliverability = (isset($shipping_method['pincode_wise_deliverability']) && $shipping_method['pincode_wise_deliverability'] == 1) ? $shipping_method['pincode_wise_deliverability'] : '0';
$city_wise_deliverability = (isset($shipping_method['city_wise_deliverability']) && $shipping_method['city_wise_deliverability'] == 1) ? $shipping_method['city_wise_deliverability'] : '0';
?>
<input type="hidden" name="city_wise_deliverability" value="<?= $city_wise_deliverability ?>">
<input type="hidden" name="pincode_wise_deliverability" value="<?= $pincode_wise_deliverability ?>">
<div class="form-group row deliverable_type">
<?php if ((isset($shipping_method['pincode_wise_deliverability']) && $shipping_method['pincode_wise_deliverability'] == 1) || (isset($shipping_method['local_shipping_method']) && isset($shipping_method['shiprocket_shipping_method']) && $shipping_method['local_shipping_method'] == 1 && $shipping_method['shiprocket_shipping_method'] == 1)) { ?>
<label for="deliverable_type" class="col-form-label col-sm-2">Deliverable Zipcode Type</label>
<div class="form-group col-sm-10">
<select class="form-control" name="deliverable_zipcode_type" id="deliverable_zipcode_type">
<option value="<?= ALL ?>" <?= (isset($fetched_data[0]['deliverable_zipcode_type']) && $fetched_data[0]['deliverable_zipcode_type'] == 1) ? 'selected' : ''; ?>>All</option>
<option value="<?= EXCLUDED ?>" <?= (isset($fetched_data[0]['deliverable_zipcode_type']) && $fetched_data[0]['deliverable_zipcode_type'] == 2) ? 'selected' : ''; ?>>Excluded</option>
</select>
</div>
<?php }
if (isset($shipping_method['city_wise_deliverability']) && $shipping_method['city_wise_deliverability'] == 1 && $shipping_method['shiprocket_shipping_method'] != 1) { ?>
<label for="" class="col-form-label col-sm-2">Deliverable City Type</label>
<div class="form-group col-sm-10">
<select class="form-control" name="deliverable_city_type" id="deliverable_city_type">
<option value="<?= ALL ?>" <?= (isset($fetched_data[0]['deliverable_city_type']) && $fetched_data[0]['deliverable_city_type'] == 1) ? 'selected' : ''; ?>>All</option>
<option value="<?= EXCLUDED ?>" <?= (isset($fetched_data[0]['deliverable_city_type']) && $fetched_data[0]['deliverable_city_type'] == 2) ? 'selected' : ''; ?>>Excluded</option>
</select>
</div>
<?php } ?>
</div>
<div class="form-group row">
<?php if ((isset($shipping_method['pincode_wise_deliverability']) && $shipping_method['pincode_wise_deliverability'] == 1) || (isset($shipping_method['local_shipping_method']) && isset($shipping_method['shiprocket_shipping_method']) && $shipping_method['local_shipping_method'] == 1 && $shipping_method['shiprocket_shipping_method'] == 1)) { ?>
<label for="serviceable_zipcodes" class="col-form-label col-sm-2">Serviceable Zipcodes <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<?php
$zipcodes = (isset($fetched_data[0]['serviceable_zipcodes']) && $fetched_data[0]['serviceable_zipcodes'] != NULL) ? explode(",", $fetched_data[0]['serviceable_zipcodes']) : [];
$zipcodes_name = fetch_details('zipcodes', "", 'zipcode,id', "", "", "", "", "id", $zipcodes);
?>
<select name="serviceable_zipcodes[]" class="search_zipcode form-control w-100" multiple onload="multiselect()" id="deliverable_zipcodes" <?= (isset($fetched_data[0]['deliverable_zipcode_type']) && ($fetched_data[0]['deliverable_zipcode_type'] == INCLUDED || $fetched_data[0]['deliverable_zipcode_type'] == EXCLUDED)) ? "" : "disabled" ?>>
<?php if (isset($zipcodes) && !empty($zipcodes)) {
foreach ($zipcodes_name as $row) {
?>
<option value="<?= $row['id'] ?>" <?= (!empty($zipcodes) && in_array($row['id'], $zipcodes)) ? 'selected' : ''; ?>><?= $row['zipcode'] ?></option>
<?php }
} ?>
</select>
</div>
<?php }
if (isset($shipping_method['city_wise_deliverability']) && $shipping_method['city_wise_deliverability'] == 1 && $shipping_method['shiprocket_shipping_method'] != 1) { ?>
<label for="cities" class="col-form-label col-sm-2">Serviceable Cities <span class='text-danger text-sm'>*</span></label>
<?php
$selected_city_ids = (isset($fetched_data[0]['serviceable_cities']) && $fetched_data[0]['serviceable_cities'] != NULL) ? explode(",", $fetched_data[0]['serviceable_cities']) : [];
?>
<div class="col-sm-10">
<select class="form-control city_list" name="serviceable_cities[]" id="deliverable_cities" multiple <?= (isset($fetched_data[0]['deliverable_city_type']) && ($fetched_data[0]['deliverable_city_type'] == INCLUDED || $fetched_data[0]['delideliverable_city_typeverable_zipcode_type'] == EXCLUDED)) ? "" : "disabled" ?>>
<?php foreach ($cities as $row) { ?>
<option value="<?= $row['id'] ?>" <?= (in_array($row['id'], $selected_city_ids)) ? 'selected' : ''; ?>><?= $row['name'] ?></option>
<?php }; ?>
</select>
</div>
<?php } ?>
</div>
<h4>Store Details</h4>
<hr>
<div class="form-group row">
<label for="store_name" class="col-sm-2 col-form-label">Name <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<input type="text" class="form-control" id="store_name" placeholder="Store Name" name="store_name" value="<?= @$fetched_data[0]['store_name'] ?>">
</div>
</div>
<div class="form-group row">
<label for="store_url" class="col-sm-2 col-form-label">URL </label>
<div class="col-sm-10">
<input type="text" class="form-control" id="store_url" placeholder="Store URL" name="store_url" value="<?= @$fetched_data[0]['store_url'] ?>">
</div>
</div>
<div class="form-group row">
<label for="store_description" class="col-sm-2 col-form-label">Description </label>
<div class="col-sm-10">
<textarea type="text" class="form-control" id="store_description" placeholder="Store Description" name="store_description"><?= isset($fetched_data[0]['store_description']) ? @$fetched_data[0]['store_description'] : ""; ?></textarea>
</div>
</div>
<div class="form-group row">
<label for="logo" class="col-sm-2 col-form-label">Logo <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<?php if (isset($fetched_data[0]['logo']) && !empty($fetched_data[0]['logo'])) { ?>
<span class="text-danger">*Leave blank if there is no change</span>
<?php } ?>
<input type="file" class="form-control" name="store_logo" id="store_logo" accept="image/*" />
</div>
</div>
<?php if (isset($fetched_data[0]['logo']) && !empty($fetched_data[0]['logo'])) { ?>
<div class="form-group row">
<div class="mx-auto product-image"><a href="<?= base_url($fetched_data[0]['logo']); ?>" data-toggle="lightbox" data-gallery="gallery_seller"><img src="<?= base_url($fetched_data[0]['logo']); ?>" class="img-fluid rounded"></a></div>
</div>
<?php } ?>
<h4>Other Details</h4>
<hr>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Status <span class='text-danger text-sm'>*</span></label>
<div id="status" class="btn-group col-sm-4">
<label class="btn btn-default" data-toggle-class="btn-default" data-toggle-passive-class="btn-default">
<input type="radio" name="status" value="0" <?= (isset($fetched_data[0]['status']) && $fetched_data[0]['status'] == '0') ? 'Checked' : '' ?>> Deactive
</label>
<label class="btn btn-primary" data-toggle-class="btn-primary" data-toggle-passive-class="btn-default">
<input type="radio" name="status" value="1" <?= (isset($fetched_data[0]['status']) && $fetched_data[0]['status'] == '1') ? 'Checked' : '' ?>> Approved
</label>
<label class="btn btn-danger" data-toggle-class="btn-danger" data-toggle-passive-class="btn-default">
<input type="radio" name="status" value="2" <?= (isset($fetched_data[0]['status']) && $fetched_data[0]['status'] == '2') ? 'Checked' : '' ?>> Not-Approved
</label>
</div>
</div>
<div class="form-group row">
<label for="tax_name" class="col-sm-2 col-form-label">Tax Name <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<input type="text" class="form-control" id="tax_name" placeholder="Tax Name" name="tax_name" value="<?= @$fetched_data[0]['tax_name'] ?>">
</div>
</div>
<div class="form-group row">
<label for="tax_number" class="col-sm-2 col-form-label">Tax Number <span class='text-danger text-sm'>*</span></label>
<div class="col-sm-10">
<input type="text" class="form-control" id="tax_number" placeholder="Tax Number" name="tax_number" value="<?= @$fetched_data[0]['tax_number'] ?>">
</div>
</div>
<div class="form-group row">
<label for="latitude" class="col-sm-2 col-form-label">Latitude </label>
<div class="col-sm-10">
<input type="text" class="form-control" id="latitude" placeholder="Latitude" name="latitude" value="<?= @$fetched_data[0]['latitude'] ?>">
</div>
</div>
<div class="form-group row">
<label for="longitude" class="col-sm-2 col-form-label">Longitude </label>
<div class="col-sm-10">
<input type="text" class="form-control" id="longitude" placeholder="Longitude" name="longitude" value="<?= @$fetched_data[0]['longitude'] ?>">
</div>
</div>
<h4>Permissions </h4>
<hr>
<?php if (isset($fetched_data[0]['permissions']) && !empty($fetched_data[0]['permissions'])) {
$permit = json_decode($fetched_data[0]['permissions'], true);
} ?>
<div class="form-group row">
<label for="require_products_approval" class="col-sm-2 form-label">Require Product's Approval?</label>
<div class="col-sm-1">
<input type="checkbox" name="require_products_approval" <?= (isset($permit['require_products_approval']) && $permit['require_products_approval'] == '1') ? 'Checked' : '' ?> data-bootstrap-switch data-off-color="danger" data-on-color="success">
</div>
<label for="customer_privacy" class="form-label">View Customer's Details?</label>
<div class="col-sm-1">
<input type="checkbox" name="customer_privacy" <?= (isset($permit['customer_privacy']) && $permit['customer_privacy'] == '1') ? 'Checked' : '' ?> data-bootstrap-switch data-off-color="danger" data-on-color="success">
</div>
</div>
<hr class="mt-4">
<h4 class="bg-light m-0 px-2 py-3">SEO Configuration</h4>
<div class="d-flex bg-light">
<div class="form-group col-sm-6">
<label for="seo_page_title" class="form-label form-label-sm d-flex">
SEO Page Title
</label>
<input type="text" class="form-control" id="seo_page_title"
placeholder="SEO Page Title" name="seo_page_title"
value="<?= isset($fetched_data[0]['seo_page_title']) ? output_escaping($fetched_data[0]['seo_page_title']) : "" ?>">
</div>
<div class="form-group col-sm-6">
<label for="seo_meta_keywords" class="form-label form-label-sm d-flex">
SEO Meta Keywords
</label>
<input class='tags bg-white' id='seo_meta_keywords' placeholder="SEO Meta Keywords" name="seo_meta_keywords" value="<?= isset($fetched_data[0]['seo_meta_keywords']) ? output_escaping($fetched_data[0]['seo_meta_keywords']) : "" ?>" />
</div>
</div>
<div class="d-flex bg-light">
<div class="form-group col-sm-6">
<label for="seo_meta_description" class="form-label form-label-sm d-flex">
SEO Meta Description
</label>
<textarea class="form-control" id="seo_meta_description"
placeholder="SEO Meta Keywords" name="seo_meta_description"><?= isset($fetched_data[0]['seo_meta_description']) ? output_escaping($fetched_data[0]['seo_meta_description']) : "" ?></textarea>
</div>
<div class="col-sm-12 col-md-6">
<div class="form-group">
<label for="image">SEO Open Graph Image <small>(Recommended Size : 131 x 131 pixels)</small></label>
<div class="col-sm-10">
<div class='col-md-12'>
<a class="uploadFile img btn btn-primary text-white btn-sm" data-input='seo_og_image' data-isremovable='1'
data-is-multiple-uploads-allowed='0' data-toggle="modal" data-target="#media-upload-modal" value="Upload"><i class='fa fa-upload'></i> Upload</a>
</div>
<?php
if (!empty(@$fetched_data[0]['seo_og_image'])) {
?>
<label class="text-danger mt-3">*Only Choose When Update is
necessary</label>
<div class="container-fluid row image-upload-section w-25">
<div class="col-md-12 col-sm-12 shadow p-3 bg-white rounded text-center grow image">
<div class='image-upload-div'><img class="img-fluid mb-2"
src="<?= base_url() . str_replace('//', '/', $fetched_data[0]['seo_og_image']) ?>"
alt="Image Not Found"></div>
<input type="hidden" name="seo_og_image" value='<?= $fetched_data[0]['seo_og_image'] ?>'>
</div>
</div>
<?php
} else { ?>
<div class="container-fluid row image-upload-section">
<div
class="col-md-12 col-sm-12 shadow p-3 mb-5 bg-white rounded m-4 text-center grow image d-none">
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<div class="form-group my-3">
<button type="reset" class="btn btn-warning">Reset</button>
<button type="submit" class="btn btn-success" id="submit_btn"><?= (isset($fetched_data[0]['id'])) ? 'Update Seller' : 'Add Seller' ?></button>
</div>
</div>
<!-- /.card-footer -->
</form>
</div>
<!--/.card-->
</div>
<!--/.col-md-12-->
</div>
<!-- /.row -->
</div><!-- /.container-fluid -->
</section>
<!-- /.content -->
</div>