コード例 #1
0
ファイル: recurring.php プロジェクト: sgh1986915/php-crm
<?php

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
if (!module_finance::can_i('view', 'Finance Upcoming')) {
    redirect_browser(_BASE_HREF);
}
if (isset($_REQUEST['finance_recurring_id']) && $_REQUEST['finance_recurring_id'] && isset($_REQUEST['record_new'])) {
    include module_theme::include_ucm(dirname(__FILE__) . '/finance_edit.php');
} else {
    if (isset($_REQUEST['finance_recurring_id']) && $_REQUEST['finance_recurring_id']) {
        //include("recurring_edit.php");
        include module_theme::include_ucm(dirname(__FILE__) . '/recurring_edit.php');
    } else {
        //include("recurring_list.php");
        include module_theme::include_ucm(dirname(__FILE__) . '/recurring_list.php');
    }
}
コード例 #2
0
    die('no perms');
}
$quote_id = (int) $_REQUEST['quote_id'];
$quote = module_quote::get_quote($quote_id);
// template for sending emails.
// are we sending the paid one? or the dueone.
//$template_name = 'quote_email';
$template_name = isset($_REQUEST['template_name']) ? $_REQUEST['template_name'] : 'quote_email';
$template = module_template::get_template_by_key($template_name);
$quote['total_amount_print'] = dollar($quote['total_amount'], true, $quote['currency_id']);
$quote['total_amount_due_print'] = dollar($quote['total_amount_due'], true, $quote['currency_id']);
$quote['quote_name'] = $quote['name'];
$quote['from_name'] = module_security::get_loggedin_name();
$quote['quote_url'] = module_quote::link_public($quote_id);
ob_start();
include module_theme::include_ucm('includes/plugin_quote/template/quote_task_list.php');
$public_html = ob_get_clean();
$quote['task_list'] = $public_html;
/*ob_start();
$quote_data = $quote;
$ignore_task_hook=true;
$for_email=true;
include('quote_public.php');
$quote['quote_tasks'] = ob_get_clean();*/
// generate the PDF ready for sending.
$pdf = module_quote::generate_pdf($quote_id);
// find available "to" recipients.
// customer contacts.
$to_select = false;
if ($quote['customer_id']) {
    $customer = module_customer::get_customer($quote['customer_id']);
コード例 #3
0
    ?>
" value="<?php 
    echo $search[$use_master_key];
    ?>
">
    <?php 
}
?>



    <?php 
$search_bar = array('elements' => array('name' => array('title' => _l('Contact Name, Email or Phone Number:'), 'field' => array('type' => 'text', 'name' => 'search[generic]', 'value' => isset($search['generic']) ? $search['generic'] : '', 'size' => 30))));
echo module_form::search_bar($search_bar);
/** START TABLE LAYOUT **/
$table_manager = module_theme::new_table_manager();
$columns = array();
$columns['name'] = array('title' => 'Name', 'callback' => function ($user) {
    echo module_user::link_open_contact($user['user_id'], true, $user);
    if ($user['is_primary'] == $user['user_id']) {
        echo ' *';
    }
}, 'cell_class' => 'row_action');
$columns['phone'] = array('title' => 'Phone Number', 'callback' => function ($user) {
    module_user::print_contact_summary($user['user_id'], 'html', array('phone|mobile'));
});
$columns['email'] = array('title' => 'Email Address', 'callback' => function ($user) {
    module_user::print_contact_summary($user['user_id'], 'html', array('email'));
});
if ($show_customer_details) {
    $columns['customer'] = array('title' => $contact_type_permission, 'callback' => function ($user) use($contact_module_name) {
コード例 #4
0
ファイル: config.php プロジェクト: sgh1986915/php-crm
 public static function js_combine($version, $reinit = false)
 {
     // combine and cache the js files into a single file.
     foreach (self::$js_files as $hash => $js_file_info) {
         if (strlen($js_file_info[2]) < 3) {
             $js_file = 'includes/plugin_' . basename($js_file_info[0]) . '/js/' . basename($js_file_info[1]);
             // see if we have an override.
             self::$js_files[$hash]['file_to_load'] = module_theme::include_ucm($js_file);
         }
     }
     $cache_name = 'cache-' . md5(serialize(self::$js_files) . $version) . '.js';
     $cache_file = _UCM_FOLDER . 'temp/' . $cache_name;
     if (is_file($cache_file) && filesize($cache_file) > 10 && module_config::c('js_cached_version', $version) == $version) {
         // it's already combined, print this one out and discard the rest.
         self::register_js(false, false, _BASE_HREF . 'temp/' . $cache_name);
         foreach (self::$js_files as $hash => $js_file_info) {
             if (strlen($js_file_info[2]) < 3) {
                 // this file is already cached in the above cache file.
                 unset(self::$js_files[$hash]);
             }
         }
     } else {
         if (!$reinit) {
             // time to generate a new cache file based on these js files.
             $js_content = '';
             foreach (self::$js_files as $hash => $js_file_info) {
                 if (isset($js_file_info['file_to_load']) && $js_file_info['file_to_load']) {
                     if (is_file($js_file_info['file_to_load'])) {
                         $js_content .= "\n";
                         $js_content .= " // " . $js_file_info['file_to_load'] . "\n\n";
                         $js_content .= file_get_contents($js_file_info['file_to_load']);
                         $js_content .= "\n";
                     }
                 }
             }
             if (strlen($js_content) > 10) {
                 file_put_contents($cache_file, $js_content);
                 module_config::save_config('js_cached_version', $version);
             }
             self::js_combine($version, true);
             // load the cache file again now that it has been generated.
         }
     }
 }
コード例 #5
0
    $invoice['deposit_job_id'] = (int) $_REQUEST['job_id'];
}
$discounts_allowed = !(isset($invoice['deposit_job_id']) && $invoice['deposit_job_id'] > 0);
$customer_data = array();
if ($invoice['customer_id']) {
    $customer_data = module_customer::get_customer($invoice['customer_id']);
}
$show_task_dates = module_config::c('invoice_task_list_show_date', 1);
$colspan = 2;
if ($show_task_dates) {
    $colspan++;
}
if (isset($invoice['credit_note_id']) && $invoice['credit_note_id']) {
    // this invoice is a credit note.
    // display a slightly different layout.
    include module_theme::include_ucm("includes/plugin_invoice/pages/invoice_admin_credit.php");
    return;
}
// find out all the payment methods.
$payment_methods = handle_hook('get_payment_methods', $module);
$x = 1;
$default_payment_method = module_config::c('invoice_default_payment_method', 'paymethod_paypal');
?>


<script type="text/javascript">
    $(function(){
        if(typeof ucm.invoice != 'undefined'){
            ucm.invoice.init();
        }
    });
コード例 #6
0
ファイル: design_header.php プロジェクト: sgh1986915/php-crm
</div>
			</div>
		<?php 
            }
            ?>


	</div>

	<div id="main_menu">
        <?php 
            $menu_include_parent = false;
            $show_quick_search = true;
            if (is_file('design_menu.php')) {
                //include("design_menu.php");
                include module_theme::include_ucm("design_menu.php");
            }
            ?>

	</div>

	<div id="page_middle">
    <?php 
        }
        ?>


		<div class="content">

                
        <?php 
コード例 #7
0
ファイル: invoice.php プロジェクト: sgh1986915/php-crm
 public static function invoice_html($invoice_id, $invoice_data, $mode = 'html')
 {
     if ($invoice_id && $invoice_data) {
         // spit out the invoice html into a file, then pass it to the pdf converter
         // to convert it into a PDF.
         ob_start();
         include module_theme::include_ucm('includes/plugin_invoice/template/invoice_print.php');
         module_template::init_template('invoice_print', ob_get_clean(), 'Used for printing out an invoice for the customer.', 'html');
         ob_start();
         include module_theme::include_ucm('includes/plugin_invoice/template/invoice_print_basic.php');
         module_template::init_template('invoice_print_basic', ob_get_clean(), 'Alternative template for printing out an invoice for the customer.', 'html');
         ob_start();
         include module_theme::include_ucm('includes/plugin_invoice/template/credit_note_pdf.php');
         module_template::init_template('credit_note_pdf', ob_get_clean(), 'Used for printing out a a credit note for the customer.', 'html');
         $invoice = $invoice_data;
         if (class_exists('module_company', false) && isset($invoice_data['company_id']) && (int) $invoice_data['company_id'] > 0) {
             module_company::set_current_company_id($invoice_data['company_id']);
         }
         $job_data = module_job::get_job(current($invoice_data['job_ids']));
         $website_data = $job_data['website_id'] ? module_website::get_website($job_data['website_id']) : array();
         $website_data = array_merge($website_data, isset($invoice_data['website_id']) && $invoice_data['website_id'] ? module_website::get_website($invoice_data['website_id']) : array());
         $invoice_template = isset($invoice_data['invoice_template_print']) && strlen($invoice_data['invoice_template_print']) ? $invoice_data['invoice_template_print'] : module_config::c('invoice_template_print_default', 'invoice_print');
         $invoice_template_suffix = '';
         if ($invoice_template != 'invoice_print') {
             $invoice_template_suffix = str_replace('invoice_print', '', $invoice_template);
         }
         ob_start();
         include module_theme::include_ucm('includes/plugin_invoice/template/invoice_task_list.php');
         $task_list_html = ob_get_clean();
         ob_start();
         include module_theme::include_ucm('includes/plugin_invoice/template/invoice_payment_history.php');
         $payment_history = ob_get_clean();
         ob_start();
         include module_theme::include_ucm('includes/plugin_invoice/template/invoice_payment_methods.php');
         $payment_methods = ob_get_clean();
         $replace = self::get_replace_fields($invoice_id, $invoice_data);
         $replace['payment_history'] = $payment_history;
         $replace['payment_methods'] = $payment_methods;
         $replace['task_list'] = $task_list_html;
         $replace['external_invoice_template_html'] = '';
         //$external_invoice_template = module_template::get_template_by_key('external_invoice');
         $external_invoice_template = false;
         if (isset($invoice_template_suffix) && strlen($invoice_template_suffix) > 0) {
             $external_invoice_template = module_template::get_template_by_key('external_invoice' . $invoice_template_suffix);
             if (!$external_invoice_template->template_id) {
                 $external_invoice_template = false;
             }
         }
         if (!$external_invoice_template) {
             $external_invoice_template = module_template::get_template_by_key('external_invoice');
         }
         $external_invoice_template->assign_values($replace);
         $replace['external_invoice_template_html'] = $external_invoice_template->replace_content();
         if (isset($invoice_data['credit_note_id']) && $invoice_data['credit_note_id']) {
             if ($invoice_data['invoice_template_print']) {
                 $invoice_data['invoice_template_print'] = 'credit_note_pdf';
             }
             $invoice_template = 'credit_note_pdf';
         }
         ob_start();
         $template = module_template::get_template_by_key($invoice_template);
         if (!$template || $template->template_key != $invoice_template) {
             echo "Invoice template {$invoice_template} not found";
         } else {
             $template->assign_values($replace);
             echo $template->render('html');
         }
         $invoice_html = ob_get_clean();
         return $invoice_html;
     }
     return false;
 }
