<?php $currency_symbol = $this->customlib->getSchoolCurrencyFormat(); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            <i class="fa fa-mortar-board"></i> Uniform Item    </h1>
											 <a href="<?php  echo base_url(); ?>uniformpos" class="col-md pull-right">Sale a Uniform</a>
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								 <a href="<?php  echo base_url(); ?>uniformitem" class="col-md pull-right">Add Item</a>
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								 <a href="<?php  echo base_url(); ?>group" class="col-md pull-right">Create Group</a> 
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								 <a href="<?php  echo base_url(); ?>values" class="col-md pull-right">Create Values</a>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <?php
            if ($this->rbac->hasPrivilege('class', 'can_add')) {
                ?>  
                <div class="col-md-4">
                    <!-- Horizontal Form -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title"><?php echo $title;       ?></h3>
                        </div><!-- /.box-header -->
						<?php  
						 foreach ($uniformitem->result() as $dep_row)  
							 {   
							?>
                        <form id="form1" action="<?php echo site_url("uniformitem/edit/" . $dep_row->id) ?>"  method="POST" accept-charset="utf-8">
                            <div class="box-body">
                                <?php if ($this->session->flashdata('msg')) { ?>
                                    <?php echo $this->session->flashdata('msg') ?>
                                <?php } ?>
                                <?php
                                if (isset($error_message)) {
                                    echo "<div class='alert alert-danger'>" . $error_message . "</div>";
                                }    
                                ?>
                                <?php echo $this->customlib->getCSRF(); ?> 							
                                <div class="form-group">
                                    <label for="itemcode">Item Code</label><small class="req"> *</small>
                                    <input autofocus="" id="itemcode" name="itemcode" placeholder="" type="text" class="form-control"   value="<?php echo $dep_row->itemcode; ?>"  />
                                    <span class="text-danger"><?php echo form_error('itemcode'); ?></span>
                                </div>	
                                <div class="form-group">
                                    <label for="itemdescript">Item Descripiton</label><small class="req"> *</small>
                                    <input autofocus="" id="itemdescript" name="itemdescript" placeholder="" type="text" class="form-control"   value="<?php echo $dep_row->itemdescript; ?>" />
                                    <span class="text-danger"><?php echo form_error('itemdescript'); ?></span>
                                </div>									 
								<div class="form-group">
                                    <label for="warehouse">Warehouse</label><small class="req"> *</small>
										<select id="warehouse" name="warehouse" placeholder="" type="text" class="form-control" >
											<option  value="<?php echo $dep_row->warehouse; ?>" > <?php echo $dep_row->warehouse; ?></option>
											<?php 
												foreach ($house->result() as $item) {
												?>
													<option value="<?php echo $item->warehouse; ?>" >  <?php echo $item->warehouse; ?></option>
											<?php }
											?>
										</select>
                                    <span class="text-danger"><?php echo form_error('warehouse'); ?></span>
                                </div>									
                                <div class="form-group">
                                    <label for="costprice">Cost Price</label><small class="req"> *</small>
                                    <input autofocus="" id="costprice" name="costprice" placeholder="" type="text" class="form-control"   value="<?php echo $dep_row->costprice; ?>" />
                                    <span class="text-danger"><?php echo form_error('costprice'); ?></span>
                                </div>                               
								<div class="form-group">
                                    <label for="sellingprice">Selling Price</label><small class="req"> *</small>
                                    <input autofocus="" id="sellingprice" name="sellingprice" placeholder="" type="text" class="form-control"   value="<?php echo $dep_row->sellingprice; ?>"  />
                                    <span class="text-danger"><?php echo form_error('sellingprice'); ?></span>
                                </div>									
								<div class="form-group">
                                    <label for="quantity">Quantity</label><small class="req"> *</small>
                                    <input autofocus="" id="quantity" name="quantity" placeholder="" type="text" class="form-control"   value="<?php echo $dep_row->quantity; ?>"  />
                                    <span class="text-danger"><?php echo form_error('quantity'); ?></span>
                                </div>	
								
								<h3 class="box-title">SIZES</h3>								
								<div class="form-group">
                                    <label for="groupsize">Group Size</label>
										<select id="groupsize" name="groupsize" placeholder="" type="text" class="form-control" >
											<option  value="<?php echo $dep_row->groupsize; ?>" ><?php echo $dep_row->groupsize; ?> </option>
											<?php 
												foreach ($g->result() as $grup) {
												?>
									<option value="<?php echo $grup->groups; ?>" >  <?php echo $grup->groups; ?></option>
											<?php }
											?>
										</select>
                                    <span class="text-danger"><?php echo form_error('groupsize'); ?></span>
                                </div>  
								<div class="form-group">
                                    <label for="valuesize">Value</label>
										<select id="valuesize" name="valuesize" placeholder="" type="text" class="form-control" >
											<option  value="<?php echo $dep_row->valuesize; ?>" ><?php echo $dep_row->valuesize; ?></option>
											<?php 
												foreach ($v->result() as $val) {
												?>
									<option value="<?php echo $val->values; ?>" >  <?php echo $val->values; ?></option>
											<?php }
											?>
										</select>
                                    <span class="text-danger"><?php echo form_error('valuesize'); ?></span>
                                </div> 								
							
								<h3 class="box-title">STYLE</h3>								
								<div class="form-group">
                                    <label for="groupstyle">Group Style</label>
										<select id="groupstyle" name="groupstyle" placeholder="" type="text" class="form-control" >
											<option  value="<?php echo $dep_row->groupstyle; ?>" ><?php echo $dep_row->groupstyle; ?></option>
											<?php 
												foreach ($g->result() as $grup) {
												?>
									<option value="<?php echo $grup->groups; ?>" >  <?php echo $grup->groups; ?></option>
											<?php }
											?>
										</select>
                                    <span class="text-danger"><?php echo form_error('groupstyle'); ?></span>
                                </div>  
								<div class="form-group">
                                    <label for="stylevalue">Value Style</label>
										<select id="stylevalue" name="stylevalue" placeholder="" type="text" class="form-control" >
											<option  value="<?php echo $dep_row->stylevalue; ?>" ><?php echo $dep_row->stylevalue; ?></option>
											<?php 
												foreach ($v->result() as $val) {
												?>
									<option value="<?php echo $val->values; ?>" >  <?php echo $val->values; ?></option>
											<?php }
											?>
										</select>
                                    <span class="text-danger"><?php echo form_error('stylevalue'); ?></span>
                                </div> 							

								<h3 class="box-title">COLOUR</h3>								
								<div class="form-group">
                                    <label for="colourgroup">Group Colour</label>
										<select id="colourgroup" name="colourgroup" placeholder="" type="text" class="form-control" >
											<option  value="<?php echo $dep_row->colourgroup; ?>" ><?php echo $dep_row->colourgroup; ?></option>
											<?php 
												foreach ($g->result() as $grup) {
												?>
									<option value="<?php echo $grup->groups; ?>" >  <?php echo $grup->groups; ?></option>
											<?php }
											?>
										</select>
                                    <span class="text-danger"><?php echo form_error('colourgroup'); ?></span>
                                </div>  
								<div class="form-group">
                                    <label for="colourvalue">Colour Value</label>
										<select id="colourvalue" name="colourvalue" placeholder="" type="text" class="form-control" >
											<option  value="<?php echo $dep_row->colourvalue; ?>" ><?php echo $dep_row->colourvalue; ?></option>
											<?php 
												foreach ($v->result() as $val) {
												?>
									<option value="<?php echo $val->values; ?>" >  <?php echo $val->values; ?></option>
											<?php }
											?>
										</select>
                                    <span class="text-danger"><?php echo form_error('colourvalue'); ?></span>
                                </div> 

								<h3 class="box-title">GENDER</h3>								
								<div class="form-group">
                                    <label for="gendergroup">Group Gender</label>
										<select id="gendergroup" name="gendergroup" placeholder="" type="text" class="form-control" >
											<option  value="<?php echo $dep_row->gendergroup; ?>" ><?php echo $dep_row->gendergroup; ?></option>
											<?php 
												foreach ($g->result() as $grup) {
												?>
									<option value="<?php echo $grup->groups; ?>" >  <?php echo $grup->groups; ?></option>
											<?php }
											?>
										</select>
                                    <span class="text-danger"><?php echo form_error('gendergroup'); ?></span>
                                </div>  
								<div class="form-group">
                                    <label for="gendervalue">Value</label>
										<select id="gendervalue" name="gendervalue" placeholder="" type="text" class="form-control" >
											<option  value="<?php echo $dep_row->gendervalue; ?>" ><?php echo $dep_row->gendervalue; ?></option>
											<?php 
												foreach ($v->result() as $val) {
												?>
									<option value="<?php echo $val->values; ?>" >  <?php echo $val->values; ?></option>
											<?php }
											?>
										</select>
                                    <span class="text-danger"><?php echo form_error('gendervalue'); ?></span>
                                </div> 
							
                            </div><!-- /.box-body -->
                            <div class="box-footer">
                                <button type="submit" class="btn btn-info pull-right"><?php echo $this->lang->line('save'); ?></button>
                            </div>
                        </form>
						<?php } ?>
                    </div>
                </div><!--/.col (right) -->
                <!-- left column -->
            <?php } ?>
            <div class="col-md-<?php
            if ($this->rbac->hasPrivilege('class', 'can_add')) {
                echo "8";
            } else {
                echo "12";
            }
            ?>">
                <!-- general form elements -->
                <div class="box box-primary">
                    <div class="box-header ptbnull">
                        <h3 class="box-title titlefix"><?php echo $title_list; ?></h3>
                        <div class="box-tools pull-right">
                        </div><!-- /.box-tools -->
                    </div><!-- /.box-header -->
                    <div class="box-body">
                        <div class="table-responsive mailbox-messages">
                            <div class="download_label"><?php echo $title_list; ?></div>
                            <table class="table table-striped table-bordered table-hover example">
                                <thead>
                                    <tr>
                                        <th>Item code</th>
                                        <th>Item descript</th>
                                        <th>Uniform Details</th>
                                        <th>Warehouse</th>
                                        <th>Cost price</th>
                                        <th>Selling price</th>
                                        <th>Qnty</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <?php  
										 foreach ($itemlist->result() as $row)  
										 {   
                                        ?>
                                        <tr>
                                            <td class="mailbox-name"><?php echo $row->itemcode;?></td>
                                            <td class="mailbox-name"><?php echo $row->itemdescript;?></td>
<td class="mailbox-name"><?php echo $row->itemgroups.'/'.$row->groupsize.'-'.$row->valuesize.'/'.$row->groupstyle.'-'.$row->stylevalue.'/'.$row->colourgroup.'-'.$row->colourvalue.'/'.$row->gendergroup.'-'.$row->gendervalue;?></td>
                                            <td class="mailbox-name"><?php echo $row->warehouse;?></td>
                                            <td class="mailbox-name"><?php echo $row->costprice;?></td>
                                            <td class="mailbox-name"><?php echo $row->sellingprice;?></td>
                                            <td class="mailbox-name"><?php echo $row->quantity;?></td>
                                        </tr>
									<?php } ?>
                                </tbody>
                            </table><!-- /.table -->



                        </div><!-- /.mail-box-messages -->
                    </div><!-- /.box-body -->
                </div>
            </div><!--/.col (left) -->
            <!-- right column -->

        </div>
        <div class="row">
            <!-- left column -->

            <!-- right column -->
            <div class="col-md-12">

            </div><!--/.col (right) -->
        </div>   <!-- /.row -->
    </section><!-- /.content -->
</div><!-- /.content-wrapper -->

