当前位置: 首页>>代码示例>>PHP>>正文


PHP Gadget::add_message方法代码示例

本文整理汇总了PHP中Gadget::add_message方法的典型用法代码示例。如果您正苦于以下问题:PHP Gadget::add_message方法的具体用法?PHP Gadget::add_message怎么用?PHP Gadget::add_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gadget的用法示例。


在下文中一共展示了Gadget::add_message方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: protect_page

 public static function protect_page()
 {
     if (!$_SESSION['logged_in']) {
         if (isset($_SESSION['cart_login'])) {
             $_SESSION['last_page'] = 'checkout';
             unset($_SESSION['cart_login']);
         } else {
             $_SESSION['last_page'] = $_SERVER['REQUEST_URI'];
         }
         if ($_POST) {
             $_SESSION['POST'] = $_POST;
         }
         Gadget::add_message('Please login to continue');
         Gadget::redirect('login');
     }
 }
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:16,代码来源:access.class.php

示例2: array

                        $newPromoCodeAmount = $promoCodeAmount - $giftCertAmount;
                        if ($newPromoCodeAmount < 0) {
                            $newPromoCodeAmount = 0;
                        }
                        $dbi->update('PromoCodes', array('Amount' => $newPromoCodeAmount), array('PromoCodeID' => $PromoCodeID));
                    }
                }

                //Gadget::add_message('success');
                Gadget::redirect('success2');
            } else {
                Gadget::add_message($transaction->get_error_message());
            }
        } catch (Exception $e) {
            s('Error: ' . $e->getMessage() . $transaction->get_error_message());
            Gadget::add_message($e->getMessage() . $transaction->get_error_message());
        }
    }
}

$page = Page::get_from_alias('giftcertificates');
$page->add_js('/js/giftcertificates.js');

require 'header.php';
?>
<div class="content-padding">
    <div><?php echo $page->content['main']; ?></div>
    <form class="user-form" name="giftcertificates-form" id="checkout-form" action="giftcertificates" method="post" onsubmit="return validateForm();">
        <table>
            <tbody>
                <tr style="vertical-align:top;">
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:31,代码来源:giftcertificates.php

示例3: elseif

            </form>
        </div>
        <?php 
        require 'footer.php';
        die;
    } else {
        Gadget::redirect('index');
        die;
    }
} elseif (isset($_REQUEST['submit_new_pass'])) {
    // Insert new password and set expires to 0
    $request = dbi()->q_1("SELECT * FROM password_reset_requests WHERE token_id = '" . $_SESSION['token_id'] . "'");
    dbi()->update('Customers', array('Password' => Access::create_hash($_REQUEST['new_pass'], 'strong')), 'CustomerID = ' . $request->CustomerID);
    dbi()->update('password_reset_requests', array('expires' => '0000-00-00 00:00:00'), 'token_id = \'' . $_SESSION['token_id'] . '\'');
    unset($_SESSION['token_id']);
    Gadget::add_message('Your password has been reset!');
    Gadget::redirect('login');
    die;
}
require 'header.php';
?>
<div class="content-padding">
    <form name="forgot-form" class="user-form" id="forgot-form" action="forgot" method="post">
        <table>
            <tr>
                <td>
                    <label for="forgot-email">email:</label>
                </td>
                <td>
                    <input type="text" name="forgot-email" id="forgot-email" />
                </td>
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:31,代码来源:forgot.php

