<?php
include('../../includes/checkSession.php');
include('../../includes/con2pma3.php');
include('../includes/header_in.php');
?>
<style type="text/css">
    .fixed{display:none !important}
    div.FixedHeader_Cloned th,
    div.FixedHeader_Cloned td {
        background-color: white !important;
    }
   
    .first{
        display: none;
    }
    /*    .fixed{
            width: auto !important;
        }*/
    .dataTable, .FixedHeader_Header {width:100% !important}
    .dataTable thead i{
        margin-top: -5px;
    }
    .imgview{
        height: 16px;
    width: 16px;
    margin-left: 4px;
    margin-top: 3px;
}

.briefc-field{width:35%}

    .briefc-field .single-select{width:100%}
    .briefc-field .double-select, .briefc-field #briefDfrom{width:49%}
.formRow select#projname,.formRow select#clientname{width:100%}
input#briefDname{width:84% !important}
    input#briefDrev{width:15% !important}
    #briefDlist{float:right}
</style>
<script src="../includes/js/fixedheader.js"></script>
<style>
    .addon-label{width:13%}
    .addon-field{width:20%}
.bfc-cycle {width:14%}
</style>



<section class="content">
    <div class="container">
        <div class="row">
            <div class="main-content">
                <h5>
                    <?php if (isset($_REQUEST["msg"])) { ?>
                        <?php echo $_REQUEST["msg"]; ?>
                    <?php } ?>
                </h5>

                <?php if ($uacc == "Full Control") { ?>
                    <?php if (!isset($_REQUEST['Edit'])) { ?>
                        <div class="add-formpage">
                            <form  method="post" action="../../DB/03-scope/BriefDesign1DB.php" onsubmit="return validatescopebriefD()">

                                <fieldset>
                                    <div class="widget">
                                        <div class="whead">
                                            <h6>
                                                <i class="fa fa-plus-circle"></i>
                                                Add </h6>
                                            <strong><a href="javascript:void(0)" onclick="hideform()" class="teamclose"><i class="fa fa-times"></i></a></strong>

                                        </div>
                                        <div class="formRow">
                                            <div class="col-sm-1-8 label-assign" style="padding-right:0px;">
                                                <label>Project Name*:</label></div>
                                            <div class="col-sm-2-2 briefc-field" style="padding-left:0px;">
                                                <select name="projname" id="projname" required>
                                                    <option value="">Select</option>
                                                    <?php
                                                    $result = mysql_query("SELECT * FROM projects where companySerial='$id' AND projStatus='1' order by projectName ASC");
                                                    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                                                        ?>
                                                        <option value="<?php echo $row['projectSerial']; ?>"><?php echo $row['projectCode'] . " - " . $row['projectName']; ?></option>
                                                    <?php } ?>
                                                </select> </div>
                                            
                                            <div class="col-sm-1-8 label-assign" style="padding-right:0px;">
                                                <label>Title | Rev*:</label></div>
                                            <div class="col-sm-2-2 briefc-field" style="padding-left:0px;">
                                                <input name="briefDname" type="text" id="briefDname" size="20" value="" placeholder="Title" />
                                                <input name="briefDrev" type="text"  id="briefDrev" value="" size="10" placeholder="Rev"/>
                                            </div>

                                        </div>
                                        <div class="formRow">
                                           <div class="col-sm-1-8 label-assign" style="padding-right:0px;">
                                                <label>Client Name*:</label></div>
                                            <div class="col-sm-2-2 briefc-field" style="padding-left:0px;">
                                                <select name="clientname" id="clientname" required>
                                                    <option value="">Select</option>
                                                    <?php
                                                    $result = mysql_query("SELECT clientCode, clientSerial, clientName, clientContactName FROM client where companySerial = '$id' AND clientStatus='1'");
                                                    //echo $result."ll";
                                                    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                                                        $clientSerial = $row["clientSerial"];
                                                        echo "<option value='$clientSerial'>" . $row["clientCode"] . " - " . $row["clientName"] . "</option>";
                                                    }
                                                    ?>
                                                </select> </div>
                                            <div class="col-sm-1-8 label-assign" style="padding-right:0px;">
                                                <label>Create/ Copy*:</label></div>
                                            <div class="col-sm-2-2 briefc-field" style="padding-left:0px;">
                                                <select name="briefDfrom" id="briefDfrom" class="double-select">
                                                    <option value="">Select</option>
                                                    <option value="From Scratch">From Scratch</option>
                                                    <option value="From another Design Brief">From another Design Brief</option>
                                                </select> 
                                                
                                                <select name="briefDlist" id="briefDlist" class="double-select">
                                                    <option value="">Select to Copy from</option>
        <?php
        $result = mysql_query("SELECT * FROM briefD where companyID = '$id' AND briefD_status='1'");
        //echo $result."ll";
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            $briefD_id = $row["briefD_id"];
            echo "<option value='$briefD_id'>" . $row["briefD_id"] . " - " . $row["briefD_name"] . "</option>";
        }
        ?>
                                                </select> </div>
                                            <div class="grid2 submit-btn save-bottom"> 
                                                <button type="submit" class="btn btn-success"><i class="fa fa-check-square"></i> </button>
                                            </div>

                                        </div>
                                       
                                </fieldset>  
                            </form>
                        </div>


        <?php
    } else {


        $BID = $_REQUEST['Edit'];
        $result = mysql_query("SELECT * FROM briefD where briefD_id='$BID'");
        $row = mysql_fetch_array($result, MYSQL_ASSOC);
        $project_id = $row["project_id"];
        $client_id = $row["client_id"];
        $briefD_name = $row["briefD_name"];
		$briefD_rev = $row["briefD_rev"];
        $briefD_create = $row["briefD_create_from"];
        $briefD_copy_from = $row["briefD_copy_from"];
        ?>

                        <div class="edit-formpage">
                            <form  action="../../DB/03-scope/BriefDesign1DB.php?Edit=<?php echo $BID; ?>" onsubmit="return validatescopebriefD()" method="post" enctype="multipart/form-data" name="form1" id="form1">
                                <div class="widget">
                                    <div class="whead">
                                        <h6>
                                            <i class="fa fa-pencil-square-o"></i>
                                            Edit</h6>
                                        <span style="float:right"><a href="javascript:void(0)" onclick="hideeform()" style="font-size:16px; padding:5px 24px; display:inline-block"><i class="fa fa-times"></i></a></span>

                                    </div>
                                    <div class="formRow">
                                        <div class="col-sm-1-8 label-assign" style="padding-right:0px;">
                                            <label>Project Name*:</label></div>
                                        <div class="col-sm-2-2 briefc-field" style="padding-left:0px;">
                                            <select name="projname" id="projname">
                                                <option value="">Select</option>
        <?php
        $result = mysql_query("SELECT * FROM projects where companySerial='$id' AND projStatus='1'");
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            ?>
                                                    <option value="<?php echo $row['projectSerial']; ?>" <?php if ($row['projectSerial'] == $project_id) { ?> selected="selected" <?php } ?>><?php echo $row['projectCode'] . " - " . $row['projectName']; ?></option>
        <?php } ?>
                                            </select> </div>
                                        
                                        <div class="col-sm-1-8 label-assign" style="padding-right:0px;">
                                            <label>Title | Rev*:</label></div>
                                        <div class="col-sm-2-2 briefc-field" style="padding-left:0px;">
                                            <input name="briefDname" type="text" class="ablks1" id="briefDname" size="30" value="<?php echo $briefD_name; ?>" /> <input name="briefDrev" type="text"  id="briefDrev" value="<?php echo $briefD_rev; ?>" size="10" placeholder="Rev"/>
                                        </div>

                                    </div>
                                    <div class="formRow">
                                        
                                        <div class="col-sm-1-8 label-assign" style="padding-right:0px;">
                                            <label>Client Name*:</label></div>
                                        <div class="col-sm-2-2 briefc-field" style="padding-left:0px;">
                                            <select name="clientname" id="clientname">
                                                <option value="">Select</option>
                                                <?php
                                                $result = mysql_query("SELECT clientCode, clientSerial, clientName, clientContactName FROM client where companySerial = '$id' AND clientStatus='1'");
                                                //echo $result."ll";
                                                while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                                                    $clientSerial = $row["clientSerial"];
                                                    if ($client_id == $clientSerial) {
                                                        echo "<option selected='selected' value='$clientSerial'>" . $row["clientCode"] . " - " . $row["clientName"] . "</option>";
                                                    } else {
                                                        echo "<option value='$clientSerial'>" . $row["clientCode"] . " - " . $row["clientName"] . "</option>";
                                                    }
                                                }
                                                ?>
                                            </select> </div>

                                        <div class="col-sm-1-8 label-assign" style="padding-right:0px;">
                                            <label>Create/ Copy*:</label></div>
                                        <div class="col-sm-2-2 briefc-field" style="padding-left:0px;">
                                            <select name="briefDfrom" id="briefDfrom" class="double-select">
                                                <option value="">Select</option>
                                                <option value="From Scratch"<?php if ($briefD_create == "From Scratch") { ?> selected="selected"<?php } ?>>From Scratch</option>
                                                <option value="From another Design Brief"<?php if ($briefD_create == "From another Design Brief") { ?> selected="selected"<?php } ?>>From another Design Brief</option>
                                            </select>
                                            <select name="briefDlist" id="briefDlist" class="double-select">
                                                <option>Select</option>
        <?php
        $result = mysql_query("SELECT briefD_id, briefD_name FROM briefc where companyID = '$id' AND briefD_status='1'");
        //echo $result."ll";
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            $briefD_id = $row["briefD_id"];
            if ($briefD_id == $briefD_copy_from) {
                echo "<option selected='selected' value='$briefD_id'>" . $row["briefD_id"] . " - " . $row["briefD_name"] . "</option>";
            } else {
                echo "<option value='$briefD_id'>" . $row["briefD_id"] . " - " . $row["briefD_name"] . "</option>";
            }
        }
        ?>
                                            </select> </div>
                                        <div class="grid2 submit-btn save-bottom"> 
                                            <button type="submit" class="btn btn-success"><i class="fa fa-check-square"></i> </button>
                                        </div>

                                    </div>
                                </div>
                            </form><div class="divider"><span></span></div>

                        </div>

                                                <?php
                                            }
                                        }
                                        ?>
                <div class="table-subject">

                    <!--  -->

                    <div class="widget">
                        <div class="whead">
                            <h6 id="active-desciplines" >
                                <b><i class="fa fa-building-o"></i>Active Design Briefs</b> 
                            </h6>
                            <span style="line-height: 35px;">
                                <a onclick="bottomfooterfunc()" href="#hidden-data" class="hidden-entry" >
                                    <!--                            Go to Hidden List-->
                                    <span class="icon-eye_box bck">

                                    </span>
                                </a>
