<?php
/* Smarty version 3.1.33, created on 2019-08-15 12:50:21
  from 'D:\websites\uvocorp\templates\dashboard\users\customers.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_5d5538ed9b21e2_25080353',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'a4e9c728ce0363b1ee13b5eeffe3b2c539afe432' => 
    array (
      0 => 'D:\\websites\\uvocorp\\templates\\dashboard\\users\\customers.tpl',
      1 => 1562947149,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5d5538ed9b21e2_25080353 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_loadInheritance();
$_smarty_tpl->inheritance->init($_smarty_tpl, true);
?>
 

<?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_20364322375d5538ed890333_79096069', 'content_wrapper');
$_smarty_tpl->inheritance->endChild($_smarty_tpl, 'dashboard/layout.tpl');
}
/* {block 'content_wrapper'} */
class Block_20364322375d5538ed890333_79096069 extends Smarty_Internal_Block
{
public $subBlocks = array (
  'content_wrapper' => 
  array (
    0 => 'Block_20364322375d5538ed890333_79096069',
  ),
);
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
?>

    <div class="panel panel-default">
        <div class="panel-heading with-icon">
            <i class="fa fa-users pr5 panel-icon"></i>
            <?php if ($_smarty_tpl->tpl_vars['section']->value == '') {?>
                <div class="pull-right flip">
                    <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/users/customers/add" class="btn btn-primary">
                        <i class="fa fa-plus"></i> Add New Customer
                    </a>
                </div>
            <?php } elseif ($_smarty_tpl->tpl_vars['section']->value == "edit") {?>
                <div class="pull-right flip">
                    <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/orders/customer/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['id'], ENT_QUOTES, 'UTF-8');?>
" class="btn btn-primary">
                        <i class="fa fa-shopping-basket"></i> View Orders
                    </a>
                </div>
            <?php }?>

            <strong>Customers</strong>
            <?php if ($_smarty_tpl->tpl_vars['section']->value == '') {?>&rsaquo; <strong><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['total_customers']->value, ENT_QUOTES, 'UTF-8');?>
</strong><?php }?>
            <?php if ($_smarty_tpl->tpl_vars['section']->value == "edit") {?>&rsaquo; <strong>Edit</strong> &rsaquo; <strong><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['id'], ENT_QUOTES, 'UTF-8');?>
</strong><?php }?>
            <?php if ($_smarty_tpl->tpl_vars['section']->value == "add") {?>&rsaquo; <strong>Add</strong><?php }?>
        </div>

        <?php if ($_smarty_tpl->tpl_vars['section']->value == '') {?>

            <div class="panel-body">

                <div class="mb20">
                    <form method="GET" id="filter_form" autocomplete="off">
                        <div class="row mb10">
                            <div class="col-md-7">
                                <input class="form-control input-sm" type="text" name="query" placeholder="Search customer ID, name, email or site ID" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['query']->value, ENT_QUOTES, 'UTF-8');?>
"/>
                            </div>
                            <div class="col-md-2">
                                <button class="btn btn-primary btn-sm">Search</button>
                            </div>
                        </div>
                    </form>
                </div>

                <?php if (count($_smarty_tpl->tpl_vars['customers']->value)) {?>
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover js_dataTable">
                            <thead>
                                <tr>
                                    <td>ID</td>
                                    <td>Name</td>
                                    <td>Email</td>
                                    <td>Site</td>
                                    <td>Total spent</td>
                                    <td>Actions</td>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['customers']->value, 'customer');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['customer']->value) {
?>
                                    <tr>
                                        <td>
                                            <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/users/customers/edit/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['id'], ENT_QUOTES, 'UTF-8');?>
">#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['id'], ENT_QUOTES, 'UTF-8');?>
</a>
                                        </td>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['name'], ENT_QUOTES, 'UTF-8');?>
