<?php defined('BASEPATH') or exit('No direct Access is Allowed'); ?>
<style>

.container-tb {
    height: 500px;
    width: 100%;
    overflow: auto;
    border: 2px solid #999;
}
* {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
table {
    border-collapse: collapse;
    table-layout: fixed;
    width: auto;
    min-width: 100%;
}
td, th {
    border: 1px solid #ccc;
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
}
thead td, thead th {
    border-top: none;
    border-bottom: none;
}
td.fth-header, th.fth-header, td.fth-footer, th.fth-footer {
    border-top: none !important;
    border-bottom: none !important;
}
td.fth-header, th.fth-header {
        padding: 3px;
    background-color: #444;
    border-bottom: rgba(0,0,0,0.2);
    color: white;
}
td.fth-footer, th.fth-footer {
    background-color:  #444;
    border-top:  rgba(0,0,0,0.2);
    color: white;
}
</style>
<div class="content-wrapper">
  <!-- Content Header (Page header) -->
 <?php /*?> <section class="content-header">
    <h1> Dashboard <small>TaskPO Make Invoice Master</small> </h1>
    <ol class="breadcrumb">
      <li><a href="#"><i class="fa fa-dashboard"></i> Dashboard</a></li>
      <li><a href="#">Manage</a></li>
      <li class="active">TaskPO Make Invoice Master</li>
    </ol>
  </section><?php */?>
  <!-- Main content -->
  <section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="box">
          <div class="box-header">
          <div class="col-md-12" id="respose">
          <?php if ($this->session->flashdata('failure') == TRUE): ?>
                <div class="alert alert-error"><?php echo $this->session->flashdata('failure'); ?></div>
                <?php endif; ?>
                <?php if ($this->session->flashdata('success') == TRUE): ?>
                <div class="alert alert-success"><?php echo $this->session->flashdata('success'); ?></div>
            <?php endif; ?>
          
          
          </div>
          <?php /*?>
          <div class="col-md-12">
          <div class="col-md-6">
          	<span class="box-title pull-right">
				<?=form_open('nokia/Taskpoinvoice');?>
                    <?php $options=array('100'=>'100','500'=>'500','1000'=>'1000','2000'=>'2000','5000'=>'5000','10000'=>'10000',"{$class_count}"=>"All");  ?>
                    <?php echo form_dropdown('perpage',$options,set_value('perpage'),['class'=>'form-control input-sm','style'=>'width:75px;','onchange'=>"this.form.submit()"]);?>
                <?=form_close();?>
            </span>
            <span class="box-title pull-right">
                <form action="<?=site_url('nokia/taskpo/download_excel_page')?>" class="exconvert"  method="post">
                    <input type="hidden" id="expo1" name="expo1"><input type="submit" value="Excel" class="form-control input-sm" style="width:50px;"/>
                </form>
            </span>
            <span class="box-title pull-right">
				<?=anchor('nokia/Taskpoinvoice','Reset',['class'=>'form-control input-sm pull-right']);?>
       		</span>
          	<span class="box-title btn btn-sm btn-danger pull-right"> 
				<?php if($taskpoinvoicecount!=""){echo $taskpoinvoicecount;}else{foreach($list as $li ){$z[]=$li->ponumber;}$z=array_unique($z);echo count($z);} ?>
            </span>
       		<span class="box-title pull-right">
				<?=form_open();?>
					<?=form_button('','Multiple Invoice',['type'=>'submit','class'=>'btn btn-sm btn-github',"id"=>"del_all"]); ?>
                <?=form_close();?>
            </span> 
			<span class="box-title pull-right">
				<?=form_open();?>
                    <?=form_button('','Single Invoice ',['type'=>'submit','class'=>'btn btn-sm btn-github',"id"=>"del_single"]); ?>
                <?=form_close();?>
			</span>
             <span class="box-title pull-right">
				<?=anchor('nokia/taskpoinvoice/make_invoice_lineitemwise','<i class="fa fa-bitbucket "></i>Invoice By Lineitem',['class'=>'btn btn-sm btn-social btn-facebook']);?>
			</span>
            
       		</div>
            <div class="col-md-6">
          	<?=form_open('nokia/taskpoinvoice/search');?>
                <table id="participantTable" class="table-responsive" style='width:850px;margin-left:100px;'>
                <tbody style="height:auto">
                    <tr class="participantRow">
                        <td><?=form_input('project',set_value('project')		,['class'=>'form-control input-sm','style'=>'width:100px;','placeholder'=>'Project']);?></td>
                        <td><?=form_dropdown('projectcode',$projectcode_list ,set_value('projectcode',''),['class'=>'form-control input-sm','style'=>'width:100px;']);?></td>
                        <td><?=form_dropdown('workpackage',$workpackage_list ,set_value('workpackage',''),['class'=>'form-control input-sm','style'=>'width:100px;']);?></td>
                        <td><?=form_dropdown('technology' ,$technology_list  ,set_value('technology',''), ['class'=>'form-control input-sm','style'=>'width:100px;']);?></td>
                        <td><?=form_input('circle'		,set_value('circle')		,['class'=>'form-control input-sm','style'=>'width:100px;','placeholder'=>'Circle']);?></td>
                        <td><?=form_input('iadate'		,set_value('iadate')		,['class'=>'form-control input-sm','style'=>'width:100px;','placeholder'=>'IA Date']);?></td>
                        <td><?=form_input('ponumber'	,set_value('ponumber')		,['class'=>'form-control input-sm','style'=>'width:100px;','placeholder'=>'PO']);?></td>
                        <td><?=form_input('pototal'		,set_value('pototal')		,['class'=>'form-control input-sm','style'=>'width:100px;','placeholder'=>'PO Total']);?></td>
                        <td><?php $options=array(''=>'Search Type','and'=>'And','or'=>'OR');?>
                        <?=form_dropdown('seach_term',$options,set_value('seach_term','and'),['class'=>'form-control input-sm','style'=>'width:100px;']);?></td>
                        <td><?php $options=array(''=>'Order By','ASC'=>'Ascending','DESC'=>'Descending','RANDOM'=>'Random');?>
                        <?=form_dropdown('order_by',$options,set_value('order_by',''),['class'=>'form-control input-sm','style'=>'width:100px;']);?> </td>
                        <td> <?=form_submit('search','search',['class'=>'btn btn-sm  btn-github form-control input-sm']);?></td>
                    </tr>
                    </tbody>
                </table>
			<?=form_close();?>
			</div>
            </div>
            <?php */?>
          </div>
        <!--<div class="box-body" style="font-size:8px;">-->
        <div class="box-body table-responsive no-padding" >
        <div  id="reportsummary">
        <!-- <table id="example2" class="table table-bordered table-hover  table-responsive" style="font-size: 10px;">-->
                
  <div id="tableContainer2" class="container-tb">
        <table>
          <thead >
            <tr>
                <th>Sr.</th>
                <th>Class Status</th>
                <th>ClassId</th>
                <th>Class Date</th>
                <th>Class Day</th>
                <th>Category</th>
                <th>Class</th>
                <th>Subject</th>
                <th>Start</th>
                <th>End</th>
                <th>Duration</th>
                <th>Extended</th>
                <th>Faculty</th>
                <th>Recording Link</th>
                <th>Presenter Link</th>
                <th>Subject Code</th>
                <th>Course Id</th>
                <th>Course start</th>
                <th>Course End</th>
                <th>Timezone</th>
              	<th><?php echo form_checkbox(['name'=>'selectall','id'=>'selectall']);?></th>
            </tr>
          </thead>
          <tbody  style="font-size: 12px;">
			<?php if( count($list) ):$sn=1;
			$count = $this->uri->segment(4);
			foreach($list as $lists ): ?>
            <tr>
                <td><?php echo  $sn; ?>
             <?php //$class_tag_id=  '444746'; ?> 
                	<?php //echo anchor("admin/Adminlte/class_view/{$lists->id}",'<i class="fa fa-fw fa-eye"></i>',['title'=>'View Class']); ?>
                	<?php echo anchor("admin/Adminlte/class_modify/{$lists->class_tag_id}",'<i class="fa fa-fw fa-edit text-orange"></i>',['title'=>'Modify Class']); ?>
			  		<?php echo anchor("admin/Adminlte/class_cancel/{$lists->class_tag_id}",'<i class="fa fa-fw fa-trash text-red"></i>',
			  		['title'=>'Cancel Class','onClick' =>"return confirm('Are you sure you want to Cancel this Class?')"]); ?>
			  		<?php echo anchor("admin/Adminlte/class_download_recording/{$lists->class_tag_id}",'<i class="fa fa-fw fa-cloud-download text-green"></i>',
			  		['title'=>'Download Class','onClick' =>"return confirm('Are you sure you want to Download this Class?')"]); ?>
			  	</td>
			  	<td><?php echo  strtoupper($lists->method);?></td>
                <td><?php echo  strtoupper($lists->class_tag_id);?></td>
                <td><?php echo date("d-M-Y", strtotime($lists->class_date));?></td>
                <td><?php echo  date('l',strtotime($lists->class_date));?></td>
                <td><?php echo  strtoupper($lists->category_id);?></td>
                <td><?php echo  strtoupper($lists->class_id);?></td>
                <td><?php echo  strtoupper($lists->subject_id);?></td>
                <td><?php echo  strtoupper($lists->class_start_time);?></td>
                <td><?php echo  strtoupper($lists->class_end_time);?></td>
                <td><?php echo  $lists->class_duration_min;?></td>
                <td><?php echo  strtoupper($lists->class_extend_time_min);?></td>
                <td><?php echo  ucwords($lists->faculty);?></td>
                <td><a target="blank" href="<?php echo  ($lists->recording_url);?>"><i class="fa fa-fw fa-external-link-square text-red"></i></a></td>
                <td><a target="blank" href="<?php echo  ($lists->presenter_url);?>"><i class="fa fa-fw fa-external-link-square"></i></a></td>
                <td><?php echo  strtoupper($lists->subject_code);?></td>
                <td><?php echo  strtoupper($lists->course_id_tag);?></td>
                <td><?php echo strtoupper(date("d-M-Y", strtotime($lists->course_start_date)));?></td>
                <td><?php echo  strtoupper(date("d-M-Y", strtotime($lists->course_end_date)));?></td>
                <td><?php echo  strtoupper($lists->time_zone);?></td>
                
                
              <td> 
              		<input name="checkbox[]" class="checkbox1" type="checkbox" id="checkbox[]" value="<?php echo $lists->id ?>">
              </td>
            </tr>
            <?php $sn++;?>
			<?php endforeach; ?>
            <?php else : ?>
            <tr>
              <td colspan="6"><strong>No record found</strong></td>
            </tr>
            <?php endif; ?>

          </tbody>
        <?php echo form_close();?>
          <tfoot >
            <tr>
                  <th>Sr.</th>
                <th>Class Status</th>
                <th>ClassId</th>
                <th>Class Date</th>
                <th>Class Day</th>
                <th>Category</th>
                <th>Class</th>
                <th>Subject</th>
                <th>Start</th>
                <th>End</th>
                <th>Duration</th>
                <th>Extended</th>
                <th>Faculty</th>
                <th>Recording Link</th>
                <th>Presenter Link</th>
                <th>Subject Code</th>
                <th>Course Id</th>
                <th>Course start</th>
                <th>Course End</th>
                <th>Timezone</th>
              	<th><?php echo form_checkbox(['name'=>'selectall','id'=>'selectall']);?></th>
            </tr>
          </tfoot>
        </table>
        </div>
        </div>
        <?php $count++; //echo  $link; ?>
        </div>
    </div>
  </div>
</div>
</section>
</div>
<?php /*?>
<script>
   $(document).ready(function() {
	resetcheckbox();
	$('#selectall').click(function(event) {  //on click
		if (this.checked) { // check select status
			$('.checkbox1').each(function() { //loop through each checkbox
				this.checked = true;  //select all checkboxes with class "checkbox1"              
			});
		} else {
			$('.checkbox1').each(function() { //loop through each checkbox
				this.checked = false; //deselect all checkboxes with class "checkbox1"                      
			});
		}
	});
	$("#del_all").on('click', function(e) {
		e.preventDefault();
		var checkValues = $('.checkbox1:checked').map(function()
		{
			return $(this).val();
		}).get();
		console.log(checkValues);
		
		$.each( checkValues, function( i, val ) {
			$("#"+val).remove();
			});
//                    return  false;
		$.ajax({
			url: '<?=site_url("Pdf/task_all");?>',
			type: 'post',
			data: 'ids=' + checkValues
		}).done(function(data) {
			$("#respose").html(data);
			$('#selectall').attr('checked', false);
		});
	});
	
	function  resetcheckbox(){
	$('input:checkbox').each(function() { //loop through each checkbox
	this.checked = false; //deselect all checkboxes with class "checkbox1"                      
	   });
	}
});

</script>


<script>
   $(document).ready(function() {
	resetcheckbox();
	$('#selectall').click(function(event) {  //on click
		if (this.checked) { // check select status
			$('.checkbox1').each(function() { //loop through each checkbox
				this.checked = true;  //select all checkboxes with class "checkbox1"              
			});
		} else {
			$('.checkbox1').each(function() { //loop through each checkbox
				this.checked = false; //deselect all checkboxes with class "checkbox1"                      
			});
		}
	});
	$("#del_single").on('click', function(e) {
		e.preventDefault();
		var checkValues = $('.checkbox1:checked').map(function()
		{
			return $(this).val();
		}).get();
		console.log(checkValues);
		
		$.each( checkValues, function( i, val ) {
			$("#"+val).remove();
			});
//                    return  false;
		$.ajax({
			url: '<?=site_url("Pdf/task_single_invoice");?>',
			type: 'post',
			data: 'ids=' + checkValues
		}).done(function(data) {
			$("#respose").html(data);
			$('#selectall').attr('checked', false);
		});
	});
	
	function  resetcheckbox(){
	$('input:checkbox').each(function() { //loop through each checkbox
	this.checked = false; //deselect all checkboxes with class "checkbox1"                      
	   });
	}
});

</script>
<?php */?>
<?php /*?>
<style>
tbody td, tfoot th,thead th {width: 5.5%;float: left;word-wrap: break-word;text-align:justify;text-align: right;}
</style>
<?php  */?>