<?php if ($uacc == "Full Control") { ?>
    <?php if (!isset($_REQUEST['Edit'])) { ?>
                                        <a onclick="showaddform()" style="cursor:pointer"  class="addform-btn " id=""><span class="icon-plus_box  bck"></span></a>
                                        <a onclick="hideform()" style="cursor:pointer" class="hideform-btn " id=""><span class="icon-minus_box  bck"></span></a>

    <?php } else {
        ?>
                                        <a onclick="showeditform()" style="cursor:pointer"  class="eform-btn " id=""><i class="fa fa-pencil-square-o green-icon"></i></a>
                                        <a onclick="hideeform()" style="cursor:pointer" class="hideeform-btn " id=""><span class="icon-minus_box  bck"></span></a>

        <?php }
    ?>
<?php } ?>
</span>

                        </div>
                        <div>
                            <!-- <div class="scroll"> -->
                            <table cellpadding="0" cellspacing="0" class="" style="width:100%; position:relative !important"  id="active_descipline_tbl">
                                <thead>
                                    <tr>
										<th class="first"></th>
                                        <th class="date-create WBSl-dcreated" >
                                            Date Created
                                            <br />
                                            (yyyy.mm.dd) <i class="fa fa-sort"></i>
                                        </th>
                                        <th  class="WBSl-from" align="left" valign="top" scope="col">
                                            Brief <br />Type<i class="fa fa-sort"><br /></th>
                                        <th  class="WBSl-ID"  align="left" valign="top" scope="col">
                                            Design Brief Name (Rev)<br />
                                            Project      Name/  
                                            Client Name<i class="fa fa-sort"></i>
                                        </th>
                                        <th class="WBSl-remarks">
                                        Prepared<br />
                                            By<i class="fa fa-sort"></th>
                                        <th class="WBSl-status"><span class="bfc-cycle">Sent<br />
