Ajax+juqery+php之两个selectoption控件传值

创新互联专注于网站建设,为客户提供成都网站建设、成都网站设计、网页设计开发服务,多年建网站服务经验,各类网站都可以开发,品牌网站建设,公司官网,公司展示网站,网站设计,建网站费用,建网站多少钱,价格优惠,收费合理。

for($i=0;$i<$num;$i++)

{  

    $n=$i+1;

  echo "$n";

   $idd='stt_'.$i ;

   echo "";

   $add='add_'.$i ;

  echo "

";

  

    $id1='user_'."$i";

    echo "";

 echo"";

 }

echo "";

?>

//find_user.php

require_once('/php/public/id.inc');

require_once('/php/public/opendb.inc');

require("/php/public/power.inc");

header("Content-type: text/html;charset=utf-8");

    function field_ora($sql) {

 global $dbhUTF;

 $stmt = $dbhUTF->prepare("$sql");

 if ($stmt->execute()) {

  return  $stmt->fetch();

 }

    }

$inno=$_POST[inno];

          $sql_exx="select depart_no from acc_gl_depart where acc_depart_no='$inno'";

          $sql_exp=$dbhUTF->prepare($sql_exx);

 $sql_exp->execute();

 list($dept_clear)=$sql_exp->fetch();

 

 

 if($dept_clear=='516000'){

 

   $sql4="select employee_no,name,get_depart(employee_no)

from employee

where depart_no ='$dept_clear' and lead_code='20' ";

 $sql4_exe=$dbhUTF->prepare($sql4);

 $sql4_exe->execute();

 $i=0;

 while (list($employee_no,$name,$dept_no)=$sql4_exe->fetch()){

#echo "$employee_no-$name-$dept_no";

 $a[$i]=array('empl'=>$employee_no,'name'=>$name,'dep'=>$dept_no);

 $i++;

}

    }

 elseif($dept_clear=='300001' or $dept_clear=='300002' or $dept_clear=='300003' or $dept_clear=='300004'){

 

  $dep_no3=substr($dept_clear,0,2);

 $sql4="select employee_no,name(employee_no),get_depart(employee_no)

from psm_double_work

where depart_no like '$dep_no3%'";

 $sql4_exe=$dbhUTF->prepare($sql4);

 $sql4_exe->execute();

 $i=0;

 while (list($employee_no,$name,$dept_no)=$sql4_exe->fetch()) {

#echo "$employee_no-$name-$dept_no";

 $a[$i]=array('empl'=>$employee_no,'name'=>$name,'dep'=>$dept_no);

 $i++;

}

 }

 ELSE if($dept_clear=='J11040'){

 

   $sql4="select employee_no,name,get_depart(employee_no)

from employee

where depart_no ='$dept_clear' and lead_code='50'";

 $sql4_exe=$dbhUTF->prepare($sql4);

 $sql4_exe->execute();

 $i=0;

 while (list($employee_no,$name,$dept_no)=$sql4_exe->fetch()){

#echo "$employee_no-$name-$dept_no";

 $a[$i]=array('empl'=>$employee_no,'name'=>$name,'dep'=>$dept_no);

 $i++;

}

    }

 else{

  $dep_no1=substr($dept_clear,0,5)."0";

  list($sqlcnt)=field_ora("select count(*) from psm_double_work where depart_no='$dep_no1'");

   if ($sqlcnt>0)

   {

 $sql4="select employee_no,name(employee_no),get_depart(employee_no)

from psm_double_work

where depart_no='$dep_no1' order by lead_code desc ";

 $sql4_exe=$dbhUTF->prepare($sql4);

 $sql4_exe->execute();

 $i=0;

 while (list($employee_no,$name,$dept_no)=$sql4_exe->fetch()) {

# echo "$employee_no-$name-$dept_no";

 $a[$i]=array('empl'=>$employee_no,'name'=>$name,'dep'=>$dept_no);

 $i++;

}

    }

  else

    {

$dep_no2=substr($dept_clear,0,3)."000";

list($sqlcnt2)=field_ora("select count(*) from psm_double_work where depart_no='$dep_no2'");

  if ($sqlcnt2>0)

  {

 $sql4="select employee_no,name(employee_no),get_depart(employee_no)

from psm_double_work

where depart_no='$dep_no2'";

 $sql4_exe=$dbhUTF->prepare($sql4);

 $sql4_exe->execute();

 $i=0;

 while (list($employee_no,$name,$dept_no)=$sql4_exe->fetch()) {

     #echo "$employee_no-$name-$dept_no";

  $a[$i]=array('empl'=>$employee_no,'name'=>$name,'dep'=>$dept_no);

 $i++;

   }

}

  else

{

 $dep_no3=substr($dept_clear,0,2)."0000";

 $sql4="select employee_no,name(employee_no),get_depart(employee_no)

from psm_double_work

where depart_no='$dep_no3'";

 $sql4_exe=$dbhUTF->prepare($sql4);

 $sql4_exe->execute();

 $i=0;

 while (list($employee_no,$name,$dept_no)=$sql4_exe->fetch()) {

# echo "$employee_no-$name-$dept_no";

 $a[$i]=array('empl'=>$employee_no,'name'=>$name,'dep'=>$dept_no);

 $i++;

}

  list($employee_no,$name,$dept_no)=$sql4_exe->fetch();

  if (!$employee_no) {

  $sql5="select employee_no,name(employee_no),get_depart(employee_no)

 from employee

where depart_no='$dept_clear'";

  $sql5_exe=$dbhUTF->prepare($sql5);

  $sql5_exe->execute();

                  $i=0;

 while (list($employee_no,$name,$dept_no)=$sql5_exe->fetch()) {

 #echo "$employee_no-$name-$dept_no";

  $a[$i]=array('empl'=>$employee_no,'name'=>$name,'dep'=>$dept_no);

  $i++;

}

   }

}

    }

  }

 

   echo json_encode($a);

?>


本文名称:Ajax+juqery+php之两个selectoption控件传值
文章地址:http://bzwzjz.com/article/ihdcde.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都网站建设 营销型网站建设 企业网站建设 响应式网站设计方案 专业网站建设 高端网站设计推广 成都网站设计公司 成都企业网站建设 响应式网站建设 重庆网站制作 网站建设方案 重庆外贸网站建设 营销网站建设 营销网站建设 网站设计 温江网站设计 定制网站建设多少钱 成都网站设计 重庆网站建设 成都网站建设公司 成都网站制作 成都网站制作公司