| Server IP : 94.136.191.34 / Your IP : 216.73.216.25 Web Server : Apache System : Linux hostpanel.netbiz.in 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64 User : omkar.com_6nnuz6y629h ( 10087) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system,proc_open,popen MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/omkar.com/httpdocs/application/views/admin/home_banners/ |
Upload File : |
<div class="row">
<!-- left column -->
<div class="col-md-12">
<!-- general form elements -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"></h3>
<!-- /.box-header -->
<!-- form start -->
<form method="post" class="form-horizontal" autocomplete="off" enctype="multipart/form-data" name="project_banners" id="project_banners" action="<?php echo base_url(); ?>admin/home/save_home_banner/<?php
if (!empty($home_banner)) {
echo '/'.$home_banner['id'];
}
?>" method="post">
<div class="box-body">
<?php if($this->session->flashdata('project_success_msg')!=""){ ?>
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('project_success_msg');?>
</div>
<?php } ?>
<div class="form-group">
<label for="Floor Plan Name" class="col-sm-2 control-label">Banner Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="home_banner_name" name="home_banner_name" placeholder="Banner Name" value="<?php
if (!empty($home_banner)) {
echo $home_banner['name'];
}
?>" >
<span id="home_banner_name_error" class="text-red"></span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Project Type</label>
<div class="col-sm-10">
<select class="form-control select2" id="project_type" name="project_type">
<option value="">Select project status</option>
<option value="Residential" <?php
if (!empty($home_banner) && ($home_banner['project_type']=='Residential')) {
echo "selected=selected";
}
?>>Residential</option>
<option value="Commercial" <?php
if (!empty($home_banner) && ($home_banner['project_type']=='Commercial')) {
echo "selected=selected";
}
?>>Commercial</option>
</select>
<span id="project_type_error" class="text-red"></span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Project Name</label>
<div class="col-sm-10">
<select class="form-control select2" id="project_name" name="project_name">
<option value="">Select project status</option>
<?php if(!empty($home_banner) && ($home_banner['project_id']!='')){?>
<option value="<?php echo $home_banner['project_id']?>" selected=selected><?php echo $home_banner['project_name']?></option>
<?php } ?>
</select>
<span id="project_name_error" class="text-red"></span>
</div>
</div>
<div class="form-group">
<label for="Project Sub Title" class="col-sm-2 control-label">Small Text</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="small_text" name="small_text" placeholder="Small Text" value="<?php
if (!empty($home_banner)) {
echo $home_banner['small_text'];
}
?>" >
</div>
</div>
<div class="form-group">
<label for="Project Sub Title" class="col-sm-2 control-label">Big Text White</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="big_text_white" name="big_text_white" placeholder="Big Text White" value="<?php
if (!empty($home_banner)) {
echo $home_banner['big_text_white'];
}
?>" >
</div>
</div>
<div class="form-group">
<label for="Project Sub Title" class="col-sm-2 control-label">Big Text Yellow</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="big_text_yellow" name="big_text_yellow" placeholder="Big Text Yellow" value="<?php
if (!empty($home_banner)) {
echo $home_banner['big_text_yellow'];
}
?>" >
</div>
</div>
<div class="form-group">
<label for="Project Sub Title" class="col-sm-2 control-label">Big Text</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="big_text" name="big_text" placeholder="Big Text" value="<?php
if (!empty($home_banner)) {
echo $home_banner['big_text'];
}
?>" >
</div>
</div>
<div class="form-group">
<label for="Floor Plan Name" class="col-sm-2 control-label">URL</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="url" placeholder="URL" value="<?php
if (!empty($home_banner)) {
echo $home_banner['url'];
}
?>" >
<!-- <span id="project_banner_name_error" class="text-red"></span> -->
</div>
</div>
<div class="form-group">
<label for="Upload Images" class="col-sm-2 control-label">Upload Banner Image</label>
<div class="col-sm-10">
<input type="file" name="image" id="thumb_img" accept="image/*">
<p class="help-block">You can upload banner image</p>
<span id="thumb_error" class="text-red"></span>
</div>
</div>
<input type="hidden" id="edit_thumb_img" name="edit_thumb_img" value="<?php if (!empty($home_banner)) { echo $home_banner['image']; } ?>">
<?php if(!empty($home_banner)){?>
<div class="col-sm-10 col-sm-offset-2">
<div class="panel panel-default">
<div class="panel-body">
<img src="<?php echo base_url(); ?>uploads/home_page/<?php echo $home_banner['image']; ?>" width="100px" alt="<?php echo $home_banner['name'] ; ?>" title="<?php echo $home_banner['name'] ; ?>">
</div>
</div>
</div>
<?php } ?>
<div class="form-group">
<label for="Upload Images" class="col-sm-2 control-label">Upload Mobile Banner</label>
<div class="col-sm-10">
<input type="file" name="mobile_banner" id="mobile_banner" accept="image/*">
<p class="help-block">You can upload mobile banner image</p>
<span id="mobile_banner_error" class="text-red"></span>
</div>
</div>
<input type="hidden" id="edit_mobile_img" name="edit_mobile_img" value="<?php if (!empty($home_banner)) { echo $home_banner['mobile_banner']; } ?>">
<?php if(!empty($home_banner)){?>
<div class="col-sm-10 col-sm-offset-2">
<div class="panel panel-default">
<div class="panel-body">
<img src="<?php echo base_url(); ?>uploads/home_page/<?php echo $home_banner['mobile_banner']; ?>" width="100px">
</div>
</div>
</div>
<?php } ?>
<!-- /.box-body -->
<div class="box-footer">
<button type="submit" class="btn btn-info pull-right">Update</button>
</div>
<!-- /.box-footer -->
</form>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Delete</h4>
</div>
<div class="modal-body">
<p>You are about to delete.</p>
<p>Do you want to proceed?</p>
</div>
<div class="modal-footer">
<button type="button" id="delete" class="btn btn-primary">Yes</button>
<button type="button" class="btn btn-default" data-dismiss="modal">No</button>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$(document).on('click', '.remove_levels', function (e) {
var project_id = $(this).attr("project-id");
var image_id = $(this).attr("image-id");
var base_url = "<?php echo base_url();?>";
$(document).on('click', '#delete', function (e) {
$(location).attr('href', base_url+'admin/home/delete_project_banner/'+project_id+'/'+image_id)
});
});
$(document).on('change', '#project_type', function (e) {
var project_type = $(this).val();
var base_url = "<?php echo base_url();?>";
$.ajax({
type: "POST",
url: base_url+'admin/home/get_particular_projects/',
data: 'project_type='+project_type,
success: function(data){
if(data!=""){
$("#project_name").html(data);
}
}
});
});
$(document).on("submit","#project_banners",function(){
var home_banner_name_error = false;
var project_type_error = false;
var project_name_error = false;
var thumb_error = false;
var mobile_banner_error = false;
var edit_thumb_img = $('#edit_thumb_img').val();
var edit_mobile_img = $('#edit_mobile_img').val();
var home_banner_name = $('#home_banner_name').val();
var project_type = $('#project_type').val();
var project_name = $('#project_name').val();
var thumb_img = $('#thumb_img').val();
var mobile_banner = $('#mobile_banner').val();
if (home_banner_name == "") {
$('#home_banner_name_error').show().html('Please provide project banner name');
home_banner_name_error = true;
} else{
$('#home_banner_name_error').hide().html('');
home_banner_name_error = false;
}
if (project_type == "") {
$('#project_type_error').show().html('Please select project type');
project_type_error = true;
}else{
$('#project_type_error').hide().html('');
project_type_error = false;
}
if (project_name == "") {
$('#project_name_error').show().html('Please select project');
project_name_error = true;
}else{
$('#project_name_error').hide().html('');
project_name_error = false;
}
if(edit_thumb_img == '' && thumb_img == ''){
$('#thumb_error').show().html('Please upload image');
thumb_error = true;
} else{
$('#thumb_error').hide().html('');
thumb_error = false;
}
if(edit_mobile_img == '' && mobile_banner == ''){
$('#mobile_banner_error').show().html('Please upload image');
mobile_banner_error = true;
} else{
$('#mobile_banner_error').hide().html('');
mobile_banner_error = false;
}
if(!home_banner_name_error && !project_type_error && !project_name_error && !thumb_error && !mobile_banner_error){
return true;
}else{
return false;
}
});
});
</script>