<?php
include('../../includes/checkSession.php');
include('../../includes/con2pma3.php');
include('../includes/header_in.php');
?>
<style>

         .imgview{
        height: 18px;
    width: 16px;
    margin-left: 4px;
    margin-top: 0px;
    margin-right:3px;
}
    .briefc-field{width:35%}
    .briefc-field .single-select{width:100%}
    .briefc-field .double-select, .briefc-field #briefCfrom{width:49%}
    .first{display:none}
    .formRow select#projname,.formRow select#clientname{width:100%}
    .bfc-datecreated{width:12%}
    .bfc-brieffrom{width:11%}
    .bfc-datename{width:31%}
    .bfc-developed{width:18%}
    .bfc-cycle{width:14%}
    .bfc-action{width:12%}
    .add-briefClient{display:none}
    .fixed{display:none}
    .bck{font-size:18px !important;}
    #add-descipline{padding:0 !important}
    #briefClist{float:right}
    .action-icons {padding-right:8px !important}
    input#briefCname{width:84% !important}
    input#briefCrev{width:15% !important}
    #active-desciplines{padding: 1px 5px !important;}
    @media (max-width:480px){
        .bfc-datecreated{display:none}
        .bfc-brieffrom{width:17%}
        .bfc-datename{width:50%}
        .bfc-developed{display:none}
        .bfc-cycle{display:none}
        .bfc-actions{width:32%}
    }
