<?php
/* Smarty version 3.1.33, created on 2023-02-18 08:35:51
  from '/home/massessays/dashboard.massessays.com/content/themes/dashboard/order/order.edit.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_63f08de734bf17_28886454',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '8d0ff1d7f0f01fc234b1d98996a6106b54f7753f' => 
    array (
      0 => '/home/massessays/dashboard.massessays.com/content/themes/dashboard/order/order.edit.tpl',
      1 => 1656689818,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_63f08de734bf17_28886454 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_loadInheritance();
$_smarty_tpl->inheritance->init($_smarty_tpl, true);
?>
 

<?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_182580682963f08de7312022_38371761', 'content_wrapper');
?>


<?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_57792570463f08de73489c5_99175688', "custom_js");
?>

<?php $_smarty_tpl->inheritance->endChild($_smarty_tpl, 'dashboard/layout.tpl');
}
/* {block 'content_wrapper'} */
class Block_182580682963f08de7312022_38371761 extends Smarty_Internal_Block
{
public $subBlocks = array (
  'content_wrapper' => 
  array (
    0 => 'Block_182580682963f08de7312022_38371761',
  ),
);
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
?>

<div class="card">
    <div class="card-header with-icon">
        <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
            <div class="pull-right flip">
                <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/order/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
" class="btn btn-secondary">
                    <i class="fa fa-arrow-left fa-fw mr5"></i> Back to Order
                </a>
            </div>
        <?php }?>
        <i class="fa fa-shopping-basket mr10"></i>
        <strong>Orders</strong>
        &rsaquo; <strong>#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
</strong>
        &rsaquo; <strong>Edit</strong>
    </div>

    <form class="form-horizontal js_ajax-forms" id="orderForm" data-url="/order" method="POST">
        <div class="card-body">
            <input type="hidden" name="order_id" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">Type of paper</label>
                <div class="col-sm-7">
                    <select name="paperTypeId" class="form-control js_calculate select_search js_custom-toggle" data-val="64">
                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['paperTypes']->value, 'paperType');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['paperType']->value) {
?>
                            <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['paperType']->value['id'], ENT_QUOTES, 'UTF-8');?>
" <?php if ($_smarty_tpl->tpl_vars['order']->value['paperType'] == $_smarty_tpl->tpl_vars['paperType']->value['id']) {?>selected=""<?php }?> ><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['paperType']->value['title'], ENT_QUOTES, 'UTF-8');?>
</option>
                        <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                    </select>
                </div>
            </div>

            <div class="form-group form-row <?php if ($_smarty_tpl->tpl_vars['order']->value['paperType'] != 64) {?>x-hidden<?php }?>">
                <label class="col-sm-2 control-label text-left">Add Paper Type</label>
                <div class="col-sm-7">
                    <input type="text" class="js_calculate form-control" name="paperTypeOption" id="paperTypeOption" maxlength="255" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['paperTypeOption'], ENT_QUOTES, 'UTF-8');?>
">
                </div>
            </div>

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">Discipline</label> 
                <div class="col-sm-7">
                    <select name="topicCatId" id="topicCatId" class="form-control js_calculate select_search js_custom-toggle" data-val="52">
                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['disciplineGroups']->value, 'topicCat');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['topicCat']->value) {
?>
                            <optgroup label="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['topicCat']->value['title'], ENT_QUOTES, 'UTF-8');?>
">
                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['topicCat']->value['disciplines'], 'discipline');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['discipline']->value) {
?>
                                    <option data-complex="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discipline']->value['is_complex_assignment'], ENT_QUOTES, 'UTF-8');?>
" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discipline']->value['discipline_id'], ENT_QUOTES, 'UTF-8');?>
" <?php if ($_smarty_tpl->tpl_vars['order']->value['topcatId'] == $_smarty_tpl->tpl_vars['discipline']->value['discipline_id']) {?>selected=""<?php }?> ><?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);?>
                            </optgroup>
                        <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                    </select>
                </div>
            </div>

            <div class="form-group form-row <?php if ($_smarty_tpl->tpl_vars['order']->value['topcatId'] != 52) {?>x-hidden<?php }?>">
                <label class="col-sm-2 control-label text-left">Add Discipline</label>
                <div class="col-sm-7">
                    <input type="text" class="js_calculate form-control" name="topcatOption" id="topcatOption" maxlength="255" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['topcat'], ENT_QUOTES, 'UTF-8');?>
