<commit_before><?php $this->load->view('otrack/common/header'); ?>
<?php $this->load->view('otrack/common/navbar'); ?>

<div class="container">
  <?php if ($message): ?>
  <div class="alert alert-<?php if ($status): ?><?php echo $status; ?><?php else: ?>danger<?php endif ?>"><?php echo $message;?></div>
  <?php endif ?>
  <h3 class="page-header">Customers</h3>
  <a class="btn btn-primary" href="<?php echo base_url('customers/create'); ?>"><i class="fa fa-fw fa-plus"></i> Add Customer</a>
  <a class="btn btn-default <?php if ($number_of_customers == 0): ?>hide<?php endif ?>" data-toggle="collapse" href="#collapse-search" aria-expanded="false" aria-controls="collapse-search"><i class="fa fa-fw fa-search"></i> Search Customer</a>
  <button type="button" class="btn btn-info <?php if ($number_of_customers == 0): ?>hide<?php endif ?>" id="btn-view-all"><i class="fa fa-fw fa-list"></i> View All</button>
  <button type="button" class="btn btn-danger pull-right <?php if ($number_of_customers == 0): ?>hide<?php endif ?>" id="btn-delete-all"><i class="fa fa-fw fa-trash"></i> Delete All</button>
  <hr>
  <div class="collapse" id="collapse-search">
    <div class="panel panel-default">
      <div class="panel-body">
        <?php
          $form_attributes = array('id'=>'form-search-customer', 'class'=>'form-search-customer form-horizontal');
          $name = array(
          'id' => 'names',
          'name' => 'names[]',
          'class' => 'form-control',
          'multiple' => 'multiple',
          'selected' => $selected_names,
          'options' => $names,
          );
          $phone = array(
          'id' => 'phones',
          'name' => 'phones[]',
          'class' => 'form-control',
          'multiple' => 'multiple',
          'selected' => $selected_phones,
          'options' => $phones,
          );
          $province = array(
          'id' => 'provinces',
          'name' => 'provinces[]',
          'class' => 'form-control',
          'multiple' => 'multiple',
          'selected' => $selected_provinces,
          'options' => $provinces,
          );
          $city = array(
          'id' => 'cities',
          'name' => 'cities[]',
          'class' => 'form-control',
          'multiple' => 'multiple',
          'selected' => $selected_cities,
          'options' => $cities,
          );
          $district = array(
          'id' => 'districts',
          'name' => 'districts[]',
          'class' => 'form-control',
          'multiple' => 'multiple',
          'selected' => $selected_districts,
          'options' => $districts,
          );
          $submit = array(
          'id' => 'btn-search-customer',
          'class' => 'btn btn-primary btn-block',
          'type' => 'submit',
          'content' => '<i class="fa fa-fw fa-filter"></i> Filter',
          );
        ?>
        <?php echo form_open(base_url($this->uri->uri_string()), $form_attributes); ?>
        <div class="form-group">
          <?php echo form_label('Customer Name', 'name', array('class'=>'control-label col-md-2')); ?>
          <div class="col-md-10">
          <?php echo form_dropdown($name); ?>
          </div>
        </div>
        <div class="form-group">
          <?php echo form_label('Phone Number', 'phone', array('class'=>'control-label col-md-2')); ?>
          <div class="col-md-10">
          <?php echo form_dropdown($phone); ?>
          </div>
        </div>
        <div class="form-group">
          <?php echo form_label('Province', 'province', array('class'=>'control-label col-md-2')); ?>
          <div class="col-md-10">
          <?php echo form_dropdown($province); ?>
          </div>
        </div>
        <div class="form-group">
          <?php echo form_label('City', 'city', array('class'=>'control-label col-md-2')); ?>
          <div class="col-md-10">
          <?php echo form_dropdown($city); ?>
          </div>
        </div>
        <div class="form-group">
          <?php echo form_label('County/District', 'district', array('class'=>'control-label col-md-2')); ?>
          <div class="col-md-10">
          <?php echo form_dropdown($district); ?>
          </div>
        </div>
        <div class="form-group">
          <div class="col-md-offset-2 col-md-10">
          <?php echo form_button($submit); ?>
          </div>
        </div>
        <?php echo form_close(); ?>
      </div>
    </div>
  </div>
  <?php
    $tmpl = array (
      'table_open'  => '<div class="table-responsive"><table class="table table-hover">',
      'heading_cell_start'  => '<th class="bg-primary">',
      'table_close'         => '</table></div>',
    );

    $this->table->set_template($tmpl);

    $heading = array(
      'Name',
      'Phone Number',
      'Primary Address',
      'Secondary Address',
      'District',
      'City',
      'Province',
      'Zip Code',
      'Action',
    );

    $this->table->set_heading($heading);

    if ($customers) {
      foreach ($customers as $customer) {
        $row = array(
          $customer->name,
          $customer->phone,
          $customer->address_1,
          $customer->address_2,
          $customer->district,
          $customer->city,
          $customer->province,
          $customer->zipcode,
          '<div class="btn-group">'.
          anchor(base_url('customers/edit').'/'.$customer->id,'<i class="fa fa-fw fa-edit"></i><span class="hidden-xs">Edit</span>',array('class'=>'btn btn-xs btn-info')).
          anchor('#modal-delete','<i class="fa fa-fw fa-trash"></i><span class="hidden-xs">Delete</span>',array('class'=>'btn btn-xs btn-danger btn-modal-delete','data-toggle'=>'modal','data-cid'=>$customer->id,'data-name'=>$customer->name)).
          '</div>',
        );

        $this->table->add_row($row);
      }<commit_msg>ui fix.<commit_after><?php $this->load->view('otrack/common/header'); ?>
<?php $this->load->view('otrack/common/navbar'); ?>

<div class="container">
  <?php if ($message): ?>
  <div class="alert alert-<?php if ($status): ?><?php echo $status; ?><?php else: ?>danger<?php endif ?>"><?php echo $message;?></div>
  <?php endif ?>
  <h3 class="page-header">Customers</h3>
  <a class="btn btn-primary" href="<?php echo base_url('customers/create'); ?>"><i class="fa fa-fw fa-plus"></i> Add Customer</a>
  <a class="btn btn-default <?php if ($number_of_customers == 0): ?>hide<?php endif ?>" data-toggle="collapse" href="#collapse-search" aria-expanded="false" aria-controls="collapse-search"><i class="fa fa-fw fa-search"></i> Search Customer</a>
  <button type="button" class="btn btn-info <?php if ($number_of_customers == 0): ?>hide<?php endif ?>" id="btn-view-all"><i class="fa fa-fw fa-list"></i> View All</button>
  <button type="button" class="btn btn-danger pull-right <?php if ($number_of_customers == 0): ?>hide<?php endif ?>" id="btn-delete-all"><i class="fa fa-fw fa-trash"></i> Delete All</button>
  <hr>
  <div class="collapse" id="collapse-search">
    <div class="panel panel-default">
      <div class="panel-body">
        <?php
          $form_attributes = array('id'=>'form-search-customer', 'class'=>'form-search-customer form-horizontal');
          $name = array(
          'id' => 'names',
          'name' => 'names[]',
          'class' => 'form-control',
          'multiple' => 'multiple',
          'selected' => $selected_names,
          'options' => $names,
          );
          $phone = array(
          'id' => 'phones',
          'name' => 'phones[]',
          'class' => 'form-control',
          'multiple' => 'multiple',
          'selected' => $selected_phones,
          'options' => $phones,
          );
          $province = array(
          'id' => 'provinces',
          'name' => 'provinces[]',
          'class' => 'form-control',
          'multiple' => 'multiple',
          'selected' => $selected_provinces,
          'options' => $provinces,
          );
          $city = array(
          'id' => 'cities',
          'name' => 'cities[]',
          'class' => 'form-control',
          'multiple' => 'multiple',
          'selected' => $selected_cities,
          'options' => $cities,
          );
          $district = array(
          'id' => 'districts',
          'name' => 'districts[]',
          'class' => 'form-control',
          'multiple' => 'multiple',
          'selected' => $selected_districts,
          'options' => $districts,
          );
          $submit = array(
          'id' => 'btn-search-customer',
          'class' => 'btn btn-primary btn-block',
          'type' => 'submit',
          'content' => '<i class="fa fa-fw fa-filter"></i> Filter',
          );
        ?>
        <?php echo form_open(base_url($this->uri->uri_string()), $form_attributes); ?>
        <div class="form-group">
          <?php echo form_label('Customer Name', 'name', array('class'=>'control-label col-md-2')); ?>
          <div class="col-md-10">
          <?php echo form_dropdown($name); ?>
          </div>
        </div>
        <div class="form-group">
          <?php echo form_label('Phone Number', 'phone', array('class'=>'control-label col-md-2')); ?>
          <div class="col-md-10">
          <?php echo form_dropdown($phone); ?>
          </div>
        </div>
        <div class="form-group">
          <?php echo form_label('Province', 'province', array('class'=>'control-label col-md-2')); ?>
          <div class="col-md-10">
          <?php echo form_dropdown($province); ?>
          </div>
        </div>
        <div class="form-group">
          <?php echo form_label('City', 'city', array('class'=>'control-label col-md-2')); ?>
          <div class="col-md-10">
          <?php echo form_dropdown($city); ?>
          </div>
        </div>
        <div class="form-group">
          <?php echo form_label('County/District', 'district', array('class'=>'control-label col-md-2')); ?>
          <div class="col-md-10">
          <?php echo form_dropdown($district); ?>
          </div>
        </div>
        <div class="form-group">
          <div class="col-md-offset-2 col-md-10">
          <?php echo form_button($submit); ?>
          </div>
        </div>
        <?php echo form_close(); ?>
      </div>
    </div>
  </div>
  <?php
    $tmpl = array (
      'table_open'  => '<div class="table-responsive"><table class="table table-hover">',
      'heading_cell_start'  => '<th class="bg-primary">',
      'table_close'         => '</table></div>',
    );

    $this->table->set_template($tmpl);

    $heading = array(
      'Name',
      'Phone Number',
      'Primary Address',
      'Secondary Address',
      'District',
      'City',
      'Province',
      'Zip Code',
      'Action',
    );

    $this->table->set_heading($heading);

    if ($customers) {
      foreach ($customers as $customer) {
        $row = array(
          $customer->name,
          $customer->phone,
          $customer->address_1,
          $customer->address_2,
          $customer->district,
          $customer->city,
          $customer->province,
          $customer->zipcode,
          '<div class="btn-group pull-right">'.
          anchor(base_url('customers/edit').'/'.$customer->id,'<i class="fa fa-fw fa-edit"></i><span class="hidden-xs">Edit</span>',array('class'=>'btn btn-xs btn-success')).
          anchor('#modal-delete','<i class="fa fa-fw fa-trash"></i><span class="hidden-xs">Delete</span>',array('class'=>'btn btn-xs btn-danger btn-modal-delete','data-toggle'=>'modal','data-cid'=>$customer->id,'data-name'=>$customer->name)).
          '</div>',
        );

        $this->table->add_row($row);
      }
{'fraction_non_alphanumeric': 0.20939064388054549, 'fraction_numerical': 0.004315553253927153, 'mean_word_length': 2.3096258211939444, 'pattern_counts': {'":': 0, '<': 203, '<?xml version=': 0, '>': 345, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2218062', 'n_tokens_mistral': 3607, 'n_tokens_neox': 3583, 'n_words': 708}