<?php
if (empty($ticketing_id)) {
?>
<div class="alert alert-danger" role="alert">
    <button class="close" data-dismiss="alert"></button>
    <strong>Danger: </strong>you can not view this product! 
    <br>
    This product is deleted or disabled.
</div>
<?php
} else {
 ?>

<style>
    .profile-pic {
        text-align: center;
        border-radius: 100%;
        -moz-border-radius: 100%;
        -webkit-border-radius: 100%;
        width: 210px;
        height: 210px;
        border: 5px solid #4c0870;
        overflow: hidden;
        margin:0px auto;
        background: #fafafa;
    }
    .profile-pic img {
        width: 188px;
        height: 188px;
        margin-top: 6px;
        border-radius: 100%;
        -moz-border-radius: 100%;
        -webkit-border-radius: 100%;
        overflow: hidden;
        -webkit-transition: all .3s ease-in-out;
        -moz-transition: all .3s ease-in-out;
        transition: all .3s ease-in-out;
    }
    #NewProductUploadPhoto{
        width:25%;
        overflow:hidden;
        position:relative;
    }
    #NewProductUploadPhoto{
        margin-left:128px;
        margin-top:10px;
        background-color:#4c0870 !important;
        color:#fff;
        width:initial;
    }
    #NewProductUploadPhoto > input,#NewProductUploadPhoto > input{
        position:absolute;
        left:0px;
        top:0px;
        width:100%;
        height:100%;
        opacity:0.01;
        cursor:pointer;}
    .b-r {
        border-left-width: 1px;
    }
    .bg-master-lighter {
        border:none;
        background-color:#fff;
        border-top:1px solid #ddd;  
    }
    .table thead tr >th{
        background-color:#4c0870;
        color:#fff;
    }
    .table thead tr th[class*='sorting_'] {
        color: #fff;
    }
</style>
<div class="wrapper">
    <div class="panel invoice">
        <div class="panel-body">
            
            <div class="row">
                
                <h1><?php print CommonLanguage::getMessage('phone_info'); ?></h1>
             <!--   <div class="col-md-4 profile-col  ">
                    <div class="profile-pic">
                        <div class="profile-border" >
                            <img id="ProductloadImagePreview" src="<?php echo $filename1; ?>" data-src="<?php echo $filename1; ?>" alt="" >
                        </div>
                    </div>
                    <?php if(file_exists(dirBase.'uploads/products_photos/' . $Product_ID. '.jpg')){?>
                    <span class="fa fa-trash red-star delete_product_image" data-view="1" data-content="<?php echo $Product_ID; ?>" style="cursor:pointer;"></span>
                    <?php }?>
                </div>-->
                <div class="col-md-12 b-r  " id="ProductDetails">
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('serial_number'); ?></label>
                            <div class="col-sm-4 Product_Code"><?php echo $edit_arr['main']['serial_number']; ?> </div>
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('customer_name'); ?></label>
                            <div class="col-sm-4 Product_Name">
                                <?php echo $customer['Customer_Name']; ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('phone_brand'); ?></label>
                            <div class="col-sm-4 Category_ID ">
                                <?php echo $edit_arr['main']["phone_brand"]; ?>
                            </div>
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('phone_name'); ?></label>
                            <div class="col-sm-4 Product_Quantity">
                                <?php echo $edit_arr['main']["phone_name"]; ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('ime'); ?></label>
                            <div class="col-sm-4 Product_VAT">
                                <?php echo $edit_arr['main']["ime"]; ?>
                            </div>
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('supporter_name'); ?></label>
                            <div class="col-sm-4 Product_Reorder_Point">
                                <?php echo $edit_arr['main']["maintenance_supporter_name"]; ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('maintenance_status'); ?></label>
                            <div class="col-sm-4 Product_PLU">
                                <?php echo $edit_arr['main']["ticketing_status_name"]; ?>
                            </div>
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('Customer_Phone'); ?></label>
                            <div class="col-sm-4 on_scale">
                                <?php echo $customer["Mobile"]; ?>
                            </div>
                        </div>
                    </div>
                    <?php if($edit_arr['main']["date_finished"] || $edit_arr['main']["finished_by"]){ ?>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo CommonLanguage::getMessage('date_finished') ?></label>
                            <div class="col-sm-4 Product_Limit_Discount">
                                <?php echo $edit_arr['main']['date_finished']; ?>
                            </div>
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('finished_by'); ?></label>
                            <div class="col-sm-4 on_scale">
                                <?php echo $edit_arr['main']["finished_by"]; ?>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('maintenance_type_name'); ?></label>
                            <div class="col-sm-4 is_card ">
                                <?php echo $edit_arr['main']["maintenance_type_name"]; ?>
                            </div>
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('Password'); ?></label>
                            <div class="col-sm-4 is_card ">
                                <?php echo $edit_arr['main']["password"]; ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php print CommonLanguage::getMessage('color'); ?></label>
                            <div class="col-sm-4 is_card ">
                                <?php echo $edit_arr['main']["color"]; ?>
                            </div>
                         </div>
                    </div>
                   
                </div>
            </div>
            <br>
           
            <table class="table table-bordered table-hover demo-table-search" id="DepotContent">
                <thead>
                    <tr>
                        <th class="text-center" ><?php print CommonLanguage::getMessage('maintenance_type_name'); ?></th>
                        <th class="text-center"><?php print CommonLanguage::getMessage('maintenance_note'); ?></th>
                        <th class="text-center"><?php print CommonLanguage::getMessage('maintenance_date'); ?></th>

                    </tr>
                </thead>
                <tbody>
                    <?php 
                 

        foreach($serial as $ser) {
                      ?>
                    <tr>
                        <td class="text-center"><?php echo $ser['maintenance_type_name'] ?></td>
                        <td class="text-center"><?php echo $ser['reply_description'] ?></td>
                        <td class="text-center"><?php echo $ser['maintenance_date'] ?></td>

                    </tr>
                    <?php } ?>             
                </tbody>
            </table>
         </div>
    </div>
</div>
<script>
    $(function () {
        if ($('#is_modal_shown').val() == 1)
            $('#EditProduct').modal('show');
        $('.delete_product_image').on('click',function(){
            var parent =  $(this),
                data={directory_name:'products_photos',image_name:parent.attr('data-content')+'.jpg'};
            deleteSpecificImage(data,parent.attr('data-view') == 1 ? '#ViewProductLoader' : '#UpdateProductIsBusy',function(response){
                if(response[1] == "success"){
                    $('#ProductloadImagePreview,#UpdateProductUploadImagePreview').attr('src','<?php echo SITE_LINK; ?>img/profiles/product.png').attr('data-src','<?php echo SITE_LINK; ?>img/profiles/product.png');
                    $('.delete_product_image').remove();
                }
            });
        });
    })
</script>
<?php } ?>