<style>

</style>


<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header custom_head">
        <div class="container-fluid">

        </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="content">

        <!-- Default box -->
        <div class="card">
            <div class="card-header">
                <h3 class="card-title">Add details to activities</h3>
                <div class="card-tools">
                    <button type="button" class="btn btn-tool" data-card-widget="collapse" data-toggle="tooltip" title="Collapse">
                        <i class="fas fa-minus"></i></button>
                    <!--                    <button type="button" class="btn btn-tool" data-card-widget="remove" data-toggle="tooltip" title="Remove">
                                            <i class="fas fa-times"></i></button>-->
                </div>
            </div>
            <div class="card-body">

                <div class="row">
                    <div class="col-md-12 mb-2">
                        <button class="btn btn-success float-right" onclick="updatePrediction()">Update</button>
                    </div>
                    <div class="col-md-12">
                        <table id="table1" class="table table-hover table-bordered table-sm" style="width: 100%">
                            <thead>
                                <tr>
									<th>#</th>
                                    <th style="width: 75%">Activity</th>
                                    <th>Duration (HH:MM)</th>
									<th>Edit</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                $index = 0;
                                foreach ($acList as $value) {
                                    ?>
                                    <tr>
										<td><?php echo $index+1; ?></td>
                                        <td><?= $value->activity; ?></td>
                                        <td><input name="newTime[]" style="text-align: right"  onchange="validateTime(this)" id="newTime_<?= $index; ?>" class="form-control" type="text"  value="<?= $value->sup_hr; ?>">
                                            <input name="oldTime[]"  id="oldTime_<?= $index; ?>"  type="hidden" value="<?= $value->sup_hr; ?>">
                                            <input name="activity[]" id="activity_<?= $index; ?>" type="hidden" value="<?= $value->activity; ?>">
                                        </td>
										<td style="text-align: center"><a href="#" onclick="loadDataToModel('<?= $value->activity; ?>')" data-toggle="modal" data-target="#myModal"><i class="fa fa-fw fa-edit"></i></a></td>
                                    </tr>
                                    <?php
                                    $index++;
                                }
                                ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="col-md-12 mt-2">
                        <button class="btn btn-success float-right" onclick="updatePrediction()">Update</button>
                    </div>
                </div>
            </div>
            <!-- /.card-footer-->
        </div>
        <!-- /.card -->

    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->


<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">

				<h4 class="modal-title" id="ac_modal-title"></h4>
				<button type="button" class="close" data-dismiss="modal">&times;</button>
			</div>
			<div class="modal-body">
				<input type="hidden" id="act" name="act" value="">
				<div class="row form-group">
					<div class="col-md-5"><label>Expected Target</label></div>
					<div class="col-md-6"><input id="sup_exp_tar" name="sup_exp_tar" type="text" class="form-control"> </div>
				</div>
				<div class="row form-group">
					<div class="col-md-5"><label>Does this activity adds value, if so how much</label></div>
					<div class="col-md-4"><select id="sup_value" name="sup_value" class="form-control">
							<option value="0">No value</option>
							<option value="1">$</option>
							<option value="2">$$</option>
							<option value="3">$$$</option>
							<option value="4">$$$$</option>
							<option value="5">$$$$$</option>
						</select></div>
				</div>
				<div class="row form-group">
					<div class="col-md-5"><label>Who looks at the actual results of this activity? </label></div>
					<div class="col-md-4"><input id="sup_monitor" name="sup_monitor" type="text" class="form-control"> </div>
				</div>
				<div class="row form-group">
					<div class="col-md-5"><label>How often the actual results are looked at?</label></div>
					<div class="col-md-3"><select name="sup_monitor_frqu" id="sup_monitor_frqu" class="form-control">
							<option value="">N/A</option>
							<option value="Daily">Daily</option>
							<option value="Weekly">Weekly</option>
							<option value="Mothly">Mothly</option>
						</select> </div>
				</div>
				<div class="row form-group">
					<div class="col-md-5"><label>State any ideas to improve the performance </label></div>
					<div class="col-md-7"><textarea id="sup_suggestion" class="form-control"></textarea></div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" onclick="updateData()" class="btn btn-primary">Update</button>
			</div>
		</div>
	</div>
</div>
</div>

<script src="<?php echo base_url("assets/customJs/add_time.js") ?>"></script>



