<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">المناقصات</a></li>
            <li><a href="tenderAnnouncementController.php?do=report">تقرير</a></li>
            <li class="active">عرض</li>
        </ol>
        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">عرض</h3>
            </div>
            <div class="panel-body"> 
               <form class="form-inline hidden-print" action="tenderAnnouncementController.php?do=adreport" method="post">
<table class="table table-bordered" style="margin-top:20px;" id="example">
    <thead>
        <tr class="bg-primary">
            <th>رقم المناقصة</th>
            <th>الاسم</th>
            <th>الجهة</th>
            <th>الحالة</th>
            <th>تفاصيل</th>
        </tr>
    </thead>
    <tbody>
        {foreach $allTenders as $row}
        <tr>
            <td>{$row.id}</td>
            <td>{$row.name}</td>
            <td>{$row.the_issuing_entity}</td>
            <td>
                                {if $row.status eq "process"}جاري البت فيها
                                {elseif $row.status eq "avilable"}يمكن التقدم لها
                                {elseif $row.status eq "done"}تم اصدار امر التوريد لها
                                {elseif $row.status eq "paused"}تم ايقاف العملية
                                {elseif $row.status eq "canceled"}تم الغاء العملية
                                {elseif $row.status eq "-1" or $row.status eq ""} 
                                {/if}
                            </td>
            <td><a href="tenderAnnouncementController.php?do=view&id={$row.id}" class="btn btn-xs btn-info">تفاصيل</a></td>
        </tr>
        {/foreach}
    </tbody>
</table>

{literal}
<script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    $('#spbutton').live('click', function (e) {
        if (!$('#spbutton').hasClass("processing")) {
            $('#spbutton').addClass("processing");
            var myForm = document.getElementById("spform");
            var SS = Spry.Widget.Form.validate(myForm);
            if (SS == true) {
                myForm.submit();
            } else {
                $('#spbutton').removeClass("processing");
            }
        }
    });
$(document).ready(function() {
    $('#nature').on('change', function() {
        if ($(this).val() === 'other') {
            $('#other_input_container').show();
        } else {
            $('#other_input_container').hide(); 
            $('#other_nature').val(''); 
        }
    });
});
$(document).ready(function(){
    $('#name').on('change', function() {
        let sideValue = $(this).find(':selected').data('side');
        if (sideValue) {
                $('#side').val(sideValue);
            } else {
                $('#side').val(''); 
            }
        });
});



    $(document).ready(function () {
        $('#example').dataTable({
            "aaSorting": [[ 0, "desc" ]],
            "scrollX":true,
            "bPaginate": false,
            "bStateSave": false,
            "sDom": 'TCR<"clear">lfrtip',
            "oTableTools": {
                "aButtons": [
                    "copy",
                    "print",
                    {
                        "sExtends": "collection",
                        "sButtonText": "حفظ",
                        "aButtons": ["csv", "xls"]
                    }
                ]
            }
        });
    });


</script>
{/literal}