<?php

require_once "AccessControl.php";
?>
				    <div class="response">

                        <div class="callout-danger-template callout callout-danger" style="display:none;">                              
                            <button class="close pull-right" type="button">×</button>
                            <h4></h4>                               
                        </div>

                        <div class="callout-success-template callout callout-success" style="display:none;">      
                            <button class="close pull-right" type="button">×</button>
                            <h4></h4>                               
                        </div>                       

                    </div>

                    <div class="content_templates">
                        
                        <div class="print-wrapper container">
                            <div class="well well-sm no-print print-options">  
                                <div class="btn-group print-restyling">
                                    <form class="print-form" method="POST" target="_blank" action="//software.logaholic.com/pdf/download7.php">
                                        <button class="btn btn-default" type="submit" value="pdf" name="output"><i class="fa fa-download"></i>PDF</button>
                                        <input type="hidden" name="content" value="" />
                                        <input type="hidden" name="name" value="" />
                                        <input type="hidden" name="version" value="" />
                                    </form>
                                    <button class="btn btn-default" onclick="dashboards.PrintHtml();"><i class="fa fa-print"></i><?php echo _PRINT_HTML; ?></button>
                                </div>
                                <span class="seperator"></span>
                                <div class="btn-group print-sizes">
                                    <button class="btn btn-default active" value="A4">A4</button>
                                    <button class="btn btn-default" value="letter"><?php echo _LETTER; ?></button>
                                </div>
                                <span class="seperator"></span>
                                <div class="btn-group print-restyling">
                                    <button class="btn btn-default" value="bold"><i class="fa fa-bold"></i></button>
                                    <button class="btn btn-default" value="italic"><i class="fa fa-italic"></i></button>
                                    <button class="btn btn-default" value="underline"><i class="fa fa-underline"></i></button>
                                </div>
                                <span class="seperator"></span>
                                <div class="btn-group print-alerts">
                                    <div class="dropdown">
                                        <button class="btn btn-default dropdown" data-toggle="dropdown" class="dropdown-toggle"><?php echo _STYLES; ?> <span class="caret"></span></button>
                                        <div class="dropdown-menu">
                                            <button class="alert alert-info" value="info"><i class="fa fa-info"></i><?php echo _INFO; ?></button>
                                            <button class="alert alert-success" value="success"><i class="fa fa-check"></i><?php echo _SUCCESS; ?></button>
                                            <button class="alert alert-warning" value="warning"><i class="fa fa-warning"></i><?php echo _WARNING; ?></button>
                                            <button class="alert alert-danger" value="danger"><i class="fa fa-ban"></i><?php echo _DANGER; ?></button>
                                        </div>
                                    </div>
                                </div>
                                <span class="seperator"></span>
                                <div class="btn-group print-command">
                                    <button class="btn btn-default" value="undo"><i class="fa fa-undo"></i><?php echo _UNDO; ?></button>
                                    <button class="btn btn-default" value="redo"><i class="fa fa-repeat"></i><?php echo _REDO; ?></button>
                                </div>
                                <span class="seperator"></span>
                                <button class="btn btn-default" onclick="dashboards.ReturnReports();"><i class="fa fa-times"></i></button>
                            </div>
                            <div class="print" contentEditable="true">    
                                <div class="page A4">
                                    <h1 class='h1-title'><span><?php echo _WEB_ANALYTICS_REPORT; ?></span>: <span class="print-title"></span></h1>
                                    <section class="print-grid connectedSortable"></section>
                                </div>                                
                            </div>
                        </div>

                        <div id="alert-templates">
                            <div class="alert alert-danger">
                                <i class="fa fa-ban"> </i>
                                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                                <div class="alert-body"></div>
                            </div>
                            <div class="alert alert-info">
                                <i class="fa fa-info"> </i>
                                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                                <div class="alert-body"></div>
                            </div>
                            <div class="alert alert-warning">
                                <i class="fa fa-warning"> </i>
                                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                                <div class="alert-body"></div>
                            </div>
                            <div class="alert alert-success">
                                <i class="fa fa-check"> </i>
                                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                                <div class="alert-body"></div>
                            </div>
                        </div>
                        
                        <!-- Report Template Open -->
                        <div id="report_template" class="box report">
                            <div class="box-header ui-sortable-handle" style="cursor: move;">   

                                <div class="pull-right btn-group box-tools">
                                    

                                    <button type="button" class="btn btn-sm btn-flat report-options-toggle" data-toggle="modal"><i class="fa fa-calendar"></i></button>
                                    <button type="button" class="btn btn-sm btn-flat help"><i class="fa fa-info"></i></button>
                                    <div class="btn-group export_buttons">
                                        <button type="button" data-toggle="dropdown" class="btn btn-sm btn-flat"><i class="fa fa-share"></i></button>
                                        <ul role="menu" class="dropdown-menu report-settings" style="margin-left:-63px;">                                            
                                            <li><a href="#" class="mail" data-toggle="modal" data-target="#emailModal"><?php echo _EMAIL; ?></a></li>
                                            <li class="divider"></li>
                                            <li><a href="#" target="_blank" class="xml">XML</a></li>
                                            <li><a href="#" target="_blank" class="json">JSON</a></li>
                                            <li><a href="#" class="csv">CSV</a></li>
                                        </ul>
                                    </div>
                                    <button type="button" class="btn btn-sm btn-flat expand"><i class="fa fa-expand"></i></button>
                                    <button type="button" data-widget="collapse" class="btn btn-sm btn-flat"><i class="fa fa-minus"></i></button>
                                    <button type="button" data-widget="remove" class="btn btn-sm btn-flat close_report"><i class="fa fa-times"></i></button> 
                                    
                                </div>
                                <h3 class="box-title"></h3>
                            </div> 
                            <div class="report-options" contenteditable="false"></div>    
                            <div class="box-body"></div>    
                            <div class="box-footer"></div>    
                        </div>
                        <!-- / Report Template Close -->


                        <div class="manage-dashboards" data-title="<?php echo _MANAGE_DASHBOARD; ?>">                            
                            <div class="box-body">

                                <table class="table">
                                    <thead>
                                        <td><?php echo _NAME; ?></td>
                                        <td><?php echo _DATERANGE_LOCK; ?></td>
                                        <td><?php echo _STARTUP; ?></td>
                                        <td><?php echo ucwords(_OPTIONS); ?></td>
                                    </thead>
                                    <tbody>
                                        <tr class="template-row">
                                            <td><span></span></td>
                                            <td><span class="label"></span></td>
                                            <td><span class="label"></span></td>
                                            <td>
                                                <div class="btn-group">
                                                    <button class="btn btn-sm btn-default view-dash" type="button"><?php echo _VIEW; ?></button>
                                                    <button class="btn btn-sm btn-default edit-dash" type="button"><?php echo _EDIT; ?></button>
                                                    <button class="btn btn-sm btn-default delete-dash" type="button"><?php echo _DELETE; ?></button>
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                    <tfoot>
                                        <td></td><td></td><td></td><td></td>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                        <div class="dashboard-settings" data-title="<?php echo _SAVE_EDIT_DASH; ?>">
                            <div class="upgrade_message" style="display:none;"></div>
                            <div class="box-body">
                                <form method="POST">
                                    <div class="form-group">
                                        <label for="dashboardname"><?php echo _ENTER_A_NAME_FOR_THIS_SCREEN; ?></label>
                                        <input class="form-control" type="text" name="dashboardname" placeholder="<?php echo _DASHBOARDNAME_PLACEHOLDER; ?>" />
                                    </div>

                                    <div class="form-group">
                                        <label ><?php echo _DESCRIPTION; ?></label>
                                        <textarea  class="form-control" name="dashboarddescription" placeholder="<?php echo _DESCRIPTION; ?>..." ></textarea>
                                    </div>
                                    <div class="form-group">                    
                                        <div class="checkbox">
                                            <label>
                                                <input type="checkbox" name="daterange_lock" />
                                                <span ><?php echo _DATERANGE_LOCK_EXPLAIN; ?></span>
                                            </label>
                                        </div>   
                                    </div>
                                    <div class="form-group">                                
                                        <div class="checkbox">
                                            <label>
                                                <input type="checkbox" name="startup" />
                                                <span ><?php echo _OPEN_THIS_DASHBOARD_AT_STARTUP; ?></span>
                                            </label>
                                        </div>   
                                    </div>