">
                </div>
            </div>

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left" for="paperFormat">Paper Format:</label>
                <div class="col-sm-7">
                    <select class="form-control js_calculate js_custom-toggle" name="paperFormat" data-val="4">
                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['paperFormats']->value, 'paperFormat');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['paperFormat']->value) {
?>
                            <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['paperFormat']->value['paper_format_id'], ENT_QUOTES, 'UTF-8');?>
" <?php if ($_smarty_tpl->tpl_vars['order']->value['paperFormat'] == $_smarty_tpl->tpl_vars['paperFormat']->value['paper_format_id']) {
}?>><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['paperFormat']->value['title'], ENT_QUOTES, 'UTF-8');?>
</option>
                        <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                    </select>
                </div>
            </div>

            <div class="form-group form-row <?php if ($_smarty_tpl->tpl_vars['order']->value['paperFormat'] != 4) {?>x-hidden<?php }?>">
                <label class="col-sm-2 control-label text-left">Add Paper Format</label>
                <div class="col-sm-7">
                    <input type="text" class="js_calculate form-control" name="paperFormatOption" id="paperFormatOption" maxlength="255" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['paperFormatTypeOption'], ENT_QUOTES, 'UTF-8');?>
">
                </div>
            </div>

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">Topic</label>
                <div class="col-sm-7">
                    <input class="form-control" type="text" name="topic" id="topic" maxlength="255" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['title'], ENT_QUOTES, 'UTF-8');?>
">
                </div>
            </div>

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">Paper Instructions</label>
                <div class="col-sm-9">
                    <textarea id="summernote" class="form-control" name="paperDetails"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['paperDetailsRaw'], ENT_QUOTES, 'UTF-8');?>
</textarea>
                </div>
            </div>

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

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">Spacing</label>
                <div class="col-sm-4">
                    <select class="js_calculate form-control" name="spacing">
                        <option value="double" <?php if ($_smarty_tpl->tpl_vars['order']->value['spacing'] == 'double') {?>selected=""<?php }?> >Double Spaced</option>
                        <option value="single" <?php if ($_smarty_tpl->tpl_vars['order']->value['spacing'] == 'single') {?>selected=""<?php }?> >Single Spaced</option>
                    </select>
                </div>
            </div>

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">Pages</label>
                <div class="col-sm-4">
                    <div class="control-stepper">
                        <button type="button" class="js_calculate btn control-stepper__minus-button incr-btn" data-action="decrease">-</button>
                        <input name="pages" type="text" class="js_calculate form-control control-stepper__input force-integer quantity" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['pages'], ENT_QUOTES, 'UTF-8');?>
" data-minvalue="0">
                        <button type="button" class="js_calculate btn control-stepper__plus-button incr-btn" data-action="increase">+</button>
                    </div>
                </div>
            </div>

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">Sources to be cited</label>
                <div class="col-sm-4">
                    <div class="control-stepper">
                        <button type="button" class="js_calculate btn control-stepper__minus-button incr-btn" data-action="decrease">-</button>
                        <input name="sources" type="text" class="js_calculate form-control control-stepper__input force-integer quantity" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['sources'], ENT_QUOTES, 'UTF-8');?>