Status</span><i class="fa fa-sort"></th>
                                        <th class="WBSl-actions action-icon" style="text-align:right">
                                            Actions<br />Status</th>


<!-- <th></th> -->
                                    </tr>
                                </thead>
                                <tbody>
<?php
$result = mysql_query("SELECT briefD.creationDate,briefD_rev,briefD.briefD_create_from,briefD.briefD_status,briefD.briefD_id,briefD.briefD_name,briefD.PreparedBy,briefD.companyID,projects.projectName,client.clientName FROM projects,client,briefD where briefD.companyID='$id' AND (briefD.briefD_status='1' OR briefD.briefD_status='3') AND projects.projectSerial=briefD.project_id AND client.clientSerial=briefD.client_id  ORDER BY briefD.creationDate DESC");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    $PreparedBy = "";
    if ($row["PreparedBy"] == 0) {
        $resultPre = mysql_query("SELECT firstName, lastName FROM login where loginId='" . $id . "'");
        $PreparedBy .= mysql_result($resultPre, 0, 0);
        $PreparedBy .=" " . mysql_result($resultPre, 0, 1);
    } else {
        $resultPre = mysql_query("SELECT internal_personnel_firstName, internal_personnel_lastName FROM internal_personnel where internal_personnel_id='" . $row["PreparedBy"] . "'");
        $PreparedBy .= mysql_result($resultPre, 0, 0);
        $PreparedBy .=" " . mysql_result($resultPre, 0, 1);
    }
    ?>

                                        <tr >
