现在的位置: 首页 > phpweb > 正文
phpweb会员添加医院预约次数限制。
2012年08月28日 phpweb ⁄ 共 3566字 暂无评论

 

为会员添加其他权限。

第一步:

在pwn_member_secure 里

INSERT INTO `pwn_member_secure` VALUES ('170', 'hospital', '预定次数', 'cishu', '1');

 

 

第二步:

修改界面 member admin下的member_type_rights.php 与member_rights.php

         else  if ( $securetype == "cishu" )

                   {

                                     echo "rn";

                                     echo "<s";

                                     echo "elect name="s[";

                                     echo $secureid;

                                     echo "]" >rn          ";

                                     $u = 0;

                                     for ( ;         $u <= 9;    $u++         )

                                     {

                                                        if ( $u == $nowset )

                                                        {

                                                                           echo "<option value='".$u."' selected>".$u."</option>";

                                                        }

                                                        else

                                                        {

                                                                           echo "<option value='".$u."'>".$u."</option>";

                                                        }

                                     }

                                     echo "        </select> &nbsp;rn";

                   }

 

第三步:用户登录后,把对应的权限放到cookie里面

 根目录下的post.php  在case "memberlogin" : 与case "memberreg" : 的

setcookie( "SE", $consecure ); 下面加入如下东西

 

                   $fsql->query( "select * from {P}_member_rights where memberid='{$memberid}' and securetype='cishu'" );

                   if ( $fsql->next_record( ) )

                   {

                                     $cishu = $fsql->f( "secureset" );

                   }

                                     setcookie( "CISHU", $cishu );

对 member admin下的 vmember.php 也进行同样处理

第四步:用户预约提交与打开预约页面的时候,进行提醒,预约次数已经查过限制

 

Hospital的post.php文件进行添加如下的东西

 

 

                   //判断该会员一周超过预约次数了吗

                   $cishu=$_COOKIE["CISHU"];

                                      $week = date('w');

 

if($week!='0'){

$zhouyi = date('Ymd',strtotime( '+'. 1-$week .' days' ));

 

}

else{

$zhouyi = date('Ymd',time()-6*24*3600);

}

           $msql->query("select id from {P}_hospital_yyinfo where memberid='$memberid' and yydate>='$zhouyi");

           $memberyuyuecishu=0;

                   while($msql->next_record()){

                            $idd=$msql->f('id');

                     $memberyuyuecishu++;

                   }

         if($memberyuyuecishu>$cishu){

                            echo "对不起,您7天内的预约次数已经超过了".$memberyuyuecishu.",无法预约";

                            exit;

                   }

 

修改HospitalRbtime3.php与HospitalRbcat3.php  加入

                                               //判断该会员一周超过预约次数了吗

                   $cishu=$_COOKIE["CISHU"];

                            $week = date('w');

 

if($week!='0'){

$zhouyi = date('Ymd',strtotime( '+'. 1-$week .' days' ));

 

}

else{

$zhouyi = date('Ymd',time()-6*24*3600);

}

           $msql->query("select id from {P}_hospital_yyinfo where memberid='$memberid' and yydate>='$zhouyi");

           $memberyuyuecishu=0;

                   while($msql->next_record()){

                            $idd=$msql->f('id');

                     $memberyuyuecishu++;

                   }

         if($memberyuyuecishu<$cishu){

                   $yysrc=ROOTPATH."hospital/templates/images/yy.gif";

                            $yyclass="line6_1";

                            $showtable="block";

                   }else{

                            $yysrc=ROOTPATH."hospital/templates/images/yyno2.gif";

                            $yyclass="line6_2";

                            $showtable="none";

                   }

给我留言

您必须 [ 登录 ] 才能发表留言!

×