コード例 #8
0
ファイル: theme_adminlte.php プロジェクト: sgh1986915/php-crm
 public static function hook_get_table_manager()
 {
     require_once module_theme::include_ucm('includes/plugin_theme_adminlte/class.table_manager.php');
     return new ucm_adminlte_table_manager();
 }
コード例 #9
0
ファイル: quote_admin.php プロジェクト: sgh1986915/php-crm
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
$quote_safe = true;
// stop including files directly.
if (!module_quote::can_i('view', 'Quotes')) {
    echo 'permission denied';
    return;
}
if (isset($_REQUEST['quote_id'])) {
    if (isset($_REQUEST['email_staff'])) {
        include module_theme::include_ucm("includes/plugin_quote/pages/quote_admin_email_staff.php");
    } else {
        if (isset($_REQUEST['email'])) {
            include module_theme::include_ucm("includes/plugin_quote/pages/quote_admin_email.php");
        } else {
            if ((int) $_REQUEST['quote_id'] > 0) {
                include module_theme::include_ucm("includes/plugin_quote/pages/quote_admin_edit.php");
                //include("quote_admin_edit.php");
            } else {
                include module_theme::include_ucm("includes/plugin_quote/pages/quote_admin_create.php");
                //include("quote_admin_create.php");
            }
        }
    }
} else {
    include module_theme::include_ucm("includes/plugin_quote/pages/quote_admin_list.php");
    //include("quote_admin_list.php");
}
コード例 #10
0
            function customer_admin_email_generate_invoice_list($invoices, $customer_id)
            {
                ob_start();
                $colspan = 9;
                $colspan2 = 0;
                $invoice_total = array();
                $invoice_total_due = array();
                foreach ($invoices as $invoice) {
                    if (!isset($invoice_total[$invoice['currency_id']])) {
                        $invoice_total[$invoice['currency_id']] = 0;
                    }
                    if ($invoice['c_total_amount'] == 0) {
                        $invoice = module_invoice::get_invoice($invoice['invoice_id']);
                    }
                    $invoice_total[$invoice['currency_id']] += $invoice['c_total_amount'];
                    if (!isset($invoice_total_due[$invoice['currency_id']])) {
                        $invoice_total_due[$invoice['currency_id']] = 0;
                    }
                    $invoice_total_due[$invoice['currency_id']] += $invoice['c_total_amount_due'];
                }
                $table_manager = module_theme::new_table_manager();
                $columns = array();
                $columns['invoice_number'] = array('title' => 'Invoice Number', 'callback' => function ($invoice) {
                    //echo module_invoice::link_open($invoice['invoice_id'],true,$invoice);
                    echo '<a href="' . module_invoice::link_public($invoice['invoice_id']) . '">' . htmlspecialchars($invoice['name']) . '</a>';
                }, 'cell_class' => 'row_action');
                $columns['invoice_status'] = array('title' => 'Status', 'callback' => function ($invoice) {
                    echo htmlspecialchars($invoice['status']);
                });
                $columns['invoice_create_date'] = array('title' => 'Create Date', 'callback' => function ($invoice) {
                    if (!$invoice['date_create'] || $invoice['date_create'] == '0000-00-00') {
                        //echo print_date($invoice['date_created']);
                    } else {
                        echo print_date($invoice['date_create']);
                    }
                });
                $columns['invoice_due_date'] = array('title' => 'Due Date', 'callback' => function ($invoice) {
                    if ((!$invoice['date_paid'] || $invoice['date_paid'] == '0000-00-00') && strtotime($invoice['date_due']) < time()) {
                        echo '<span class="error_text">';
                        echo print_date($invoice['date_due']);
                        echo '</span>';
                    } else {
                        echo print_date($invoice['date_due']);
                    }
                });
                $columns['invoice_sent_date'] = array('title' => 'Sent Date', 'callback' => function ($invoice) {
                    if ($invoice['date_sent'] && $invoice['date_sent'] != '0000-00-00') {
                        ?>

				            <?php 
                        echo print_date($invoice['date_sent']);
                        ?>

				        <?php 
                    } else {
                        ?>

				            <span class="error_text"><?php 
                        _e('Not sent');
                        ?>
</span>
				        <?php 
                    }
                });
                $columns['invoice_paid_date'] = array('title' => 'Paid Date', 'callback' => function ($invoice) {
                    if ($invoice['date_paid'] && $invoice['date_paid'] != '0000-00-00') {
                        ?>

				            <?php 
                        echo print_date($invoice['date_paid']);
                        ?>

				        <?php 
                    } else {
                        if ($invoice['date_cancel'] && $invoice['date_cancel'] != '0000-00-00') {
                            ?>

				            <span class="error_text"><?php 
                            _e('Cancelled');
                            ?>
</span>
				        <?php 
                        } else {
                            if ($invoice['overdue']) {
                                ?>

				            <span class="error_text" style="font-weight: bold; text-decoration: underline;"><?php 
                                _e('Overdue');
                                ?>
</span>
				        <?php 
                            } else {
                                ?>

				            <span class="error_text"><?php 
                                _e('Not paid');
                                ?>
</span>
				        <?php 
                            }
                        }
                    }
                });
                if (class_exists('module_website', false) && module_website::is_plugin_enabled() && module_website::can_i('view', module_config::c('project_name_plural', 'Websites'))) {
                    $colspan++;
                    $columns['invoice_website'] = array('title' => module_config::c('project_name_single', 'Website'), 'callback' => function ($invoice) {
                        if (isset($invoice['website_ids'])) {
                            foreach ($invoice['website_ids'] as $website_id) {
                                if ((int) $website_id > 0) {
                                    echo module_website::link_open($website_id, true);
                                    echo '<br/>';
                                }
                            }
                        }
                    });
                }
                $columns['invoice_job'] = array('title' => 'Job', 'callback' => function ($invoice) {
                    foreach ($invoice['job_ids'] as $job_id) {
                        if ((int) $job_id > 0) {
                            //echo module_job::link_open($job_id,true);
                            $job_data = module_job::get_job($job_id);
                            echo '<a href="' . module_job::link_public($job_id) . '">' . htmlspecialchars($job_data['name']) . '</a>';
                            if ($job_data['date_start'] && $job_data['date_start'] != '0000-00-00' && $job_data['date_renew'] && $job_data['date_renew'] != '0000-00-00') {
                                _e(' (%s to %s)', print_date($job_data['date_start']), print_date(strtotime("-1 day", strtotime($job_data['date_renew']))));
                            }
                            echo "<br/>\n";
                        }
                    }
                    hook_handle_callback('invoice_admin_list_job', $invoice['invoice_id']);
                });
                if (!isset($_REQUEST['customer_id']) && module_customer::can_i('view', 'Customers')) {
                    $colspan++;
                    $columns['invoice_customer'] = array('title' => 'Customer', 'callback' => function ($invoice) {
                        echo module_customer::link_open($invoice['customer_id'], true);
                    });
                }
                $columns['c_invoice_total'] = array('title' => 'Invoice Total', 'callback' => function ($invoice) {
                    echo dollar($invoice['total_amount'], true, $invoice['currency_id']);
                });
                $columns['c_invoice_total_due'] = array('title' => 'Amount Due', 'callback' => function ($invoice) {
                    echo dollar($invoice['total_amount_due'], true, $invoice['currency_id']);
                    ?>

				        <?php 
                    if ($invoice['total_amount_credit'] > 0) {
                        ?>

				        <span class="success_text"><?php 
                        echo _l('Credit: %s', dollar($invoice['total_amount_credit'], true, $invoice['currency_id']));
                        ?>
</span>
				            <?php 
                    }
                });
                if (class_exists('module_extra', false)) {
                    ob_start();
                    $colspan2 += module_extra::print_table_header('invoice');
                    // used in the footer calc.
                    ob_end_clean();
                    $table_manager->display_extra('invoice', function ($invoice) {
                        module_extra::print_table_data('invoice', $invoice['invoice_id']);
                    });
                }
                $table_manager->set_columns($columns);
                $table_manager->row_callback = function ($row_data) {
                    // load the full vendor data before displaying each row so we have access to more details
                    if (isset($row_data['invoice_id']) && (int) $row_data['invoice_id'] > 0) {
                        return module_invoice::get_invoice($row_data['invoice_id']);
                    }
                    return array();
                };
                $table_manager->set_rows($invoices);
                if (module_config::c('invoice_list_show_totals', 1)) {
                    $footer_rows = array();
                    foreach ($invoice_total + $invoice_total_due as $currency_id => $foo) {
                        $currency = get_single('currency', 'currency_id', $currency_id);
                        $footer_rows[] = array('invoice_number' => array('data' => '<strong>' . _l('%s Totals:', $currency && isset($currency['code']) ? $currency['code'] : '') . '</strong>', 'cell_colspan' => $colspan - 2, 'cell_class' => 'text-right'), 'c_invoice_total' => array('data' => '<strong>' . dollar(isset($invoice_total[$currency_id]) ? $invoice_total[$currency_id] : 0, true, $currency_id) . '</strong>'), 'c_invoice_total_due' => array('data' => '<strong>' . dollar(isset($invoice_total_due[$currency_id]) ? $invoice_total_due[$currency_id] : 0, true, $currency_id) . '</strong>'), 'row_bulk_action' => array('data' => ' ', 'cell_colspan' => $colspan2));
                    }
                    $table_manager->set_footer_rows($footer_rows);
                }
                $table_manager->pagination = false;
                $table_manager->print_table();
                return ob_get_clean();
            }
