<?php
require_once("../includes/config.php");
//////// doc id /////////////
if(isset($_REQUEST['id'])){ $idvar = $_REQUEST['id']; }else{ $idvar = "";}
if(isset($_REQUEST['status'])){$selstatus=$_REQUEST['status'];}else{$selstatus="";}
if(isset($_REQUEST['request_from'])){$selrf=$_REQUEST['request_from'];}else{$selrf="";}
if(isset($_REQUEST['daterange'])){$seldaterng=$_REQUEST['daterange'];}else{$seldaterng="";}
$arrstatus = getFullStatus("",$link1);
//// get product category array
$arr_pc = getProductArray($link1);
//// get product sub category array
$arr_psc = getProductSubCatArray($link1);
//// get brand array
$arr_brand = getBrandArray($link1);
//// get part type array
$arr_pt = getPartTypeArray($link1);


/////////check approval is applicable or not
$apply_app = getAnyDetails(base64_decode($_REQUEST['pid']),"apply_approval","tabid","tab_master",$link1);
$docid=base64_decode($idvar);
//// PO Master details
$sql_locdet="SELECT * FROM jobcard_master where system_ref_no='".$docid."'";
$res_locdet=mysqli_query($link1,$sql_locdet);
$row_locdet=mysqli_fetch_assoc($res_locdet);
$prodet = explode("~",getAnyDetails($row_locdet['job_part'],"brandid, itemtypeid, part_name, productid, psubcatid, purchase_unit","partcode","partcode_master",$link1));
$jobpart = "<strong>".$row_locdet['job_part']."&nbsp;&nbsp;/&nbsp;&nbsp;".$prodet[2]."</strong>&nbsp;&nbsp;/&nbsp;&nbsp;".$arr_psc[$prodet[4]]."&nbsp;&nbsp;/&nbsp;&nbsp;".$arr_pc[$prodet[3]]."&nbsp;&nbsp;/&nbsp;&nbsp;".$arr_brand[$prodet[0]]."&nbsp;&nbsp;/&nbsp;&nbsp;".$arr_pt[$prodet[1]];
///// back page link
////// requisition page link
$move_reqpage = "status=".$selstatus."&request_from=".$row_locdet['location_code']."&daterange=".$seldaterng."&id=".$_REQUEST['id']."&pageref=store_job_view&request_type=JC&job_no=".$row_locdet['system_ref_no']."".$pagenav."";
////// make sub job page link
$move_sjobpage = "status=".$selstatus."&request_from=".$row_locdet['location_code']."&daterange=".$seldaterng."&id=".$_REQUEST['id']."&pageref=store_job_view&job_no=".$row_locdet['system_ref_no']."".$pagenav."";
////// BOM use in job page link
$move_bomusepage = "status=".$selstatus."&request_from=".$row_locdet['location_code']."&daterange=".$seldaterng."&id=".$_REQUEST['id']."&pageref=store_job_view&job_no=".$row_locdet['system_ref_no']."".$pagenav."";
////// assign job page link
$move_ajobpage = "status=".$selstatus."&request_from=".$row_locdet['location_code']."&daterange=".$seldaterng."&id=".$_REQUEST['id']."&pageref=store_job_view&job_no=".$row_locdet['system_ref_no']."".$pagenav."";