" data-minvalue="0">
                        <button type="button" class="js_calculate btn control-stepper__plus-button incr-btn" data-action="increase">+</button>
                    </div>
                </div>
            </div>

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">Charts</label>
                <div class="col-sm-4">
                    <div class="control-stepper">
                        <button type="button" class="js_calculate btn control-stepper__minus-button incr-btn" data-action="decrease">-</button>
                        <input name="charts" type="text" class="js_calculate form-control control-stepper__input force-integer quantity" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['charts'], ENT_QUOTES, 'UTF-8');?>
" data-minvalue="0">
                        <button type="button" class="js_calculate btn control-stepper__plus-button incr-btn" data-action="increase">+</button>
                    </div>
                </div>
            </div>

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">PowerPoint slides</label>
                <div class="col-sm-4">
                    <div class="control-stepper">
                        <button type="button" class="js_calculate btn control-stepper__minus-button incr-btn" data-action="decrease">-</button>
                        <input name="slides" type="text" class="js_calculate form-control control-stepper__input force-integer quantity" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['slides'], ENT_QUOTES, 'UTF-8');?>
" data-minvalue="0">
                        <button type="button" class="js_calculate btn control-stepper__plus-button incr-btn" data-action="increase">+</button>
                    </div>
                </div>
            </div>

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">Writer Category</label>
                <div class="col-sm-7">
                    <select class="form-control js_calculate" name="writerCategoryId">
                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['writerPreferences']->value, 'writerPreference');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['writerPreference']->value) {
?>
                            <option <?php if (isset($_smarty_tpl->tpl_vars['writerPreference']->value['percent'])) {?>data-percent="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writerPreference']->value['percent'], ENT_QUOTES, 'UTF-8');?>
"<?php }?> value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writerPreference']->value['id'], ENT_QUOTES, 'UTF-8');?>
" <?php if ($_smarty_tpl->tpl_vars['order']->value['writerCategoryId'] == $_smarty_tpl->tpl_vars['writerPreference']->value['id']) {?>selected=""<?php }?> ><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writerPreference']->value['title'], ENT_QUOTES, 'UTF-8');?>
</option>
                        <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                    </select>
                </div>
            </div>

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">Tracking ID</label>
                <div class="col-sm-7">
                    <input class="form-control" type="text" name="tracking_id" id="tracking_id" maxlength="255" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['trackingId'], ENT_QUOTES, 'UTF-8');?>
">
                </div>
            </div>

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

            <?php if ($_smarty_tpl->tpl_vars['siteSettings']->value['WRITER_SAMPLES_ENABLED'] || $_smarty_tpl->tpl_vars['order']->value['areSamplesRequired']) {?>
                <div class="form-group form-row">
                    <label class="col-sm-2 control-label text-left">Get Writer Samples</label>
                    <div class="col-sm-7">
                        <label class="switch" for="samplesNeeded">
                            <input class="js_calculate" type="checkbox" name="samplesNeeded" id="samplesNeeded" <?php if ($_smarty_tpl->tpl_vars['order']->value['areSamplesRequired'] == '1') {?>checked="checked"<?php }?>>
                            <span class="slider round"></span>
                        </label>
                    </div>
                </div>
            <?php }?>

            <?php if ($_smarty_tpl->tpl_vars['siteSettings']->value['COPY_OF_SOURCES_ENABLED'] || $_smarty_tpl->tpl_vars['order']->value['areSourcesRequired']) {?>
                <div class="form-group form-row">
                    <label class="col-sm-2 control-label text-left">Copy of Sources</label>
                    <div class="col-sm-7">
                        <label class="switch" for="usedsources">
                            <input class="js_calculate" type="checkbox" name="usedsources" id="usedsources" <?php if ($_smarty_tpl->tpl_vars['order']->value['areSourcesRequired'] == '1') {?>checked="checked"<?php }?>>
                            <span class="slider round"></span>
                        </label>
                    </div>
                </div>
            <?php }?>

            <?php if ($_smarty_tpl->tpl_vars['siteSettings']->value['PROGRESSIVE_DELIVERY_ENABLED'] || $_smarty_tpl->tpl_vars['order']->value['progressiveDeliveryHidden']) {?>
                <div class="form-group form-row">
                    <label class="col-sm-2 control-label text-left">Progressive Delivery</label>
                    <div class="col-sm-7">
                        <label class="switch" for="progressiveDeliveryHidden">
                            <input class="js_calculate" type="checkbox" name="progressiveDeliveryHidden" id="progressiveDeliveryHidden" <?php if ($_smarty_tpl->tpl_vars['order']->value['progressiveDeliveryHidden'] == '1' && $_smarty_tpl->tpl_vars['order']->value['tariffHrs'] > 120) {?>checked="checked"<?php }?> <?php if ($_smarty_tpl->tpl_vars['order']->value['tariffHrs'] < 120) {?>disabled=""<?php }?>>
                            <span class="slider round"></span>
                        </label>
                    </div>
                </div>
            <?php }?>

            <?php if ($_smarty_tpl->tpl_vars['siteSettings']->value['EXPERT_PROOFREADING_ENABLED'] || $_smarty_tpl->tpl_vars['order']->value['expertProofreading']) {?>
                <div class="form-group form-row">
                    <label class="col-sm-2 control-label text-left">Expert Proofreading</label>
                    <div class="col-sm-7">
                        <label class="switch" for="expertProofreading">
                            <input class="js_calculate" type="checkbox" name="expertProofreading" id="expertProofreading" <?php if ($_smarty_tpl->tpl_vars['order']->value['expertProofreading'] == '1') {?>checked="checked"<?php }?>>
                            <span class="slider round"></span>
                        </label>
                    </div>
                </div>
            <?php }?>

            <div class="divider"></div>
                
            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">Total</label>
                <div class="col-sm-7">
                    <span id="orderPrice" class="h2 text-success">$0.00</span>
                </div>
            </div>

            <div class="form-group form-row">
                <label class="col-sm-2 control-label text-left">
                    Change Deadline
                </label>
                <div class="col-sm-7">
                    <label class="switch" for="changeDeadline">
                        <input type="checkbox" name="changeDeadline" id="changeDeadline">
                        <span class="slider round"></span>
                    </label>
                </div>
            </div>

            <div deadline-combo class="x-hidden">
                <div class="form-group form-row">
                    <label class="col-sm-2 control-label text-left">Academic level</label>
                    <div class="col-sm-7">
                        <select name="academicLevelId" class="form-control js_calculate">
                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['academicLevels']->value, 'academicLevel');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['academicLevel']->value) {
?>
                                <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['academicLevel']->value['id'], ENT_QUOTES, 'UTF-8');?>