<!--                                     <div class="form-group">
                                        <div class="checkbox">
                                            <label>
                                                <input type="checkbox" name="save_reports" />
                                                <span ><?php echo _SAVE_OPEN_WORKSPACE_REPORTS_IN_DASHBOARD; ?></span>
                                            </label>
                                        </div>                           
                                    </div> -->
                                    <div class="form-group">
                                        <div class="checkbox">
                                            <label>
                                                <input type="checkbox" name="private" />
                                                <input type="hidden" name="userid" value="0"/>
                                                <span ><?php echo _SAVE_PRIVATE_DASHBOARD; ?></span>
                                            </label>
                                        </div>                           
                                    </div>
                                    <div class="form-group">                          
                                        <input type="submit" class="save-dash btn btn-primary" value="<?php echo _SAVE; ?>" />                      
                                    </div>                         
                                </form>
                            </div> 
                        </div>

                        <div class="edit-visitorid">
                            <div class="box-header">
                                <h3 class="box-title"><b><?php echo _VISITOR_INFO; ?>:</b> (ID: <span class="visitorid"></span>)</h3>
                            </div>
                            <div class="box-body">
                                <div class="visitor-info-field">
                                    <input type="hidden" value="" name="visid">

                                    <div class="form-group">
                                        <label><?php echo _IP_NUMBER; ?>:</label>
                                        <input type="text" class="form-control" name="ipnumber" disabled>
                                    </div>

                                    <div class="form-group">
                                        <label><?php echo _LOCATION; ?>:</label>
                                        <span class="location"></span>
                                    </div>

                                    <div class="form-group">
                                        <label><?php echo _IDENTIFY; ?>:</label>
                                        <select name="setting" class="form-control">
                                            <option value="human"><?php echo _HUMAN; ?></option
                                            ><option value="bot"><?php echo _BOTS; ?></option>
                                        </select>
                                    </div>

                                    <div class="form-group">
                                        <label><?php echo _LABELNAME; ?>:</label>
                                        <input class="form-control" type="text" name="label" />
                                    </div>

                                    <button class="btn btn-primary save-visitor"><?php echo _SAVE; ?></button>
                                </div>
                            </div>
                        </div>

                        <div class="delete-page-settings" data-title="<?php echo _DELETE." "._PAGE; ?>">
                            <div class="box-body">
                                <form>
                                    <div class="form-group">
                                        <?php echo DateSelector(); ?>
                                    </div>
                                    <div class="form-group">
                                        <label><?php echo _PAGE; ?></label>
                                        <input type="text" class="form-control" name="fldvalue" > (<?php echo _EXACT_VALUE_ONLY; ?>)
                                        <input type="hidden" name="fldname" value="page" />
                                    </div>
                                        <button class="delete-page btn btn-danger" data-loading-text="<?php echo _DELETING; ?>..."><?php echo _DELETE; ?></button>
                                </form>
                            </div>
                        </div>

                        <div data-title="<?php echo _DELETE." "._IPNUMBER; ?>" class="delete-ipnumber-settings">                            
                            <div class="box-body">
                                <form>
                                    <div class="form-group">
                                        <?php echo DateSelector(); ?>
                                    </div>
                                    <div class="form-group">
                                        <label><?php echo _IPNUMBER; ?></label>
                                        <input type="text" class="form-control" name="fldvalue" > (<?php echo _EXACT_VALUE_ONLY; ?>)
                                        <input type="hidden" name="fldname" value="ipnumber" />
                                    </div>
                                        <button class="delete-ipnumber btn btn-danger" data-loading-text="<?php echo _DELETING; ?>..."><?php echo _DELETE; ?></button>
                                </form>
                            </div>
                        </div>
                        
                        <iframe class="iframe-widget" src="" frameborder="0"></iframe>


                        <!-- small box -->
                        <div id="mini_report" class="col-lg-3 col-xs-6 metric-report">
                            <div class="small-box bg-dark-gray loading">
                                <div class="inner">
                                    <h3 class="number">&nbsp;</h3>
                                    <p class="title">&nbsp;<br><?php echo _LOADING; ?>...</p>
                                </div>
                                <div class="icon">
                                    <i class="ion"></i>
                                </div>
                                <button data-widget="remove" class="btn btn-sm btn-flat remove-mini"><i class="fa fa-times"></i></button> 
                                <a href="#" class="small-box-footer more-link">
                                    <?php echo _MORE_INFO; ?> <i class="fa fa-arrow-circle-right"></i>
                                </a>
                            </div>
                        </div>

                        <div id="the_grid">
                            <!-- Small boxes (Stat box) -->
                            <div class="row keyMetricsRow">                                
                            </div><!-- /.row -->

                            <!-- Main row -->
                            <div class="row">
                                <section id ="full-dash" class="col-lg-12 connectedSortable fullwidth"></section>
                                <section id="dashcol1" class="col-lg-7 connectedSortable dashcol"></section>                                
                                <section id="dashcol2" class="col-lg-5 connectedSortable dashcol"></section> 
                                <section id="dashcol3" class="connectedSortable dashcol hidden"></section>
                                <section id="dashcol4" class="connectedSortable dashcol hidden"></section>
                                <section id="dashcol5" class="connectedSortable dashcol hidden"></section>
                                <section id="dashcol6" class="connectedSortable dashcol hidden"></section>
                            </div><!-- /.row (main row) -->
                        </div>


                    </div><!-- /.content_templates --> 
                    <!-- Email report modal -->
                    <div id="emailModal" class="modal" role="dialog">
                        <div class="modal-dialog">
                            <!-- Modal content-->
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                                    <h4 class="modal-title"><?php echo _EMAIL_REPORT_LABEL; ?></h4>
                                </div>
                                <div class="modal-body">
                                    <form id="send_report_email_form">

                                        <div class="form-group">
                                            <label><?php echo _YOUR_EMAIL; ?></label>
                                            <input type=text name="fromemail" class="form-control" placeholder="">
                                        </div>

                                        <div class="form-group">
                                            <label><?php echo _THEIR_EMAIL; ?></label>
                                            <input type=text name="email" class="form-control" placeholder="">
                                        </div>
                                        <div class="form-group">
                                            <label><?php echo _SUBJECT; ?></label>
                                            <input type=text name="subject" class="form-control" placeholder="">
                                        </div>
                                        <div class="form-group">
                                            <label><?php echo _MESSAGE; ?></label>
                                            <textarea name="message" rows=7 class="form-control"></textarea>
                                        </div>

                                        <span ><?php echo _YOU_WILL_RECEIVE_COPY_OF_EMAIL; ?></span>
                                        <input type=hidden name="box-id" value="">
                                    </form>
                                </div>
                                <div class="modal-footer">
                                    <button class='btn btn-default' data-dismiss="modal"><?php echo _CANCEL; ?></button>
                                    <button class='btn btn-success send_report_email' ><?php echo _SEND_THIS_REPORT_AS_EMAIL; ?></button>                
                                </div>
                            </div>

                        </div>
                    </div>                     