示例4: array

        $errors[] = 'no message provided';
    }
    if ($errors) {
        Gadget::add_message(implode(', ', $errors));
    } else {
        $insert_data = array('Email' => $email_addr, 'Message' => $message);
        $dbi->insert('Contact', $insert_data);
        //$to_address     = 'bjorgensen@sydcon.com';
        $to_address = 'madisonandrayne2012@gmail.com';
        $email = new Email(true);
        $email->AddAddress($to_address);
        $email->Subject = 'Contact Us Submission';
        $body = '<p>The following message was submitted from the Contact Us form by ' . $email_addr . ':</p>' . htmlspecialchars($message);
        $email->MsgHTML($body);
        $email->Send();
        Gadget::add_message('Your message has been submitted.');
    }
}
$js = <<<EOT
function validate_form(){
    if(!\$('#contact-email').val()){
        alert('Please enter an email address.');
        return false;
    }
    if(!checkEmail(\$('#contact-email').val())){
        alert('Please enter a valid email address.');
        return false;
    }
    if(!\$('#contact-message').val()){
        alert('Please enter a message.');
        return false;
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:31,代码来源:contact.php

示例5: debug

/**
 * @author Brad Jorgensen <bjorgensen@sydcon.com>
 */
require 'includes/global.inc.php';
debug(0, 0, 0);
Access::protect_page();
$page = Page::get_from_alias('preferences');
$page->add_js('/js/myorder.js');
$page->add_js('slider');
$krustomer = Customer::get_current();
if ($_POST) {
    $errors = array();
    $data = clean_input($_POST);
    if ($errors) {
        Gadget::add_message(implode(', ', $errors));
    } else {
        //@todo this needs protection
        //@todo put this stuff in a class
        foreach ($data as $key => $value) {
            if (strpos($key, 'like_') === 0) {
                $insert_data = array('LikeID' => (int) substr($key, 5), 'CustomerID' => $_SESSION['CustomerID'], 'Value' => (int) $value);
                $odu = array('Value' => (int) $value);
                $dbi->insert('CustomerLikes', $insert_data, $odu);
            }
        }
        $krustomer->Allergies = $data['Allergies'];
        $krustomer->Want = implode(',', clean_input($_POST['Want']));
        $krustomer->DontWant = implode(',', clean_input($_POST['DontWant']));
        $krustomer->Comments = $data['Comments'];
        $krustomer->update();
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:30,代码来源:preferences.php

示例6: array

            if (strpos($key, 'like_') === 0) {
                $insert_data = array(
                    'LikeID'     => (int) substr($key, 5),
                    'CustomerID' => $_SESSION['CustomerID'],
                    'Value'      => (int) $value,
                );

                $odu = array(
                    'Value' => (int) $value,
                );

                $dbi->insert('CustomerLikes', $insert_data, $odu);
            }
        }

        Gadget::add_message('Your information has been saved.');
    }
}

require 'header.php';
?>
<div class="content-padding">
    <form class="user-form" name="my-form" id="my-form" action="myorder" method="post" onsubmit="return validateForm();">
        <table>
            <tbody>
                <tr>
                    <td colspan="2">
                        <h2>
                            Contact Information
                        </h2>
                    </td>
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:31,代码来源:myorder.php

示例7: switch

    if ($errors) {
        Gadget::add_message(implode(', ', $errors));
    } else {
        switch (Access::log_user_in($email, $password)) {
            case 0:
                // shouldn't get here, should be redirected
                $message = 'You have been logged in.';
                break;
            case 1:
                $message = 'incorrect password';
                break;
            case 2:
                $message = 'email address not found';
                break;
        }
        Gadget::add_message($message);
    }
}
require 'header.php';
?>
<style type="text/css">
    #login_wrapper {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    #login_left {
        width: 45%;
        border-right: 1px solid #9cc2b9;
        float: left;
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:31,代码来源:login-sydcon.php

示例8: array

                $PromoCodeID = $PromoCode->PromoCodeID;
            } else {
                $PromoCodeID = NULL;
            }
        }

        $_SESSION['subscription_update'] = array(
            'WeeklyMeals' => (int) $_POST['WeeklyMeals'],
            'WeeklyReg'   => (int) $_POST['WeeklyReg'],
            'WeeklyVeg'   => (int) $_POST['WeeklyVeg'],
            'PromoCodeID' => $PromoCodeID,
        );

        Gadget::redirect('preferences');
    }
    Gadget::add_message('Please select the number of meals and servings per week.');
}

$page = Page::get_from_alias('tasting');
$page->add_css('/css/menu.css');
$page->add_js('/js/tasting.js');

require 'header.php';
?>
<div id="content-header">
    <div id="content-header-left">
        <p class="header-p">
            our chef selects meals for you<br />
            from weekly menu plus new exclusive dishes<br />
            15% off our regular pricing, 4-week minimum
        </p>
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:31,代码来源:tasting.php

示例9: array

        ),
    ));

    if($validation->errors){
        Gadget::add_message($validation->get_errors());
    }else{
        $insert_data = array(
            'Email'    => $email,
            'Password' => Access::create_hash($password, 'strong'),
            'DeliveryZip' => $zip
        );
        $dbi->insert('Customers', $insert_data);
        if($dbi->errno == 1062){
            Gadget::add_message('This email address is already registered.');
        }else{
            Gadget::add_message('Your account has been created.');
            Gadget::redirect('login');
        }
    }
}

require 'header.php';
?>
<div class="content-padding">
    <form class="user-form" name="register-form" id="register-form" action="register" method="post" onsubmit="return validateForm();">
        <table>
            <tr>
                <td>
                    <label for="register-email">email:</label>
                </td>
                <td>
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:31,代码来源:register.php


注:本文中的Gadget::add_message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。