コード例 #11
0
ファイル: functions.php プロジェクト: sgh1986915/php-crm
function adminlte_generate_fieldset($callback, $options)
{
    $defaults = array('id' => false, 'type' => 'table', 'title' => false, 'title_type' => 'h3', 'heading' => false, 'row_title_class' => 'width1', 'row_data_class' => '', 'elements' => array(), 'class' => 'tableclass tableclass_form', 'extra_settings' => array(), 'elements_before' => '', 'elements_after' => '');
    $options = array_merge($defaults, $options);
    if (function_exists('hook_filter_var')) {
        $options = hook_filter_var('generate_fieldset_options', $options);
    }
    ob_start();
    ?>

    <div class="box <?php 
    echo module_theme::get_config('adminlte_boxstyle', 'box-solid');
    echo isset($options['heading']['responsive']) ? ' box-responsive' : '';
    ?>
">
        <div class="box-header">
            <?php 
    if ($options['heading']) {
        if (!isset($options['heading']['type']) || $options['heading']['type'] != 'h3') {
            $options['heading']['type'] = 'h3';
        }
        $options['heading']['class'] = 'box-title';
        print_heading($options['heading']);
    } else {
        if ($options['title']) {
            ?>
                <<?php 
            echo $options['title_type'];
            ?>
 class="box-title"><?php 
            _e($options['title']);
            ?>
</<?php 
            echo $options['title_type'];
            ?>
>
            <?php 
        }
    }
    ?>
        </div>
        <!-- .block -->
        <div class="box-body">
            <?php 
    echo $options['elements_before'];
    ?>
            <?php 
    if ($options['elements']) {
        if (module_theme::get_config('adminlte_formstyle', 'table') == 'table') {
            ?>
                    <table class="<?php 
            echo $options['class'];
            ?>
">
                        <tbody>
                        <?php 
            foreach ($options['elements'] as $element) {
                if (isset($element['ignore']) && $element['ignore']) {
                    continue;
                }
                if (isset($element['field']) && !isset($element['fields'])) {
                    $element['fields'] = array($element['field']);
                    unset($element['field']);
                }
                ?>
                            <tr>
                                <?php 
                if (isset($element['message']) && $element['message'] || isset($element['warning']) && isset($element['warning'])) {
                    ?>
                                    <th colspan="2" class="text-center">
                                        <?php 
                    if (isset($element['message'])) {
                        ?>
                                            <?php 
                        echo $element['message'];
                        ?>
                                        <?php 
                    } else {
                        if (isset($element['warning'])) {
                            ?>
                                            <span class="error_text"><?php 
                            echo $element['warning'];
                            ?>
</span>
                                        <?php 
                        }
                    }
                    ?>
                                    </th>
                                <?php 
                } else {
                    ?>
                                    <th class="<?php 
                    echo isset($element['row_title_class']) ? $element['row_title_class'] : $options['row_title_class'];
                    ?>
">
                                        <?php 
                    if (isset($element['title'])) {
                        ?>
                                            <?php 
                        echo htmlspecialchars(_l($element['title']));
                        ?>
                                        <?php 
                    }
                    ?>
                                    </th>
                                    <td class="<?php 
                    echo isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class'];
                    ?>
">
                                    <?php 
                    if (isset($element['fields'])) {
                        ?>
                                        <?php 
                        if (is_array($element['fields'])) {
                            foreach ($element['fields'] as $dataid => $field) {
                                if (is_array($field)) {
                                    // treat this as a call to the form generate option
                                    module_form::generate_form_element($field);
                                    echo ' ';
                                } else {
                                    if (is_closure($field)) {
                                        $field();
                                    } else {
                                        echo $field . ' ';
                                    }
                                }
                            }
                        } else {
                            echo $element['fields'];
                        }
                        ?>
                                    <?php 
                    }
                    // fields
                    ?>
                                    </td> <!-- /.input-group -->
                                <?php 
                }
                //else
                ?>
                            </tr> <!-- /.form-group -->
                        <?php 
            }
            if (class_exists('module_extra') && module_extra::is_plugin_enabled() && $options['extra_settings']) {
                module_extra::display_extras($options['extra_settings']);
            }
            ?>
                        </tbody>
                        </table> <!-- /.elements -->
                    <?php 
            // end table layout
        } else {
            if (module_theme::get_config('adminlte_formstyle', 'table') == 'div') {
                ?>
                    <div class="<?php 
                echo $options['class'];
                ?>
">
                        <?php 
                foreach ($options['elements'] as $element) {
                    if (isset($element['ignore']) && $element['ignore']) {
                        continue;
                    }
                    if (isset($element['field']) && !isset($element['fields'])) {
                        $element['fields'] = array($element['field']);
                        unset($element['field']);
                    }
                    ?>
                            <div class="form-group">
                                <?php 
                    if (isset($element['message']) && $element['message'] || isset($element['warning']) && isset($element['warning'])) {
                        ?>
                                    <div class="text-center">
                                        <?php 
                        if (isset($element['message'])) {
                            ?>
                                            <?php 
                            echo $element['message'];
                            ?>
                                        <?php 
                        } else {
                            if (isset($element['warning'])) {
                                ?>
                                            <span class="error_text"><?php 
                                echo $element['warning'];
                                ?>
</span>
                                        <?php 
                            }
                        }
                        ?>
                                    </div>
                                <?php 
                    } else {
                        ?>
                                    <div class="input-group<?php 
                        echo !isset($element['title']) ? '-notitle' : '';
                        ?>
">
                                    <?php 
                        if (isset($element['title'])) {
                            ?>
                                        <span class="input-group-addon table-row-title"><span class="<?php 
                            echo isset($element['row_title_class']) ? $element['row_title_class'] : $options['row_title_class'];
                            ?>
"><?php 
                            echo htmlspecialchars(_l($element['title']));
                            ?>
</span></span>
                                    <?php 
                        }
                        if (isset($element['fields'])) {
                            ?>

                                        <?php 
                            if (is_array($element['fields'])) {
                                // if there is only one element we put it up in the form-control so that it displays nicely.
                                // if there are more than one elements we wrap them in a div form-control.
                                $do_wrap = true;
                                if (count($element['fields']) == 1) {
                                    $field = current($element['fields']);
                                    if (is_array($field) && $field['type'] != 'wysiwyg' && $field['type'] != 'check' && $field['type'] != 'checkbox') {
                                        $do_wrap = false;
                                        $currency = false;
                                        if ($field['type'] == 'currency') {
                                            $field['type'] = 'text';
                                            $currency = true;
                                            //$field['class'] = (isset($field['class']) ? $field['class'] : '') .' currency ';
                                        }
                                        $field['class'] = (isset($field['class']) ? $field['class'] : '') . ' form-control ' . (isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class']);
                                        $help_text = false;
                                        if (isset($field['help'])) {
                                            // we put the help element outside in its own <span class="input-group-addon"></span>
                                            // don't let the generatE_form_element produce it.
                                            $help_text = $field['help'];
                                            unset($field['help']);
                                        }
                                        module_form::generate_form_element($field);
                                        if ($currency) {
                                            ?>
		                                                <span class="input-group-addon"><?php 
                                            echo currency('', true, isset($field['currency_id']) ? $field['currency_id'] : false);
                                            ?>
</span>
		                                                <?php 
                                        }
                                        if ($help_text) {
                                            ?>
		                                                <span class="input-group-addon"><?php 
                                            _h($help_text);
                                            ?>
</span>
		                                                <?php 
                                        }
                                    }
                                }
                                if ($do_wrap) {
                                    ?>
 <div class="form-control<?php 
                                    echo !isset($element['title']) ? '-notitle' : '';
                                    ?>
 <?php 
                                    echo isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class'];
                                    ?>
"> <?php 
                                    $help_text = false;
                                    foreach ($element['fields'] as $dataid => $field) {
                                        if (is_array($field) && isset($field['help'])) {
                                            // this element has a help text.
                                            if ($help_text) {
                                                // already a help text (shouldn't happen, ditch it.. and display multiple as normal)
                                                $help_text = false;
                                                break;
                                            } else {
                                                $help_text = $field['help'];
                                            }
                                        }
                                    }
                                    foreach ($element['fields'] as $dataid => $field) {
                                        if (is_array($field)) {
                                            if (isset($field['help']) && $help_text) {
                                                unset($field['help']);
                                            }
                                            // treat this as a call to the form generate option
                                            module_form::generate_form_element($field);
                                            echo ' ';
                                        } else {
                                            if (is_closure($field)) {
                                                $field();
                                            } else {
                                                echo $field . ' ';
                                            }
                                        }
                                    }
                                    ?>
 </div> <?php 
                                    if ($help_text) {
                                        ?>
	                                                <span class="input-group-addon"><?php 
                                        _h($help_text);
                                        ?>
</span>
	                                                <?php 
                                    }
                                }
                            } else {
                                ?>
 <div class="form-control <?php 
                                echo isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class'];
                                ?>
"> <?php 
                                echo $element['fields'];
                                ?>
 </div> <?php 
                            }
                            ?>
                                    <?php 
                        }
                        // fields
                        ?>
                                    </div> <!-- /.input-group -->
                                <?php 
                    }
                    //else
                    ?>
                            </div> <!-- /.form-group -->
                        <?php 
                }
                if (class_exists('module_extra') && module_extra::is_plugin_enabled() && $options['extra_settings']) {
                    module_extra::display_extras($options['extra_settings']);
                }
                ?>
                        </div> <!-- /.elements -->
                    <?php 
            } else {
                if (module_theme::get_config('adminlte_formstyle', 'table') == 'long') {
                    ?>
                    <div class="<?php 
                    echo $options['class'];
                    ?>
">
                        <?php 
                    foreach ($options['elements'] as $element) {
                        if (isset($element['ignore']) && $element['ignore']) {
                            continue;
                        }
                        if (isset($element['field']) && !isset($element['fields'])) {
                            $element['fields'] = array($element['field']);
                            unset($element['field']);
                        }
                        ?>
                            <div class="form-group form-group-long">
                                <?php 
                        if (isset($element['message']) && $element['message'] || isset($element['warning']) && isset($element['warning'])) {
                            ?>
                                    <div class="text-center">
                                        <?php 
                            if (isset($element['message'])) {
                                ?>
                                            <?php 
                                echo $element['message'];
                                ?>
                                        <?php 
                            } else {
                                if (isset($element['warning'])) {
                                    ?>
                                            <span class="error_text"><?php 
                                    echo $element['warning'];
                                    ?>
</span>
                                        <?php 
                                }
                            }
                            ?>
                                    </div>
                                <?php 
                        } else {
                            ?>

                                    <?php 
                            if (isset($element['title'])) {
                                ?>
                                        <label class="<?php 
                                echo isset($element['row_title_class']) ? $element['row_title_class'] : $options['row_title_class'];
                                ?>
"><?php 
                                echo htmlspecialchars(_l($element['title']));
                                ?>
</label>
                                    <?php 
                            }
                            if (isset($element['fields'])) {
                                ?>

                                        <?php 
                                if (is_array($element['fields'])) {
                                    foreach ($element['fields'] as $dataid => $field) {
                                        if (is_array($field)) {
                                            // treat this as a call to the form generate option
                                            $field['class'] = (isset($field['class']) ? $field['class'] : '') . ' ' . (isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class']);
                                            switch ($field['type']) {
                                                case 'check':
                                                case 'checkbox':
                                                case 'wysiwyg':
                                                    break;
                                                default:
                                                    $field['class'] .= ' form-control ';
                                            }
                                            module_form::generate_form_element($field);
                                            echo ' ';
                                        } else {
                                            if (is_closure($field)) {
                                                $field();
                                            } else {
                                                echo $field . ' ';
                                            }
                                        }
                                    }
                                } else {
                                    ?>
 <div class="form-control <?php 
                                    echo isset($element['row_data_class']) ? $element['row_data_class'] : $options['row_data_class'];
                                    ?>
"> <?php 
                                    echo $element['fields'];
                                    ?>
 </div> <?php 
                                }
                                ?>
                                    <?php 
                            }
                            // fields
                            ?>
                                <?php 
                        }
                        //else
                        ?>
                            </div> <!-- /.form-group -->
                        <?php 
                    }
                    if (class_exists('module_extra') && module_extra::is_plugin_enabled() && $options['extra_settings']) {
                        module_extra::display_extras($options['extra_settings']);
                    }
                    ?>
                        </div> <!-- /.elements -->
                    <?php 
                }
            }
        }
        // end div layout
    }
    echo $options['elements_after'];
    ?>
        <!-- /.block -->
        </div>
    </div>


    <?php 
    return ob_get_clean();
}
コード例 #12
0
ファイル: init.php プロジェクト: sgh1986915/php-crm
<?php

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca, 0a3014a3-2b8f-460b-8850-d6025aa845f8
 * Package Date: 2015-11-25 03:08:08 
 * IP Address: 67.79.165.254
 */
if (!isset($_REQUEST['display_mode']) || isset($_REQUEST['display_mode']) && $_REQUEST['display_mode'] != 'iframe' && $_REQUEST['display_mode'] != 'ajax') {
    $_REQUEST['display_mode'] = 'adminlte';
}
require_once module_theme::include_ucm('includes/plugin_theme_adminlte/functions.php');
module_config::register_css('theme', 'bootstrap.min.css', full_link('/includes/plugin_theme_adminlte/css/bootstrap.min.css'), 11);
module_config::register_css('theme', 'font-awesome.min.css', full_link('/includes/plugin_theme_adminlte/css/font-awesome.min.css'), 11);
module_config::register_css('theme', 'jquery.ui.min.css', full_link('/includes/plugin_theme_adminlte/css/jquery-ui-1.10.3.custom.css'), 5);
//module_config::register_css('theme','jquery.ui.structure.min.css',full_link('/includes/plugin_theme_adminlte/css/jquery-ui.structure.min.css'),6);
//module_config::register_css('theme','jquery.ui.theme.min.css',full_link('/includes/plugin_theme_adminlte/css/jquery-ui.theme.min.css'),7);
module_config::register_css('theme', 'AdminLTE.css', full_link('/includes/plugin_theme_adminlte/css/AdminLTE.css'), 12);
if (isset($_SERVER['REQUEST_URI']) && (strpos($_SERVER['REQUEST_URI'], _EXTERNAL_TUNNEL) || strpos($_SERVER['REQUEST_URI'], _EXTERNAL_TUNNEL_REWRITE))) {
    module_config::register_css('theme', 'external.css', full_link('/includes/plugin_theme_adminlte/css/external.css'), 100);
}
module_config::register_js('theme', 'jquery.min.js', full_link('/includes/plugin_theme_adminlte/js/jquery.min.js'), 1);
module_config::register_js('theme', 'jquery-ui.min.js', full_link('/includes/plugin_theme_adminlte/js/jquery-ui-1.10.3.custom.min.js'), 2);
module_config::register_js('theme', 'cookie.js', full_link('/js/cookie.js'), 3);
module_config::register_js('theme', 'javascript.js', full_link('/js/javascript.js'), 4);
module_config::register_js('theme', 'bootstrap.min.js', full_link('/includes/plugin_theme_adminlte/js/bootstrap.min.js'), 6);
module_config::register_js('theme', 'app.js', full_link('/includes/plugin_theme_adminlte/js/AdminLTE/app.js'));
module_config::register_js('theme', 'adminlte.js', full_link('/includes/plugin_theme_adminlte/js/adminlte.js'));
コード例 #13
0
ファイル: init.php プロジェクト: sgh1986915/php-crm
<?php

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
//module_config::register_css('theme','metis_style.css',full_link('/includes/plugin_theme/themes/metis/css/metis_style.css'));
if (!isset($_REQUEST['display_mode']) || isset($_REQUEST['display_mode']) && $_REQUEST['display_mode'] != 'iframe' && $_REQUEST['display_mode'] != 'ajax') {
    $_REQUEST['display_mode'] = 'metis';
}
require_once module_theme::include_ucm('includes/plugin_theme/themes/metis/metis_functions.php');
/**
* <link rel="stylesheet" href="assets/lib/bootstrap/css/bootstrap.css">
   <link rel="stylesheet" href="assets/css/main.css"/>
   <link rel="stylesheet" href="assets/lib/Font-Awesome/css/font-awesome.css"/>

   <link rel="stylesheet" href="assets/css/theme.css">
<script src="assets/lib/modernizr-build.min.js"></script>
*
* <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
   <script>window.jQuery || document.write('<script src="assets/lib/jquery.min.js"><\/script>')</script>
   <script src="assets/lib/bootstrap/js/bootstrap.js"></script>
   <script type="text/javascript" src="assets/js/style-switcher.js"></script>
   <script src="assets/js/main.js"></script>
*/
module_config::register_css('theme', 'bootstrap.css', full_link('/includes/plugin_theme/themes/metis/lib/bootstrap/css/bootstrap.min.css'), 5);
コード例 #14
0
    public function print_table()
    {
        $this->process_data();
        $colspan = 0;
        if (!$this->inline_table) {
            ?>
        <div class="box <?php 
            echo module_theme::get_config('adminlte_boxstyle', 'box-solid');
            ?>
">
            <?php 
            /*if($this->pagination){
                        ?>
                        <div class="box-header clearfix">
                            <div class="row"><div class="col-xs-6">
            
                            </div><div class="col-xs-6 text-right">
                            <?php  echo $this->rows['summary']; ?>
                            </div></div>
                        </div>
                        <?php
                        }*/
            ?>
        <div class="box-body table-responsive <?php 
            echo module_theme::get_config('adminlte_tablefullwidth', 1) ? 'no-padding' : '';
            ?>
">
            <?php 
        }
        ?>
            <table class="<?php 
        echo $this->table_class;
        echo module_theme::get_config('adminlte_tablestripe', '1') ? ' table-striped' : '';
        echo module_theme::get_config('adminlte_tableborder', '0') ? ' table-bordered' : '';
        ?>
"<?php 
        echo $this->table_id ? ' id="' . $this->table_id . '"' : '';
        ?>
>
            <thead>
            <tr class="title">
                <?php 
        foreach ($this->columns as $column_id => $column_data) {
            $title = is_array($column_data) ? $column_data['title'] : $column_data;
            $colspan++;
            ?>
                    <th id="<?php 
            echo $column_id;
            ?>
"><?php 
            echo _l($title);
            ?>
</th>
                <?php 
        }
        if (class_exists('module_extra', false) && count($this->extra_fields)) {
            foreach ($this->extra_fields as $extra_field) {
                $colspan += module_extra::print_table_header($extra_field['type']);
            }
        }
        if (class_exists('module_subscription', false) && count($this->subscription_fields)) {
            foreach ($this->subscription_fields as $extra_field) {
                module_subscription::print_table_header($extra_field['type']);
                $colspan++;
            }
        }
        ?>
            </tr>
            </thead>
	        <?php 
        if (count($this->header_rows)) {
            ?>
            <thead class="summary">
            <?php 
            foreach ($this->header_rows as $row) {
                $this->print_footer_row($row);
            }
            ?>
            </thead>
            <?php 
        }
        ?>
            <tbody>
            <?php 
        if (!count($this->rows['rows'])) {
            if ($this->blank_message) {
                ?>
	                <tr>
		                <td colspan="<?php 
                echo $colspan;
                ?>
" class="blank_message" style="text-align: center"><?php 
                _e($this->blank_message);
                ?>
</td>
	                </tr>
	                <?php 
            }
        } else {
            foreach ($this->rows['rows'] as $row) {
                $this->print_row($row);
            }
        }
        ?>
            </tbody>
            <?php 
        if (count($this->footer_rows)) {
            ?>
            <tfoot class="summary">
            <?php 
            foreach ($this->footer_rows as $row) {
                $this->print_footer_row($row);
            }
            ?>
            </tfoot>
            <?php 
        }
        ?>
        </table>
        <?php 
        if (!$this->inline_table) {
            ?>
        </div>
        <?php 
        }
        if ($this->pagination && (!$this->pagination_hide_single_page || $this->pagination_hide_single_page && $this->rows['page_numbers'] > 1)) {
            ?>
            <div class="box-footer clearfix">
                <div class="row"><div class="col-xs-6">
                <?php 
            // regex and change the default pagination html output to something nicer, default is:
            /* <div class="pagination_links"><span>			    « Prev |
               </span>					<span><a href="/ucm/demo/customer.customer_admin_list/?leads=1&amp;pgtable=0#t_table" rel="0" class="current">1</a></span>
                                           <span><a href="/ucm/demo/customer.customer_admin_list/?leads=1&amp;pgtable=1#t_table" rel="1" class="">2</a></span>
                                           <span><a href="/ucm/demo/customer.customer_admin_list/?leads=1&amp;pgtable=2#t_table" rel="2" class="">3</a></span>
                                           <span><a href="/ucm/demo/customer.customer_admin_list/?leads=1&amp;pgtable=3#t_table" rel="3" class="">4</a></span>
                                       | <span><a href="/ucm/demo/customer.customer_admin_list/?leads=1&amp;pgtable=1#t_table" rel="1">Next »</a><span>
               </span></span></div> */
            $this->rows['links'] = str_replace('<div class="pagination_links">', '<div class="pagination_links paging_bootstrap pagination-sm no-margin"><ul class="pagination pagination-sm">', $this->rows['links']);
            $this->rows['links'] = str_replace('</div>', '</ul></div>', $this->rows['links']);
            //$this->rows['links'] = str_replace('pagination_links','pagination_links paging_bootstrap',$this->rows['links']);
            $this->rows['links'] = str_replace('|', '', $this->rows['links']);
            $this->rows['links'] = str_replace('...', '<li class="disabled"><a href="#">...</a></li>', $this->rows['links']);
            if (preg_match_all('#<span>(.*)</span>#imsU', $this->rows['links'], $matches)) {
                foreach ($matches[0] as $key => $val) {
                    $li_class = strpos($val, 'current') ? 'active' : '';
                    if (strpos($matches[1][$key], '<a') === false) {
                        $li_class = 'disabled';
                        $matches[1][$key] = '<a href="#">' . $matches[1][$key] . '</a>';
                    }
                    $this->rows['links'] = str_replace($val, '<li class="' . $li_class . '">' . $matches[1][$key] . '</li>', $this->rows['links']);
                }
            }
            echo $this->rows['links'];
            ?>
                </div><div class="col-xs-6 text-right">
                <?php 
            echo $this->rows['summary'];
            ?>
                </div></div>
            </div>
            <?php 
        }
        if (!$this->inline_table) {
            ?>
        </div>
        <?php 
        }
    }
コード例 #15
0
ファイル: style.php プロジェクト: sgh1986915/php-crm
<?php

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca, 0a3014a3-2b8f-460b-8850-d6025aa845f8
 * Package Date: 2015-11-25 03:08:08 
 * IP Address: 67.79.165.254
 */
$styles = array();
/*
#wrap {
  background-color: #333;
}*/
$styles['.form-box .header,#login .bg-loginbtn'] = array('d' => 'Login Color', 'v' => array('background-color' => '#3d9970', 'color' => '#FFFFFF'));
$styles['sidebar-position'] = array('d' => 'other-settings', 'elements' => array(array('title' => 'Color Style', 'field' => array('type' => 'select', 'name' => 'config[' . _THEME_CONFIG_PREFIX . 'adminlte_colorstyle]', 'options' => array('light' => _l('Light'), 'dark' => _l('Dark')), 'blank' => false, 'value' => module_theme::get_config('adminlte_colorstyle', 'dark'), 'help' => 'Menu and Header color options.')), array('title' => 'Box Style', 'field' => array('type' => 'select', 'name' => 'config[' . _THEME_CONFIG_PREFIX . 'adminlte_boxstyle]', 'options' => array('box-solid' => _l('Solid White'), 'box-gray' => _l('Gray Top Line'), 'box-primary' => _l('Blue Top Line'), 'box-success' => _l('Green Top Line'), 'box-danger' => _l('Red Top Line'), 'box-warning' => _l('Orange Top Line')), 'blank' => false, 'value' => module_theme::get_config('adminlte_boxstyle', 'box-solid'), 'help' => 'Different options for the content box colors.')), array('title' => 'Form Style', 'field' => array('type' => 'select', 'name' => 'config[' . _THEME_CONFIG_PREFIX . 'adminlte_formstyle]', 'options' => array('table' => _l('Clean/Compact (table,tr,td)'), 'div' => _l('Boxed (divs)')), 'blank' => false, 'value' => module_theme::get_config('adminlte_formstyle', 'table'), 'help' => 'Change how form elements display on the page.')), array('title' => 'Menu Style', 'field' => array('type' => 'select', 'name' => 'config[' . _THEME_CONFIG_PREFIX . 'adminlte_menustyle]', 'options' => array('fixed' => _l('Fixed'), 'normal' => _l('Normal')), 'blank' => false, 'value' => module_theme::get_config('adminlte_menustyle', 'fixed'), 'help' => 'Change if the menu scrolls with the page or remains fixed.')), array('title' => 'Badge Color', 'field' => array('type' => 'select', 'name' => 'config[' . _THEME_CONFIG_PREFIX . 'adminlte_badgecolor]', 'options' => array('bg-red' => _l('red'), 'bg-yellow' => _l('yellow'), 'bg-aqua' => _l('aqua'), 'bg-blue' => _l('blue'), 'bg-light-blue' => _l('light blue'), 'bg-green' => _l('green'), 'bg-navy' => _l('navy'), 'bg-teal' => _l('teal'), 'bg-olive' => _l('olive'), 'bg-lime' => _l('lime'), 'bg-orange' => _l('orange'), 'bg-fuchsia' => _l('fuchsia'), 'bg-purple' => _l('purple'), 'bg-maroon' => _l('maroon'), 'bg-black' => _l('black')), 'blank' => false, 'value' => module_theme::get_config('adminlte_badgecolor', 'bg-light-blue'), 'help' => 'The color of the notification bubbles/badges in the menu items.')), array('title' => 'Table Borders', 'field' => array('type' => 'select', 'name' => 'config[' . _THEME_CONFIG_PREFIX . 'adminlte_tableborder]', 'options' => array('1' => _l("Yes"), '0' => _l("No")), 'blank' => false, 'value' => module_theme::get_config('adminlte_tableborder', 0), 'help' => 'Verticle lines on table data. Change this and check the Customer list.')), array('title' => 'Table Striped', 'field' => array('type' => 'select', 'name' => 'config[' . _THEME_CONFIG_PREFIX . 'adminlte_tablestripe]', 'options' => array('1' => _l("Yes"), '0' => _l("No")), 'blank' => false, 'value' => module_theme::get_config('adminlte_tablestripe', 1), 'help' => 'Alternating colors on table data. Change this and check the Customer list.')), array('title' => 'Table Full Width', 'field' => array('type' => 'select', 'name' => 'config[' . _THEME_CONFIG_PREFIX . 'adminlte_tablefullwidth]', 'options' => array('1' => _l("Yes"), '0' => _l("No")), 'blank' => false, 'value' => module_theme::get_config('adminlte_tablefullwidth', 1), 'help' => 'Makes the table data stretch to the edge of the box. Change this and check the Customer list.'))));
コード例 #16
0
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
$ticket_safe = true;
$limit_time = strtotime('-' . module_config::c('ticket_turn_around_days', 5) . ' days', time());
if (isset($_REQUEST['ticket_id'])) {
    if (isset($_REQUEST['notify']) && $_REQUEST['notify']) {
        include module_theme::include_ucm("includes/plugin_ticket/pages/ticket_admin_notify.php");
    } else {
        include module_theme::include_ucm("includes/plugin_ticket/pages/ticket_admin_edit.php");
    }
    //include('ticket_admin_edit.php');
    /*if(module_security::getlevel() > 1){
          ob_end_clean();
          $_REQUEST['i'] = $_REQUEST['ticket_id'];
          $_REQUEST['hash'] = module_ticket::link_public($_REQUEST['ticket_id'],true);
          $module->external_hook('public');
          exit;
          //include('includes/plugin_ticket/public/ticket_customer_view.php');
      }else{*/
    //include("ticket_admin_edit.php");
    //}
} else {
    //include("ticket_admin_list.php");
    include module_theme::include_ucm("includes/plugin_ticket/pages/ticket_admin_list.php");
}
コード例 #17
0
ファイル: job_discussion.php プロジェクト: sgh1986915/php-crm
 public static function print_discussion($job_id, $task_id, $job_data = array(), $task_data = array(), $allow_new = true)
 {
     $job_data = $job_data ? $job_data : module_job::get_job($job_id, true, true);
     if ($job_data && isset($job_data['job_discussion']) && $job_data['job_discussion'] == 1) {
         // disabled & hidden.
         return;
     }
     $task_data = $task_data ? $task_data : module_job::get_task($job_id, $task_id);
     $comments = get_multiple('job_discussion', array('job_id' => $job_id, 'task_id' => $task_id), 'job_discussion_id', 'exact', 'job_discussion_id');
     $current_user_id = module_security::get_loggedin_id();
     $customer = module_customer::get_customer($job_data['customer_id']);
     if (!$current_user_id) {
         if ($job_data['customer_id'] && $customer['primary_user_id']) {
             $current_user_id = $customer['primary_user_id'];
         }
     }
     include module_theme::include_ucm('includes/plugin_job_discussion/inc/comment_list.php');
 }
コード例 #18
0
ファイル: functions.php プロジェクト: sgh1986915/php-crm
function print_heading($options)
{
    // we've moved this function to the theme module.
    // all future updates to this function will be done there, not in this main file.
    if (is_callable('module_theme::print_heading')) {
        module_theme::print_heading($options);
        return;
    }
    if (!is_array($options)) {
        $options = array('type' => 'h2', 'title' => $options);
    }
    $buttons = array();
    if (isset($options['button']) && is_array($options['button']) && count($options['button'])) {
        $buttons = $options['button'];
        if (isset($buttons['url'])) {
            $buttons = array($buttons);
        }
    }
    ?>
	<<?php 
    echo $options['type'];
    ?>
>
		<?php 
    foreach ($buttons as $button) {
        ?>
		<span class="button">
			<a href="<?php 
        echo $button['url'];
        ?>
" class="uibutton"<?php 
        if (isset($button['id'])) {
            echo ' id="' . $button['id'] . '"';
        }
        if (isset($button['onclick'])) {
            echo ' onclick="' . $button['onclick'] . '"';
        }
        ?>
>
                <?php 
        if (isset($button['type']) && $button['type'] == 'add') {
            ?>
 <img src="<?php 
            echo _BASE_HREF;
            ?>
images/add.png" width="10" height="10" alt="add" border="0" /> <?php 
        }
        ?>
				<span><?php 
        echo _l($button['title']);
        ?>
</span>
			</a>
		</span>
		<?php 
    }
    ?>
        <?php 
    if (isset($options['help'])) {
        ?>
            <span class="button">
                <?php 
        _h($options['help']);
        ?>
            </span>
        <?php 
    }
    ?>
		<span class="title">
			<?php 
    echo _l($options['title']);
    ?>
		</span>
	</<?php 
    echo $options['type'];
    ?>
>
	<?php 
}
コード例 #19
0
ファイル: design_header.php プロジェクト: sgh1986915/php-crm
    </header>
<?php 
            }
            ?>


<div id="wrap">

	<div id="top">

        <!-- <div class="header-spacer visible-xs" style="height:51px;"></div> -->
        <nav class="navbar navbar-inverse navbar-static-top hidden-xs">
            <!-- Brand and toggle get grouped for better mobile display -->
            <header class="navbar-header">
                <?php 
            if ($header_logo = module_theme::get_config('theme_logo', _BASE_HREF . 'images/logo.png')) {
                ?>

                <a href="<?php 
                echo _BASE_HREF;
                ?>
" class="navbar-brand"><img src="<?php 
                echo htmlspecialchars($header_logo);
                ?>
" border="0" title="<?php 
                echo htmlspecialchars(module_config::s('header_title', 'UCM'));
                ?>
"></a>
            <?php 
            } else {
                ?>
コード例 #20
0
ファイル: quote.php プロジェクト: sgh1986915/php-crm
 public static function quote_html($quote_id, $quote_data, $mode = 'html')
 {
     if ($quote_id && $quote_data) {
         // spit out the quote html into a file, then pass it to the pdf converter
         // to convert it into a PDF.
         $quote = $quote_data;
         if (class_exists('module_company', false) && isset($quote_data['company_id']) && (int) $quote_data['company_id'] > 0) {
             module_company::set_current_company_id($quote_data['company_id']);
         }
         $quote_template = isset($quote_data['quote_template_print']) && strlen($quote_data['quote_template_print']) ? $quote_data['quote_template_print'] : module_config::c('quote_template_print_default', 'quote_pdf');
         $quote_template_suffix = '';
         if ($quote_template != 'quote_pdf') {
             $quote_template_suffix = str_replace('quote_pdf', '', $quote_template);
         }
         ob_start();
         include module_theme::include_ucm('includes/plugin_quote/template/quote_task_list.php');
         $task_list_html = ob_get_clean();
         $replace = self::get_replace_fields($quote_id, $quote_data);
         $replace['task_list'] = $task_list_html;
         $replace['quote_link'] = module_quote::link_public($quote_id);
         $replace['external_quote_template_html'] = '';
         $external_quote_template = module_template::get_template_by_key('quote_pdf');
         $external_quote_template->assign_values($replace);
         $replace['external_quote_template_html'] = $external_quote_template->replace_content();
         ob_start();
         $template = module_template::get_template_by_key($quote_template);
         $template->assign_values($replace);
         echo $template->render('html');
         $quote_html = ob_get_clean();
         return $quote_html;
     }
     return false;
 }
コード例 #21
0
}
if ((int) $user_id > 0) {
    //handle_hook("note_list",$module,"user","user_id",$user_id);
    if (class_exists('module_note', false) && module_note::is_plugin_enabled()) {
        module_note::display_notes(array('title' => 'User Notes', 'owner_table' => 'user', 'owner_id' => $user_id, 'view_link' => $module->link_open($user_id)));
    }
    if (class_exists('module_group', false) && module_group::is_plugin_enabled()) {
        module_group::display_groups(array('title' => 'User Groups', 'owner_table' => 'user', 'owner_id' => $user_id, 'view_link' => module_user::link_open($user_id)));
    }
}
hook_handle_callback('layout_column_half', 2);
if (is_file('includes/plugin_user/pages/user_admin_edit_login.php')) {
    include module_theme::include_ucm('includes/plugin_user/pages/user_admin_edit_login.php');
}
if (is_file('includes/plugin_user/pages/user_admin_edit_staff.php')) {
    include module_theme::include_ucm('includes/plugin_user/pages/user_admin_edit_staff.php');
}
if (is_file('includes/plugin_user/pages/user_admin_edit_company.php')) {
    include module_theme::include_ucm('includes/plugin_user/pages/user_admin_edit_company.php');
}
hook_handle_callback('layout_column_half', 'end');
$form_actions = array('class' => 'action_bar action_bar_center', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save User')), array('ignore' => !($user_id != 1 && module_user::can_i('delete', 'Users', 'Config')), 'type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete')), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . $module->link_open(false) . "';")));
echo module_form::generate_form_actions($form_actions);
?>





</form>
コード例 #22
0
ファイル: job.php プロジェクト: sgh1986915/php-crm
 public static function generate_job_summary($job_id, $job, $show_hours_summary = true)
 {
     $show_task_numbers = module_config::c('job_show_task_numbers', 1) && $job['auto_task_numbers'] != 2;
     ob_start();
     include module_theme::include_ucm('includes/plugin_job/pages/ajax_job_summary.php');
     return ob_get_clean();
 }
コード例 #23
0
); this.form.submit();">
	            <p>
		            <?php 
    _e('If you cannot solve this ticket please assign it to someone else in the drop down list.');
    ?>

	            </p>
            </div>
            <?php 
    $fieldset_data = array('heading' => array('title' => _l('Unassigned Ticket'), 'type' => 'h3'), 'elements_before' => ob_get_clean());
    echo module_form::generate_fieldset($fieldset_data);
    unset($fieldset_data);
}
/** TICKET MESSAGES */
if (!$done_messages) {
    $tickets_in_reverse = module_config::c('ticket_messages_in_reverse', 0);
    include module_theme::include_ucm('includes/plugin_ticket/pages/ticket_admin_edit_messages.php');
}
hook_handle_callback('layout_column_half', 'end');
echo $action_buttons;
?>


