<?php
/* Smarty version 4.5.4, created on 2024-11-03 07:50:15
  from '/Users/razib/Herd/suite/ui/theme/default/leads.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.4',
  'unifunc' => 'content_67277187e8b851_94095949',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'efaba137c0c041393ddaed31883bc8da8e96eb36' => 
    array (
      0 => '/Users/razib/Herd/suite/ui/theme/default/leads.tpl',
      1 => 1730635718,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_67277187e8b851_94095949 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_loadInheritance();
$_smarty_tpl->inheritance->init($_smarty_tpl, true);
?>


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


<?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_72517512067277187e86616_09203277', "script");
?>

<?php $_smarty_tpl->inheritance->endChild($_smarty_tpl, ((string)$_smarty_tpl->tpl_vars['layouts_admin']->value));
}
/* {block "content"} */
class Block_62860497667277187e7d403_66342060 extends Smarty_Internal_Block
{
public $subBlocks = array (
  'content' => 
  array (
    0 => 'Block_62860497667277187e7d403_66342060',
  ),
);
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
?>



    <div class="subheader">
        <h1 class="subheader-title">
            <i class='subheader-icon fal fa-user-alt'></i> <?php echo $_smarty_tpl->tpl_vars['_L']->value['Leads'];?>
 <span class='fw-300'></span>
        </h1>
        <div class="subheader-block d-lg-flex align-items-center">
            <a href="#" class="btn btn-primary add_item waves-effect waves-light" id="add_item"><i class="fal fa-plus"></i> <?php echo $_smarty_tpl->tpl_vars['_L']->value['New Lead'];?>
</a>
        </div>

    </div>

    <div class="row">


        <div class="col-md-12">
            <div class="panel">
                <div class="panel-container show">
                    <div class="panel-content">


                        <div class="row">
                            <div class="col-md-3 col-sm-6">

                                <form>

                                    <div class="mb-3">
                                        <label for="filter_first_name"><?php echo $_smarty_tpl->tpl_vars['_L']->value['First Name'];?>
</label>
                                        <input type="text" id="filter_first_name" name="filter_first_name" class="form-control">
                                    </div>

                                    <div class="mb-3">
                                        <label for="filter_middle_name"><?php echo $_smarty_tpl->tpl_vars['_L']->value['Middle Name'];?>
</label>
                                        <input type="text" id="filter_middle_name" name="filter_middle_name" class="form-control">
                                    </div>

                                    <div class="mb-3">
                                        <label for="filter_last_name"><?php echo $_smarty_tpl->tpl_vars['_L']->value['Last Name'];?>
</label>
                                        <input type="text" id="filter_last_name" name="filter_last_name" class="form-control">
                                    </div>

                                    <div class="mb-3">
                                        <label for="filter_email"><?php echo $_smarty_tpl->tpl_vars['_L']->value['Email'];?>
</label>
                                        <input type="email" id="filter_email" name="filter_email" class="form-control">
                                    </div>

                                    <div class="mb-3">
                                        <label for="filter_salutation"><?php echo $_smarty_tpl->tpl_vars['_L']->value['Salutation'];?>
</label>
                                        <input type="text" id="filter_salutation" name="filter_salutation" class="form-control">
                                    </div>

                                    <div class="mb-3">
                                        <label for="filter_company"><?php echo $_smarty_tpl->tpl_vars['_L']->value['Company'];?>
</label>
                                        <input type="text" id="filter_company" name="filter_company" class="form-control">
                                    </div>

                                    <div class="mb-3">
                                        <label for="filter_phone"><?php echo $_smarty_tpl->tpl_vars['_L']->value['Phone'];?>
</label>
                                        <input type="text" id="filter_phone" name="filter_phone" class="form-control">
                                    </div>

                                    <div class="mb-3">
                                        <label for="filter_status"><?php echo $_smarty_tpl->tpl_vars['_L']->value['Status'];?>
</label>
                                        <input type="text" id="filter_status" name="filter_status" class="form-control">
                                    </div>








                                    <button type="submit" id="ib_filter" class="btn btn-primary"><?php echo $_smarty_tpl->tpl_vars['_L']->value['Filter'];?>
</button>

                                    <br>
                                </form>


                            </div>
                            <div class="col-md-9 col-sm-6 ib_right_panel">


                                <div class="table-responsive" id="ib_data_panel">


                                    <table class="table table-bordered table-hover display" id="ib_dt">
                                        <thead>
                                        <tr class="heading">
                                            <th><?php echo $_smarty_tpl->tpl_vars['_L']->value['ID'];?>
</th>
                                            <th><?php echo $_smarty_tpl->tpl_vars['_L']->value['Name'];?>
</th>
                                            <th><?php echo $_smarty_tpl->tpl_vars['_L']->value['Title'];?>
</th>
                                            <th><?php echo $_smarty_tpl->tpl_vars['_L']->value['Company'];?>
</th>

                                            <th><?php echo $_smarty_tpl->tpl_vars['_L']->value['Phone'];?>
</th>

                                            <th><?php echo $_smarty_tpl->tpl_vars['_L']->value['Email'];?>
</th>
                                            <th><?php echo $_smarty_tpl->tpl_vars['_L']->value['Status'];?>
</th>
                                            <th><?php echo $_smarty_tpl->tpl_vars['_L']->value['Owner'];?>
</th>