###############################################################################################
/////// if user update job status or remark against it
if(isset($_POST['saveButton3'])){
	if($_POST['saveButton3'] == "Save"){
		if($_POST['status'] != $row_locdet['status']){
			///// update status in job master
			mysqli_query($link1,"UPDATE jobcard_master set status='".$_POST['status']."' where system_ref_no='".$docid."'");
		}
		///// insert in job history
		$flag = jobHistory($docid,$row_locdet['location_code'],"JOB UPDATE",$_POST['status'],$_POST['remark'],$_SESSION['userid'],$ip,$link1,true);
		$msg = "Job card is successfully updated.";
		$cflag="success";
		$cmsg = "Success";
	}
}
/////// if user assign job to location
if(isset($_POST['saveButton4'])){
	if($_POST['saveButton4'] == "Save"){
		$flag = true;
		mysqli_autocommit($link1, false);
		$error_msg = "";
		$arr_loc = $_REQUEST['assign_location'];
		if(count(array_filter($arr_loc)) == count($arr_loc)){
			for($i = 0; $i < count($arr_loc); $i++){
				/////// make sub job no. with main job no.
				$rs = mysqli_fetch_assoc(mysqli_query($link1,"SELECT max(temp_no) as doc_count from jobcard_master where system_ref_no like '".$docid."%' and job_type='ASSIGN JOB'"));
				$req_no = $rs['doc_count'] + 1;
				//$pad = str_pad($req_no,4,0,STR_PAD_LEFT);
				$docseries = $docid."-A".$req_no;
				////// maintain job master details
				$result1 = mysqli_query($link1,"insert into jobcard_master set location_code='".$arr_loc[$i]."', system_ref_no='".$docseries."', job_type='ASSIGN JOB', temp_no='".$req_no."', entry_by='".$_SESSION['userid']."', entry_date='".$today."',entry_time='".$currtime."',entry_ip='".$ip."', production_date='".$row_locdet['production_date']."',start_date='".$row_locdet['start_date']."',end_date='".$row_locdet['end_date']."', planning_no='".$row_locdet['planning_no']."',planning_date='".$row_locdet['planning_date']."',bomid='".$row_locdet['bomid']."',job_part='".$row_locdet['job_part']."',job_qty='".$row_locdet['job_qty']."',bal_qty='".$row_locdet['bal_qty']."',purchase_unit='".$row_locdet['purchase_unit']."',status='12',remark='".$_POST['remark']."'");
				//// check if query is not executed
				if (!$result1) {
					$flag = false;
					$error_msg = "Error Code1: ".mysqli_error($link1);
				}
				////// maintain job data details
				$result2 = mysqli_query($link1,"INSERT INTO jobcard_data (system_ref_no,partcode,conversion_factor,bomperunit,qty,allocate_qty,balance_qty,consume_qty,purchase_unit) SELECT '".$docseries."',a.partcode,a.conversion_factor,a.bomperunit,qty,a.allocate_qty,a.balance_qty,a.consume_qty,a.purchase_unit FROM jobcard_data a WHERE a.system_ref_no = '".$docid."'");
				//// check if query is not executed
				if (!$result2) {
					$flag = false;
					$error_msg = "Error Code2: ".mysqli_error($link1);
				}
				////// insert in activity table////
				$flag =	dailyActivity($_SESSION['userid'],$docseries,"ASSIGN JOB","ADD",$ip,$link1,$flag);
				///// insert in job history
				$flag =	jobHistory($docseries,$arr_loc[$i],"ASSIGN JOB CREATE","12",$_POST['remark'],$_SESSION['userid'],$ip,$link1,$flag);
			}
			///// check both master and data query are successfully executed
			if ($flag) {
				mysqli_commit($link1);
				$msg = "Job is successfully assigned to selected location";
				$cflag="success";
				$cmsg = "Success";
			} else {
				mysqli_rollback($link1);
				$msg = "Request could not be processed ".$error_msg.". Please try again.";
				$cflag="danger";
				$cmsg = "Failed";
			} 
			//mysqli_close($link1);
		}else{
			$msg = "Request could not be processed. You have not selected any location.";
			$cflag="danger";
			$cmsg = "Failed";
		}
		///// move to parent page
    	header("location:store_job_list.php?msg=".$msg."&chkflag=".$cflag."&chkmsg=".$cmsg."&status=".$selstatus."&request_from=".$selrf."&daterange=".$seldaterng."".$pagenav);
    	exit;
	}
}
?>
<!DOCTYPE html>
<html>
  <head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>
  <?=siteTitle?>
  </title>
  <link rel="shortcut icon" href="../images/titleimg.png" type="image/png">
  <script src="../js/jquery.js"></script>
  <?php 
	 include("../includes/fontawesome.html");
	 include("../includes/main_css.html"); 
	 include("../includes/bootstrap.html");
	 include("../includes/datatables.html");
  ?>
  <script type="text/javascript" language="javascript">
  $(document).ready(function(){
	$("#frm3").validate();
	$("#frm4").validate();
  });		
  ////// function for open modal to view planning details
	function openModel(docid){
		$.get('planning_request_viewonly.php?doc_id=' + docid, function(html){
			 $('#courierModel .modal-body').html(html);
			 $('#courierModel').modal({
				show: true,
				backdrop:"static"
			});
		 });
		 $("#docno").html(docid);
	}
	////// function for open modal to update status and remark of the job
	function updateStatusRemark(jobid){
		$.get('update_job_status.php?job_id=' + jobid, function(html){
			 $('#updstsModel .modal-body').html(html);
			 $('#updstsModel').modal({
				show: true,
				backdrop:"static"
			});
		 });
		 $("#jobno").html(jobid);
	}
	////// function for open modal to assign job to location
	function assignJob(jobid){
		$.get('assign_job.php?job_id=' + jobid, function(html){
			 $('#asnJobModel .modal-body').html(html);
			 $('#asnJobModel').modal({
				show: true,
				backdrop:"static"
			});
			makedropdown();
		 });
		 $("#jobno2").html(jobid);
		 
	}
	function makedropdown(){
		$('#assign_location').multiselect({
				includeSelectAllOption: false,
				buttonWidth:"500",
				buttonClass: "form-control required custom-select"
	   
		});
	}	
  </script>
  <script src="../js/jquery.validate.js"></script>
  <!-- Include multiselect -->
  <script type="text/javascript" src="../js/bootstrap-multiselect.js"></script>
  <link rel="stylesheet" href="../css/bootstrap-multiselect.css" type="text/css"/>
  <style type="text/css">
    .multiselect-container {
        width: 100% !important;
    }
  </style>
  </head>
  <body>
  <div class="container-fluid">
    <div class="row content">
    <?php 
    include("../includes/leftnav_admin.php");
    ?>
      <div class="<?=$screenwidth?>">
        <h2 align="center"><i class="fa <?=$fa_icon?>"></i> Job Details</h2>
      	<h4 align="center"><?php echo "( ".$row_locdet['system_ref_no']." )"; ?></h4>
	   <?php if(!empty($msg)){?>
        <div class="alert alert-<?php echo $cflag;?> alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            <strong><?php echo $cmsg;?>!</strong>&nbsp;&nbsp;<?=$msg?>.
        </div>
        <?php $msg = ""; }?>     
   <div class="form-group"  id="page-wrap" style="margin-left:10px;">
   <div class="panel-group">
    <div class="panel panel-success table-responsive">
        <div class="panel-heading"><i class="fa fa-newspaper-o fa-lg"></i>&nbsp;&nbsp;Job Details</div>
         <div class="panel-body">
          <table class="table table-bordered" width="100%">
            <tbody>
              <tr>
                <td width="20%"><label class="control-label">Job Location</label></td>
                <td width="80%" colspan="3"><?php echo getAnyDetails($row_locdet['location_code'],"locationname","location_code","location_master",$link1)." (".$row_locdet['location_code'].")"; ?></td>
              </tr>
              <tr>
                <td width="20%"><label class="control-label">Create By</label></td>
                <td width="30%"><?=getAnyDetails($row_locdet['entry_by'],"name","username","admin_users",$link1)." (".$row_locdet['entry_by'].")";?></td>
                <td width="20%"><label class="control-label">Create Date</label></td>
                <td width="30%"><?=dt_format($row_locdet['entry_date'])." | ".time_format($row_locdet['entry_time']);?></td>
              </tr>
              <tr>
                <td width="20%"><label class="control-label">Job Start Date</label></td>
                <td width="30%"><?=dt_format($row_locdet['start_date']);?></td>
                <td width="20%"><label class="control-label">Job End Date</label></td>
                <td width="30%"><?=dt_format($row_locdet['end_date']);?></td>
              </tr>
              <tr>
                <td width="20%"><label class="control-label">Planning No.</label></td>
                <td width="30%"><button title="Click to view planning details" type="button" class="btn<?=$btncolor?>" onClick="openModel('<?php echo $row_locdet['planning_no'];?>');"><?php echo $row_locdet['planning_no']; ?></button></td>
                <td width="20%"><label class="control-label">Planning Date</label></td>
                <td width="30%"><?=dt_format($row_locdet['planning_date']);?></td>
              </tr>
              <tr>
                <td width="20%"><label class="control-label">Production Date</label></td>
                <td width="30%"><?=dt_format($row_locdet['production_date']);?></td>
                <td width="20%"><label class="control-label">Status</label></td>
                <td width="30%"><?=$arrstatus[$row_locdet['status']];?></td>
              </tr>
               <tr class="bg-warning">
                <td width="20%"><label class="control-label">Job Product</label></td>
                <td width="30%"><?=$jobpart?></td>
                <td width="20%"><label class="control-label">Job Qty</label></td>
                <td width="30%"><?=$row_locdet['job_qty']." ".$prodet[5];?></td>
              </tr>
               <tr class="bg-warning">
                <td width="20%"><label class="control-label">Ready Qty</label></td>
                <td width="30%"><?=$row_locdet['ready_qty']." ".$prodet[5];?></td>
                <td width="20%"><label class="control-label">Balance Qty</label></td>
                <td width="30%"><?=$row_locdet['bal_qty']." ".$prodet[5];?></td>
              </tr>
			  <tr>
				<td width="20%"><label class="control-label">Remark</label></td>
                <td width="30%" colspan="3"><?=$row_locdet['remark']?></td>
              </tr>
              <?php if(!empty($row_locdet['updateby'])){?>
              <tr>
                <td width="20%"><label class="control-label">Update By</label></td>
                <td width="30%"><?=getAnyDetails($row_locdet['updateby'],"name","username","admin_users",$link1)?></td>
                <td width="20%"><label class="control-label">Update Date</label></td>
                <td width="30%"><?=dt_format($row_locdet['updatedate'])?></td>
              </tr>
              <?php }?>
              <?php if(!empty($row_locdet['cancel_by'])){?>
              <tr>
                <td width="20%"><label class="control-label">Cancel By</label></td>
                <td width="30%"><?=getAnyDetails($row_locdet['cancel_by'],"name","username","admin_users",$link1)." (".$row_locdet['cancel_by'].")";?></td>
                <td width="20%"><label class="control-label">Cancel Date</label></td>
                <td width="30%"><?=dt_format($row_locdet['cancel_date'])." | ".time_format($row_locdet['cancel_time']);?></td>
              </tr>
              <tr>
                <td width="20%"><label class="control-label">Cancel Remark</label></td>
                <td colspan="3"><?=$row_locdet['cancel_remark']?></td>
              </tr>
              <?php }?>
              <?php 
			  if($apply_app=="Y"){
				  $row_app = mysqli_fetch_assoc(mysqli_query($link1,"select action_by,action_taken,action_date,action_remark from  approval_activity where ref_no='".$docid."'"));
				  ?>
              <tr>
                <td width="20%"><label class="control-label">Approval By</label></td>
                <td width="30%"><?=getAnyDetails($row_app['action_by'],"name","username","admin_users",$link1)?></td>
                <td width="20%"><label class="control-label">Approval Date</label></td>
                <td width="30%"><?=dt_format($row_app['action_date'])?></td>
              </tr>
              <tr>
                <td width="20%"><label class="control-label">Approval Action</label></td>
                <td width="30%"><?=!empty($arrstatus[$row_app['action_taken']])?></td>
                <td width="20%"><label class="control-label">Approval Remark</label></td>
                <td width="30%"><?=$row_app['action_remark']?></td>
              </tr>
              <?php }?>
            </tbody>
          </table>
        </div><!--close panel body-->
    </div><!--close panel-->
    <div class="panel panel-success table-responsive">
        <div class="panel-heading"><i class="fa fa-cubes fa-lg"></i>&nbsp;&nbsp;BOM Part Details</div>
         <div class="panel-body">
          <table class="table table-bordered" width="100%">
            <thead>
                <tr class="<?=$tableheadcolor?>">
                    <th width="35%">BOM Part</th>
                    <th width="15%">Conversion Factor</th>
                    <th width="10%">Job Qty</th>
                    <th width="10%">Allocate Qty</th>
                    <th width="10%">Balance Qty</th>
                    <th width="10%">Consume Qty</th>
                    <th width="10%">Purcahse Unit</th>
                </tr>
            </thead>
            <tbody>
			<?php
			/// select PO data table info
			$tot_req_qty=0;
			$tot_alloc_qty=0;
			$tot_bal_qty=0;
			$tot_cons_qty=0;
			$res_bom = mysqli_query($link1,"SELECT * FROM jobcard_data where system_ref_no='".$docid."'");
			while($row_bom = mysqli_fetch_assoc($res_bom)){
				$bompartdet = explode("~",getAnyDetails($row_bom['partcode'],"brandid, itemtypeid, part_name, productid, psubcatid","partcode","partcode_master",$link1));
				$bompart = "<strong>".$row_bom['partcode']."&nbsp;&nbsp;/&nbsp;&nbsp;".$bompartdet[2]."</strong>&nbsp;&nbsp;/&nbsp;&nbsp;".$arr_psc[$bompartdet[4]]."&nbsp;&nbsp;/&nbsp;&nbsp;".$arr_pc[$bompartdet[3]]."&nbsp;&nbsp;/&nbsp;&nbsp;".$arr_brand[$bompartdet[0]]."&nbsp;&nbsp;/&nbsp;&nbsp;".$arr_pt[$bompartdet[1]];
			?>
              <tr>
                <td><?php echo $bompart;?></td>
				<td align="right"><?=getQtyFormate($row_bom['conversion_factor'])?></td>
                <td align="right"><?=getQtyFormate($row_bom['qty'])?></td>
                <td align="right"><?=getQtyFormate($row_bom['allocate_qty'])?></td>
				<td align="right"><?=getQtyFormate($row_bom['balance_qty'])?></td>
                <td align="right"><?=getQtyFormate($row_bom['consume_qty'])?></td>
                <td><?=$row_bom['purchase_unit']?></td>
              </tr>
			 <?php 
				  $tot_req_qty+=$row_bom['qty'];
				  $tot_alloc_qty+=$row_bom['allocate_qty']; 
				  $tot_bal_qty+=$row_bom['balance_qty']; 
				  $tot_cons_qty+=$row_bom['consume_qty']; 
			  ?>
            <?php }?> 
			<tr>
				<td>&nbsp;</td>
				<td align="right"><label class="control-label">Total</label></td>
				<td align="right"><label class="control-label"><?php echo getQtyFormate($tot_req_qty); ?></label></td>
				<td align="right"><label class="control-label"><?php echo getQtyFormate($tot_alloc_qty); ?></label></td>
				<td align="right"><label class="control-label"><?php echo getQtyFormate($tot_bal_qty); ?></label></td>
                <td align="right"><label class="control-label"><?php echo getQtyFormate($tot_cons_qty); ?></label></td>
                <td>&nbsp;</td>
			</tr>
            </tbody>
          </table>
        </div><!--close panel body-->
    </div><!--close panel-->
    <div class="panel panel-success table-responsive">
        <div class="panel-heading"><i class="fa fa-id-card fa-lg"></i>&nbsp;&nbsp;Action</div>
         <div class="panel-body">
         <form id="frm1" name="frm1" class="form-horizontal" action="" method="post">
         	<?php
			$st1 = !empty($row_locdet['status']) ? $row_locdet['status'] : " ";
			$st2 = !empty($_POST['status']) ? $_POST['status'] : " "; 
			if($st1!=13 && $st2!=13){ ?>
            <div class="form-group">
            	<div class="col-md-3"><button title="Create Sub Job" type="button" class="btn<?=$btncolor?>" onClick="window.location.href='make_subjob.php?<?=$move_sjobpage?>'"><i class="fa fa-wrench fa-lg"></i>&nbsp;&nbsp;Create Sub Job</button></div>
                <div class="col-md-3"><button title="BOM Use" type="button" class="btn<?=$btncolor?>" onClick="window.location.href='bom_use.php?<?=$move_bomusepage?>'"><i class="fa fa-sitemap fa-lg"></i>&nbsp;&nbsp;BOM Use</button></div>
                <div class="col-md-3"><button title="Update Status & Remark" type="button" class="btn<?=$btncolor?>" onClick="updateStatusRemark('<?php echo $row_locdet['system_ref_no'];?>');"><i class="fa fa-pencil fa-lg"></i>&nbsp;&nbsp;Update Status & Remark</button></div>
                <div class="col-md-3"> <button title="Add Effort" type="button" class="btn<?=$btncolor?>" onClick="window.location.href='abc.php?op=add<?=$pagenav?>'"><i class="fa fa-users fa-lg"></i>&nbsp;&nbsp;Add Effort</button></div>
            </div>
            <div class="form-group">
            	<div class="col-md-3"><button title="Stock Out" type="button" class="btn<?=$btncolor?>" onClick="window.location.href='abc.php?op=add<?=$pagenav?>'"><i class="fa fa-send fa-lg"></i>&nbsp;&nbsp;Stock Out</button></div>
                <div class="col-md-3"><button title="Stock Return" type="button" class="btn<?=$btncolor?>" onClick="window.location.href='stock_transfer_add.php?op=add<?=$pagenav?>'"><i class="fa fa-rotate-left fa-lg"></i>&nbsp;&nbsp;Stock Return</button></div>
                <div class="col-md-3"><button title="Stock Request" type="button" class="btn<?=$btncolor?>" onClick="window.location.href='requisition_uploader.php?<?=$move_reqpage?>'"><i class="fa fa-shopping-basket fa-lg"></i>&nbsp;&nbsp;Stock Request</button></div>
                <div class="col-md-3"><button title="Assign Job" type="button" class="btn<?=$btncolor?>" onClick="assignJob('<?php echo $row_locdet['system_ref_no'];?>');"><i class="fa fa-hand-o-right fa-lg"></i>&nbsp;&nbsp;Assign Job</button></div>
            </div>
            <?php
			} ?>
            <div class="form-group">
                 <div class="col-md-12" align="center"><button title="Back" type="button" class="btn<?=$btncolor?>" onClick="window.location.href='store_job_list.php?status=<?=$selstatus;?>&request_from=<?=$selrf;?>&daterange=<?=$seldaterng;?><?=$pagenav?>'"><i class="fa fa-reply fa-lg"></i>&nbsp;&nbsp;Back</button>
                  </div>
            </div><!--close form group-->
          </form>
        </div><!--close panel body-->
    </div><!--close panel-->  
    </div><!--close panel group-->
        </div>
        <!--End form group--> 
      </div>
      <!--End col-sm-9--> 
    </div>
    <!--End row content--> 
  </div>
  <!--End container fluid-->

