app/Customize/Controller/Admin/Customer/CustomerEditController.php line 307

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Customize\Controller\Admin\Customer;
  13. use Eccube\Controller\AbstractController;
  14. use Eccube\Entity\Master\CustomerStatus;
  15. use Eccube\Event\EccubeEvents;
  16. use Eccube\Event\EventArgs;
  17. use Eccube\Form\Type\Admin\CustomerType;
  18. use Eccube\Repository\CustomerRepository;
  19. use Eccube\Util\StringUtil;
  20. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  21. use Symfony\Component\HttpFoundation\Request;
  22. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  23. use Symfony\Component\Routing\Annotation\Route;
  24. use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
  25. class CustomerEditController extends AbstractController
  26. {
  27.     /**
  28.      * @var CustomerRepository
  29.      */
  30.     protected $customerRepository;
  31.     /**
  32.      * @var EncoderFactoryInterface
  33.      */
  34.     protected $encoderFactory;
  35.     public function __construct(
  36.         CustomerRepository $customerRepository,
  37.         EncoderFactoryInterface $encoderFactory
  38.     ) {
  39.         $this->customerRepository $customerRepository;
  40.         $this->encoderFactory $encoderFactory;
  41.     }
  42.     /**
  43.      * @Route("/%eccube_admin_route%/customer/new", name="admin_customer_new")
  44.      * @Route("/%eccube_admin_route%/customer/{id}/edit", requirements={"id" = "\d+"}, name="admin_customer_edit")
  45.      * @Template("@admin/Customer/edit.twig")
  46.      */
  47.     public function index(Request $request$id null)
  48.     {
  49.         $this->entityManager->getFilters()->enable('incomplete_order_status_hidden');
  50.         // 編集
  51.         if ($id) {
  52.             $Customer $this->customerRepository
  53.                 ->find($id);
  54.             if (is_null($Customer)) {
  55.                 throw new NotFoundHttpException();
  56.             }
  57.             $oldStatusId $Customer->getStatus()->getId();
  58.             // 編集用にデフォルトパスワードをセット
  59.             $previous_password $Customer->getPassword();
  60.             $Customer->setPassword($this->eccubeConfig['eccube_default_password']);
  61.         // 新規登録
  62.         } else {
  63.             $Customer $this->customerRepository->newCustomer();
  64.             $oldStatusId null;
  65.         }
  66.         // 会員登録フォーム
  67.         $builder $this->formFactory
  68.             ->createBuilder(CustomerType::class, $Customer);
  69.         $event = new EventArgs(
  70.             [
  71.                 'builder' => $builder,
  72.                 'Customer' => $Customer,
  73.             ],
  74.             $request
  75.         );
  76.         $this->eventDispatcher->dispatch(EccubeEvents::ADMIN_CUSTOMER_EDIT_INDEX_INITIALIZE$event);
  77.         $form $builder->getForm();
  78.         $form->handleRequest($request);
  79.         if ($form->isSubmitted() && $form->isValid()) {
  80.             log_info('会員登録開始', [$Customer->getId()]);
  81.             $encoder $this->encoderFactory->getEncoder($Customer);
  82.             if ($Customer->getPassword() === $this->eccubeConfig['eccube_default_password']) {
  83.                 $Customer->setPassword($previous_password);
  84.             } else {
  85.                 if ($Customer->getSalt() === null) {
  86.                     $Customer->setSalt($encoder->createSalt());
  87.                     $Customer->setSecretKey($this->customerRepository->getUniqueSecretKey());
  88.                 }
  89.                 $Customer->setPassword($encoder->encodePassword($Customer->getPassword(), $Customer->getSalt()));
  90.             }
  91.             // 退会ステータスに更新の場合、ダミーのアドレスに更新
  92.             $newStatusId $Customer->getStatus()->getId();
  93.             if ($oldStatusId != $newStatusId && $newStatusId == CustomerStatus::WITHDRAWING) {
  94.                 $Customer->setEmail(StringUtil::random(60).'@dummy.dummy');
  95.             }
  96.             $this->entityManager->persist($Customer);
  97.             $this->entityManager->flush();
  98.             log_info('会員登録完了', [$Customer->getId()]);
  99.             $event = new EventArgs(
  100.                 [
  101.                     'form' => $form,
  102.                     'Customer' => $Customer,
  103.                 ],
  104.                 $request
  105.             );
  106.             $this->eventDispatcher->dispatch(EccubeEvents::ADMIN_CUSTOMER_EDIT_INDEX_COMPLETE$event);
  107.             $this->addSuccess('admin.common.save_complete''admin');
  108.             return $this->redirectToRoute('admin_customer_edit', [
  109.                 'id' => $Customer->getId(),
  110.             ]);
  111.         }
  112.         return [
  113.             'form' => $form->createView(),
  114.             'Customer' => $Customer,
  115.         ];
  116.     }
  117.     /**
  118.      * @Route("/%eccube_admin_route%/customer/balance", name="admin_customer_balance")
  119.      * @Template("@admin/Customer/balance.twig")
  120.      */
  121.     public function balance(Request $request$id null)
  122.     {
  123. // DB アクセス用Class 展開
  124.         $em $this -> getDoctrine() ->getManager() ;
  125. // 初期画面か入金画面 どちらかの選択(POST Dataがない場合:初期画面)
  126. // 初期画面
  127.         if(!($request->getMethod() === 'POST')){
  128.             $query 'select * from dtb_customer where customer_status_id=2 order by create_date' ;
  129.             $statement $em->getConnection()->prepare($query) ;
  130.             $result $statement -> execute() ;
  131.             $buff $statement->fetchall() ;
  132.             $count ;
  133.             foreach($buff as $info){
  134.                 $customer_info[$count]["id"] = $info["id"] ;
  135.                 $customer_info[$count]["myouji"] = $info["name01"] ;
  136.                 $customer_info[$count]["namae"] = $info["name02"] ;
  137.                 $customer_info[$count]["kana1"] = $info["kana01"] ;
  138.                 $customer_info[$count]["kana2"] = $info["kana02"] ;
  139.                 $customer_info[$count]["number"] = $info["phone_number"] ;
  140.                 $c_id $info["id"] ;
  141.                 $query 'select input from dtb_customer_payhis where customer_id='.$c_id ;
  142.                 $statement $em->getConnection()->prepare($query) ;
  143.                 $result $statement -> execute() ;
  144.                 $buff $statement->fetchall() ;
  145.                 $total_in ;
  146.                 foreach($buff as $inp){
  147.                     $total_in $total_in $inp["input"] ;
  148.                 }
  149.                 $balance["input"] = number_format($total_in) ;
  150.                 $query 'select output from dtb_customer_payhis where customer_id='.$c_id ;
  151.                 $statement $em->getConnection()->prepare($query) ;
  152.                 $result $statement -> execute() ;
  153.                 $buff $statement->fetchall() ;
  154.                 $total_out ;
  155.                 foreach($buff as $out){
  156.                     $total_out $total_out $out["output"] ;
  157.                 }
  158.                 $balance["output"] = number_format($total_out) ;
  159.                 $customer_info[$count]["zandaka"] = number_format($total_in $total_out) ;
  160.                 $count ++ ;
  161.             }
  162.             $customer_status ;
  163.             $info = [] ;
  164.             return['customer_info' => $customer_info,'info'=>$info,'status'=>$customer_status,] ;
  165.         }
  166. // ユーザ選択または入金画面
  167.         else{
  168.             $pdata $_POST ;
  169. // ユーザー情報読み出し
  170.             $c_id $pdata["id"] ;
  171.             $query 'select id, sex_id, name01, name02, kana01, kana02 from dtb_customer where id='.$c_id ;
  172.             $statement $em->getConnection()->prepare($query) ;
  173.             $result $statement -> execute() ;
  174.             $buff $statement -> fetchall() ;
  175.             foreach($buff as $info){
  176.                 $customer_info["id"] = $info["id"] ;
  177.                 $customer_info["sex"] = $info["sex_id"] ;
  178.                 $customer_info["name1"] = $info["name01"] ;
  179.                 $customer_info["name2"] = $info["name02"] ;
  180.                 $customer_info["kana1"] = $info["kana01"] ;
  181.                 $customer_info["kana2"] = $info["kana02"] ;
  182.             }
  183.             if(!(isset($pdata["input"]))){
  184.                 $customer_status ;
  185.                 $query 'select input from dtb_customer_payhis where customer_id='.$c_id ;
  186.                 $statement $em->getConnection()->prepare($query) ;
  187.                 $result $statement -> execute() ;
  188.                 $buff $statement->fetchall() ;
  189.                 $total_in ;
  190.                 foreach($buff as $inp){
  191.                     $total_in $total_in $inp["input"] ;
  192.                 }
  193.                 $balance["input"] = number_format($total_in) ;
  194.                 $query 'select output from dtb_customer_payhis where customer_id='.$c_id ;
  195.                 $statement $em->getConnection()->prepare($query) ;
  196.                 $result $statement -> execute() ;
  197.                 $buff $statement->fetchall() ;
  198.                 $total_out ;
  199.                 foreach($buff as $out){
  200.                     $total_out $total_out $out["output"] ;
  201.                 }
  202.                 $balance["output"] = number_format($total_out) ;
  203.                 $balance["zandaka"] = number_format($total_in $total_out) ;
  204.                 return[
  205.                     'customer_info' => $customer_info,
  206.                     'balance' => $balance,
  207.                     'status'=>$customer_status,
  208.                 ] ;
  209.             }
  210.             else{
  211.                 $customer_status ;
  212. // 操作Log 保存機能追加
  213. //var_dump($_SESSION) ;
  214.                 $spl_read = ($_SESSION['_sf2_attributes']['_security_admin']) ;
  215.                 $search_word 's:30:' ;
  216.                 $read_buffer strstr($spl_read,$search_word) ;
  217.                 $breplace ='"' ;
  218.                 $areplace ='ふ' ;
  219.                 $access_buff str_replace($breplace,$areplace,$read_buffer,$number) ;
  220.                 $num_buff mb_strpos((string)$access_buff,"ふ") ;
  221.                 $num_buff $num_buff ;
  222.                 $num_buff mb_strpos((string)$access_buff,"ふ"$num_buff) ;
  223.                 $num_buff $num_buff ;
  224.                 $num_buff mb_strpos((string)$access_buff,"ふ"$num_buff) ;
  225.                 $id_numtop $num_buff ;
  226.                 $num_buff $num_buff ;
  227.                 $num_buff mb_strpos((string)$access_buff,"ふ"$num_buff) ;
  228.                 $id_numend $num_buff ;
  229.                 $cut_off $id_numend $id_numtop-;
  230.                 $cut_top$id_numtop+;
  231.                 $access_id substr((string)$access_buff,$cut_top,$cut_off) ;
  232.                 $input $pdata["input"] ;
  233.                 $create date("Y-m-d H:i:s") ;
  234.                 $query 'insert into dtb_customer_payhis (customer_id, input, create_time, access_id) values ('.$c_id.', '.$input.', "'.$create.'", "'.$access_id.'")' ;
  235.                 $statement $em->getConnection() -> prepare($query) ;
  236.                 $result $statement -> execute() ;
  237.                 $query 'select input, create_time from dtb_customer_payhis where customer_id='.$c_id ;
  238.                 $statement $em->getConnection()->prepare($query) ;
  239.                 $result $statement -> execute() ;
  240.                 $buff $statement->fetchall() ;
  241.                 $total_in ;
  242.                 foreach($buff as $inp){
  243.                     $total_in $total_in $inp["input"] ;
  244.                     if($inp["create_time"] == $create){
  245.                         $inp_cost $inp["input"] ;
  246.                     }
  247.                 }
  248.                 $balance["input"] = number_format($total_in) ;
  249.                 $query 'select output from dtb_customer_payhis where customer_id='.$c_id ;
  250.                 $statement $em->getConnection()->prepare($query) ;
  251.                 $result $statement -> execute() ;
  252.                 $buff $statement->fetchall() ;
  253.                 $total_out ;
  254.                 foreach($buff as $out){
  255.                     $total_out $total_out $out["output"] ;
  256.                 }
  257.                 $balance["output"] = number_format($total_out) ;
  258.                 $balance["zandaka"] = number_format($total_in $total_out) ;
  259.                 $balance["nyukin"] = number_format($inp_cost) ;
  260.                 return[
  261.                     'customer_info' => $customer_info,
  262.                     'balance' => $balance,
  263.                     'status'=>$customer_status,
  264.                 ] ;
  265.             }
  266.         }
  267.     }
  268.     /**
  269.      * @Route("/%eccube_admin_route%/customer/authent", name="admin_customer_authent")
  270.      * @Template("@admin/Customer/authent.twig")
  271.      */
  272.     public function authent(Request $request$id null)
  273.     {
  274. // DB アクセス用Class 展開
  275.         $p_data $_POST ;
  276.         $message '' ;
  277.         $em $this -> getDoctrine() ->getManager() ;
  278. // 初期画面か入金画面 どちらかの選択(POST Dataがない場合:初期画面)
  279. // 初期画面
  280.         if(!isset($p_data['mode'])){
  281. //            $info['status'] = 1 ;
  282.             $query 'select * from dtb_customer where customer_status_id=1' ;
  283.             $statement $em->getConnection()->prepare($query) ;
  284.             $result $statement->execute() ;
  285.             $buff $statement->fetchall() ;
  286.             $count ;
  287.             foreach($buff as $a){
  288.                 $info[$count]['id'] = $a['id'] ;
  289.                 $info[$count]['sex'] = $a['sex_id'] ;
  290.                 $info[$count]['name1'] = $a['name01'] ;
  291.                 $info[$count]['name2'] = $a['name02'] ;
  292.                 $info[$count]['comp'] = $a['company_name'] ;
  293.                 $info[$count]['addr1'] = $a['addr01'] ;
  294.                 $info[$count]['addr2'] = $a['addr02'] ;
  295.                 $info[$count]['phone'] = $a['phone_number'] ;
  296.                 $info[$count]['status'] = ;
  297.                 $count ++ ;
  298.             }
  299.             return[
  300.                 'info'=>$info,
  301.                 'msg'=>$message,
  302.             ] ;
  303.         }
  304.         else{
  305.             if ($p_data['mode'] == 'confirmed'){
  306. //                $info['status'] = 2 ;
  307.                 $count ;
  308.                 foreach($p_data['auth'] as $a){
  309.                     if(isset($a['select'])){
  310.                         if($a['select'] == 1){
  311.                             $id $a['id'] ;
  312.                             $query 'select * from dtb_customer where id='.$id ;
  313.                             $statement $em->getConnection()->prepare($query) ;
  314.                             $result $statement->execute() ;
  315.                             $buff $statement->fetchall() ;
  316.                             foreach($buff as $a){
  317.                                 $info[$count]['id'] = $a['id'] ;
  318.                                 $info[$count]['sex'] = $a['sex_id'] ;
  319.                                 $info[$count]['name1'] = $a['name01'] ;
  320.                                 $info[$count]['name2'] = $a['name02'] ;
  321.                                 $info[$count]['comp'] = $a['company_name'] ;
  322.                                 $info[$count]['addr1'] = $a['addr01'] ;
  323.                                 $info[$count]['addr2'] = $a['addr02'] ;
  324.                                 $info[$count]['phone'] = $a['phone_number'] ;
  325.                                 $info[$count]['status'] = ;
  326.                             }
  327.                             $count++ ;
  328.                         }
  329.                     }
  330.                 }
  331.                 if($count == 0){
  332.                     $query 'select * from dtb_customer where customer_status_id=1' ;
  333.                     $statement $em->getConnection()->prepare($query) ;
  334.                     $result $statement->execute() ;
  335.                     $buff $statement->fetchall() ;
  336.                     $count ;
  337.                     foreach($buff as $a){
  338.                         $info[$count]['id'] = $a['id'] ;
  339.                         $info[$count]['sex'] = $a['sex_id'] ;
  340.                         $info[$count]['name1'] = $a['name01'] ;
  341.                         $info[$count]['name2'] = $a['name02'] ;
  342.                         $info[$count]['comp'] = $a['company_name'] ;
  343.                         $info[$count]['addr1'] = $a['addr01'] ;
  344.                         $info[$count]['addr2'] = $a['addr02'] ;
  345.                         $info[$count]['phone'] = $a['phone_number'] ;
  346.                         $info[$count]['status'] = ;
  347.                         $count ++ ;
  348.                     }
  349.                     $message '1' ;
  350.                 }
  351.                 return[
  352.                     'info'=>$info,
  353.                     'msg'=>$message,
  354.                 ] ;
  355.             }
  356.             else{
  357.                 $query 'select email01,email03,email04 from dtb_base_info' ;
  358.                 $statement $em->getConnection()->prepare($query) ;
  359.                 $result $statement->execute() ;
  360.                 $buff $statement->fetchall() ;
  361.                 foreach($buff as $a){
  362.                     $from $a['email01'] ;
  363.                     $bcc   $a['email03'] ;
  364.                     $path  $a['email04'] ;
  365.                 }
  366.                 foreach($p_data['auth'] as $a){
  367.                     $create date("Y-m-d H:i:s") ;
  368.                     $id $a['id'] ;
  369.                     $query 'UPDATE dtb_customer SET customer_status_id=2, update_date= "'.$create.'" where id='.$id ;
  370.                     $statement $em->getConnection()->prepare($query) ;
  371.                     $result $statement->execute() ;
  372.                     $query 'select * from dtb_customer where id='.$id ;
  373.                     $statement $em->getConnection()->prepare($query) ;
  374.                     $result $statement->execute() ;
  375.                     $buff $statement->fetchall() ;
  376.                     foreach($buff as $b){
  377.                         $id $b['id'] ;
  378.                         $name1 $b['name01'] ;
  379.                         $name2 $b['name02'] ;
  380.                         $kana1  $b['kana01'] ;
  381.                         $kana2  $b['kana02'] ;
  382.                         $addr    $b['email'] ;
  383.                     }
  384.                     $header_msg =$name1.' '.$name2.' 様 ('.$kana1.' '.$kana2.'様)' ;
  385.                     $footer_msg1 "お客様の会員登録が完了いたしましたので、ご連絡差し上げます" ;
  386.                     $footer_msg2 "ご登録のID及びパスワードにて「ログイン」可能です。" ;
  387.                     $mail $header_msg."\n\n" ;
  388.                     $mail .= $footer_msg1."\n" ;
  389.                     $mail .= $footer_msg2."\n" ;
  390.                     $mail .= "\n本メールは淘淘市場より、送信しております。\nもし、お心当たりがない場合は、その旨".$from."
  391.                                     までご連絡頂ければ幸いです" ;
  392. //日本語設定を行う
  393.                     mb_language("Japanese");
  394.                     mb_internal_encoding("UTF-8");
  395.                     $mail_to    $addr ;          //送信先メールアドレス
  396.                     $mail_subject   "会員登録完了のお知らせ";   //メールの件名
  397.                     $mail_body  $mail;                //メールの本文
  398.                     $mail_header "from:".$from;           //フォームで入力されたメールアドレスを送信元として表示する
  399.                     $mail_header .= "\n" ;
  400.                     $mail_header .= "Bcc:".$bcc ;
  401.                     $mail_path "-f$path;
  402.                     $mailsend mb_send_mail($mail_to$mail_subject$mail_body$mail_header,$mail_path);
  403.                 }
  404.                 $info[0]['status'] = ;
  405.                 return[
  406.                     'info'=>$info,
  407.                 ] ;
  408.             }
  409.         }
  410.     }
  411.     /**
  412.      * @Route("/%eccube_admin_route%/customer/acclog", name="admin_customer_acclog")
  413.      * @Template("@admin/Customer/acclog.twig")
  414.      */
  415.     public function acclog(Request $request$id null){
  416.         $p_data=$_POST ;
  417.         var_dump($p_data) ;
  418.         $em $this -> getDoctrine() ->getManager() ;
  419.         $info = [] ;
  420.         $opt_val=[] ;
  421.         if(!isset($p_data['page'])){
  422.             $page ;
  423.         }
  424.         else{
  425.             $page $p_data['page'] ;
  426.             if(isset($p_data['offset_page_p'])){
  427.                 $page $page ;
  428.                 if($page <= 0){
  429.                     $page ;
  430.                 }
  431.             }
  432.             elseif(isset($p_data['offset_page_n'])){
  433.                 $page $page ;
  434.             }
  435.         }
  436.         $c_id false ;
  437.         if(isset($p_data['select_id'])){
  438.             $c_id $p_data['select_id'] ;
  439.             if($p_data['select_id'] != $p_data['bc_id']){
  440.                 $page ;
  441.             }
  442.         }
  443.         $time_str false ;
  444.         if(isset($p_data['period_str'])){
  445.             $time_str $p_data['period_str'] ;
  446.             if($p_data['period_str'] != $p_data['bp_str']){
  447.                 $page ;
  448.             }
  449.         }
  450.         $time_end false ;
  451.         if(isset($p_data['period_end'])){
  452.             $time_end $p_data['period_end'] ;
  453.             if($p_data['period_end'] != $p_data['bp_end']){
  454.                 $page ;
  455.             }
  456.         }
  457.         $state['page'] = $page ;
  458.         $state['c_id'] = $c_id ;
  459.         $state['end'] = $time_end ;
  460.         $state['str'] = $time_str ;
  461.         $query 'select * from dtb_customer_payhis' ;
  462.         $cquery '' ;
  463.         $tsquery '' ;
  464.         $teqyert '' ;
  465.         $flg_where ;
  466.         if($c_id){
  467.             $cquery ' Where customer_id = '.$c_id ;
  468.             $flg_where ;
  469.             $query $query.$cquery ;
  470.         }
  471.         if($time_str){
  472.             if($flg_where == 0){
  473.                 $tsquery ' Where "'.$time_str.'" <= create_time' ;
  474.                 $flg_where ;
  475.             }
  476.             else{
  477.                 $tsquery ' and "'.$time_str.'" <= create_time' ;
  478.             }
  479.             $query$query.$tsquery ;
  480.         }
  481.         if($time_end){
  482.             if($flg_where == 0){
  483.                 $tequery ' Where create_time <= "'.$time_end.'"' ;
  484.                 $flg_where ;
  485.             }
  486.             else{
  487.                 $tequery ' and create_time <= "'.$time_end.'"' ;
  488.             }
  489.             $query=$query.$tequery ;
  490.         }
  491.         $query $query.' order by create_time desc' ;
  492.         $statement $em->getConnection()->prepare($query) ;
  493.         $result $statement->execute() ;
  494.         $buff $statement->fetchall() ;
  495.         $count ;
  496.         foreach($buff as $a){
  497.             $ibuff[$count]['c_id'] = $a['customer_id'] ;
  498.             $balance $a['input'] ;
  499.             $ibuff[$count]['input'] = number_format($balance) ;
  500.             $ibuff[$count]['time'] = $a['create_time'] ;
  501.             $ibuff[$count]['access'] = $a['access_id'] ;
  502.             $id $a['customer_id'] ;
  503.             $query 'select name01, name02 from dtb_customer where id='.$id ;
  504.             $statement $em->getConnection()->prepare($query) ;
  505.             $result $statement->execute() ;
  506.             $buff1 $statement -> fetch() ;
  507.             $name $buff1['name01'].' '.$buff1['name02'] ;
  508.             $ibuff[$count]['name'] = $name ;
  509.             $count ++ ;
  510.         }
  511.         $roll $page*(30/3) ;
  512.         $ct_option ;
  513.         $state['terminate'] = ;
  514.         for($subcount 0$subcount<(30/3); $subcount++ ){
  515.             $offcount $roll+$subcount ;
  516.             if(isset($ibuff[$offcount]['c_id'])){
  517.                 $info[$subcount]['c_id'] = $ibuff[$offcount]['c_id'] ;
  518.                 $info[$subcount]['input'] = $ibuff[$offcount]['input'] ;
  519.                 $info[$subcount]['time'] = $ibuff[$offcount]['time'] ;
  520.                 $info[$subcount]['access'] = $ibuff[$offcount]['access'] ;
  521.                 $info[$subcount]['name'] = $ibuff[$offcount]['name'] ;
  522.                 if(isset($opt_val[0]['c_id'])){
  523.                     $flg_confirm ;
  524.                     for($i=0$i$ct_option$i++){
  525.                         if($opt_val[($i)]['c_id'] == $info[$subcount]['c_id']){
  526.                             $flg_confirm =;
  527.                         }
  528.                     }
  529.                     if($flg_confirm == 0){
  530.                         $opt_val[$ct_option]['c_id'] = $info[$subcount]['c_id'] ;
  531.                         $opt_val[$ct_option]['name'] = $info[$subcount]['name'] ;
  532.                         if((isset($p_data['select_id'])) && ($p_data['select_id'] == $info[$subcount]['c_id'])){
  533.                             $opt_val[$ct_option]['selstate'] = ;
  534.                         }
  535.                         else{
  536.                             $opt_val[$ct_option]['selstate'] = ;
  537.                         }
  538.                         $ct_option ++ ;
  539.                     }
  540.                 }
  541.                 else{
  542.                     $opt_val[$ct_option]['c_id'] = $info[$subcount]['c_id'] ;
  543.                     $opt_val[$ct_option]['name'] = $info[$subcount]['name'] ;
  544.                     $opt_val[$ct_option]['selstate'] = ;
  545.                     $ct_option ++ ;
  546.                 }
  547.             }
  548.             else{
  549.                 $state['terminate'] = ;
  550.                 $subcount = (30/3) ;
  551.             }
  552.         }
  553.         return[
  554.             'info'=> $info,
  555.             'opt_val'=>$opt_val,
  556.             'state' => $state,
  557.             ] ;
  558.     }
  559. }