                                            <th><?php echo $_smarty_tpl->tpl_vars['_L']->value['Manage'];?>
</th>
                                        </tr>
                                        </thead>




                                    </table>
                                </div>

                            </div>
                        </div>



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

    </div>


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

    <?php echo '<script'; ?>
>
        $(function() {

            var _url = $("#_url").val();

            var $ib_data_panel = $("#ib_data_panel");

            $ib_data_panel.block({ message:block_msg });


            var $modal = $('#cloudonex_body');

            $('[data-bs-toggle="tooltip"]').tooltip();

            var ib_dt = $('#ib_dt').DataTable( {

                "serverSide": true,
                "ajax": {
                    "url": base_url + "leads/json_list/",
                    "type": "POST",
                    "data": function ( d ) {

                        d.first_name = $('#filter_first_name').val();
                        d.last_name = $('#filter_last_name').val();
                        d.middle_name = $('#filter_middle_name').val();
                        d.email = $('#filter_email').val();
                        d.salutation = $('#filter_salutation').val();
                        d.company = $('#filter_company').val();
                        d.phone = $('#filter_phone').val();
                        d.status = $('#filter_status').val();


                    }
                },
                "pageLength": 10,
                responsive: true,

                lengthMenu: [
                    [ 10, 25, 50, -1 ],
                    [ '10 rows', '25 rows', '50 rows', 'Show all' ]
                ],
                "columnDefs": [
                    { "orderable": false, "targets": 8 }
                ],
                "order": [[ 0, 'desc' ]],
                "scrollX": true,
                "initComplete": function () {
                    $ib_data_panel.unblock();
                },
                "language": {
                    "emptyTable": "<?php echo $_smarty_tpl->tpl_vars['_L']->value['No items to display'];?>
",
                    "info":      "<?php echo $_smarty_tpl->tpl_vars['_L']->value['Showing _START_ to _END_ of _TOTAL_ entries'];?>
",
                    "infoEmpty":      "<?php echo $_smarty_tpl->tpl_vars['_L']->value['Showing 0 to 0 of 0 entries'];?>
",
                    buttons: {
                        pageLength: '<?php echo $_smarty_tpl->tpl_vars['_L']->value['Show all'];?>
'
                    },
                    searchPlaceholder: "<?php echo __('Search');?>
"
                },
            } );

            var $ib_filter = $("#ib_filter");

            $('.add_item').on('click', function(e){

                e.preventDefault();

                $.fancybox.open({
                    src  :  base_url + 'leads/modal_lead/new/',
                    touch: false,
                    type : 'ajax',
                    opts : {
                        afterShow : function( instance, current ) {

                        }
                    },
                });

            });





            $modal.on('click', '.modal_submit', function(e){

                e.preventDefault();


                $.post( _url + "leads/post/", $("#ib_modal_form").serialize())
                    .done(function( data ) {

                        if ($.isNumeric(data)) {

                            // $ib_data_panel.block({ message:block_msg });
                            //
                            // ib_dt.ajax.reload(
                            //     function () {
                            //         $ib_data_panel.unblock();
                            //     }
                            // );
                            location.reload();

                        }

                        else {

                            toastr.error(data);
                        }

                    });

            });


            $modal.on('click', '.act_convert_to_customer', function(e){

                e.preventDefault();


                $.post( base_url + "leads/convert_to_customer/", { lid: $("#v_lid").val() })
                    .done(function( data ) {

                        if ($.isNumeric(data)) {

                            window.location = base_url + 'contacts/view/' + data;

                        }

                        else {

                            toastr.error(data);
                        }

                    });

            });

            $modal.on('click', '.act_memo_update', function(e){

                e.preventDefault();


                $.post( base_url + "leads/update_memo/", { lid: $("#v_lid").val(), memo:$("#v_memo").val() })
                    .done(function( data ) {

                        toastr.success(data);

                    });

            });





            $ib_filter.on('click', function(e) {
                e.preventDefault();

                $ib_data_panel.block({ message:block_msg });

                ib_dt.ajax.reload(
                    function () {
                        $ib_data_panel.unblock();
                    }
                );


            });


            $ib_data_panel.on('click', '.cdelete', function(e){
                e.preventDefault();
                var lid = this.id;
                app.confirm(_L['are_you_sure'], function(result) {
                    if(result){

                        $.get( base_url + "delete/lead/"+lid, function( data ) {
                            $ib_data_panel.block({ message:block_msg });

                            ib_dt.ajax.reload(
                                function () {
                                    $ib_data_panel.unblock();
                                }
                            );
                        });


                    }
                });

            });

            $ib_data_panel.on('click', '.cedit', function(e){
                e.preventDefault();
                var lid = this.id;

                $.fancybox.open({
                    src  :  base_url + 'leads/modal_lead/edit/'+lid,
                    type : 'ajax',
                    opts : {
                        afterShow : function( instance, current ) {

                        }
                    },
                });



            });

            $ib_data_panel.on('click', '.cview', function(e){

                e.preventDefault();
                var lid = this.id;

                $.fancybox.open({
                    src  :  base_url + 'leads/modal_lead/view/'+lid,
                    type : 'ajax',
                    opts : {
                        afterShow : function( instance, current ) {

                        }
                    },
                });


            });





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