<?php
/* Smarty version 3.1.33, created on 2020-08-11 07:30:44
  from '/Users/codeworldweb.com/websites/uvocorp/content/themes/dashboard/customize/disciplines.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_5f324924915221_57811639',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'dfadf5edd031793b4ef126fa3fd6468a6074f138' => 
    array (
      0 => '/Users/codeworldweb.com/websites/uvocorp/content/themes/dashboard/customize/disciplines.tpl',
      1 => 1597131043,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5f324924915221_57811639 (Smarty_Internal_Template $_smarty_tpl) {
if (count($_smarty_tpl->tpl_vars['disciplineGroups']->value)) {?>
    <div class="table-responsive">
        <table class="table <?php if ($_smarty_tpl->tpl_vars['theme_mode_night']->value) {?>table-dark<?php }?> table-striped table-bordered table-hover js_dataTable">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>Title</th>
                    <th>Complex Assignment</th>
                    <th>Actions</th>
                </tr>
            </thead> 
            <tbody>
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['disciplineGroups']->value, 'disciplines');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['disciplines']->value) {
?>
                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['disciplines']->value, 'discipline');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['discipline']->value) {
?>
                        <tr>
                            <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discipline']->value['discipline_id'], ENT_QUOTES, 'UTF-8');?>
</td>
                            <td>
                                <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discipline']->value['title'], ENT_QUOTES, 'UTF-8');?>
 <?php if (isset($_smarty_tpl->tpl_vars['disciplineGroups']->value[$_smarty_tpl->tpl_vars['discipline']->value['discipline_id']])) {?><span class="badge badge-info">Group</span><?php }?>
                            </td>
                            <td>
                                <?php if ($_smarty_tpl->tpl_vars['discipline']->value['is_complex_assignment']) {?>
                                    <span class="fa fa-check text-success"></span>
                                <?php } else { ?>
                                    <span class="fa fa-times text-danger"></span>
                                <?php }?>
                            </td>
                            <td>
                                <?php if ($_smarty_tpl->tpl_vars['discipline']->value['discipline_id'] != '52') {?>
                                    <button data-toggle="tooltip" data-placement="top" title="Delete" class="btn btn-xs btn-danger js_admin-deleter" data-handle="discipline" data-id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discipline']->value['discipline_id'], ENT_QUOTES, 'UTF-8');?>
">
                                        <i class="fa fa-trash-alt"></i>
                                    </button>
                                <?php }?>
                                <button type="button" data-toggle="modal" data-url="#editDisciplineModal" data-size="medium" data-options='<?php echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'json_encode' ][ 0 ], array( $_smarty_tpl->tpl_vars['discipline']->value ));?>
' class="btn btn-xs btn-info">
                                    <i class="fa fa-pencil-alt"></i>
                                </button>
                            </td>
                        </tr>
                    <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
            </tbody>
        </table>

        <?php echo $_smarty_tpl->tpl_vars['pager']->value;?>

    </div>
<?php } else { ?>
    <div class="text-center x-muted"> 
        <img class="mb20" width="15%" src="/static/images/no_results.png">
        <p class="mb10"><strong>No disciplines to show</strong></p>
    </div>
<?php }?>

<!-- Add Discipline -->
<?php echo '<script'; ?>
 id="addDisciplineModal" type="text/template">
    <form class="js_ajax-forms p0 m0" data-url="/preferences?do=addDiscipline" method="POST" autocomplete="off">
        <div class="modal-header">
            <h5 class="modal-title">Add Discipline</h5>
            <span class="modal-close" data-dismiss="modal" aria-label="Close">
                <i class="fa fa-times"></i>
            </span>
        </div>

        <div class="modal-body">
            <div class="form-group">
                <label class="control-label">Title</label>
                <input name="title" type="text" class="form-control">
            </div>

            <?php if (count($_smarty_tpl->tpl_vars['disciplineGroups']->value)) {?>
                <div class="form-group">
                    <label class="control-label">Discipline group</label>
                    <select class="form-control" name="discipline_group">
                        <option value="-1">None</option>
                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['disciplineGroups']->value, 'disciplines');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['disciplines']->value) {
?>
                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['disciplines']->value, 'discipline');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['discipline']->value) {
?>
                                    <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discipline']->value['discipline_id'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discipline']->value['title'], ENT_QUOTES, 'UTF-8');?>
</option>
                            <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                        <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                    </select>
                    <span class="help-block">
                        Disciplines have groups. You might have a Chemistry discipline under Formal Science group. Totally optional.
                    </span>
                </div>
            <?php }?>

            <div class="form-table-row mb0"> 
                <div> 
                    <div class="form-control-label h5">Complex Assignment</div> 
                    <div class="form-text d-none d-sm-block">Charge an extra 20% for the complexity of this discipline</div> 
                </div> 
                <div class="text-right"> 
                    <label class="switch" for="is_complex_assignment"> 
                        <input type="checkbox" name="is_complex_assignment" id="is_complex_assignment"> 
                        <span class="slider round"></span> 
                    </label> 
                </div> 
            </div>

            <!-- success -->
            <div class="alert alert-success mt10 x-hidden" role="alert"></div>
            <!-- success -->

            <!-- error -->
            <div class="alert alert-danger mt10 x-hidden" role="alert"></div>
            <!-- error -->
        </div>
        
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
            <button type="submit" class="btn btn-info" id="modal-confirm-ok">Add Discipline</button>
        </div>
    </form>
<?php echo '</script'; ?>
>
<!-- Add Discipline -->

<!-- Edit Discipline -->
<?php echo '<script'; ?>
 id="editDisciplineModal" type="text/template">
    <form class="js_ajax-forms p0 m0" data-url="/preferences?do=editDiscipline" method="POST" autocomplete="off">
        <input type="hidden" name="discipline_id" value="{{discipline_id}}">
        <div class="modal-header">
            <h5 class="modal-title">Edit Discipline</h5>
            <span class="modal-close" data-dismiss="modal" aria-label="Close">
                <i class="fa fa-times"></i>
            </span>
        </div>

        <div class="modal-body">
            <div class="form-group">
                <label class="control-label">Title</label>
                <input name="title" type="text" class="form-control" value="{{title}}">
            </div>

            <?php if (count($_smarty_tpl->tpl_vars['disciplineGroups']->value)) {?>
                <div class="form-group">
                    <label class="control-label">Discipline group</label>
                    <select class="form-control" name="discipline_group">
                        <option value="-1">None</option>
                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['disciplineGroups']->value, 'disciplines');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['disciplines']->value) {
?>
                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['disciplines']->value, 'discipline');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['discipline']->value) {
?>
                                <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discipline']->value['discipline_id'], ENT_QUOTES, 'UTF-8');?>
" {{#group_id=<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discipline']->value['discipline_id'], ENT_QUOTES, 'UTF-8');?>
}}selected=""{{/group_id=<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discipline']->value['discipline_id'], ENT_QUOTES, 'UTF-8');?>
}}><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discipline']->value['title'], ENT_QUOTES, 'UTF-8');?>
</option>
                            <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                        <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                    </select>
                    <span class="help-block">
                        Disciplines have groups. You might have a Chemistry discipline under Formal Science group. Totally optional.
                    </span>
                </div>
            <?php }?>

            <div class="form-table-row mb0"> 
                <div> 
                    <div class="form-control-label h5">Complex Assignment</div> 
                    <div class="form-text d-none d-sm-block">Charge an extra 20% for the complexity of this discipline</div> 
                </div> 
                <div class="text-right"> 
                    <label class="switch" for="is_complex_assignment"> 
                        <input type="checkbox" name="is_complex_assignment" id="is_complex_assignment" {{#is_complex_assignment}}checked=""{{/is_complex_assignment}}> 
                        <span class="slider round"></span> 
                    </label> 
                </div> 
            </div>

            <!-- success -->
            <div class="alert alert-success mt10 x-hidden" role="alert"></div>
            <!-- success -->

            <!-- error -->
            <div class="alert alert-danger mt10 x-hidden" role="alert"></div>
            <!-- error -->
        </div>
        
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
            <button type="submit" class="btn btn-info" id="modal-confirm-ok">Save Changes</button>
        </div>
    </form>
<?php echo '</script'; ?>
>
<!-- Edit Discipline --><?php }
}
