<?php $this->load->view('element/head');?>
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper" xmlns="http://www.w3.org/1999/html">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Setting Form
        <small>Setting App</small>
      </h1>
    </section>

    <!-- Main content -->
    <section class="content">
	
      <div class="row">
        <div class="col-xs-12">
          <ul class="nav nav-tabs">
            <li role="presentation" class="active"><a href="<?php echo site_url('setting/edit/1');?>">Input Setting App</a></li>
          </ul>
		  <div class="box box-info">
            <div class="box-header with-border">
              <!-- <h3 class="box-title">setting</h3> -->
              <?php if($this->session->flashdata('failed_favicon')){?>
                <div class="alert alert-danger text-center">
                  <strong><?php echo $this->session->flashdata('failed_favicon');?></strong>
                </div>
              <?php } ?>
              <?php if($this->session->flashdata('failed_background')){?>
                <div class="alert alert-danger text-center">
                  <strong><?php echo $this->session->flashdata('failed_background');?></strong>
                </div>
              <?php } ?>
              <?php if($this->session->flashdata('failed_logo')){?>
                <div class="alert alert-danger text-center">
                  <strong><?php echo $this->session->flashdata('failed_logo');?></strong>
                </div>
              <?php } ?>
              <?php if($this->session->flashdata('failed_spinner')){?>
                <div class="alert alert-danger text-center">
                  <strong><?php echo $this->session->flashdata('failed_spinner');?></strong>
                </div>
              <?php } ?>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal" method="POST" action="<?php echo site_url('setting/save').'/'.$setting['id'];?>" enctype="multipart/form-data">
              <div class="box-body">
                <div class="col-md-6">
                  <div class="form-group">
                    <label class="col-sm-4 control-label" for="name">Judul App</label>
                    <div class="col-sm-8">
                      <input type="text" value="<?php echo !empty($setting) ? $setting['judul_app'] : '';?>" name="judul_app" placeholder="Judul App" id="judul_app" class="form-control" required/>
                      <input type="hidden" value="<?php echo !empty($setting) ? $setting['id'] : '';?>" name="id" id="id" class="form-control" required/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-4 control-label" for="address">Alamat</label>
                    <div class="col-sm-8">
                      <textarea name="alamat" placeholder="Alamat" id="alamat" class="form-control"/><?php echo !empty($setting) ? $setting['alamat'] : '';?></textarea>
                    </div>
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-group">
                    <label class="col-sm-4 control-label" for="no_telp">No. Telp</label>
                    <div class="col-sm-8">
                    <input type="number" value="<?php echo !empty($setting) ? $setting['no_telp'] : '';?>" name="no_telp" placeholder="No. Telp" id="no_telp" class="form-control" required/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-4 control-label" for="deskripsi_toko">Deskripsi</label>
                    <div class="col-sm-8">
                      <textarea name="deskripsi_toko" placeholder="Deskripsi Toko" id="deskripsi_toko" class="form-control"/><?php echo !empty($setting) ? $setting['deskripsi_toko'] : '';?></textarea>
                    </div>
                  </div>
                </div>
                <div class="col-md-6">
                <div class="form-group">
                  
                    <label class="col-sm-4 control-label" for="password">Password User</label>
                    <div class="col-sm-8">
                      <input type="password" value="" name="password" placeholder="Password" id="password" class="form-control"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-4 control-label" for="logo">Logo</label>
                    <div class="col-sm-5">
                    <input type="file" name="logo" id="logo" class="form-control"/>
                    <small class="text-danger">* PNG, JPG, GIF | Max Size W: 1500px * H: 700px</small>
                    </div>
                    <div class="col-sm-3">
                      <a href="<?php echo site_url()."uploads/".$setting['logo']; ?>" target="_blank" class="btn btn-primary"><i class="fa fa-eye"></i> </a>
                      <a href="<?php echo site_url()."public/mb/images/logo.png"; ?>" target="_blank" class="btn btn-success"><i class="fa fa-eye"></i> Template</a>
                    </div>
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-group">
                    <label class="col-sm-4 control-label" for="favicon">Favicon</label>
                    <div class="col-sm-5">
                    <input type="file" name="favicon" id="favicon" class="form-control"/>
                    <small class="text-danger">* PNG, JPG, GIF | Max size W: 45px * H: 45px</small>
                    </div>
                    <div class="col-sm-3">
                      <a href="<?php echo site_url()."uploads/".$setting['favicon']; ?>" target="_blank" class="btn btn-primary"><i class="fa fa-eye"></i> </a>
                      <a href="<?php echo site_url()."public/mb/images/icon.png"; ?>" target="_blank" class="btn btn-success"><i class="fa fa-eye"></i> Template</a>
                    </div>
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-group">
                    <label class="col-sm-4 control-label" for="background">Background Desktop</label>
                    <div class="col-sm-5">
                    <input type="file" name="background" id="background" class="form-control"/>
                    <small class="text-danger">* PNG, JPG, GIF | Max size W: 1500 * H: 800px</small>
                    </div>
                    <div class="col-sm-3">
                      <a href="<?php echo site_url()."uploads/".$setting['background']; ?>" target="_blank" class="btn btn-primary"><i class="fa fa-eye"></i> </a>
                      <a href="<?php echo site_url()."public/mb/images/background.jpg"; ?>" target="_blank" class="btn btn-success"><i class="fa fa-eye"></i> Template</a>
                    </div>
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-group">
                    <label class="col-sm-4 control-label" for="backgroundmobile">Background Mobile</label>
                    <div class="col-sm-5">
                    <input type="file" name="backgroundmobile" id="backgroundmobile" class="form-control"/>
                    <small class="text-danger">* PNG, JPG, GIF | Max size W: 1165 * H: 1995px</small>
                    </div>
                    <div class="col-sm-3">
                      <a href="<?php echo site_url()."uploads/".$setting['backgroundmobile']; ?>" target="_blank" class="btn btn-primary"><i class="fa fa-eye"></i> </a>
                      <a href="<?php echo site_url()."public/mb/images/background-mobile.jpg"; ?>" target="_blank" class="btn btn-success"><i class="fa fa-eye"></i> Template</a>
                    </div>
                  </div>
                </div>
                <div class="col-md-6" style="display: none;">
                  <div class="form-group">
                    <label class="col-sm-4 control-label" for="spinner">Background Mobile</label>
                    <div class="col-sm-5">
                    <input type="file" name="spinner" id="spinner" class="form-control"/>
                    <small class="text-danger">* PNG, JPG, GIF | Max size W: 360 * H: 431px</small>
                    </div>
                    <div class="col-sm-3">
                      <a href="<?php echo site_url()."uploads/".$setting['spinner']; ?>" target="_blank" class="btn btn-primary"><i class="fa fa-eye"></i> </a>
                      <a href="<?php echo site_url()."uploads/format/templatespinner.png"; ?>" target="_blank" class="btn btn-success"><i class="fa fa-eye"></i> Template</a>
                    </div>
                  </div>
                </div>
              <!-- /.box-body -->
              <div class="box-footer">
                <div class="col-md-3">
                  <button class="btn btn-info pull-right" type="submit" name="submit">Save</button>
                </div>
              </div>
              <!-- /.box-footer -->
            </form>
          </div>
		</div>
        <!-- /.col -->
      </div>
	  <!-- row -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
<?php $this->load->view('element/footer');?>