示例#1
0
 public function signup()
 {
     $this->exportJS("\$('#docNav').hide();");
     $data = base::subHeader("Create an Account", "Add your Company to the Support System");
     $data .= base::begin();
     $data .= base::pageHeader("Before you Begin", "You are about to create an account. If your company is already in our system, please have your company administrator add your account. You will only be able to add your company once.");
     $elements = [];
     $elements[] = ['type' => 'input', 'var' => 'user_name', 'text' => 'Full Name:', 'comment' => 'Main contact for account'];
     $elements[] = ['type' => 'input', 'var' => 'user_email', 'text' => 'E-mail Address:', 'comment' => 'Also your login to this system'];
     $elements[] = ['type' => 'password', 'var' => 'user_password', 'text' => 'Password:'******'type' => 'input', 'var' => 'user_phone', 'text' => 'Phone Number (and Extension):', 'comment' => 'xxx.xxx.xxxx ext. xxx'];
     $elements[] = ['type' => 'input', 'var' => 'user_title', 'text' => 'Your Title:', 'comment' => 'Leave blank if individual'];
     $span = [];
     $span[] = ['span' => 6, 'elements' => $elements];
     $elements = [];
     $elements[] = ['type' => 'input', 'var' => 'company_name', 'text' => 'Company Name:', 'comment' => 'If individual leave this blank'];
     $elements[] = ['type' => 'input', 'var' => 'company_address', 'text' => 'Address:', 'comment' => 'Where to mail invoices if required?'];
     $elements[] = ['type' => 'input', 'var' => 'company_address2', 'text' => 'Address Line 2:', 'comment' => 'Suite, etc.'];
     $elements[] = ['type' => 'input', 'var' => 'company_city', 'text' => 'City:'];
     $elements[] = ['type' => 'input', 'var' => 'company_state', 'text' => 'State:'];
     $elements[] = ['type' => 'input', 'var' => 'company_zip', 'text' => 'Zip:'];
     $span[] = ['span' => 6, 'elements' => $elements];
     $form = form::init()->spanElements($span)->id('createAccount')->post('/login/')->render();
     $button = button::init()->formid('createAccount')->text('Create My Account')->addStyle('post')->addStyle('btn-primary')->icon('fire')->message('Creating Account..')->postVar('createAccount')->render();
     $save = "<div class='pull-right'>{$button}</div>";
     $data .= widget::init()->icon('share-alt')->span(12)->header('Account Details')->content($form)->footer($save)->render();
     $this->export($data);
 }
示例#2
0
<?php

