资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

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://cdkjz.cn/article/ihdcde.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220