<td class="first"></td>
                                            <td class="WBSl-dcreated" align="left" valign="middle" scope="col"></th><?php echo $row["creationDate"]; ?></td>
                                            <td class="WBSl-from" align="left" valign="middle" ><?php echo $row["briefD_create_from"]; ?></td>
                                            <td class="WBSl-ID"align="left" valign="middle" scope="col">(DBRF-<?php echo $row["briefD_id"]; ?>) - <?php echo $row["briefD_name"]; ?> (<?php echo $row["briefD_rev"]; ?>)<br /><?php echo $row["projectName"] . "/ " . $row["clientName"]; ?></td>


                                          <td class="WBSl-remarks" align="left" valign="middle" scope="col"><?php echo $PreparedBy; ?><br /></td>
                                          <td class="WBSl-status" align="left" valign="middle" scope="col"><?php if($row["briefD_status"]==3){?>Sent for Review<?php } else echo "Not Sent for Review" ?><br /></td>

                                            <td class="WBSl-actions action-icons" align="right" valign="middle">

                                        <?php 
										 if($row["briefD_status"]!=3)
												{
										if ($uacc == "Full Control") { ?>
                                                    <div class="close-icon"> 
                                                        <a href="javascript:void(0)" onclick="deleteBD1(<?php echo $row["briefD_id"] ?>)">
                                                            <div class="glyph">
                                                                <div class="fs1 iconb" data-icon="" title="Delete"></div>
                                                            </div>
                                                        </a> 
                                                    </div>
    <?php } else { ?> 						
                                                    <div class="glyph">
                                                        <div class="fs1 iconb" data-icon="" title="Delete"></div>
                                                    </div> 
    <?php } ?>
    <?php if ($uacc == "Full Control") { ?>
                                                    <div class="edit-icon">
                                                        <a href="BriefDesign1.php?Edit=<?php echo $row["briefD_id"]; ?>">
                                                            <div class="glyph">
                                                                <div class="fs1 iconb" data-icon="" title="Edit"></div>
                                                            </div>
                                                        </a> 
                                                    </div>
    <?php } else { ?>
                                                    <div class="glyph">
                                                        <div class="fs1 iconb" data-icon="" title="Edit"></div>
                                                    </div>
    <?php } ?>
    <?php if ($uacc == "Full Control") { ?>
                                                    <div class="eye-icon">   
                                                        <a href="../../DB/03-scope/BriefDesign1DB.php?InActive=<?php echo $row['briefD_id']; ?>">
                                                            <div class="glyph">
                                                                <div class="fs1 iconb" data-icon="" title="Hide" ></div>
                                                            </div>
                                                        </a> 
                                                    </div>
    <?php } else { ?>
                                                    <div class="glyph">
                                                        <div class="fs1 iconb" data-icon="" title="Hide" ></div>
                                                    </div>

    <?php } } ?>  


    <?php if ($uacc == "Full Control") { ?>
<div class="eye-icon"> 
                                                    <a href="Brief-D1.php?BID=<?php echo $row["briefD_id"]; ?>">  
                                                        <img class="imgview" src="../includes/images/icons/documentation3.png" title="View Contents">
                                                    </a><a href="DBPrintView.php?BID=<?php echo $row["briefD_id"]; ?>"><img class="imgview" src="../includes/images/icons/print.png" title="Print Preview"></a> </div>

    <?php } else { ?>
                                                    <img src="../includes/images/icons/documentation3.png" title="View detail">
    <?php } ?>  



                                            </td>

 <?php
                                        $typid = $row["briefD_id"];
                                        $path = "03-scope";
                                        $type = "BriefDesign1";
                                        $attach = 0;
                                        $reminder = 0;
                                        $note = 1;
                                        include('../includes/noterow2.php');
                                        ?>

                                        </tr>

                                            <?php } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="divider"><span></span></div>
        </div>
    </div>

    <!--  -->


