2014级PHP程序设计
2016-2-23 14:43
请先登录。
<meta http-equiv="Content-Type" charset="utf-8"/>
<h1>the second work - 计算司龄补助</h1>
<?php
/**
*根据员工入职时间,计算司龄补助
*参数$y...
<?php
function allowance($years){
echo date('入职年份为:');
echo $years;
echo '年';
...
<?php
echo "至尊会员为A,金牌会员为B,银牌会员为C,普通会员为D,非会员为E";
echo "<br />";
function member($price,$grade){
if($grade=="A"){
$price =...
<?php
header("Content-type: text/html; charset=utf-8");
function logIn($name,$password)
{
$sName = strlen($name);
...
<?php
/*名称:司龄补助计算
* 参数:$year,入职年份
* 返回值:无
*/
function getAllowance($year)
{
$time=time();
$date=date('Y',$time);
$num=$date-$year;
...
<?php
//用户登录功能实现
function admin($name,$password){
$username = strlen($name);
$userpassword = strlen($password);
if($username&l...
<?php
header("Content-type: text/html; charset=utf-8");
function allowance($years)
{
$time = time();
date_...
function login($name,$password){
$numName = strlen($name);
$numPassword = strlen($password);
if($numName < 4){
echo '用户名长度不够';
}else i...
<?php
function vipCount($vip,$originalPrice){
switch ($vip){
case '至尊会员':
$originalPrice *= 0.75;
...
<?php
//司龄补助计算
//subsidy:司龄补助
function subsidy($year){
$time=time();
date_default_timezone_set("PRC");
$thetime=date('Y',$tim...
<?php
function seniority($money){
$time = time();
date_default_timezone_set("PRC");
echo ...
<?php
function allowance($year){
$time=time(); //获取当前时间
date_default_timezone_set("PRC"); //添加所在地时区
$time1=date(...
<?php
/**
*根据员工的入职时间计算司龄补助
*参数$year
*/
header("content-type:text/html;charst=utf-8");//编码规范
//函数
function all...
<?php
function countPrice($user,$price){
 ...
<?php
function add($name,$password){
$lenname=strlen($name);
$lenpassword=strlen($password);
if($lenname>=4&&$lenpass...
<?php
function admin($name,$password){
$sname = strlen($name);
$spassword = strlen($password);
if($sname < 4){
...
代码:
<?php
header("content-type:text/html;charset=utf-8");
function discountPrice($price,$menber)
{
...
<?php
function daZhe($price,$class){
echo "商品原价为:$price</br>";
if(...
<?php
function onLoad($username,$password){
if(strlen($username>4)){
echo "用户名长度不够<br/...
<?php
function seniority($money){
$time = time();
date_default_timezone_set("PRC");
&nbs...
<?php
function allowance($Year) {
$time = time();
$nYear = date('Y',$time);
$years = $nYear - $Year;
$money = $years ...
<?php
function vipcount($vip,$money){
switch ($vip) {
case '至尊会员':
$money *= 0.75;
echo "至尊会员商品折后价格为 $money</br&...
<?php
/**
*功能:计算商品价格
*至尊会员原价基础上打7.5折
*金牌会员原价基础上打8折
*银牌会员原价基础上8.5折
*普通会员原价基础上9.8折
*非会员不打折
*参数 $originalPrice,原价
*参数 $member,会员...
代码:
<?php
header("content-type:text/html;charset=utf-8");
function register($name,$password)
{
$nam...
<?php
function discount($member , $price){
switch($member)
{
case '至尊会员':
$price = $price * 0.75;
echo '至尊会员打折后的费用...
<?php
function discount($level,$price){
echo "商品原价为$price</br>";
switch ($level) {
case '至尊会员':
$money = $price*0.75...
<?php
function imoney($year){
$time=time();
$ntime=date('Y',$time);
$years=$ntime-$year;
if($years<=12)
&...
代码:
<?php
/**
*根据员工入职的时间计算司龄补助
*参数$entry,入职时间
*返回值,司龄补助
**/
header("content-type:text/html...
<?php
/**
* 函数:计算商品价格
* 输入参数:会员类别$user,价格$price
* 返回值:...
<?php
function user($userName,$passWord){
$numName = strlen($userName);
...