<?php

$accessControl = array("Admin" => true);
require_once '../../AccessControl.php';

include_once("../../components/Subscriptions/subscriptions.php");
include_once("../../includes/formGenerator.php");

$form = new FormGenerator();
$form->editable = true;
$form->typemerging = true;
$form->JqueryScript("#SetupSubscriptions");

$subscriptions = new Subscriptions();
$subscriptions->install_subscription_system();

$subscriptions->subscripts = $subscriptions->get_subscriptions();
?>
						<link type="text/css" rel="stylesheet" href="components/Subscriptions/subscriptions.css" />

                        <div>
                            
                            <div class="callout-success-template callout callout-success" style="display:none;">                              
                                <h4></h4>                               
                            </div>

                            <div class="callout-danger-template callout callout-danger" style="display:none;">                              
                                <h4></h4>                               
                            </div>

                        </div>
						<div id="SetupSubscriptions">
							<div class="box box-solid box-primary subscription-settings">
							    <div class="box-header">
							        <h3 class="box-title"><?php echo _SETUP_REPORT_SUBSCRIPTIONS; ?></h3>  	        
							        <button class="btn btn-sm btn-default" data-widget="remove" type="button"><i class="fa fa-times"></i></button>      
							    </div><!-- /.box-header -->
								<div class="box-body">
									<?php $subscriptions->new_subscription_form(); ?>
									<?php $subscriptions->ui_edit_form(); ?>
									<div class='delete-subscription-form'><?php $subscriptions->ui_delete_form(); ?></div>
								</div>
								<div style="clear:both">&nbsp;</div>
							</div>
							<div class="box box-solid box-primary SubscriptionsInfo">
							    <div class="box-header">
							        <h3 class="box-title"><?php echo _SETUP_REPORT_SUBSCRIPTIONS; ?></h3>       
							    </div><!-- /.box-header -->

							    <div class="box-body">			
									<div class="col-sm-6">
										<div id='ReportGrid'>
											<div class='list-header'>
												<div class="form-group">
													<input type='text' id='report-filter' name='report-filter' class="form-control" placeholder="<?php echo _SEARCH; ?>..." />
												</div>
											</div>
											<ul id='Reports'>
												<?php $subscriptions->ui_report_list(); ?>	
											</ul>
										</div>
									</div>			
									<div class="col-sm-6">
										<div id='SubscriptionGrid'>
											<div class='list-header'>
												<span><?php echo _SUBSCRIPTIONS; ?></span>
												<button class="btn btn-danger estimate-button add-new-sub"><?php echo _ADD_NEW_SUBSCRIPTION; ?></button>
												<div style="clear:both; height:10px;">&nbsp;</div>
											</div>
											<ul id='Subscriptions'>
												<?php $subscriptions->ui_subscription_list(); ?>
											</ul>
										</div>
									</div>
									<div style="clear:both"></div>
									
									<button class="btn btn-primary estimate-button commit-install"><?php echo _SAVE; ?></button>

									<div style="clear:both">&nbsp;<br />&nbsp;</div>
									<div class="alert alert-info"><i class="fa fa-info"></i> <?php echo _SUBSCRIPTIONS_INFO; ?></div>
								</div>
							</div>
						</div>

						<div class="box box-solid box-primary display_upgrade">
                            <div class="box-header">
                                <h3 class="box-title"><?php echo "Display Upgrade Info" //echo _EMAIL_ALERTS;?></h3>
                                
                            </div><!-- /.box-header -->

                            <div class="box-body table-responsive">

								
                            	<div class="btn-group toggle">                            		
                            		<button class="btn btn-default disable_this" type="submit"><?php echo _DISABLE;?></button>
                            		<button class="btn btn-default enable_this" type="submit"><?php echo _ENABLE;?></button>
                            	</div>

 								<div style="clear:both">
                                    &nbsp;<br />&nbsp;
                                </div>

								<div class="alert alert-info enable">
                                    <i class="fa fa-info"></i><?php echo "When enabled, Logaholic will display an upgrade notice for reports a user does not have access to. When Disabled, reports not in the subscription package will be hidden."; ?>
                                </div>
								
								

                            </div><!-- /.box-body -->
                        </div><!-- /.box -->