" <?php if ($_smarty_tpl->tpl_vars['order']->value['academicLevel'] == $_smarty_tpl->tpl_vars['academicLevel']->value['id']) {?>selected=""<?php }?>><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['academicLevel']->value['title'], ENT_QUOTES, 'UTF-8');?>
</option>
                            <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                        </select>
                    </div>
                </div>

                <div class="form-group form-row">
                    <label class="col-sm-2 control-label text-left">Deadline</label>
                    <div class="col-sm-7">
                        <select name="tariffId" class="form-control js_calculate" data-tariff-control="" tariff-id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['tariffId'], ENT_QUOTES, 'UTF-8');?>
"></select>
                    </div>
                </div>
            </div>

            <div class="form-group form-row">
                <div class="col-md-9 offset-sm-3">
                    <!-- 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>
        </div>
        <div class="card-footer text-center">
            <button type="submit" class="btn btn-info">Save Changes</button>
        </div>
    </form>
</div>
<?php
}
}
/* {/block 'content_wrapper'} */
/* {block "custom_js"} */
class Block_57792570463f08de73489c5_99175688 extends Smarty_Internal_Block
{
public $subBlocks = array (
  'custom_js' => 
  array (
    0 => 'Block_57792570463f08de73489c5_99175688',
  ),
);
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
?>