</td>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['email'], ENT_QUOTES, 'UTF-8');?>
</td>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['site_name'], ENT_QUOTES, 'UTF-8');?>
</td>
                                        <td><span class="text_success">$<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['total_spent'], ENT_QUOTES, 'UTF-8');?>
</span></td>
                                        <td>
                                            <button data-toggle="tooltip" data-placement="top" title="Delete" class="btn btn-xs btn-danger js_admin-deleter" data-handle="customer" data-id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                                <i class="fa fa-trash-alt"></i>
                                            </button>
                                            <a data-toggle="tooltip" data-placement="top" title="Edit" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/users/customers/edit/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['id'], ENT_QUOTES, 'UTF-8');?>
" class="btn btn-xs btn-primary">
                                                <i class="fa fa-pencil-alt"></i>
                                            </a>
                                        </td>
                                    </tr>
                                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                            </tbody>
                        </table>

                        <?php echo $_smarty_tpl->tpl_vars['pager']->value;?>

                    </div>
                <?php } else { ?>
                    <div class="text-center x-muted"> <i class="fa fa-users fa-4x"></i>
                        <p class="mb10"><strong>No customers to show</strong></p>
                    </div>
                <?php }?>
            </div>
        
        <?php } elseif ($_smarty_tpl->tpl_vars['section']->value == "add") {?>

            <div class="panel-body">
                <form class="js_ajax-forms col-md-9 form-horizontal" data-url="/users/customers?do=add">
                    <div class="form-group">
                        <label class="col-sm-3 control-label text-left">
                            Site
                        </label>
                        <div class="col-sm-9">
                            <select class="form-control" name="site_id" required>
                                <option value="-1">Select Site</option>
                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['sites']->value, 'site');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['site']->value) {
?>
                                <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['site']->value['site_id'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['site']->value['name'], ENT_QUOTES, 'UTF-8');?>
</option>
                                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label text-left">
                            Email
                        </label>
                        <div class="col-sm-9">  
                            <input class="form-control" type="text" name="email" required>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label text-left">
                            Password
                        </label>
                        <div class="col-sm-9">
                            <input class="form-control" type="text" name="password" required>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label text-left">
                            Name <small>(optional)</small>
                        </label>
                        <div class="col-sm-9">
                            <input class="form-control" type="text" name="name">
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-9 col-sm-offset-3">
                            <!-- success -->
                            <div class="alert alert-success mt10 x-hidden" role="alert"></div>
                            <!-- success -->

                            <!-- error -->
                            <div class="alert alert-danger mt10 x-hidden" role="alert"></div>
                            <!-- error -->

                            <button type="submit" class="btn btn-primary">Add Customer</button>
                        </div>
                    </div>

                </form>
            </div>

        <?php } elseif ($_smarty_tpl->tpl_vars['section']->value == "edit") {?>
        
            <div class="panel-body">
                <div class="row">
                    <div class="col-xs-12 col-sm-7 mb10">
                        <ul class="list-group">
                        
                            <li class="list-group-item"> 
                                <span class="badge"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['id'], ENT_QUOTES, 'UTF-8');?>
</span> Customer ID
                            </li>
                            <li class="list-group-item"> 
                                <span class="badge"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['google_analytics_id'], ENT_QUOTES, 'UTF-8');?>
</span> GA Id
                            </li>
                            <li class="list-group-item"> 
                                <span class="badge"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['site_name'], ENT_QUOTES, 'UTF-8');?>
</span> From site
                            </li>
                            <li class="list-group-item"> 
                                <span class="badge js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['reg_date'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['reg_date'], ENT_QUOTES, 'UTF-8');?>
</span> Joined
                            </li>
                            <li class="list-group-item"> 
                                <span class="badge js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['last_login'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['last_login'], ENT_QUOTES, 'UTF-8');?>
</span> Last Login
                            </li>
                        </ul>
                    </div>
                    <div class="col-xs-12 col-sm-5 mb10">
                        <ul class="list-group">
                            <li class="list-group-item"> 
                                <span class="badge">$<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['total_spent'], ENT_QUOTES, 'UTF-8');?>
