<?php $this->load->view('includes/header'); ?>
<div class="page-title">
  <h2><span>Add Members</span></h2>
  <div class="buttons">
    <?php echo anchor("sitepanel/members/", '<span>Cancel</span>', 'class="btn btn-danger pull-right" '); ?>
    <a href="javascript:void(0);" class="btn btn-success addbtn pull-right"><span>Add</span></a>    
  </div>
</div>
<!-- PAGE CONTENT WRAPPER -->
<div class="page-content-wrap">
  <div class="row">
    <div class="col-md-12">
      <div class="panel panel-default">
        <div class="panel-body">
          <?php echo form_open_multipart("sitepanel/members/add/", 'class="form-horizontal" id="catForm"'); ?>  
           <?php  echo validation_message();
                   echo error_message(); ?>
          <div id="tab_pinfo">
            <div class="row">
              <div class="col-md-10 col-md-offset-1">

              <div class="form-group" style="background:#eee">
                <label class="col-md-6 control-label"><strong>Login Details</strong></label>
              </div>

                 <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Title<span class="required">*</span></label>
                  <div class="col-md-9 col-xs-12">
                     <select name="title" class="form-control">
                          <option value="" disabled selected>Title*</option>
                          <option value="Mr.">Mr.</option>
                          <option value="Mrs.">Mrs.</option>
                          <option value="Miss.">Miss.</option>
                          <option value="Dr.">Dr.</option>
                          <option value="Ms.">Ms.</option>
                     </select>
                    <?php echo form_error( 'title'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">First Name<span class="required">*</span></label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="first_name" value="<?php echo set_value('first_name'); ?>" />
                    <?php echo form_error( 'first_name'); ?>
                  </div>
                </div>
              </div>
               
               <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Last Name<span class="required">*</span></label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="last_name" value="<?php echo set_value('last_name'); ?>" />
                    <?php echo form_error( 'last_name'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Mobile Number<span class="required">*</span></label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="mobile_number" value="<?php echo set_value('mobile_number'); ?>" />
                    <?php echo form_error( 'mobile_number'); ?>
                  </div>
                </div>
              </div>

              <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Email Address<span class="required">*</span></label>
                  <div class="col-md-9">
                    <input type="text" class="form-control" name="email" value="<?php echo set_value('email'); ?>" />
                    <?php echo form_error( 'email'); ?>
                  </div>
                </div>
                 <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Password<span class="required">*</span></label>
                  <div class="col-md-9 col-xs-12">
                      <input type="text" class="form-control" name="password" value="<?php echo set_value('password'); ?>" />
                    <?php echo form_error( 'password'); ?>
                  </div>
                </div>
              </div>

              <div class="form-group" style="background:#eee">
                <label class="col-md-6 control-label"><strong>Contact Details</strong></label>
              </div>

               <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Profile Picture</label>
                  <div class="col-md-9">
                    <input type="file" class="fileinput btn-primary" name="image1"  title="Browse file"/>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Website</label>
                  <div class="col-md-9 col-xs-12">
                     <input type="text" class="form-control" name="website" value="<?php echo set_value('website'); ?>" />
                    <?php echo form_error( 'website'); ?>
                  </div>
                </div>
               
              </div>

              <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Company Name<span class="required">*</span></label>
                  <div class="col-md-9">
                    <input type="text" class="form-control" name="company_name" value="<?php echo set_value('company_name'); ?>" />
                    <?php echo form_error( 'company_name'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Designation</label>
                  <div class="col-md-9 col-xs-12">
                     <input type="text" class="form-control" name="designation" value="<?php echo set_value('designation'); ?>" />
                    <?php echo form_error( 'designation'); ?>
                  </div>
                </div>
              </div>

               <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Address<span class="required">*</span></label>
                  <div class="col-md-9">
                    <input type="text" class="form-control" name="address" value="<?php echo set_value('address'); ?>" />
                    <?php echo form_error( 'address'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Country<span class="required">*</span></label>
                  <div class="col-md-9 col-xs-12">
                     <?php echo CountrySelectBox(array("name" => "country", 'current_selected_val' => "India", "format" => 'class="select_country_pop form-control" required')); ?>
                    <?php echo form_error( 'country'); ?>
                  </div>
                </div>
              </div>

               <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">State<span class="required">*</span></label>
                  <div class="col-md-9">
                   <select name="state" id="state" class="form-control">
                      <option value="" disabled selected>State</option>
                      <?php
                      foreach ($state as $sk => $sval) {
                        $sel = ($mres['state'] == $sval['id'] || $this->input->post('state') == $sval['id']) ? 'selected' : '';
                        ?>
                        <option value="<?php echo $sval['id']; ?>" <?php echo $sel; ?>><?php echo $sval['name']; ?></option>
                        <?php  } ?>
                    </select>
                    <?php echo form_error( 'company_name'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">City<span class="required">*</span></label>
                  <div class="col-md-9">
                   <select name="city" id="city" class="form-control">
                      <option value="" disabled selected>City</option>
                      <?php
                      foreach ($city as $sk => $sval) {
                        $sel = ($mres['city'] == $sval['id'] || $this->input->post('state') == $sval['id']) ? 'selected' : '';
                        ?>
                        <option value="<?php echo $sval['id']; ?>" <?php echo $sel; ?>><?php echo $sval['city']; ?></option>
                        <?php  } ?>
                    </select>
                    <?php echo form_error( 'company_name'); ?>
                  </div>
                </div>
              </div>

              <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Locality</label>
                  <div class="col-md-9">
                    <input type="text" class="form-control" name="locality" value="<?php echo set_value('locality'); ?>" />
                    <?php echo form_error( 'locality'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Landmark</label>
                  <div class="col-md-9 col-xs-12">
                     <input type="text" class="form-control" name="landmark" value="<?php echo set_value('landmark'); ?>" />
                    <?php echo form_error( 'landmark'); ?>
                  </div>
                </div>
              </div>

               <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Pincode<span class="required">*</span></label>
                  <div class="col-md-9">
                    <input type="text" class="form-control" name="zipcode" value="<?php echo set_value('zipcode'); ?>" />
                    <?php echo form_error( 'zipcode'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Alt Mobile No</label>
                  <div class="col-md-9 col-xs-12">
                     <input type="text" class="form-control" name="alt_mobile" value="<?php echo set_value('alt_mobile'); ?>" />
                    <?php echo form_error( 'alt_mobile'); ?>
                  </div>
                </div>
              </div>

               <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Alt Email</label>
                  <div class="col-md-9">
                    <input type="text" class="form-control" name="alt_email" value="<?php echo set_value('alt_email'); ?>" />
                    <?php echo form_error( 'alt_email'); ?>
                  </div>
                </div>
               
              </div>

              
              <div class="form-group" style="background:#eee">
                <label class="col-md-6 control-label"><strong>Company factsheet</strong></label>
              </div>

               <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Nature Of Business<span class="required">*</span></label>
                  <div class="col-md-9">
                    <select name="business_nature" class="form-control">
                      <option value="" disabled selected>Nature Of Business</option>
                      <?php foreach ($businessNatureAll as $ek => $ev) { ?>
                        <option value="<?php echo $ek; ?>"><?php echo $ev; ?></option>
                        <?php } ?>
                    </select>
                    <!-- <div class="row" style="max-height: 150px; overflow-y: scroll; border: 1px solid #e1e1e1; padding: 5px;">
                        <?php foreach ($businessNatureAll as $k => $v) {
                        ?>
                       <div class="col-md-4 col-lg-4 col-sm-4 col-xs-6">
                         <input type="checkbox" name="business_nature[]" value="<?=$v;?>"><?=$v;?>
                       </div>
                        <?php } ?>
                    <?php echo form_error( 'business_nature'); ?>
                  </div> -->
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Additional Nature of Business</label>
                  <div class="col-md-9">
                    <div class="row" style="max-height: 150px; overflow-y: scroll; border: 1px solid #e1e1e1; padding: 5px;">
                        <?php foreach ($businessNature as $k => $v) {
                        ?>
                       <div class="col-md-4 col-lg-4 col-sm-4 col-xs-6">
                         <input type="checkbox" name="business_nature_alt[]" value="<?=$k;?>"><?=$v;?>
                       </div>
                        <?php } ?>
                    <?php echo form_error('business_nature_alt'); ?>
                  </div>
                  </div>
                </div>
              </div>

              <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">CEO Name<span class="required">*</span></label>
                  <div class="col-md-9">
                    <input type="text" class="form-control" name="ceo_name" value="<?php echo set_value('ceo_name'); ?>" />
                    <?php echo form_error( 'ceo_name'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Registered Address<span class="required">*</span></label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="registered_address" value="<?php echo set_value('registered_address'); ?>" />
                    <?php echo form_error( 'registered_address'); ?>
                  </div>
                </div>
              </div>

               <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">About Company</label>
                  <div class="col-md-9">
                    <textarea class="form-control" name="about_company"><?php echo set_value('about_company'); ?></textarea>
                    <?php echo form_error( 'about_company'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Youtube Video ID</label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="youtube_id" value="<?php echo set_value('youtube_id'); ?>" />
                    <?php echo form_error( 'youtube_id'); ?>
                  </div>
                </div>
              </div>

              <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">No. of Employees*</label>
                  <div class="col-md-9">
                    <select name="employee_count" class="form-control">
                      <option value="" disabled selected>No. of Employees</option>
                      <?php foreach ($employeeCount as $ek => $ev) { ?>
                        <option value="<?php echo $ek; ?>"><?php echo $ev; ?></option>
                        <?php } ?>
                    </select>
                    <?php echo form_error( 'employee_count'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Year of establishment</label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="establishment_year" value="<?php echo set_value('establishment_year'); ?>" />
                    <?php echo form_error( 'establishment_year'); ?>
                  </div>
                </div>
              </div>

               <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Legal Status of Firm</label>
                  <div class="col-md-9">
                    <select name="legal_firm_status" class="form-control">
                      <option value="" disabled selected>Legal Status of Firm</option>
                      <?php foreach ($firmStatus as $ek => $ev) { ?>
                        <option value="<?php echo $ek; ?>"><?php echo $ev; ?></option>
                        <?php } ?>
                    </select>
                    <?php echo form_error( 'legal_firm_status'); ?>
                  </div>
                </div>
                 <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Name of Promoter</label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="promoter_name" value="<?php echo set_value('promoter_name'); ?>" />
                    <?php echo form_error( 'promoter_name'); ?>
                  </div>
                </div>
              </div>
              

              <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Select Turnover</label>
                  <div class="col-md-9">
                    <select name="turnover" class="form-control">
                      <option value="" disabled selected>Select Turnover</option>
                      <?php foreach ($turnover as $ek => $ev) { ?>
                        <option value="<?php echo $ek; ?>"><?php echo $ev; ?></option>
                        <?php } ?>
                    </select>
                    <?php echo form_error( 'turnover'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Building Infrastructure</label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="building_infrastructure" value="<?php echo set_value('building_infrastructure'); ?>" />
                    <?php echo form_error( 'building_infrastructure'); ?>
                  </div>
                </div>
              </div>

              <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Premises Size</label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="premises_size" value="<?php echo set_value('premises_size'); ?>" />
                    <?php echo form_error( 'premises_size'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Premises Unit</label>
                  <div class="col-md-9">
                    <select name="premises_unit" id="premises_unit" class="form-control">
                      <?php foreach ($premises_unit as $key => $val) { ?>
                        <option value="<?php echo $key; ?>" <?php echo $sel; ?>><?php echo $val; ?></option>
                        <?php } ?>
                    </select>
                    <?php echo form_error( 'turnover'); ?>
                  </div>
                </div>
              </div>
              <div class="form-group" style="background:#eee">
                <label class="col-md-6 control-label"><strong>Infrastructure Images</strong></label>
              </div>
               <div class="form-group">

              <label class="col-md-3 col-xs-12 control-label">Infrastructure Images</label>

              <div class="col-md-2">

                <div class="">

                  <img src="<?php echo get_image('infra', '', '125', '125', 'R'); ?>" id="pic1" class="profile_picture" width="125" height="125"  /><div class="clearfix"></div>

                  <a href="javascript:void(0);" onclick="$('#infra_img1').trigger('click');"  class="profile_picture">Add Infrastructure Image</a>

                </div>

                <input id="infra_img1" name="infra_img1" type="file" onchange="document.getElementById('pic1').src = window.URL.createObjectURL(this.files[0])" class="validate" style="display: none;" />

              </div>

              <div class="col-md-2">

                <div class="">

                  <img src="<?php echo get_image('infra', '', '125', '125', 'R'); ?>" id="pic2" class="profile_picture" width="125" height="125" /><div class="clearfix"></div>

                  <a href="javascript:void(0);" onclick="$('#infra_img2').trigger('click');" class="profile_picture">Add Infrastructure Image</a>

                </div>

                <input id="infra_img2" name="infra_img2" type="file" onchange="document.getElementById('pic2').src = window.URL.createObjectURL(this.files[0])" class="validate" style="display: none;" />

              </div>

              <div class="col-md-2">

                <div class="">

                  <img src="<?php echo get_image('infra', '', '125', '125', 'R'); ?>" id="pic3" class="profile_picture" width="125" height="125" /><div class="clearfix"></div>

                  <a href="javascript:void(0);" onclick="$('#infra_img3').trigger('click');" class="profile_picture">Add Infrastructure Image</a>

                </div>

                <input id="infra_img3" name="infra_img3" type="file" onchange="document.getElementById('pic3').src = window.URL.createObjectURL(this.files[0])" class="validate" style="display: none;" />

              </div>

              <div class="col-md-2">

                <div class="">

                  <img src="<?php echo get_image('infra', '', '125', '125', 'R'); ?>" id="pic4" class="profile_picture" width="125" height="125" /><div class="clearfix"></div>

                  <a href="javascript:void(0);" onclick="$('#infra_img4').trigger('click');" class="profile_picture">Add Infrastructure Image</a>

                </div>

                <input id="infra_img4" name="infra_img4" type="file" onchange="document.getElementById('pic4').src = window.URL.createObjectURL(this.files[0])" class="validate" style="display: none;" />

              </div>

            </div>



                <div class="form-group" style="background:#eee">
                <label class="col-md-6 control-label"><strong>Company USP</strong></label>
              </div>
                   <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Primary Competitive Advantage</label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="competitive_advantage" value="<?php echo set_value('competitive_advantage'); ?>" />
                    <?php echo form_error( 'competitive_advantage'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Contract Manufacturing</label>
                  <div class="col-md-9">
                    <input type="text" class="form-control" name="contract_manufacturing" value="<?php echo set_value('contract_manufacturing'); ?>" />
                    <?php echo form_error( 'contract_manufacturing'); ?>
                  </div>
                </div>
              </div>
                   <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Quality Measures / Testing Facilities</label>
                  <div class="col-md-9 col-xs-12">
                  <select name="testing_facilities" class="form-control">
                      <option value="" disabled selected>Quality Measures / Testing Facilities</option>
                      <?php foreach ($testingFacilities as $tk => $tv) { ?>
                        <option value="<?php echo $tk; ?>"><?php echo $tv; ?></option>
                        <?php } ?>
                    </select>
                  </div>
                </div>
              </div>


              <div class="form-group" style="background:#eee">
                <label class="col-md-6 control-label"><strong>Statutory Profile</strong></label>
              </div>
               <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">DGFT / IE Code</label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="ie_code" value="<?php echo set_value('ie_code'); ?>" />
                    <?php echo form_error( 'ie_code'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Banker</label>
                  <div class="col-md-9">
                    <input type="text" class="form-control" name="banker" value="<?php echo set_value('banker'); ?>" />
                    <?php echo form_error( 'banker'); ?>
                  </div>
                </div>
              </div>

               <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">GST No</label>
                  <div class="col-md-9 col-xs-12">
                    <input type="text" class="form-control" name="gst_no" value="<?php echo set_value('gst_no'); ?>" />
                    <?php echo form_error( 'gst_no'); ?>
                  </div>
                </div>
              </div>

              <div class="form-group" style="background:#eee">
                <label class="col-md-6 control-label"><strong>Packaging/Payment and Shipment Details</strong></label>
              </div>
              <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Customized Packaging</label>
                  <div class="col-md-9 col-xs-12">
                     <select name="customized_packaging" class="form-control">
                      <option value="" disabled selected>Customized Packaging</option>
                      <?php foreach ($customizedPackaging as $ck => $cv) { ?>
                        <option value="<?php echo $ck; ?>"><?php echo $cv; ?></option>
                        <?php } ?>
                    </select>
                    <?php echo form_error( 'customized_packaging'); ?>
                  </div>
                </div>
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Select Payment Mode</label>
                  <div class="col-md-9">
                    <div class="row" style="max-height: 150px; overflow-y: scroll; border: 1px solid #e1e1e1; padding: 5px;">
                        <?php foreach ($paymentMode as $k => $v) {
                        ?>
                       <div class="col-md-4 col-lg-4 col-sm-4 col-xs-6">
                         <input type="checkbox" name="payment_mode[]" value="<?=$v;?>"><?=$v;?>
                       </div>
                        <?php } ?>
                    <?php echo form_error('payment_mode'); ?>
                  </div>
                  </div>
                </div>
              </div>

              <div class="form-group">
                <div class="col-md-6 col-xs-12">
                  <label class="col-md-3 control-label">Shipment Mode</label>
                  <div class="col-md-9 col-xs-12">
                     <input type="text" class="form-control" name="shipment_mode" value="<?php echo set_value('shipment_mode'); ?>" />
                    <?php echo form_error( 'shipment_mode'); ?>
                  </div>
                </div>
               
              </div>
               
               

                <div class="form-group">
                  <label class="col-md-3 control-label"></label>
                  <div class="col-md-9">
                    <input type="submit" name="sub" class="btn btn-success pull-right" value="Add" class="button2" />
                    <input type="hidden" name="action" value="addcategory" />
                   
                  </div>
                </div>


              </div>
            </div>
          </div>
          <?php echo form_close(); ?>                                
        </div>
      </div>
    </div>
  </div>                    
</div>
<!-- END PAGE CONTENT WRAPPER --> 
<?php $this->load->view('includes/footer'); ?>
<script type="text/javascript">
  $('.addbtn').click(function(){
    $('#catForm').submit();
  });
</script>