    <?php echo '<script'; ?>
 type="text/javascript">
        $(function () { 
            var $form = $("#orderForm");
            var tariffs = <?php echo json_encode($_smarty_tpl->tpl_vars['tariffs']->value);?>
;

            $form 
                && renderTariffs( $("[name='academicLevelId'] :selected").val() ) 
                    && calculate();

            $(document).on('change click input', $form.find('.js_calculate'), function(e) {
                calculate();
            });

            $('[name="changeDeadline"]').on('change',function(){
                if ($(this).is(':checked')) {
                    $form.find('[deadline-combo]').removeClass('x-hidden');
                } else {
                    $form.find('[deadline-combo]').addClass('x-hidden');
                }
            });

            $("[name='academicLevelId']").on('change',function(){
                var academicLevel = $(this).val();
                renderTariffs(academicLevel);
            });

            function renderTariffs( academicLevel ) {
                var tariffControl = $("[data-tariff-control]");
                var tariffId = tariffControl.attr("tariff-id");

                tariffControl.empty();
                if ( academicLevel ) {
                    activeTariff = tariffs[academicLevel]
                    $.each(activeTariff, function(i, tariff){
                        tariffControl.append( 
                            $('<option>').text(tariff.name).attr('value', tariff.id).attr('data-hrs', tariff.hrs).attr('data-cpp', tariff.price_per_page.value)
                        );
                    });
                }

                return true;
            }

            $('.js_custom-toggle').on('change',function(){
                var _this = $(this);
                var $value= _this.val();
                var $val = _this.data('val');
                var parent = $(this).closest('.form-group');

                if($value == $val) {
                    parent.next('.form-group').removeClass('x-hidden');
                } else {
                    parent.next('.form-group').addClass('x-hidden');
                }
            });

            function calculate() {
                var availableWinbackCoupons = null;
                var discount = null;

                var formStateForCalculator = {
                    discount,
                    winbackCoupons: availableWinbackCoupons,
                    writerCategoryId: parseInt($form.find('[name="writerCategoryId"] :selected').val()) || null,
                    writerPercent: parseInt($form.find('[name="writerCategoryId"] :selected').data('percent')) || null,
                    complexAssignmentDiscipline: $form.find('[name="topicCatId"] :selected').data('complex') || 0,
                    pages: parseInt($form.find('[name="pages"]').val()),
                    slides: parseInt($form.find('[name="slides"]').val()),
                    charts: parseInt($form.find('[name="charts"]').val()),
                    tariffPricePerPage: <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['tariffPricePerPage'], ENT_QUOTES, 'UTF-8');?>
,
                    tariffHrs: <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['tariffHrs'], ENT_QUOTES, 'UTF-8');?>
,
                    spacing: $form.find('[name="spacing"] :selected').val() || false,
                    getSamplesOn: $form.find('[name="samplesNeeded"]:checked').val() || false,
                    getProgressiveDeliveryOn: $form.find('[name="progressiveDeliveryHidden"]:checked').val() || false,
                    getUsedSourcesOn: $form.find('[name="usedsources"]:checked').val() || false,
                    expertProofreading: $form.find('[name="expertProofreading"]:checked').val() || false
                };

                if( $form.find('[name="changeDeadline"]').is(':checked') ) {
                    formStateForCalculator.tariffPricePerPage = $form.find('[name="tariffId"] :selected').data('cpp') || 0;
                    formStateForCalculator.tariffHrs = $form.find('[name="tariffId"] :selected').data('hrs') || 0;
                }

                try {
                    var cost = PROXIMCostCalculator.calculate(formStateForCalculator);
                    $form.find("#orderPrice").text("$"+cost.totalCost);
                } catch (e) {
                    console.error(e);
                }

            }        
        });
    <?php echo '</script'; ?>
>
<?php
}
}
/* {/block "custom_js"} */
}