</form>

<?php 
if (($last_response_from == 'customer' || $last_response_from == 'autoreply') && $ticket['status_id'] != _TICKET_STATUS_RESOLVED_ID) {
    // don't do this for resolved tickets
    // only set the default field if the last respose was from the customer.
    module_form::set_default_field('new_ticket_message');
}
コード例 #24
0
ファイル: address.php プロジェクト: sgh1986915/php-crm
 public static function print_address_form($owner_id, $owner_table, $address_type, $title = '')
 {
     $address = self::get_address($owner_id, $owner_table, $address_type);
     $address_id = isset($address['address_id']) ? $address['address_id'] : false;
     $display_pretty = true;
     // we use the new fieldset builder
     $address_hash = md5($owner_table . '|' . $address_type);
     // just for posting unique arrays.
     include module_theme::include_ucm("includes/plugin_address/pages/address_block.php");
 }
コード例 #25
0
ファイル: job_admin.php プロジェクト: sgh1986915/php-crm
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
$job_safe = true;
// stop including files directly.
if (!module_job::can_i('view', 'Jobs')) {
    echo 'permission denied';
    return;
}
if (isset($_REQUEST['job_id'])) {
    if (isset($_REQUEST['email_staff'])) {
        include module_theme::include_ucm("includes/plugin_job/pages/job_admin_email_staff.php");
    } else {
        if (isset($_REQUEST['email'])) {
            include module_theme::include_ucm("includes/plugin_job/pages/job_admin_email.php");
        } else {
            if ((int) $_REQUEST['job_id'] > 0) {
                include module_theme::include_ucm("includes/plugin_job/pages/job_admin_edit.php");
                //include("job_admin_edit.php");
            } else {
                include module_theme::include_ucm("includes/plugin_job/pages/job_admin_create.php");
                //include("job_admin_create.php");
            }
        }
    }
} else {
    include module_theme::include_ucm("includes/plugin_job/pages/job_admin_list.php");
    //include("job_admin_list.php");
}
コード例 #26
0
ファイル: template.php プロジェクト: sgh1986915/php-crm
    public function render($type = 'html', $options = array())
    {
        ob_start();
        switch ($type) {
            case 'pretty_html':
                // header and footer so plain contnet can be rendered nicely.
                $display_mode = get_display_mode();
                // addition - woah! we pass this through to the template module for re-rending again:
                ob_start();
                ?>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>{PAGE_TITLE}</title>
    {FAVICON}
    {AUTOMATIC_STYLES}
    {AUTOMATIC_SCRIPTS}
    <style type="text/css">
        body{
            margin:0;
        }
    </style>
</head>
<body>
<div class="pretty_content_wrap">
    {CONTENT}
</div>
</body>
</html>
                <?php 
                /*$c = $this->replace_content();
                  if(!$this->wysiwyg){
                      //$c = nl2br($c);
                  }
                  echo $c;*/
                module_template::init_template('external_template', ob_get_clean(), 'Used when displaying the external content such as "External Jobs" and "External Invoices" and "External Tickets".', 'code', array('CONTENT' => 'The inner content', 'PAGE_TITLE' => 'in the <title> tag', 'FAVICON' => 'if the theme specifies a favicon it will be here', 'AUTOMATIC_STYLES' => 'system generated stylesheets', 'AUTOMATIC_SCRIPTS' => 'system generated javascripts'));
                ob_start();
                ?>

                <link rel="stylesheet" href="<?php 
                echo _BASE_HREF;
                ?>
css/desktop.css" type="text/css">
                <link rel="stylesheet" href="<?php 
                echo _BASE_HREF;
                ?>
css/print.css" type="text/css" media="print">
                <link rel="stylesheet" href="<?php 
                echo _BASE_HREF;
                ?>
css/styles.css" type="text/css">
                <link type="text/css" href="<?php 
                echo _BASE_HREF;
                ?>
css/smoothness/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" />
                <?php 
                module_config::print_css();
                ?>
 <?php 
                $css = ob_get_clean();
                ob_start();
                ?>

                <script type="text/javascript" src="<?php 
                echo _BASE_HREF;
                ?>
js/jquery-1.8.3.min.js"></script>
                <script type="text/javascript" src="<?php 
                echo _BASE_HREF;
                ?>
js/jquery-ui-1.9.2.custom.min.js"></script>
                <script type="text/javascript" src="<?php 
                echo _BASE_HREF;
                ?>
js/timepicker.js"></script>
                <script type="text/javascript" src="<?php 
                echo _BASE_HREF;
                ?>
js/cookie.js"></script>
                <script type="text/javascript" src="<?php 
                echo _BASE_HREF;
                ?>
js/javascript.js?ver=2"></script>
                <?php 
                module_config::print_js();
                ?>

                <?php 
                $scripts = ob_get_clean();
                $external_template = self::get_template_by_key('external_template');
                $external_template->assign_values(array('CONTENT' => $this->replace_content(), 'PAGE_TITLE' => $this->page_title ? $this->page_title : module_config::s('admin_system_name'), 'FAVICON' => module_theme::get_config('theme_favicon', '') ? '<link rel="icon" href="' . htmlspecialchars(module_theme::get_config('theme_favicon', '')) . '">' : '', 'AUTOMATIC_STYLES' => $css, 'AUTOMATIC_SCRIPTS' => $scripts));
                echo $external_template->render('raw');
                break;
            case 'html':
            default:
                $c = $this->replace_content();
                if ($this->wysiwyg) {
                    //$c = nl2br($c);
                }
                echo $c;
                break;
        }
        return ob_get_clean();
    }