</style>
<script src="../includes/js/fixedheader.js"></script>
<section class="content">
    <div class="container">
        <div class="row">
            <div class="main-content">
                <!--<h5>-->
                <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 id="form2" name="form2" method="post" action="../../DB/03-scope/BriefClient1DB.php" onsubmit="return validatescopebriefC()">
                                
                                <div class="widget">
                                    <div class="whead">
                                        <h6>
                                            <i class="fa fa-plus-circle"></i>
                                            Add 
                                        </h6>
                                        <strong><a href="javascript:void(0)" onclick="$('.add-briefClient').hide('slow')" 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" class="single-select">
                                                <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="briefCname" type="text"  id="briefCname" value="" size="20" placeholder="Title"/>
                                            <input name="briefCrev" type="text"  id="briefCrev" 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" class="single-select">
                                                <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="briefCfrom"  id="briefCfrom" class="double-select">
                                                <option value="">Select</option>
                                                <option value="From Scratch">From Scratch</option>
                                                <option value="From another Client Brief">From another Client Brief</option>
                                            </select>

                                            <select name="briefClist"  id="briefClist" style="display:none;"  class="double-select">
                                                <option value="">Select to Copy from</option>
                                                <?php
                                                $result = mysql_query("SELECT * FROM briefC where companyID = '$id' AND briefC_status='1'");
                                                //echo $result."ll";
                                                while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                                                    $briefC_id = $row["briefC_id"];
                                                    echo "<option value='$briefC_id'>" . $row["briefC_id"] . " - " . $row["briefC_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>
                        <?php
                    } else {

                        $BID = $_REQUEST['Edit'];
                        $result = mysql_query("SELECT * FROM briefC where briefC_id='$BID'");
                        $row = mysql_fetch_array($result, MYSQL_ASSOC);
                        $project_id = $row["project_id"];
                        $client_id = $row["client_id"];
                        $briefC_name = $row["briefC_name"];
						$briefC_rev = $row["briefC_rev"];
                        $briefC_create = $row["briefC_create_from"];
                        $briefC_copy_from = $row["briefC_copy_from"];
                        ?>
                        <div class="edit-formpage">
                            <form id="form" name="form2" method="post" action="../../DB/03-scope/BriefClient1DB.php?Edit=<?php echo $BID; ?>" onsubmit="return validatescopebriefC()">
                                <div class="widget">
                                    <div class="whead">
                                        <h6>
                                            <div class="fs1 iconb" data-icon=""></div>
                                            Edit </h6>
                                        <strong><a href="javascript:void(0)" onclick="$('.edit-deciplane').hide('slow')" 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">
                                                <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="briefCname" type="text"  id="briefCname" size="20" value="<?php echo $briefC_name; ?>" />
                                            <input name="briefCrev" type="text"  id="briefCrev" size="10" placeholder="Rev" value="<?php echo $briefC_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*: </label></div>
                                        <div class="col-sm-2-2 briefc-field"  style="padding-left:0px;">
                                            <select name="briefCfrom"  class="double-select" id="briefCfrom">
                                                <option value="">Select</option>
                                                <option value="From Scratch"<?php if ($briefC_create == "From Scratch") { ?> selected="selected"<?php } ?>>From Scratch</option>
                                                <option value="From another Client Brief"<?php if ($briefC_create == "From another Client Brief") { ?> selected="selected"<?php } ?>>From another Client Brief</option>
                                            </select>

                                            <select name="briefClist"  class="double-select" id="briefClist" <?php if ($briefC_create != "From another Client Brief") { ?> style="display:none;"<?php } ?>>
                                                <option value="">Select to Copy from</option>
                                                <?php
                                                $result = mysql_query("SELECT briefC_id, briefC_name FROM briefc where companyID = '$id' AND briefC_status='1'");
                                                //echo $result."ll";
                                                while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                                                    $briefC_id = $row["briefC_id"];
                                                    if ($briefC_id == $briefC_copy_from) {
                                                        echo "<option selected='selected' value='$briefC_id'>" . $row["briefC_id"] . " - " . $row["briefC_name"] . "</option>";
                                                    } else {
                                                        echo "<option value='$briefC_id'>" . $row["briefC_id"] . " - " . $row["briefC_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>

                    <?php }
                }
                ?>

                <div class="table-subject">



                    <!--  -->

                    <div class="widget">
                        <div class="whead">
                            <h6 id="active-desciplines" style="margin-top:8px;" >
                                <b><i class="fa fa-users"></i>Active Client Briefs &nbsp;&nbsp; </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>
                        <table cellpadding="0" cellspacing="0" class="" style="width:100%; position:relative !important"  id="active_descipline_tbl">    <thead>

                                <tr >
                                    <th class="first"></th>
                                    <th class="bfc-datecreated"   align="left" valign="top" bgcolor="#E2E2E2" scope="col">Date Created<br />
                                        (yyyy.mm.dd)<i class="fa fa-sort">
                                    </th>
                                    <th class="bfc-brieffrom"  align="left" valign="top" bgcolor="#E2E2E2" scope="col"> Brief <br />Type<i class="fa fa-sort"></th>
                                    <th class="bfc-datename"  align="left" valign="top" bgcolor="#E2E2E2" scope="col">ID - Title (REV)<br />
                                        Project      Name/ 
                                        Client Name<i class="fa fa-sort"></th>
                                    <th class="bfc-developed" width="18%" align="left" valign="top" bgcolor="#E2E2E2" scope="col">Prepared <br />By</th>
                                    <th class="bfc-cycle"  align="left" valign="top" bgcolor="#E2E2E2" scope="col">Sent<br />
                                        Status<i class="fa fa-sort"></th>
                                    <th class="bfc-actions action-icons"  align="right" valign="top" bgcolor="#E2E2E2" scope="col"> Actions<br />
                                        Status</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                $result = mysql_query("SELECT briefC.creationDate, briefC.briefC_status, briefC.briefC_create_from,briefC.briefC_id,briefC.briefC_name,briefC.briefC_rev,briefC.PreparedBy,briefC.companyID,projects.projectName,client.clientName FROM projects,client,briefC where briefC.companyID='$id' AND (briefC.briefC_status='1' OR briefC.briefC_status='3') AND projects.projectSerial=briefC.project_id AND client.clientSerial=briefC.client_id  ORDER BY briefC_id 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="bfc-datecreated" align="left" valign="top"  scope="col"><?php echo $row["creationDate"]; ?></td>
                                        <td class="bfc-brieffrom" align="left" valign="top" ><?php echo $row["briefC_create_from"]; ?><br /></td>
                                        <td class="bfc-datename" align="left" valign="top" >(CBRF-<?php echo $row["briefC_id"]; ?>) - <?php echo $row["briefC_name"]." (".$row["briefC_rev"].")"; ?><br />
                                          <?php echo $row["projectName"] . "/ " . $row["clientName"]; ?></td>
                                      <td class="bfc-developed" align="left" valign="top" ><?php echo $PreparedBy; ?><br /></td>
                                        <td class="bfc-cycle" align="left" valign="top" ><?php if($row["briefC_status"]==3){?>Sent for Review<?php }else {?>Not Sent for Review<?php }?></td>
                                        <td class="bfc-actions action-icons" walign="right" valign="top">

                                                <?php if($row["briefC_status"]!=3)
												{ 
												if ($uacc == "Full Control") { ?>
                                                <div class="close-icon"> <a href="javascript:void(0)" onclick="showConfirm('<?php echo $row["briefC_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="BriefClient1.php?Edit=<?php echo $row["briefC_id"]; ?>">
                                                        <div class="glyph">
                                                            <div class="fs1 iconb" data-icon="" title="Edit Description"></div>
                                                        </div> 
                                                    </a></div>
    <?php } else { ?>
                                                <div class="glyph">
                                                    <div class="fs1 iconb" data-icon="" title="Edit Description"></div>
                                                </div> 
                                            <?php } ?>

                                        
    <?php if ($uacc == "Full Control") { ?><div class="eye-icon"><a href="../../DB/03-scope/BriefClient1DB.php?InActive=<?php echo $row['briefC_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 } }?> 
                                           
                                            <div class="close-icon"> 
                                                <a href="Brief-C1PV.php?BID=<?php echo $row["briefC_id"]; ?>">  <img class="imgview" src="../includes/images/icons/documentation3.png" title="View Contents"></a> 
                                            <a href="CBPrintView.php?BID=<?php echo $row["briefC_id"]; ?>"><img class="imgview" src="../includes/images/icons/print.png" title="Print Preview"></a></div>
                                        </td>
                                        <?php
                                        $typid = $row["briefC_id"];
                                        $path = "03-scope";
                                        $type = "BriefClient1";
                                        $attach = 0;
                                        $reminder = 0;
                                        $note = 1;
                                        include('../includes/noterow2.php');
                                        ?>
                                    </tr>


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



            </div>

            <div class="divider"><span></span></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="#hidden-data" class="hidden-entry" >View The Hidden List</a> &nbsp; | 
                        <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="hidden-data">
                <table cellpadding="0" cellspacing="0" width="100%" class="tDark" id="hidden-entry">
                    <thead>
                        <tr >
                            <td class="bfc-datecreated"   align="left" valign="top" bgcolor="#E2E2E2" scope="col">Date Created<br />
                                (yyyy.mm.dd)
                                </th></td>
                            <td class="bfc-brieffrom"  align="left" valign="top" bgcolor="#E2E2E2" scope="col"> Brief <br />Type</td>
                            <td class="bfc-datename"  align="left" valign="top" bgcolor="#E2E2E2" scope="col">ID - Title (REV)<br />
                                Project      Name/ 
                                Client Name</td>
                            <td class="bfc-developed" width="18%" align="left" valign="top" bgcolor="#E2E2E2" scope="col">Prepared <br />By</td>
                            <td class="bfc-cycle"  align="left" valign="top" bgcolor="#E2E2E2" scope="col">Sent<br />
Status
</td>
                            <td class="bfc-action action-icons"  align="right" valign="top" bgcolor="#E2E2E2" scope="col">Action <br>Status</td>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        $result = mysql_query("SELECT briefC.creationDate, briefC.briefC_create_from,briefC.briefC_id,briefC.briefC_name,briefC.PreparedBy,briefC.companyID,projects.projectName,client.clientName FROM projects,client,briefC where briefC.companyID='$id' AND briefC.briefC_status='0' AND projects.projectSerial=briefC.project_id AND client.clientSerial=briefC.client_id  ORDER BY briefC.creationDate DESC, briefC_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="bfc-datecreated" align="left" valign="top"  scope="col"><?php echo $row["creationDate"]; ?></td>
                                <td class="bfc-brieffrom" align="left" valign="top" ><?php echo $row["briefC_create_from"]; ?><br /></td>
                                <td class="bfc-datename" align="left" valign="top" >(CBRF-<?php echo $row["briefC_id"]; ?>) - <?php echo $row["briefC_name"]." (".$row["briefC_rev"].")"; ?><br /><?php echo $row["projectName"] . "/ " . $row["clientName"]; ?></td>
                                <td class="bfc-developed " align="left" valign="top" ><?php echo $PreparedBy; ?></td>
                                <td class="bfc-cycle" align="left" valign="top" ><?php if($row["briefC_status"]==3){?>Sent for Review<?php }else {?>Not Sent for Review<?php }?></td>
                                <td class="bfc-actions action-icons" valign="top"><?php if ($uacc == "Full Control") { ?>
                                        <a href="../../DB/03-scope/BriefClient1DB.php?Active=<?php echo $row['briefC_id']; ?>">
                                            <div class="glyph">
                                                <div class="fs1 iconb" data-icon="" title="Hide" ></div>
                                            </div>
                                        </a>
    <?php } else { ?>
                                        <div class="glyph">
                                            <div class="fs1 iconb" data-icon="" title="Hide" ></div>
                                        </div>
                            <?php } ?></td>
                            </tr>
<?php } ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</footer>


<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": "bfc-datecreated"},
            {"data": "bfc-brieffrom"},
            {"data": "bfc-datename"},
            {"data": "bfc-developed"},
            {"data": "bfc-cycle"},
            {"data": "bfc-actions"},
            {"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();
        }
        ;


    });




    function bottomfooterfunc()
    {
        $(".bottom-footer").toggle("slow");
    }

    function showConfirm(did) {
        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/BriefClient1DB.php?del=" + did;

            } else {
                return 0;
            }
        });
    }
</script>
<?php include('../includes/footer.php'); ?>