<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2><?= print_lang($app_lang,'services_qut_mod_new_breadcrumb_title'); ?></h2>
        <ol class="breadcrumb">
            <li>
                <a class="url-elem" href="<?php echo url('/dashboard'); ?>"><?= print_lang($app_lang,'home'); ?></a>
            </li>
            <li>
                <a class="url-elem" href="<?php echo url('/services-quotation'); ?>"><?= print_lang($app_lang,'services_qut_mod_breadcrumb_title'); ?></a>
            </li>
            <li class="active">
                <strong><?= print_lang($app_lang,'services_qut_mod_new_breadcrumb_title'); ?></strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">
    </div>
</div>


<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox-title services-quotation-fix-row">
        <h5><?= print_lang($app_lang,'fields_with'); ?> <strong class="text-danger">*</strong> <?= print_lang($app_lang,'are_mandatory'); ?></h5>
        <div style="display: inline-block; margin-left: 150px;" id="services-qut-type-btns">
            <label class="checkbox-inline i-checks">
                <input checked="checked" type="radio" name="service_type" value="registered" id="service-qut-type"> &nbsp;&nbsp; <?= print_lang($app_lang,'services_qut_mod_add_service_registered'); ?>
            </label>
            <label class="checkbox-inline i-checks" style="margin-left: 30px;">
                <input type="radio" name="service_type" value="manual" id="service-qut-type"> &nbsp;&nbsp; <?= print_lang($app_lang,'services_qut_mod_add_service_manual'); ?>
            </label>
        </div>
    </div>
    <div class="ibox-content">
        <!-- spinner -->
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
        <!-- spinner -->
        
        <div class="row">
            <div class="col-sm-12 b-r">
                <form role="form" id="services-quotation-temp-form">

                    <div class="row" style="margin-bottom: 5px;">
                        <div class="row services-quotation-fix-row">
                            <div class="col-md-7">
                                <div class="row">
                                    <div class="col-md-4">
                                        <div class="form-group">
                                            <label><?= print_lang($app_lang,'services_qut_mod_new_input_currency'); ?> <strong class="text-danger">*</strong></label>
                                            <select class="form-control chosen-select" name="temp_currency">
                                                <option disabled="" value="" selected="">-- <?= print_lang($app_lang,'services_qut_mod_new_input_currency'); ?> --</option>
                                                <?php foreach($currencies as $row){ ?>
                                                    <option value="<?= $row['uid']; ?>" data-usd-equalance="<?= $row['usd_equalance']; ?>" <?php if($quotation_data['currency'] == $row['uid']){ echo 'selected="selected"'; } ?>><?= $row['name']; ?> (<?= $row['symbol']; ?>)</option>
                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-md-4">
                                        <div class="form-group">
                                            <label><?= print_lang($app_lang,'services_qut_mod_new_input_client'); ?> <strong class="text-danger">*</strong></label>
                                            <select class="form-control chosen-select temp_client_edit" name="temp_client">
                                                <option disabled="" selected="">-- <?= print_lang($app_lang,'services_qut_mod_new_input_client'); ?> --</option>
                                                <?php foreach($clients as $row){ ?>
                                                    <option value="<?= $row['uid']; ?>" <?php if($quotation_data['client'] == $row['uid']){ echo 'selected="selected"'; } ?>><?= $row['name']; ?></option>
                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-md-4">
                                        <div class="form-group">
                                            <label><?= print_lang($app_lang,'services_qut_mod_new_input_invoice'); ?> <strong class="text-danger">*</strong></label>
                                            <input type="text" class="form-control pointer-none" name="temp_invoice" value="<?= $invoice_number; ?>" placeholder="<?= print_lang($app_lang,'services_qut_mod_new_input_invoice'); ?>" readonly="">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <label><?= print_lang($app_lang,'services_qut_mod_new_input_date'); ?></label>
                                    <?php $edate = display_true_date( date('y-m-d') ); ?>
                                    <?php if($branch_calander == 'persian'){ ?>
                                        <input type="text" class="form-control persian-date" name="temp_sdate" value="<?= true_date_for_inputs($edate); ?>" placeholder="<?= print_lang($app_lang,'services_qut_mod_new_input_date'); ?>" readonly="" style="background: #fff;">
                                    <?php }else{ ?>
                                        <input type="date" class="form-control" name="temp_sdate" value="<?= true_date_for_inputs($edate); ?>">
                                    <?php } ?>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label><?= print_lang($app_lang,'services_qut_mod_new_input_memo'); ?></label>
                                    <textarea style="height: 35px;" class="form-control temp_memo_edit" name="temp_memo" rows="1" placeholder="<?= print_lang($app_lang,'services_qut_mod_new_input_memo'); ?>"></textarea>
                                </div>
                            </div>
                        </div>

                    </div>

                    <div class="row extra-mar-botm">
                        <div class="col-md-2 registered-service-qut-row">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'services_qut_mod_new_input_title'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select service-qut-registered-dp" name="temp_title_dp">
                                    <option disabled="" value="" selected="">-- <?= print_lang($app_lang,'services_qut_mod_new_input_title'); ?> --</option>
                                    <?php foreach($services_cat as $row){ ?>
                                        <option data-unit="<?= $row['unit']; ?>" data-currency="<?= $row['currency']; ?>" data-currency-equalance="<?= $row['currency_usd_equalance']; ?>" data-rate="<?= $row['rate']; ?>" value="<?= $row['uid']; ?>"><?= $row['name']; ?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-md-2 manual-service-qut-row display-none">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'services_qut_mod_new_input_title'); ?> <strong class="text-danger">*</strong></label>
                                <input type="text" class="form-control" name="temp_title" placeholder="<?= print_lang($app_lang,'services_qut_mod_new_input_title'); ?>">
                            </div>
                        </div>

                        <div class="col-md-2">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'services_qut_mod_new_input_unit'); ?></label>
                                <input type="text" class="form-control" name="temp_unit" readonly placeholder="<?= print_lang($app_lang,'services_qut_mod_new_input_unit'); ?>">
                            </div>
                        </div>

                        <div class="col-md-2">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'services_qut_mod_new_input_qty'); ?></label>
                                <input type="text" class="form-control" name="temp_qty" placeholder="<?= print_lang($app_lang,'services_qut_mod_new_input_qty'); ?>">
                            </div>
                        </div>

                        <div class="col-md-2">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'services_qut_mod_new_input_rate'); ?></label>
                                <input type="text" class="form-control" name="temp_rate" readonly placeholder="<?= print_lang($app_lang,'services_qut_mod_new_input_rate'); ?>">
                            </div>
                        </div>

                        <div class="col-md-2">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'services_qut_mod_new_input_discount'); ?></label>
                                <input type="text" class="form-control" name="temp_discount" placeholder="<?= print_lang($app_lang,'services_qut_mod_new_input_discount'); ?>">
                            </div>
                        </div>

                        <div class="col-md-2">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'services_qut_mod_new_input_total'); ?></label>
                                <input type="text" class="form-control" name="temp_total" placeholder="<?= print_lang($app_lang,'services_qut_mod_new_input_total'); ?>" readonly>
                            </div>
                        </div>

                    </div>

                    <div class="row extra-mar-botm">
                        <div class="col-md-12 text-right">
                            <button style="width: 100%;" class="btn btn-w-m btn-primary" type="submit"><?= print_lang($app_lang,'services_qut_mod_new_input_add_to_services'); ?></button>
                        </div>
                    </div>

                </form>
            </div>
        </div>

        <form role="form" id="services-quotation-form" action="<?php echo url('/services-quotation/save'); ?>">
            <div class="row" style="margin-top: 10px;">
                <div class="col-md-12">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th class="text-center"><?= print_lang($app_lang,'services_qut_mod_new_input_show_title'); ?></th>
                                    <th class="text-center"><?= print_lang($app_lang,'services_qut_mod_new_input_show_unit'); ?></th>
                                    <th class="text-center"><?= print_lang($app_lang,'services_qut_mod_new_input_show_qty'); ?></th>
                                    <th class="text-center"><?= print_lang($app_lang,'services_qut_mod_new_input_show_rate'); ?></th>
                                    <th class="text-center"><?= print_lang($app_lang,'services_qut_mod_new_input_show_discount'); ?></th>
                                    <th class="text-center"><?= print_lang($app_lang,'services_qut_mod_new_input_show_total'); ?></th>
                                    <th class="text-center" style="width: 60px;"><?= print_lang($app_lang,'services_qut_mod_new_input_show_action'); ?></th>
                                </tr>
                            </thead>
                            <tbody id="services-quotation-items-table-body">
                                
                            </tbody>
                        </table>    
                    </div>
                    
                    <div class="row services-quotation-under-table-totals">
                        <div class="col-md-3 total-services-quotation-cel">
                            <strong><?= print_lang($app_lang,'services_qut_mod_new_input_total_amount'); ?>: </strong>
                            <span></span>
                            <input type="hidden" name="totals">
                        </div>
                        <div class="col-md-3 total-diss-cel">
                            <strong><?= print_lang($app_lang,'services_qut_mod_new_input_total_discount'); ?>: </strong>
                            <span></span>
                            <input type="hidden" name="discounts">
                        </div>
                        <div class="col-md-3 gross-total-cel">
                            <strong><?= print_lang($app_lang,'services_qut_mod_new_input_total_gross'); ?>: </strong>
                            <span></span>
                            <input type="hidden" name="gross_totals">
                        </div>
                        <div class="col-md-3 total-profit-cel">
                            <strong><?= print_lang($app_lang,'services_qut_mod_new_input_total_profit'); ?>: </strong>
                            <span></span>
                        </div>
                    </div>

                </div>

                

            </div>

            <div class="row extra-mar-botm">
                <div class="col-md-12 text-right">
                    <button style="width: 100%;" class="btn btn-w-m btn-primary" type="submit"><?= print_lang($app_lang,'save'); ?></button>
                </div>
            </div>
        </form>

    </div>

</div>