</div>
</div>
</div>
</div>
</section>
<footer>
    <div class="container">
        <div class="row">
            <div class="top-footer">
                <div class="instructions-cont">
                    <i class="fa fa-info-circle"></i>
                    <h6>Instructions </h6>
                    <span>
                        <a onclick="bottomfooterfunc()" href="#addonhidden-data" class="hidden-entry" >View The Hidden List </a> |
                        <a href="#active-desciplines">Go to Active List</a></span>
                </div>
                <div class="left-warning"> Deletion is permanent and can not be retrieved.  If a  parameter has been used at other places, deletion might cause problems.  A 
                    parameter can be deleted only after its usage is removed from other places.  
                    If you dont want to see an entry or a parameter, you can hide it instead of deleting it.  A Hidden entry or parameter will  show as &quot;HIDDEN&quot; at all places where it was used before.  
                    <!--Table of Hidden Values is given below--> 
                </div>
            </div>
            <div class="bottom-footer" id="addonhidden-data">
                <table cellpadding="0" cellspacing="0" width="100%" class="tDark" id="hidden-entry">
                    <thead>
                        <tr>

                            <th class="date-create WBSl-dcreated" >
                                Date Created
                                <br />
                                (yyyy.mm.dd) <i class="fa fa-sort"></i>
                            </th>
                            <th align="left" valign="top"  class="WBSl-ID" scope="col">
                               Brief <br />Type<i class="fa fa-sort"></i>
                            </th>
                            <th  align="left" valign="top"  class="WBSl-ID" scope="col">
                              Design Brief Name (Rev)<br />
                                Project      Name/  
                                Client Name<i class="fa fa-sort"></i>
                            </th>
                          <th class="WBSl-remarks">Prepared<br />
                                By</th>

                            <th class="WBSl-remarks"><span class="bfc-cycle">Sent<br />
Status</span></th>




                            <th class="WBSl-actions action-icon" style="text-align:right">
                                Actions<br />
                            </th>


<!-- <th></th> -->
                        </tr>
                    </thead>
                    <tbody>
