

<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">المشروعات</a></li>
            <li><a href="projectController.php?do=show"> المشروعات</a></li>

        </ol>




        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
           <!--  <div class="panel-heading">المشروعات
                <a href="{$youtubes[240]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
            </div>
 -->
            <div class="panel-heading" style="padding:5px 15px 15px">
                <h3 class="panel-title" style="display: inline-block;"> عرض       </h3>
                <a href="{$youtubes[198]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
                <a href="projectController.php" class="hidden-print"><input type="button"  id="submit" style="margin-left: 12px" class="btn btn-primary pull-left " value="إضافة جديد"/></a>
            </div>


            <div class="panel-body">


                <div id="outputString" class="alert alert-block alert-success fade in" style="display:none">
                    <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">&times;</button>

                    <p id="outputStringValue">{$outputString}</p>

                    <div class="clearfix"></div>
                </div>



            </div>

            <form class="form-inline hidden-print" method="post" action="projectController.php?do=show">
                    
                     <div class="form-group"  >
                        <label class="sr-only">المشروعات</label>
                            <select class="select2 wdt100" name="projectid" id="projectid" >
                                <option value="-1" >اختر </option>
                                {foreach $alldata as $project}
                                <option value="{$project->id}">{$project->name}</option>
                                {/foreach}
                            </select>
                    </div>

                    {if $Programsettingdata->projectshownew eq 0 || $Programsettingdata->realestatedev eq 0} 
                   <div class="form-group" >
                         <label class="sr-only">انواع المشروعات</label>
                            <select class="select2 wdt100" name="projectkindid" id="projectkindid" >
                                <option value="-1">اختر</option>
                                {foreach $allprojectkind as $projectkind}
                                <option value="{$projectkind->projectkindid}">{$projectkind->projectkindname}</option>
                                {/foreach}
                            </select>
                    </div>
                    {/if}




                    {if $Programsettingdata->realestatedev eq 0} 
                    <div class="form-group" >
                         <label class="sr-only">مراحل المشروعات</label>
                        <select class="select2 wdt100" name="projectstageid" id="projectstageid" >
                            <option value="-1">اختر</option>
                            {foreach $projectstages as $projectstage}
                                <option value="{$projectstage->id}">{$projectstage->name}</option>
                            {/foreach}
                        </select>
                    </div>

                    <div class="form-group" style="    margin-left: 30px;">
                        <label class="sr-only">نوع الاعمال   </label>
                        <br>
                        <input type="radio"  name="business_type" value="1" >
                        <label >انشاءات </label>
                        <input type="radio"  name="business_type" value="2">
                        <label >تشطيبات </label>
                        <input type="radio"  name="business_type" value="3">
                        <label >اخرى  </label>
                    </div>
                    <div class="form-group">
                        <label class="sr-only"> نوع مبلغ الاشراف    </label>
                        <br>
                        <input type="radio"  name="supervision_type" value="1"  >
                        <label >قيمه </label>
                        <input type="radio"  name="supervision_type" value="2" >
                        <label >نسبه</label>
                    </div>
                   
                    {/if}  




                    {if $Programsettingdata->projectshownew eq 0} 
                    <div class="form-group" style="    margin-left: 30px;">
                        <label class="sr-only"> تم تصميم البانر </label>
                        <br>
                          <input type="radio"  name="bannerdesigned" value="1">
                          <label >نعم </label>
                          <input type="radio"  name="bannerdesigned" value="2">
                          <label >لا</label>
                    </div>
                    <div class="form-group">
                        <label class="sr-only"> حالة المشروع </label>
                        <br>
                          <input type="radio"  name="projectsuit" value="1">
                          <label >تم </label>
                          <input type="radio"  name="projectsuit" value="2">
                          <label >تحت التنفيذ</label>
                          <input type="radio"  name="projectsuit" value="3">
                          <label >لم يبدا بعد</label>
                    </div>
                    {/if} 
                   

                    <br />
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="from" >
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" >
                    </div>
                    <button type="submit" class="btn btn-primary hidden-print">بحث</button>
                </form>
            <hr/>



            <table class="table table-black">
                <thead>
                    <tr>
                        <th style="width:50px;">م</th>
                        <th>اسم المشروع</th>

                        {if $Programsettingdata->projectshownew eq 0 || $Programsettingdata->realestatedev eq 0} 
                          <th>نوع المشروع</th>
                        {/if}

                        {if $Programsettingdata->realestatedev eq 0} 
                        <th>مراحل المشروع</th>
                        <th>اسم المالك</th>
                        <th>نوع الاعمال</th>
                        <th>مبلغ الاشراف</th>
                       {/if} 


                        {if $Programsettingdata->projectshownew eq 0} 
                       
                        <th>تم تصميم البانر</th>
                        <th>حالة المشروع</th>
                        <th>تاريخ الاضافه</th>
                        <th>تاريخ الانتهاء</th>
                       {/if} 
                        <th> اجمالى التعاقد</th>
                        <th>المستخدم </th>
                        {if $Programsettingdata->realestatedev eq 0} 
                        <th class="noprint"> بيانات مراحل المشروع</th>
                        <th class="noprint">البرنامج الزمنى</th>
                        <th class="noprint"> التقرير اليومى للمشروع  </th>
                        {/if}
                        <th class="noprint">تعديل</th>
                        <th class="noprint">انهاء</th>
                        <th class="noprint">حذف</th>
                    </tr>
                </thead>
                <tbody>



                    {assign var=i value=1}
                    {foreach $alldata as $data}

                    <tr {if $data->finish eq 1} class="danger" {/if}>

                        <td>{$i}</td>
                        <td>{$data->name}</td>
                        {if $Programsettingdata->projectshownew eq 0 || $Programsettingdata->realestatedev eq 0} 
                          <td>{$data->projectkindname}</td>
                        {/if}
                        {if $Programsettingdata->realestatedev eq 0} 
                            <td>
                            {foreach $data->projectstages as $projectstage}
                             {$projectstage.name}  / 
                            {/foreach}
                            </td>
                            <td>{$data->owner_name}</td>
                            <td>{if $data->business_type == 1} انشاءات   {else if $data->business_type == 2} تشطيبات  {else if $data->business_type == 3}  اخرى {/if}</td>
                            <td>{$data->supervision_amount} {if $data->supervision_type == 1} {$currency} {else} % {/if}</td>
                        {/if} 
                        {if $Programsettingdata->projectshownew eq 0} 
                        <td>{if $data->bannerdesigned == 1} نعم  {else if $data->bannerdesigned == 2}  لا {/if}</td>
                        <td>{if $data->projectsuit == 1} تم   {else if $data->projectsuit == 2}  تحت التنفيذ  {else if $data->projectsuit == 3} لم يبدا بعد {/if}</td>
                        <td>{$data->addeddate}</td>
                        <td>{$data->expirydate}</td>
                        {/if}
                        <td>{$data->totalcontract}</td>
                        <td>{$data->employeename}</td>

                        {if $Programsettingdata->realestatedev eq 0} 
                        <td class="noprint">
                            <a href="projectstagesdataController.php?do=detail&id={$data->id}" type="button" class="btn btn-default btn-md">بيانات مراحل المشروع</a>
                        </td>
                         <td class="noprint">
                            <a href="projectController.php?do=timetableitems&id={$data->id}" type="button" class="btn btn-default btn-md">البرنامج الزمنى</a>
                        </td>
                         <td class="noprint">
                            <a href="projectdailyreportController.php?do=prodetail&id={$data->id}" type="button" class="btn btn-default btn-md">التقرير اليومى للمشروع  </a>
                        </td>
                         {/if}


                        <td class="noprint">
                            <a href="projectController.php?do=edit&id={$data->id}" type="button" class="btn btn-default btn-lg editicon"></a>
                        </td>



                        <td class="noprint">
                            {if $data->finish eq 0}
                            <a href="#" name="dd" type="button" class="btn btn-default btn-lg deleteicon showfinishmsg" data-id="{$data->id}" data-go="projectController.php" ></a>
                            {else}
                            -----
                            {/if}
                        </td>

                        <td class="noprint">
                            {if $data->finish eq 0}
                            <a href="#" name="dd" type="button" class="btn btn-default btn-lg deleteicon showdeletemsg" data-id="{$data->id}" data-go="projectController.php" ></a>

                            {else}
                            -----
                            {/if}
                        </td>



                    </tr>
                    {capture assign=i}{$i+1}{/capture}
                    {/foreach}


                </tbody>
            </table>





            <div class="clearfix"></div>


            <hr />

            <div  class="noprint">
                <div class="col-lg-12">


                    <div class="form-group">
                        <div class="col-lg-4">
                            <button type="button" onclick="print_Custom('mycustomheader');" class="btn btn-success pull-right">طباعة</button>
                        </div>
                    </div>

                </div>
                <div class="clearfix"></div>
            </div>






            <div class="clearfix"></div>


        </div>



    </div>

</div>





<!-- Modal -->
<div class="modal fade noprint" id="small" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">تأكيد حذف المشروع</h4>
            </div>
            <div class="modal-body">
                <label> هل تريد حذف هذا المشروع؟</label>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">لا</button>
                <button type="button" class="btn btn-primary deleteit">نعم</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->





<!-- Modal -->
<div class="modal fade noprint" id="finishsmall" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">تأكيد  انهاء المشروع</h4>
            </div>
            <div class="modal-body">
                 <label> هل تريد حذف هذا المشروع؟</label>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">لا</button>
                <button type="button" class="btn btn-primary finishit">نعم</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