<!-- Start Modal  Planning Request view -->
<div class="modal modalTH fade" id="courierModel" role="dialog">
	<form class="form-horizontal" role="form" id="frm2" name="frm2">
		<div class="modal-dialog modal-dialogTH modal-lg">
  			<!-- Modal content-->
  			<div class="modal-content">
    			<div class="modal-header">
      				<button type="button" class="close" data-dismiss="modal">&times;</button>
      				<h2 class="modal-title" align="center"><i class='fa fa-bar-chart faicon'></i> Planning Request</h2>
      				<h4 id="docno" align="center"></h4>
    			</div>
    			<div class="modal-body modal-bodyTH">
     				<!-- here dynamic task details will show -->
    			</div>
    			<div class="modal-footer">
      				<button type="button" id="btnCancel" class="btn<?=$btncolor?>" data-dismiss="modal"><i class="fa fa-window-close fa-lg"></i> Close</button>
    			</div> 
  			</div>
		</div>
	</form>
</div><!--close Modal  Planning Request view -->
<!-- Start Modal Update status and remark -->
<div class="modal modalTH fade" id="updstsModel" role="dialog">
	<form class="form-horizontal" role="form" id="frm3" name="frm3" method="post">
		<div class="modal-dialog modal-dialogTH modal-lg">
            <!-- Modal content-->
            <div class="modal-content">
    			<div class="modal-header">
      				<button type="button" class="close" data-dismiss="modal">&times;</button>
      				<h2 class="modal-title" align="center"><i class='fa fa-pencil faicon'></i> Update Status & Remark</h2>
      				<h4 id="jobno" align="center"></h4>
    			</div>
    			<div class="modal-body modal-bodyTH">
     				<!-- here dynamic task details will show -->
    			</div>
    			<div class="modal-footer">
                	<button class='btn<?=$btncolor?>' id="saveButton3" type="submit" name="saveButton3" value="Save"><i class="fa fa-save fa-lg"></i>&nbsp;&nbsp;Save</button>
      				<button type="button" id="btnCancel" class="btn<?=$btncolor?>" data-dismiss="modal"><i class="fa fa-window-close fa-lg"></i> Close</button>
    			</div>
  			</div>
		</div>
	</form>
