"); print("set_name:" .$p['set_name']); print("
"); print("day:" .$p['day']); print("
"); print("flg:" .$p['flg']); print("
"); */ // テンプレート読み込み $template =& loadTemplate($p); $this->db = cs4_open(); // すでに登録がないかを確認 $where = "user_id=\"".$p['uid']."\" and set_id =\"".$p['set_id']."\""; $num = cs4_num_rows($this->db,"kty_diet_set_users",$where); //未登録の場合 if('0' == $num){ $data = array( "user_id" => $p['uid'], "set_id" => $p['set_id'], ); //DBに格納 $ret_insert = cs4_insert($this->db,"kty_diet_set_users",$data); //テンプレートの設定 if($ret_insert) { $template->setCurrentBlock('__Regist__'); $template->setVariable('set_name',$p['set_name']); $template->parseCurrentBlock(); }else{ $template->touchBlock('__ShowError2__'); $template->hideBlock('__Regist__'); } }else{ $template->touchBlock('__ShowError__'); $template->hideBlock('__Regist__'); } $template->setVariable('set_id',$p['set_id']); $template->setVariable('day',$p['day']); $template->setVariable('flg',$p['flg']); $template->show(); cs4_close($this->db); } diet_regist($p); ?>