</span> Total spent
                            </li>
                            <li class="list-group-item"> 
                                <span class="badge">$<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['affiliate_balance'], ENT_QUOTES, 'UTF-8');?>
</span> Affiliate Balance
                            </li>
                            <?php if ($_smarty_tpl->tpl_vars['customer']->value['referrer_id']) {?>
                                <li class="list-group-item"> 
                                    <a class="badge" href="/users/customers/edit/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['referrer_id'], ENT_QUOTES, 'UTF-8');?>
" target="_blank"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['referrer_id'], ENT_QUOTES, 'UTF-8');?>
</a> Referrer ID
                                </li>
                            <?php }?>
                            <li class="list-group-item"> 
                                <span class="badge"><?php if ($_smarty_tpl->tpl_vars['customer']->value['is_subscribed']) {?>Yes<?php } else { ?>No<?php }?></span> Subscribed
                            </li>
                            <li class="list-group-item"> 
                                <span class="badge js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['last_activity'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['last_activity'], ENT_QUOTES, 'UTF-8');?>
</span> Last Activity
                            </li>
                        </ul>
                    </div>
                </div>
                <form class="js_ajax-forms col-md-9 form-horizontal" data-url="/users/customers?do=edit">
                    <input type="hidden" name="customer_id" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['id'], ENT_QUOTES, 'UTF-8');?>
"/>
                    
                    <div class="form-group">
                        <label class="col-sm-3 control-label text-left">
                            Email
                        </label>
                        <div class="col-sm-9">  
                            <input class="form-control" type="text" name="email" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['email'], ENT_QUOTES, 'UTF-8');?>
" required>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label text-left">
                            Phone
                        </label>
                        <div class="col-sm-9">  
                            <input class="form-control" type="text" name="phone" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['phone'], ENT_QUOTES, 'UTF-8');?>
">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label text-left">
                            Name <small>(optional)</small>
                        </label>
                        <div class="col-sm-9">
                            <input class="form-control" type="text" name="name" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['name'], ENT_QUOTES, 'UTF-8');?>
">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label text-left">
                            Site
                        </label>
                        <div class="col-sm-9">
                            <select class="form-control" name="site_id" required>
                                <option value="-1">Select Site</option>
                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['sites']->value, 'site');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['site']->value) {
?>
                                    <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['site']->value['site_id'], ENT_QUOTES, 'UTF-8');?>
" <?php if ($_smarty_tpl->tpl_vars['customer']->value['site_id'] == $_smarty_tpl->tpl_vars['site']->value['site_id']) {?>selected=""<?php }?>><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['site']->value['name'], ENT_QUOTES, 'UTF-8');?>
</option>
                                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label text-left">
                            Total Spent
                        </label>
                        <div class="col-sm-9">
                            <input class="form-control force-integer" type="text" name="total_spent" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['total_spent'], ENT_QUOTES, 'UTF-8');?>
">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label text-left">
                            Password
                        </label>
                        <div class="col-sm-9">
                            <input class="form-control" type="text" name="password">
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-9 col-sm-offset-3">
                            <!-- success -->
                            <div class="alert alert-success mt10 x-hidden" role="alert"></div>
                            <!-- success -->

                            <!-- error -->
                            <div class="alert alert-danger mt10 x-hidden" role="alert"></div>
                            <!-- error -->

                            <button type="submit" class="btn btn-primary">Save Changes</button>
                            <button type="button" class="btn btn-info js_reset-password-link" data-id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['customer']->value['id'], ENT_QUOTES, 'UTF-8');?>
" data-handle="customer">Password reset link</button>
                        </div>
                    </div>

                </form>
            </div>
        <?php }?>
    </div>
<?php
}
}
/* {/block 'content_wrapper'} */
}