</div><!--close modal Update status and remark -->
<!-- Start  Modal Assign job to the selected location -->
<div class="modal modalTH fade" id="asnJobModel" role="dialog">
	<form class="form-horizontal" role="form" id="frm4" name="frm4" method="post">
		<div class="modal-dialog modal-dialogTH modal-lg">
            <!-- Modal content-->
            <div class="modal-content">
    			<div class="modal-header">
      				<button type="button" class="close" data-dismiss="modal">&times;</button>
      				<h2 class="modal-title" align="center"><i class='fa fa-hand-o-right faicon'></i> Assign Job To Location</h2>
      				<h4 id="jobno2" align="center"></h4>
    			</div>
    			<div class="modal-body modal-bodyTH">
     				<!-- here dynamic task details will show -->
    			</div>
    			<div class="modal-footer">
                	<button class='btn<?=$btncolor?>' id="saveButton4" type="submit" name="saveButton4" value="Save"><i class="fa fa-save fa-lg"></i>&nbsp;&nbsp;Save</button>
      				<button type="button" id="btnCancel" class="btn<?=$btncolor?>" data-dismiss="modal"><i class="fa fa-window-close fa-lg"></i> Close</button>
    			</div>
  			</div>
		</div>
	</form>
</div><!--close modal Assign job to the selected location-->
<?php
include("../includes/footer.php");
include("../includes/connection_close.php");
?>
</body>
</html>