require_once '_toolkit/main.php';
//var_export($_FILES);
if ($_FILES) {
    $file = file::upload('image', 'data/image/' . $_FILES['image']['name']);
    $ext = $file->getExtension();
    $file->rename('background' . $ext);
    $file->move('backgrounds/1/');
    echo $file->getBaseName() . html::br();
    echo $file->getFolder() . html::br();
    echo $file->getPath() . html::br();
    $img = $file->getImage();
    if ($img !== false) {
        $img->resize(100, 75);
    }
    //echo $img->htmlTag();
    echo html::img($file);
    //$file->delete();
} else {
    echo form::init(NULL, NULL, 'multipart/form-data');
    echo new Field('image', 'file');
    echo form::submit();
    echo '</form>';
}
示例#3
0
* Action : set_status
*******************************************************************************/
if ($act == "set_status") {
    $admlib->validate('tour_edit');
    $dbu->set_status("destinasi_bahasa", "id", $p_id, $status, "status");
    $_SESSION['msg'] = "status destinasi_bahasa berhasil di update ....";
    $_SESSION['alt'] = "info";
    header("location: " . $urlx->get_referer());
}
/*******************************************************************************
* Action : view
*******************************************************************************/
if ($act == "view") {
    $admlib->validate('tour_view');
    $admlib->set_aktip("tourcms_kota");
    $formix->init();
    $page = $dbu->get_record("destinasi_bahasa", "id", $p_id);
    $form = $page;
    $formix->populate($form);
    include "tmp_view.php";
    exit;
}
/*******************************************************************************
* Action : add
*******************************************************************************/
if ($act == "add") {
    $admlib->set_aktip("tourcms_kota");
    $admlib->validate('tour_add');
    $formix->init();
    if ($step == 1) {
        $formix->populate($form);
示例#4
0
 public function open()
 {
     return form::init($this->action, $this->method, $this->enctType);
 }
示例#5
0
文件: auth.php 项目: kronius/vidpro
 function init()
 {
     if (empty($this->params['short'])) {
         // вызвано не возле короткой формы логина, а в теле страницы
         if (empty($_GET['k'])) {
             redirect($this->get_url('Jlib_target=default'));
         } else {
             // если стоял таймер и он не прошел - продлить таймер и отфутболить в корень сайта
             if (!empty($_SESSION['Jlib_auth']['passre_locker']) && $_SESSION['Jlib_auth']['passre_locker'] + 5 > time()) {
                 $_SESSION['Jlib_auth']['passre_locker'] = time();
                 redirect($this->get_url('Jlib_target=default'));
             }
             // выдержать для солидности пару секунд и проверить наличие такого кода в базе
             $sql = 'sql:user?u_passre=\'' . $_GET['k'] . '\' $shrink=yes auto_query=no';
             $res = $GLOBALS[CM]->run($sql);
             if ($res) {
                 // есть такой код - вывести форму для смены пароля
                 if (isset($_SESSION['Jlib_auth']['passre_locker'])) {
                     unset($_SESSION['Jlib_auth']['passre_locker']);
                 }
                 $this->pg = $this->tpl['change'];
             } else {
                 // код левый - поставить таймер и отфутболить в корень сайта
                 $_SESSION['Jlib_auth']['passre_locker'] = time();
                 redirect($this->get_url('Jlib_target=default'));
             }
         }
     }
     parent::init();
 }
示例#6
0
 private function getMyProfile()
 {
     $pre = "<p>Your profile is used to determine how you get updates to your tickets, billing notifications as well as your picture that is shown for your ticket updates.</p>";
     $span = [];
     $fields = [];
     $fields[] = ['type' => 'ajax', 'id' => 'profilePicture', 'text' => 'Profile Picture:'];
     $fields[] = ['type' => 'password', 'var' => 'user_password', 'text' => 'Change Password:'******'type' => 'input', 'text' => 'Cell Phone Number:', 'var' => 'user_sms', 'val' => $this->user->user_sms, 'class' => 'sms'];
     $opts = [];
     $opts[] = ['val' => $this->user->user_cansms, 'text' => $this->user->user_cansms ? "Yes" : 'No'];
     $opts[] = ['val' => $this->user->user_cansms, 'text' => '--------------'];
     $opts[] = ['val' => 'Y', 'text' => 'Yes'];
     $opts[] = ['val' => 'N', 'text' => 'No'];
     $fields[] = ['type' => 'select', 'var' => 'user_cansms', 'opts' => $opts, 'text' => 'Send Text Messages?', 'comment' => 'If set to Yes, you will be sent a text when tickets are updated or you are billed.'];
     $span[] = ['span' => 6, 'elements' => $fields];
     $fields = [];
     $fields[] = ['type' => 'input', 'text' => 'Other E-mail Addresses:', 'var' => 'user_altemails', 'val' => $this->user->user_altemails, 'comment' => "Enter any secondary email addresses separated by commas"];
     $span[] = ['span' => 6, 'elements' => $fields];
     $this->exportJS(js::maskInput('sms', '1-999-999-9999'));
     $this->exportJS(js::ajaxFile('profilePicture', "profilePic"));
     return $pre . form::init()->id('myProfileForm')->post('/')->spanelements($span)->render();
 }
示例#7
0
 private function taskUpdateForm(&$subticket)
 {
     $fields = [];
     $fields[] = ['type' => 'textarea', 'span' => 12, 'rows' => 6, 'var' => 'reply_body', 'text' => 'Reply:'];
     $data = form::init()->post('/ticket/')->elements($fields)->id('taskReplyForm')->render();
     $data .= button::init()->addStyle('btn-primary')->text('Update Task')->postVar('updateTask')->id($subticket['id'])->message('Updating Task..')->addStyle('post')->icon('plus-sign')->formid('taskReplyForm')->render();
     $data .= button::init()->addStyle('btn-danger')->text('Close Task')->url("/closetask/{$subticket['id']}/")->message('Closing Task..')->icon('remove')->addStyle('get')->formid('taskReplyForm')->render();
     return $data;
 }
示例#8
0
 private function createTicketForm()
 {
     $fields = [];
     $queues = $this->query("SELECT * from queues");
     $opts = [];
     foreach ($queues as $queue) {
         $opts[] = ['val' => $queue['id'], 'text' => $queue['queue_name']];
     }
     $custdata = [];
     $companies = $this->query("SELECT * from companies ORDER by company_name ASC");
     foreach ($companies as $company) {
         $custdata[] = ['val' => $company['id'], 'text' => $company['company_name']];
     }
     $span = [];
     $fields[] = ['type' => 'select', 'var' => 'queue_id', 'opts' => $opts, 'text' => 'Queue:'];
     if ($this->isProvidingCompany()) {
         $fields[] = ['type' => 'select', 'var' => 'company_id', 'opts' => $custdata, 'text' => 'Client:'];
     }
     $fields[] = ['type' => 'input', 'var' => 'ticket_title', 'text' => 'Ticket Subject:'];
     $span[] = ['span' => 6, 'elements' => $fields];
     $fields = [];
     $fields[] = ['type' => 'textarea', 'rows' => 7, 'var' => 'ticket_body', 'span' => 12, 'text' => 'Body:'];
     $span[] = ['span' => 6, 'elements' => $fields];
     $pre = "<p>You are about to open a new ticket. Once a ticket is opened, e-mails will be sent to all appropriate parties as well as notifications inside aTikit.</p>";
     $form = form::init()->spanElements($span)->id('newTicketForm')->post('/')->render();
     return $pre . $form;
 }
示例#9
0
 function init($auto_parse = true)
 {
     parent::init(false);
     if (isset($_GET[$this->name])) {
         //$_POST=&$_GET;
         //echo "IN";
         $this->data =& $_GET;
     } elseif (!empty($this->ctrl)) {
         $this->data = $this->ctrl;
     }
     parent::init($auto_parse);
     $this->form_params['method'] = 'GET';
 }
示例#10
0
 public function showClient($content)
 {
     $id = $content['showClient'];
     $company = $this->query("SELECT * from companies WHERE id='{$id}'")[0];
     $user = $this->query("SELECT * from users WHERE company_id='{$company['id']}'")[0];
     // Going to pretty much copy the end-user signup form. (and change our postvars)
     $elements = [];
     $elements[] = ['type' => 'input', 'var' => 'user_name', 'text' => 'Full Name:', 'comment' => 'Main contact for account', 'val' => $user['user_name']];
     $elements[] = ['type' => 'input', 'var' => 'user_email', 'text' => 'E-mail Address:', 'comment' => 'Also your login to this system', 'val' => $user['user_email']];
     $elements[] = ['type' => 'password', 'var' => 'user_password', 'text' => 'Password:'******'type' => 'input', 'var' => 'user_phone', 'text' => 'Phone Number (and Extension):', 'comment' => 'xxx.xxx.xxxx ext. xxx', 'val' => $user['user_phone']];
     $elements[] = ['type' => 'input', 'var' => 'user_title', 'text' => 'Title:', 'comment' => 'Leave blank if individual', 'val' => $user['user_title']];
     $span = [];
     $span[] = ['span' => 6, 'elements' => $elements];
     $elements = [];
     $elements[] = ['type' => 'input', 'var' => 'company_name', 'text' => 'Company Name:', 'comment' => 'If individual leave this blank', 'val' => $company['company_name']];
     $elements[] = ['type' => 'input', 'var' => 'company_address', 'text' => 'Address:', 'comment' => 'Where to mail invoices if required?', 'val' => $company['company_address']];
     $elements[] = ['type' => 'input', 'var' => 'company_address2', 'text' => 'Address Line 2:', 'comment' => 'Suite, etc.', 'val' => $company['company_address2']];
     $elements[] = ['type' => 'input', 'var' => 'company_city', 'text' => 'City:', 'val' => $company['company_city']];
     $elements[] = ['type' => 'input', 'var' => 'company_state', 'text' => 'State:', 'class' => 'state', 'val' => $company['company_state']];
     $elements[] = ['type' => 'input', 'var' => 'company_zip', 'text' => 'Zip:', 'val' => $company['company_zip']];
     $span[] = ['span' => 6, 'elements' => $elements];
     $form = form::init()->spanElements($span)->id('editAccount')->post('/clients/')->render();
     $button = button::init()->formid('editAccount')->text('Edit Account')->addStyle('post')->addStyle('btn-primary')->icon('fire')->message('Modifying Account..')->postVar('editAccount')->id($company['id'])->render();
     $save = "<div class='pull-right'>{$button}</div>";
     $data .= widget::init()->icon('share-alt')->span(12)->header('Account Details')->content($form)->footer($save)->render();
     $this->exportJS(js::maskInput('state', "**"));
     $this->export($data);
 }
示例#11
0
 private function addBankAccountForm()
 {
     $pre = "<p>You are adding a bank account to your dwolla.com account. You will be able to draft payments from this account to pay any invoices you may have. Please note that we do \n\t\t\t\tnot store this information on our servers. Credit and Checking account information is stored with the respective merchant; in this case Dwolla.com</p>";
     $span = [];
     $fields = [];
     $fields[] = ['type' => 'input', 'text' => 'Routing Number', 'comment' => 'First 9 Numbers in the bottom left of the check', 'var' => 'routing'];
     $fields[] = ['type' => 'input', 'text' => 'Account Number', 'comment' => 'Account number without leading zeros', 'var' => 'account'];
     $span[] = ['span' => 6, 'elements' => $fields];
     $fields = [];
     $opts = [['val' => 'Checking', 'text' => 'Checking Account'], ['val' => 'Savings', 'text' => 'Savings Account']];
     $fields[] = ['type' => 'select', 'var' => 'type', 'text' => 'Account Type:', 'opts' => $opts];
     $fields[] = ['type' => 'input', 'text' => 'Nickname:', 'comment' => '(i.e. Chase Checking Account)', 'var' => 'nickname'];
     $span[] = ['span' => 6, 'elements' => $fields];
     $form = form::init()->post('/billing/')->id('addAccountForm')->spanelements($span)->render();
     return $pre . $form;
 }
示例#12
0
 private function createCouponForm()
 {
     $pre = "<p>Coupons are used for monthly credit card plans. If you have a specfic service that you charge, you can apply that plan and also apply a coupon code. The customer can also\n\t\t\t\t\tapply the coupon code in their billing preferences, however it will be a dropdown for admins vs. a text field for customers.</p>";
     $span = [];
     $fields = [];
     $fields[] = ['type' => 'input', 'text' => 'Coupon ID', 'comment' => 'Enter and id like HALFOFF or something coupon code-like.', 'var' => 'coupon_id'];
     $fields[] = ['type' => 'input', 'text' => 'Discount:', 'comment' => 'Enter a decimal value or a percentage. i.e 5.00 or 25%', 'var' => 'coupon_discount'];
     $span[] = ['span' => 6, 'elements' => $fields];
     $fields = [];
     $opts = [];
     $opts[] = ['val' => 'forever', 'text' => 'Forever (Every Invoice)'];
     $opts[] = ['val' => 'once', 'text' => 'Once (One Invoice Cycle)'];
     $opts[] = ['val' => 'repeating', 'text' => 'Repeating (Repeats for X Months)'];
     $fields[] = ['type' => 'select', 'text' => 'Lifespan:', 'comment' => 'How long will this coupon be in effect?', 'opts' => $opts, 'var' => 'coupon_duration'];
     $fields[] = ['type' => 'input', 'text' => 'Repeating?', 'comment' => 'If repeating, how many months should it repeat?', 'var' => 'coupon_duration_in_months'];
     $fields[] = ['type' => 'input', 'text' => 'Max Redemptions:', 'comment' => 'How many times can this coupon be claimed?', 'var' => 'coupon_max_redemptions'];
     $span[] = ['span' => 6, 'elements' => $fields];
     $form = form::init()->id('createCouponForm')->spanElements($span)->post('/admin/')->render();
     return $pre . $form;
 }
示例#13
0
 public function form($action = NULL, $method = NULL, $enctype = NULL)
 {
     echo form::init($action, $method, $enctype, array('class' => '_tk_form _tk_cmp_' . $this->name));
 }
示例#14
0
 function init()
 {
     if (AJAX) {
         $this->ajax_process();
         parent::init();
         return true;
     }
     parent::init(false);
     if (!empty($this->ctrl['unlock'])) {
         //Выбираю пользователя
         $rs = $GLOBALS[CM]->run('sql:user?u_lock=\'' . $this->ctrl['unlock'] . '\'$shrink=yes auto_query=no');
         unset($rs['u_pwd']);
         if ($rs && $rs2) {
             $GLOBALS[CM]->run('sql:user?u_id=\'' . $rs['u_id'] . '\'$auto_query=no', 'update', array('u_lock' => '', 'u_last_login' => date('Y-m-d H:i:s')));
             $_SESSION['Jlib_auth'] = array_merge($rs, $rs2, array('site_auth' => 1, 'admin_auth' => 0));
             $this->pg = $this->tpl['reg_unlocked'];
         } else {
             $this->pg = $this->tpl['reg_stilllocked'];
         }
         $tmp = new iControl(array('pg' => $this->pg));
         $tmp->get_maked();
         $this->pg = $tmp->pg;
         unset($tmp);
         $this->parsed = true;
         $this->maked = true;
         return true;
     }
     //Инициализация хранилища визарда
     $this->wizard_init();
     if (!empty($GLOBALS['Jlib_page_extra'][0]) && $GLOBALS['Jlib_page_extra'][0] == 'ulogin') {
         $this->ulogin_reg();
     }
     //Получить информацию о шагах
     //Определить шаг
     if (!empty($this->ctrl[$this->params['ctrl_steps']])) {
         $this->cur_step = $this->ctrl[$this->params['ctrl_steps']];
     } else {
         $this->cur_step = array_shift(array_keys($this->params['steps']));
     }
     //Оформить шаг
     $this->show_step();
     $this->load_params_reg();
     // инициализация
     $this->user = 0;
     if ($this->user && $this->saller) {
         // режим update
     } else {
         // режим insert
         $this->form_params['cs_mode'] = 'insert';
     }
     parent::init(true);
     $this->inited = true;
 }