<?php
/* Smarty version 3.1.34-dev-7, created on 2020-12-20 11:10:30
  from '/home/bscom/public_html/crm/ui/theme/default/crmdeliverychallan_list.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.34-dev-7',
  'unifunc' => 'content_5fdec0a6c27878_39322594',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'b26bc10b08d22a89615ce47daf6b738277bbab6c' => 
    array (
      0 => '/home/bscom/public_html/crm/ui/theme/default/crmdeliverychallan_list.tpl',
      1 => 1608433757,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5fdec0a6c27878_39322594 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_loadInheritance();
$_smarty_tpl->inheritance->init($_smarty_tpl, true);
?>


<?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_15886553375fdec0a6bea244_76993646', "content");
?>

<?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_14239714335fdec0a6c25f89_45431598', "script");
$_smarty_tpl->inheritance->endChild($_smarty_tpl, ((string)$_smarty_tpl->tpl_vars['layouts_admin']->value));
}
/* {block "content"} */
class Block_15886553375fdec0a6bea244_76993646 extends Smarty_Internal_Block
{
public $subBlocks = array (
  'content' => 
  array (
    0 => 'Block_15886553375fdec0a6bea244_76993646',
  ),
);
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/home/bscom/public_html/crm/vendor/smarty/smarty/libs/plugins/modifier.date_format.php','function'=>'smarty_modifier_date_format',),));
?>



    <div class="row">
        <div class="col-md-12">
            <h3 class="ibilling-page-header">Delivery Challans</h3>
        </div>
    </div>
 
    <div class="row">
        <div class="col-md-12">
                            <?php if ($_smarty_tpl->tpl_vars['view_type']->value == 'filter') {?>
                                          <?php }?>


                <form class="form-horizontal" method="post" action="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
crmdelivery/deliverychallan-list">
                            <div class="row">
                                <div class="col-md-2">
                                    
                                    
                                        

                                    
                                    
                                        
                                       
                                </div>
                                 <div class="col-md-6">
                                     Choose Date
                               <input type="date" id="today_date" name="today_date" value=<?php echo $_smarty_tpl->tpl_vars['today']->value;?>
 class="form-control"/>
                               </div>
                                <div class="col-md-4">
                                   <br/>
                                        <button type="submit"  class="btn btn-primary ">Submit </button>
                                </div>
                                

                            </div>
                        </form>
                        <br/>
         <form action="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
crmdelivery/deliverychallan-deleteall" method="post">
            <div class="ibox float-e-margins">
            
                <div class="ibox-title">
                
                                                                                                            
                    Delivery Orders
                   

                    <div class="ibox-tools">
                                                                                                                                                                                <input type="checkbox"  value="Check All" class="did" name="checkAll" id="checkAll"/> <label id="lblcheck" class="btn-info">Select All</label>

                        <button id="hrefSelect" onclick="return confirm('This action cannot be undone.Are you sure?')" class="btn btn-danger btn-xs"><i class="fa fa-trash"></i> Delete Delivery Chellans</a> </button>

                        
                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
crmdelivery/deliverychallan-add/" class="btn btn-primary btn-xs"><i class="fa fa-plus"></i> Add Delivery Chellan</a>
                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
crmdelivery/driver-manual-assign"  class="btn btn-inverse  btn-sm"><i class="fa fa-car"></i> Manual Assign </a>

                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
crmdelivery/driver-assign"  class="btn btn-inverse  btn-sm"><i class="fa fa-car"></i> Smart Assign Driver </a>
                      
                    </div>
                </div>
                <div class="ibox-content">





                    <table class="table table-bordered table-hover sys_table footable" <?php if ($_smarty_tpl->tpl_vars['view_type']->value == 'filter') {?> data-filter="#foo_filter" data-page-size="50" <?php }?>>
                        <thead>
                        <tr>
                            <th></th>
                            <th>#</th>
                            <th>Customer</th>
                            <th>Delivery Date</th>
                            <th>Assigned Driver</th>
                            <th>
                                <?php echo $_smarty_tpl->tpl_vars['_L']->value['Status'];?>

                            </th>
                            <th class="text-right" width="140px;"><?php echo $_smarty_tpl->tpl_vars['_L']->value['Manage'];?>
</th>
                        </tr>
                        </thead>
                        <tbody>

                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['dn']->value, 'ds');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['ds']->value) {
?>
                            <tr>
                            <td><input type="checkbox" class="did" name="did[]" value="<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
" ></td>
                                <td  data-value="<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
"><a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
crmdelivery/view/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
/"><?php echo $_smarty_tpl->tpl_vars['ds']->value['cn'];?>
</a> </td>
                                <td>
                                    <?php if (isset($_smarty_tpl->tpl_vars['contacts']->value[$_smarty_tpl->tpl_vars['ds']->value['userid']])) {?>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
crmdelivery/view/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
/">
                                            <?php echo $_smarty_tpl->tpl_vars['ds']->value['account'];?>

                                            <?php if ($_smarty_tpl->tpl_vars['contacts']->value[$_smarty_tpl->tpl_vars['ds']->value['userid']]->company != '') {?>
                                              <br>  <?php echo $_smarty_tpl->tpl_vars['contacts']->value[$_smarty_tpl->tpl_vars['ds']->value['userid']]->company;?>

                                            <?php }?>

                                        </a>
                                    <?php }?>
                                </td>
                                <td><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['ds']->value['c2'],"%d-%m-%Y");?>