<?php
$result = mysql_query("SELECT briefD.creationDate, briefD_rev,briefD.briefD_create_from,briefD.briefD_id,briefD.briefD_name,briefD.PreparedBy,briefD.companyID,projects.projectName,client.clientName FROM projects,client,briefD where briefD.companyID='$id' AND briefD.briefD_status='0' AND projects.projectSerial=briefD.project_id AND client.clientSerial=briefD.client_id  ORDER BY creationDate DESC, briefD_name ASC");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    $PreparedBy = "";
    if ($row["PreparedBy"] == 0) {
        $resultPre = mysql_query("SELECT firstName, lastName FROM login where loginId='" . $id . "'");
        $PreparedBy .= mysql_result($resultPre, 0, 0);
        $PreparedBy .=" " . mysql_result($resultPre, 0, 1);
    } else {
        $resultPre = mysql_query("SELECT internal_personnel_firstName, internal_personnel_lastName FROM internal_personnel where internal_personnel_id='" . $row["PreparedBy"] . "'");
        $PreparedBy .= mysql_result($resultPre, 0, 0);
        $PreparedBy .=" " . mysql_result($resultPre, 0, 1);
    }
    ?>

                            <tr >

                                <td class="WBSl-dcreated" align="left" valign="middle" scope="col"></th><?php echo $row["creationDate"]; ?></td>
                                <td class="WBSl-ID" align="left" valign="middle" ><?php echo $row["briefD_create_from"]; ?></td>
                                <td class="WBSl-ID"align="left" valign="middle" scope="col">(DBRF-<?php echo $row["briefD_id"]; ?>) - <?php echo $row["briefD_name"]; ?> (<?php echo $row["briefD_rev"]; ?>)<br /><?php echo $row["projectName"] . "/ " . $row["clientName"]; ?></td>


                                <td class="WBSl-remarks" align="left" valign="middle" scope="col"><?php echo $PreparedBy; ?><br /></td>
                                <td class="WBSl-remarks" align="left" valign="middle" scope="col"><?php if($row["briefD_status"]==3){?>
                                  Sent for Review
                              <?php } else echo "Not Sent for Review" ?></td>

                                <td class="WBSl-actions action-icons" align="right" valign="middle">


                            <?php if ($uacc == "Full Control") { ?>
                                        <a href="../../DB/03-scope/BriefDesign1DB.php?Active=<?php echo $row['briefD_id']; ?>">
                                            <div class="glyph">
                                                <div class="fs1 iconb" data-icon="" title="Unhide"></div>
                                            </div>
                                        </a>
    <?php } else { ?>
                                        <div class="glyph">
                                            <div class="fs1 iconb" data-icon="" title="Unhide"></div>
                                        </div>
    <?php } ?> 


                                </td>



                            </tr>

<?php } ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</footer>
<script>

//    function bottomfooterfunc() {
//        $('#addonhidden-data').toggle('slow');
//    }
    function deleteBD1(id) {

        alertify.confirm("This record will be deleted and cannot be retrieved. Press OK to Delete.", function (e) {
            if (e) {
                window.location.href = "../../DB/03-scope/BriefDesign1DB.php?del="+id;

            } else {
                return 0;
            }
        });
    }
</script>
<script type="text/javascript">

// i = showing 1 of 2 pages
// f = filter or search
// p = pages buttons
// l = records per page drop down

function format(d) {
        // `d` is the original data object for the row
       console.log(d.details);
        return '<div class="notesDIV">' + d.details + '</div>';
    }

    active_descipline_table = $('#active_descipline_tbl').DataTable({
        "bJQueryUI": false,
        "bAutoWidth": false,
        "columns": [
            {
                "className": 'details-control',
                "orderable": false,
                "defaultContent": '',
            },
			{"data": "WBSl-dcreated"},
			{"data": "WBSl-from"},
			{"data": "WBSl-ID"},
			{"data": "WBSl-remarks"},
			{"data": "WBSl-status"},
			{"data": "WBSl-action"},
			{"data": "details", "visible": false}
        ],
        "order": [[1, 'DESC']],
        "lengthMenu": [[-1, 10, 25, 50], ["All", 10, 25, 50]],
        "sPaginationType": "full_numbers",
        "sDom": '<"tOptions" f><"top">rt<"bottom" pil><"clear">',
        "oLanguage": {
            "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
        },
		 "aoColumnDefs": [{"bSortable": false, "aTargets": [7]}]
    });

    $('div.dataTables_filter input[type=search]').attr('placeholder', 'Type to Start Search');
    var active_descipline_table1 = $('#active_descipline_tbl').DataTable();
    new $.fn.dataTable.FixedHeader(active_descipline_table1, {
        bottom: true
    });
 $('.details-control').ready(function () {

        no_of_records = active_descipline_table.page.info().recordsTotal;
        for (var i = 0; i < no_of_records; i++) {
            active_descipline_table.row(i).child(format(active_descipline_table.row(i).data())).show();
        }
        ;


    });
</script>
<?php include('../includes/footer.php'); ?>