<script type="text/javascript">

function validate_domain(){
	
    if($("#domain_title").val()==''){
        $("#domain_title").addClass('error');
        $("#domain_title").focus();
        $("#msg_domain_title").html('Please enter name').show();
        return false;
    }else{
        $("#domain_title").removeClass('error');
        $("#msg_domain_title").hide();
    }
}

</script>


<div class="breadcrumb">
    <h1>Domains</h1>
    <ul>
        <li><a href="<?php echo SITE_URL.ADMIN_DIR ?>">Dashboard</a></li>
        <li>Add New domain</li>

    </ul>
</div>


<div class="separator-breadcrumb border-top"></div>

<div class="row">
    <div class="col-md-12">
        <div class="card mb-4">
            <div class="card-body">
                <div class="card-title mb-3">Add New Domain</div>
                <form action="" method="post" onsubmit="return validate_domain();" enctype="multipart/form-data">

                    <?php if(isset($domainDetail->domain_id) && $domainDetail->domain_id!=0) { ?>
                            <input type="hidden" id="domain_id" name="domain_id" value="<?php echo $domainDetail->domain_id ?>" />
                    <?php } ?>

                    <div class="row">

                    	<div class="col-md-6 form-group mb-3">
                            <label for="domain_title">domain Name <span class="asterisk">*</span></label>
                            <input type="text" class="form-control" id="domain_title" name="domain_title" value="<?php echo $domainDetail->domain_title; ?>" placeholder="Enter domain name">
                            <div class="invalid-tooltip" id="msg_domain_title"></div>
                        </div>
                        <div class="col-md-12 form-group mb-3">
                            <label class="control-label">Status</label>
                            <div class="controls">
                              <label class="switch switch-primary mr-3">
                                <input type="checkbox" id="domain_status" name="domain_status" <?php echo ($domainDetail->domain_status=='1') ? "checked='checked'" : "" ?>>
                                <span class="slider"></span>
                             </label>
                            </div>
    	                  </div>

                        <div class="col-md-12">
                            <button class="btn btn-primary" id="submit" name="submit">Submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>