</td>
                                <td> <?php echo $_smarty_tpl->tpl_vars['ds']->value['fullname'];?>
</td>
                                <td>
                                                <?php if ($_smarty_tpl->tpl_vars['ds']->value['delivery_status'] == 'Unassigned') {?>
                                                <span class="label label-danger"><?php echo $_smarty_tpl->tpl_vars['ds']->value['delivery_status'];?>
</span>
                                                <?php } elseif ($_smarty_tpl->tpl_vars['ds']->value['delivery_status'] == 'Assigned') {?>
                                                    <span class="label label-info"><?php echo $_smarty_tpl->tpl_vars['ds']->value['delivery_status'];?>
</span>
                                                <?php } elseif ($_smarty_tpl->tpl_vars['ds']->value['delivery_status'] == 'Acknowledged') {?>
                                                    <span class="label label-primary"><?php echo $_smarty_tpl->tpl_vars['ds']->value['delivery_status'];?>
</span>
                                                <?php } elseif ($_smarty_tpl->tpl_vars['ds']->value['delivery_status'] == 'Started') {?>
                                                    <span class="label label-warning"><?php echo $_smarty_tpl->tpl_vars['ds']->value['delivery_status'];?>
</span>
                                                <?php } elseif ($_smarty_tpl->tpl_vars['ds']->value['delivery_status'] == 'Inprogress') {?>
                                                    <span class="label label-default"><?php echo $_smarty_tpl->tpl_vars['ds']->value['delivery_status'];?>
</span>
                                                <?php } elseif ($_smarty_tpl->tpl_vars['ds']->value['delivery_status'] == 'Successful') {?>
                                                    <span class="label label-success"><?php echo $_smarty_tpl->tpl_vars['ds']->value['delivery_status'];?>
</span>
                                                <?php } else { ?>
                                                    <span class="label label-danger"><?php echo $_smarty_tpl->tpl_vars['ds']->value['delivery_status'];?>
</span>
                                                <?php }?>
                                </td>
                               
                           
                                <td class="text-right">

                                                                                                            
                                    <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
crmdelivery/view/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
/" class="btn btn-primary btn-xs" data-toggle="tooltip" data-placement="top" title="<?php echo $_smarty_tpl->tpl_vars['_L']->value['View'];?>
"><i class="fa fa-file-text-o"></i></a>

                                    <?php if ($_smarty_tpl->tpl_vars['ds']->value['delivery_status'] == 'Unassigned' || $_smarty_tpl->tpl_vars['ds']->value['delivery_status'] == 'Assigned') {?>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
crmdelivery/edit/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
/" class="btn btn-info btn-xs" data-toggle="tooltip" data-placement="top" title="<?php echo $_smarty_tpl->tpl_vars['_L']->value['Edit'];?>
"><i class="fa fa-pencil"></i></a>

                        

                                                                            <?php }?>


                                </td>
                            </tr>
                        <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>

                        </tbody>

                        <?php if ($_smarty_tpl->tpl_vars['view_type']->value == 'filter') {?>
                            <tfoot>
                            <tr>
                                <td colspan="8">
                                    <ul class="pagination">
                                    </ul>
                                </td>
                            </tr>
                            </tfoot>
                        <?php }?>

                    </table>
                    <?php echo $_smarty_tpl->tpl_vars['paginator']->value['contents'];?>

                </div>
            </div>
            </form>
        </div>
    </div>
<?php
}
}
/* {/block "content"} */
/* {block "script"} */
class Block_14239714335fdec0a6c25f89_45431598 extends Smarty_Internal_Block
{
public $subBlocks = array (
  'script' => 
  array (
    0 => 'Block_14239714335fdec0a6c25f89_45431598',
  ),
);
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
?>

<?php echo '<script'; ?>
>

        $(function() {
            $('.did').prop('checked', false);
            $('#checkAll').prop('checked', false);
            document.getElementById('lblcheck').innerHTML = 'Select All';


            $(document).on('click', '#checkAll', function() {
                
                
                if ($(this).val() == 'Check All') {
                    
                    $('.did').prop('checked', true);
                    $('#checkAll').prop('checked', true);
                    $(this).val('Uncheck All');
                    document.getElementById('lblcheck').innerHTML = 'Unselect All';
                    document.getElementById('hrefSelect').innerHTML = 'Delete Selected Delivery Chellans';

                } else {
                    $('.did').prop('checked', false);
                     $('#checkAll').prop('checked', false);   
                    $(this).val('Check All');
                    document.getElementById('lblcheck').innerHTML = 'Select All';
                    document.getElementById('hrefSelect').innerHTML = 'Delete Delivery Chellans';


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