        
  
      
<?php 
    $conid=$_REQUEST['con'];
    $nowdue = date('Y-m-d H:i:s');
    $queCon = $db->prepare('SELECT *FROM tbl_info_register i
    INNER JOIN tbl_con_infos cn ON cn.reg_info_id=i.regst_id 
    INNER JOIN tbl_clients c ON c.ct_id=i.clnt_id 
    INNER JOIN tbl_reqs_type r ON r.reqtype_id=i.reqtype
    WHERE cn.con_info_id="'.$conid.'"');
    $queCon->execute();
    while($ffCon = $queCon->fetch()){
    $req = $ffCon['regst_id'];      
    $con = $ffCon['con_info_id'];
    $appntsent= $ffCon['appntsent']; 
    $stats = $ffCon['info_sts'];
    ### RECEIVE DETAILS ####### 
    $snder = $db->prepare("SELECT * FROM tbl_role r
    INNER JOIN tbl_title t ON t.department_id = r.role_id 
    WHERE t.title_id ='".$appntsent."'");  
    $snder->execute();
    $viewSnder = $snder->fetch();
 
    $roleNam = $viewSnder['role_name'];
    $tileNam = $viewSnder['title_name'];
     
    ### RECEIVE DETAILS #######
?>

  <form  class="form-horizontal" id="" method="POST" action="" autocomplete="off">
    <div class="card mb-g border shadow-0">
        <div class="card-header bg-white p-0 header">
            <div class="p-3 d-flex flex-row">
                <div class="d-block ml-2">
                    <span class="h6 font-weight-bold text-uppercase d-block m-0">
                        <?php echo $ffCon['sub_matt'];?>
                    </span>
                    <div class="clearfix"></div>  
                </div>
            </div>
        </div>

        <div class="card-body ">

        <div class="container">
            <div data-size="A4">
                
                <div class="row">
                    <div class="col-sm-12">
                        <div class="d-flex align-items-center mb-5">
                            <h2 class="keep-print-font fw-500 mb-0 text-primary flex-1 position-relative">
                                Client: <?php echo $ffCon['ct_names'];?>
                                <small class="text-muted mb-0 fs-xs">
                                    Request for <?php echo $ffCon['reqtype_name'];?>
                                </small>
                                
                            </h2>
                            
                            <!-- status -->
                            <div class="position-absolute pos-top pos-right height-3 mt-1 hidden-md-down">
                                <br>
                                <div class="row">
                                <label class="col-md-4"><b>Status:<span class="required" style="color:red">*</span> </b></label>
                                    <div class="col-md-8">
                                        <select class="select2 form-control w-100" name="assgnSts" id="assgnSts" data-placeholder="-select status-" required>
                                            <option></option>
                                            <?php
                                                $stmt = $db->query('SELECT *FROM tbl_status WHERE status_id IN(7,10) ORDER BY status_id ASC');
                                                try
                                                {
                                                    while ($rrr = $stmt->fetch(PDO::FETCH_ASSOC)) {
                                                    ?>
                                                        <option value="<?php echo $rrr['status_id']; ?>" selected><?php echo $rrr['status_name']; ?></option>
                                                    <?php
                                                    }
                                                    }
                                                    catch (PDOException $ex) {
                                                    //Something went wrong rollback!
                                                    echo $ex->getMessage();
                                                }
                                            ?>	
                                        </select>
                                    </div>
                                </div>
                            </div>

                        </div>

                        <h3 class="fw-300 display-4 fw-500 color-primary-600 keep-print-font pt-4 l-h-n m-0">
                            DESIGN STRUCTURE
                        </h3>

                        <div class="text-dark fw-700 h1 mb-g keep-print-font">
                            <?php 
                                include 'desgn_str.php'; 
                            ?>
                        </div>

                    </div>
                </div>

                <div class="row">
                    <div class="col-sm-4 d-flex">
                        <div class="table-responsive">
                            <table class="table table-clean table-sm align-self-end">
                                <tbody>
                                    <tr>
                                        <td> Request Date:</td>
                                        <td><?php echo date('d/M/Y',strtotime($ffCon['requestDate']));?></td>
                                    </tr>
                                    <tr>
                                        <td><strong>Assigned Date:</strong> </td>
                                        <td><?php echo date('d/M/Y',strtotime($ffCon['dueCon']));?></td>
                                    </tr>
                                    <tr>
                                        <td>Department From</td>
                                        <td><?php echo $roleNam;?></td>
                                    </tr>
                                    <tr>
                                        <td>Appointment:</td>
                                        <td><?php echo $tileNam;?></td>
                                    </tr>
                                    <tr>
                                        <td>Completed Date:</td>
                                        <td><?php echo date('d/M/Y',strtotime($ffCon['cpte_date']));?></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="col-sm-4 ml-sm-auto">
                        <div class="table-responsive">
                            <table class="table table-sm table-clean text-right">
                                <tbody>
                                    <tr>
                                        <td>
                                            <strong>Handled by:</strong>
                                        </td>
                                    </tr>
                                    <?php                                        
                                        $asgnQue=$db->prepare('SELECT *FROM tbl_assign_reqs a
                                        INNER JOIN tbl_title t ON t.title_id=a.asgn_appoint 
                                        WHERE conasgn="'.$con.'"');
                                        $asgnQue->execute();
                                        while($rr=$asgnQue->fetch()){
                                    ?>
                                    <tr>
                                        <td>
                                            <strong><?php echo $rr['title_name'];?></strong>
                                        </td>
                                    </tr>
                                    <?php }?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                 
                <?php 
                include 'boqvalid_view.php';
                ?>
            </div>
        </div> 


        </div>

        <div class="card-footer">
            <div class="d-flex align-items-center">
                <span class="text-sm text-muted font-italic">

                    <button type="submit" name="validBoq" class="btn btn-primary btn-sm"style="border-radius: 4px;font-weight: bold;" 
                    id="validBoq" title="Assign to head office"><i class="fa fa-check" aria-hidden="true"></i> Validate</button> 

                    <div class="alert alert-info" role="alert" id="asgnAlert" style="display: none;">
                        <strong><b>Well Done!</b></strong> You have already assign.
                    </div>
                </span>
                <a href="gate?b=cptereq" class="flex-shrink-0 ml-auto" style="font-weight: bold;">Go back <i class="fa fa-mail-reply ml-2"></i> </a>
            </div>
        </div>

    </div>  
    </form>

         
<?php  }?>