コード例 #27
0
ファイル: contact_admin.php プロジェクト: sgh1986915/php-crm
<?php

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
if (isset($_REQUEST['user_id'])) {
    $user_safe = true;
    include module_theme::include_ucm("includes/plugin_user/pages/contact_admin_edit.php");
    //include("contact_admin_edit.php");
} else {
    include module_theme::include_ucm("includes/plugin_user/pages/contact_admin_list.php");
    //include("contact_admin_list.php");
}
コード例 #28
0
 public static function start_payment($invoice_id, $payment_amount, $invoice_payment_id, $user_id = false)
 {
     if ($invoice_id && $payment_amount && $invoice_payment_id) {
         // we are starting a payment via coinbase!
         // setup a pending payment and redirect to coinbase.
         $invoice_data = module_invoice::get_invoice($invoice_id);
         if (!$user_id) {
             $user_id = $invoice_data['user_id'];
         }
         if (!$user_id) {
             $user_id = isset($invoice_data['primary_user_id']) ? $invoice_data['primary_user_id'] : 0;
         }
         if (!$user_id) {
             $user_id = module_security::get_loggedin_id();
         }
         $user_data = module_user::get_user($user_id);
         if (!$user_data || !strpos($user_data['email'], '@')) {
             die('Please ensure your user account has a valid email address before paying with coinbase');
         }
         $invoice_payment_data = module_invoice::get_invoice_payment($invoice_payment_id);
         // we add the fee details to the invoice payment record so that the new invoice total can be calculated.
         $fee_percent = module_config::c('payment_method_coinbase_charge_percent', 0);
         $fee_amount = module_config::c('payment_method_coinbase_charge_amount', 0);
         $fee_description = module_config::c('payment_method_coinbase_charge_description', 'Coinbase Fee');
         $fee_total = 0;
         if ($fee_percent != 0 || $fee_amount != 0) {
             $fee_total = module_invoice::calculate_fee($invoice_id, $invoice_data, $payment_amount, array('percent' => $fee_percent, 'amount' => $fee_amount, 'description' => $fee_description));
             if ($fee_total != 0) {
                 // add this percent/amount to the invoice payment
                 $payment_amount = $payment_amount + $fee_total;
                 update_insert('invoice_payment_id', $invoice_payment_id, 'invoice_payment', array('fee_percent' => $fee_percent, 'fee_amount' => $fee_amount, 'fee_description' => $fee_description, 'fee_total' => $fee_total, 'amount' => $payment_amount));
             }
         }
         // we check if this payment is a recurring payment or a standard one off payment.
         if (module_config::c('payment_method_coinbase_subscriptions', 0)) {
             // we support subscriptions!
             // first check if the subscription module is active, and if this invoice is part of an active subscription.
             $is_subscription = false;
             if (class_exists('module_subscription', false)) {
                 $subscription_history = get_single('subscription_history', 'invoice_id', $invoice_id);
                 if ($subscription_history && $subscription_history['subscription_id']) {
                     // this invoice is for a subscription! woo!
                     // work out when we should bill for this subscription.
                     $subscription = module_subscription::get_subscription($subscription_history['subscription_id']);
                     $subscription_owner = module_subscription::get_subscription_owner($subscription_history['subscription_owner_id']);
                     if ($subscription_owner['owner_table'] && $subscription_owner['owner_id']) {
                         // work out when the next invoice will be generated for this subscription.
                         $members_subscriptions = module_subscription::get_subscriptions_by($subscription_owner['owner_table'], $subscription_owner['owner_id']);
                         if (isset($members_subscriptions[$subscription_history['subscription_id']])) {
                             $member_subscription = $members_subscriptions[$subscription_history['subscription_id']];
                             // everything checks out! good to go....
                             // for now we just do a basic "EVERY X TIME" subscription
                             // todo: work out how long until next generate date, and set that (possibly smaller) time period as the first portion of the subscription
                             /*echo '<pre>';
                               print_r($subscription_history);
                               print_r($subscription);
                               print_r($subscription_owner);
                               print_r($member_subscription);
                               exit;*/
                             $is_subscription = array();
                             if ($subscription['days'] > 0) {
                                 $is_subscription['days'] = $subscription['days'];
                             }
                             if ($subscription['months'] > 0) {
                                 $is_subscription['months'] = $subscription['months'];
                             }
                             if ($subscription['years'] > 0) {
                                 $is_subscription['years'] = $subscription['years'];
                             }
                             if (count($is_subscription)) {
                                 $is_subscription['name'] = $subscription['name'];
                                 $is_subscription['id'] = $subscription_history['subscription_id'];
                             }
                         }
                     }
                 }
             }
             // todo: check if this invoice has a manual renewal date, perform subscription feature as above.
             if ($is_subscription) {
                 // coinbase only supports these recurring methods:
                 // daily, weekly, every_two_weeks, monthly, quarterly, and yearly
                 // work out which one our days are at.
                 $days = isset($is_subscription['days']) ? $is_subscription['days'] : 0;
                 if (isset($is_subscription['months'])) {
                     $days += $is_subscription['months'] * 30;
                     unset($is_subscription['months']);
                 }
                 if (isset($is_subscription['years'])) {
                     $days += $is_subscription['years'] * 365;
                     unset($is_subscription['years']);
                 }
                 $is_subscription['days'] = $days;
                 if ($days == 1) {
                     $is_subscription['coinbase_period'] = 'daily';
                 } else {
                     if ($days == 7 || $days == 6 || $days == 8) {
                         $is_subscription['coinbase_period'] = 'weekly';
                     } else {
                         if ($days == 14 || $days == 13 || $days == 15) {
                             $is_subscription['coinbase_period'] = 'every_two_weeks';
                         } else {
                             if ($days == 29 || $days == 30 || $days == 31) {
                                 $is_subscription['coinbase_period'] = 'monthly';
                             } else {
                                 if ($days >= 87 && $days <= 95) {
                                     $is_subscription['coinbase_period'] = 'quarterly';
                                 } else {
                                     if ($days >= 363 && $days <= 370) {
                                         $is_subscription['coinbase_period'] = 'yearly';
                                     } else {
                                         send_error('Someone tried to pay with coinbase but coinbase does not support a recurring subscription period of ' . $days . ' days. Only:  daily, weekly, every_two_weeks, monthly, quarterly, and yearly ');
                                         $is_subscription = false;
                                         // not supported.
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             if ($is_subscription && isset($is_subscription['coinbase_period'])) {
                 $invoice_payment_data = module_invoice::get_invoice_payment($invoice_payment_id);
                 if (isset($invoice_payment_data['invoice_payment_subscription_id']) && (int) $invoice_payment_data['invoice_payment_subscription_id'] > 0) {
                     // existing subscription already!
                     // not really sure what to do here, just redirect to coinbase as if the user is doing it for the first time.
                     $_REQUEST['payment_subscription'] = true;
                     // hacks!
                 }
                 if (isset($_REQUEST['payment_subscription']) || module_config::c('payment_method_coinbase_force_subscription', 0)) {
                     // user is setting up a subscription! yes!!
                     // we create an entry in our database for this particular subscription
                     // or if one exists for this payment already then we just continue with that (ie: the user is going in again to redo it)
                     // setup a new subscription in the database for us.
                     if (isset($invoice_payment_data['invoice_payment_subscription_id']) && (int) $invoice_payment_data['invoice_payment_subscription_id'] > 0) {
                         $invoice_payment_subscription_id = $invoice_payment_data['invoice_payment_subscription_id'];
                     } else {
                         $invoice_payment_subscription_id = update_insert('invoice_payment_subscription_id', false, 'invoice_payment_subscription', array('status' => _INVOICE_SUBSCRIPTION_PENDING, 'days' => isset($is_subscription['days']) ? $is_subscription['days'] : 0, 'months' => isset($is_subscription['months']) ? $is_subscription['months'] : 0, 'years' => isset($is_subscription['years']) ? $is_subscription['years'] : 0, 'date_start' => '0000-00-00', 'date_last_pay' => '0000-00-00', 'date_next' => '0000-00-00'));
                         update_insert('invoice_payment_id', $invoice_payment_id, 'invoice_payment', array('invoice_payment_subscription_id' => $invoice_payment_subscription_id));
                     }
                     $description = _l('Recurring payment for %s %s', $is_subscription['name'], _l(str_replace('_', ' ', $is_subscription['coinbase_period'])));
                     $subscription_name = $is_subscription['name'];
                     unset($is_subscription['name']);
                     // so reset/key cals below rosk.
                     $subscription_id = $is_subscription['id'];
                     unset($is_subscription['id']);
                     // so reset/key cals below rosk.
                     $currency = module_config::get_currency($invoice_payment_data['currency_id']);
                     $currency_code = $currency['code'];
                     include module_theme::include_ucm('includes/plugin_paymethod_coinbase/pages/coinbase_form.php');
                     exit;
                 } else {
                     if (isset($_REQUEST['payment_single'])) {
                         // use is choosing to continue payment as a once off amount
                     } else {
                         // give the user an option
                         $template = module_template::get_template_by_key('invoice_payment_subscription');
                         $template->page_title = htmlspecialchars($invoice_data['name']);
                         $template->assign_values($invoice_payment_data);
                         $template->assign_values(module_invoice::get_replace_fields($invoice_data['invoice_id'], $invoice_data));
                         $template->assign_values(array('invoice_payment_id' => $invoice_payment_id, 'payment_url' => module_invoice::link_public_pay($invoice_data['invoice_id']), 'payment_method' => 'paymethod_coinbase', 'payment_amount' => $payment_amount, 'pretty_payment_amount' => dollar($payment_amount, true, $invoice_data['currency_id']), 'subscription_period' => _l('%s days (%s)', $is_subscription['days'], $is_subscription['coinbase_period']), 'fee_amount' => dollar($fee_amount, true, $invoice_data['currency_id']), 'fee_total' => dollar($fee_total, true, $invoice_data['currency_id']), 'fee_percent' => $fee_percent, 'fee_description' => $fee_description));
                         echo $template->render('pretty_html');
                         exit;
                     }
                 }
             }
         }
         $description = _l('Payment for invoice %s', $invoice_data['name']);
         //self::coinbase_redirect($description,$payment_amount,$user_id,$invoice_payment_id,$invoice_id,$invoice_payment_data['currency_id']);
         $currency = module_config::get_currency($invoice_payment_data['currency_id']);
         $currency_code = $currency['code'];
         include module_theme::include_ucm('includes/plugin_paymethod_coinbase/pages/coinbase_form.php');
         /*$template = new module_template();
           ob_start();
           $template->content = ob_get_clean();
           echo $template->render('pretty_html');*/
         exit;
     }
     return false;
 }
コード例 #29
0
ファイル: note.php プロジェクト: sgh1986915/php-crm
    public static function print_note($note_id, $note_item, $display_summary = false, $can_edit = true, $can_delete = true, $options = array())
    {
        if (!$note_item) {
            $note_item = self::get_note($note_id);
        }
        static $x = 0;
        global $plugins;
        $can_view = $can_edit = $can_create = $can_delete = false;
        // re-check permissions...
        if (isset($options) && isset($options['owner_table']) && $options['owner_table'] && isset($options['title']) && $options['title']) {
            $can_view = $plugins[$options['owner_table']]->can_i('view', $options['title']);
            $can_edit = $plugins[$options['owner_table']]->can_i('edit', $options['title']);
            $can_create = $plugins[$options['owner_table']]->can_i('create', $options['title']);
            $can_delete = $plugins[$options['owner_table']]->can_i('delete', $options['title']);
        } else {
        }
        if (!module_security::is_page_editable()) {
            //$can_edit=$can_create=$can_delete=false;
        }
        if (isset($options['summary_owners'])) {
            unset($options['summary_owners']);
        }
        if (isset($options['display_summary'])) {
            unset($options['display_summary']);
        }
        //
        if (!trim($note_item['note'])) {
            $note_item['note'] = 'none';
        }
        ob_start();
        /** START TABLE LAYOUT **/
        $table_manager = module_theme::new_table_manager();
        $columns = array();
        $columns['date'] = array('title' => 'Date', 'width' => 60, 'callback' => function ($note_item) {
            if ($note_item['reminder']) {
                echo '<strong>';
            }
            echo print_date($note_item['note_time']);
            if ($note_item['reminder']) {
                echo '</strong>';
            }
        });
        $columns['description'] = array('title' => 'Description', 'callback' => function ($note_item) {
            if (isset($note_item['public']) && $note_item['public']) {
                echo '* ';
            }
            if ($note_item['can_edit']) {
                $note_text = nl2br(htmlspecialchars(substr($note_item['note'], 0, module_config::c('note_trim_length', 35))));
                $note_text .= strlen($note_item['note']) > module_config::c('note_trim_length', 35) ? '...' : '';
                ?>

                <a href="<?php 
                echo module_note::link_open($note_item['note_id'], false, $note_item['options']);
                ?>
" data-options="<?php 
                echo htmlspecialchars(base64_encode(serialize($note_item['options'])));
                ?>
" class="note_edit note_options_link" rel="<?php 
                echo $note_item['note_id'];
                ?>
"> <?php 
                echo $note_text;
                ?>
 </a>
                <?php 
            } else {
                echo forum_text($note_item['note']);
            }
        });
        $columns['info'] = array('title' => 'Info', 'width' => 40, 'callback' => function ($note_item) {
            if ($note_item['display_summary']) {
                if ($note_item['rel_data']) {
                    global $plugins;
                    echo $plugins[$note_item['owner_table']]->link_open($note_item['owner_id'], true);
                }
            } else {
                // find the user name who made thsi note.
                $user_data = module_user::get_user($note_item['create_user_id']);
                echo $user_data['name'];
            }
        });
        if ($can_delete) {
            $columns['del'] = array('title' => ' ', 'callback' => function ($note_item) {
                if ($note_item['can_delete']) {
                    ?>
 <a href="<?php 
                    echo module_note::link_open($note_item['note_id'], false, array_merge($note_item['options'], array('do_delete' => 'yes', 'note_id' => $note_item['note_id'])));
                    ?>
" data-options="<?php 
                    echo htmlspecialchars(base64_encode(serialize(array_merge($note_item['options'], array('do_delete' => 'yes', 'note_id' => $note_item['note_id'])))));
                    ?>
" rel="<?php 
                    echo $note_item['note_id'];
                    ?>
" onclick="if(confirm('<?php 
                    _e('Really Delete Note?');
                    ?>
'))return true; else return false;" class="note_delete note_options_link delete ui-state-default ui-corner-all ui-icon ui-icon-trash">[x]</a> <?php 
                }
            });
        }
        $table_manager->set_columns($columns);
        $table_manager->inline_table = true;
        $table_manager->row_callback = function ($row_data, &$row_object) use($display_summary, $can_edit, $can_delete, &$options) {
            $row_data['display_summary'] = $display_summary;
            $row_data['can_edit'] = $can_edit;
            $row_data['can_delete'] = $can_delete;
            $row_data['options'] = $options;
            $row_object->row_id = 'note_' . $row_data['note_id'];
            return $row_data;
        };
        $table_manager->print_row($note_item);
        /*?>
        		<tr id="note_<?php echo $note_item['note_id'];?>" class="<?php echo ($x++%2)?'odd':'even';?>">
        			<td>
                        <?php
                        if($note_item['reminder'])echo '<strong>';
                        echo print_date($note_item['note_time']);
                        if($note_item['reminder'])echo '</strong>';
                        ?>
        			</td>
        			<td>
                        <?php
                        if(isset($note_item['public']) && $note_item['public'])echo '* ';
                        if($can_edit){
                            $note_text = nl2br(htmlspecialchars(substr($note_item['note'],0,module_config::c('note_trim_length',35))));
                            $note_text .= strlen($note_item['note']) > module_config::c('note_trim_length',35) ? '...' : '';
                            ?>
                        <a href="<?php echo self::link_open($note_item['note_id'],false,$options);?>" data-options="<?php echo htmlspecialchars(base64_encode(serialize($options)));?>" class="note_edit note_options_link" rel="<?php echo $note_item['note_id'];?>"> <?php echo $note_text; ?> </a>
                        <?php }else{
                            echo forum_text($note_item['note']);
                        } ?>
        			</td>
        			<td nowrap="nowrap">
        				<?php
        				if($display_summary){
        					if($note_item['rel_data']){
                                echo $plugins[$note_item['owner_table']]->link_open($note_item['owner_id'],true);
        					}
        				}else{
        					// find the user name who made thsi note.
        					$user_data = module_user::get_user($note_item['create_user_id']);
        					echo $user_data['name'];
        				}
        				?>
        			</td>
                    <?php if($can_delete){ ?>
                    <td><a href="<?php echo self::link_open($note_item['note_id'],false,array_merge($options,array('do_delete'=>'yes','note_id'=>$note_item['note_id'])));?>" data-options="<?php echo htmlspecialchars(base64_encode(serialize(array_merge($options,array('do_delete'=>'yes','note_id'=>$note_item['note_id'])))));?>" rel="<?php echo $note_item['note_id'];?>" onclick="if(confirm('<?php _e('Really Delete Note?');?>'))return true; else return false;" class="note_delete note_options_link delete ui-state-default ui-corner-all ui-icon ui-icon-trash">[x]</a></td>
                    <?php } ?>
        		</tr>
        		<?php
        		*/
        return ob_get_clean();
    }
コード例 #30
0
ファイル: customer.php プロジェクト: sgh1986915/php-crm
 public static function get_customer_signup_form_html()
 {
     ob_start();
     include module_theme::include_ucm('includes/plugin_customer/pages/customer_signup_form.php');
     return ob_get_clean();
 }