<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">
<channel>
    <title>MID [Serendipity Weblog] - PHP</title>
    <link>http://blog.till-daylight.org/</link>
    <description>MS-Kの適当なダイアリー</description>
    <dc:language>ja</dc:language>
    <generator>Serendipity 1.0 - http://www.s9y.org/</generator>
    <pubDate>Fri, 05 Dec 2008 04:29:53 GMT</pubDate>

    <image>
        <url>/templates/nm/img/feed.png</url>
        <title>RSS: MID [Serendipity Weblog] - PHP - MS-Kの適当なダイアリー</title>
        <link>http://blog.till-daylight.org/</link>
        <width>12</width>
        <height>12</height>
    </image>

<item>
    <title>PHP5でOOP演習：社長命令・起立！[4-4-2] 再掲（コンポジットパターン：委譲）</title>
    <link>http://blog.till-daylight.org/archives/239-PHP5OOP4-4-2.html</link>
            <category>PHP</category>
    
    <comments>http://blog.till-daylight.org/archives/239-PHP5OOP4-4-2.html#comments</comments>
    <wfw:comment>http://blog.till-daylight.org/wfwcomment.php?cid=239</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.till-daylight.org/rss.php?version=2.0&amp;type=comments&amp;cid=239</wfw:commentRss>
    

    <author>nospam@example.com (MS-K)</author>
    <content:encoded>
    &lt;p&gt;
Java本、&lt;a href=&quot;http://www.amazon.co.jp/dp/4798104183/&quot;  title=&quot;amazonで確認&quot;&gt;オブジェクト脳のつくり方&lt;/a&gt;の演習をPHP5に書き換えたものであり、
昔、はてダに書いたものの備忘録です。&lt;br /&gt;
はてダの記事が消えるまたは消した時のために保守投稿。
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;meisai.php, chumonsha.php&lt;/em&gt; は&lt;a href=&quot;./archives/238-PHP5OOP4-4-1.html&quot; &gt;4-4-1&lt;/a&gt;と全く同じものを使います。
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;juchu.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;chumonsha.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;meisai.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Juchu &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$juchuBango&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$meisai&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$meisais&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$chumonsha&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;__construct&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$juchuBango&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;juchuBango&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$juchuBango&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; addMeisai&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$meisai&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;meisais&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$meisai&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getMeisais&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;meisais&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; setChumonsha&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$chumonsha&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;chumonsha&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$chumonsha&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getChumonsha&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;chumonsha&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getJuchuBango&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;juchuBango&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// ----- ここより上部は4-4-1と同じ -----&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 以下、受注合計計算処理を追加&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getMeisaiGokei&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$gokei&lt;/span&gt; = &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$limit&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/count&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;count&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;meisais&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getMeisais&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;=&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;; &lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&amp;lt;&lt;span class=&quot;re0&quot;&gt;$limit&lt;/span&gt;; &lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;++&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$gokei&lt;/span&gt; += &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getPrice&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$gokei&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;manager.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/header&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;header&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;Content-type: text/html; charset=UTF-8&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;juchu.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Manager &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; __constract&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// サンプルデータ挿入&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// num : 受注番号&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Juchu&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// name, address : 注文者&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$chumonsha&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Chumonsha&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;MS-K&#039;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&#039;札幌市てきとーなところ&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// $number, $prodname, $price : 明細&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisai1&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Meisai&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&#039;The CLASH&#039;&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisai2&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Meisai&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&#039;SHAM 69&#039;&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2200&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;setChumonsha&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$chumonsha&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;addMeisai&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$meisai1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;addMeisai&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$meisai2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$persontmp&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getChumonsha&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getMeisais&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 表示ロジック&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$html&lt;/span&gt; =&amp;lt;&amp;lt;&amp;lt; EOD&lt;br /&gt;&lt;br /&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;受注伝票&lt;br /&gt;-----------------------------------&lt;br /&gt;受注番号　：&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getJuchuBango&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;注文者　　：&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$persontmp&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;注文者住所：&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$persontmp&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getAddress&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;table border=&lt;span class=&quot;st0&quot;&gt;&quot;1&quot;&lt;/span&gt; cellpadding=&lt;span class=&quot;st0&quot;&gt;&quot;3&quot;&lt;/span&gt; summary=&lt;span class=&quot;st0&quot;&gt;&quot;注文明細一覧&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;明細番号&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;注文商品&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;価格&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br /&gt;EOD;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// ----- ここまで、4-4-1と全く同じ -----&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// ----- 以下、コメント部分以外4-4-1と全く同じ -----&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 格納されたデータを走査&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// $gokei = 0; juchu.phpにて処理&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$limit&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/count&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;count&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getMeisais&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;=&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;; &lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&amp;lt;&lt;span class=&quot;re0&quot;&gt;$limit&lt;/span&gt;; &lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;++&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisai&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$html&lt;/span&gt; .= &lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;tr&amp;gt;&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;lt;td&amp;gt;&quot;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getMeisaiBango&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;/td&amp;gt;&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;lt;td&amp;gt;&quot;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getProdName&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;/td&amp;gt;&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;lt;td&amp;gt;&quot;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getPrice&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span class=&quot;st0&quot;&gt;&#039;円&#039;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;/td&amp;gt;&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;lt;/tr&amp;gt;&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// $gokei += $meisaistmp[$i]-&amp;gt;getPrice(); juchu.phpにて処理&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$html&lt;/span&gt; .=&amp;lt;&amp;lt;&amp;lt; EOD&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;合計金額&amp;lt;/th&amp;gt;&amp;lt;th colspan=&lt;span class=&quot;st0&quot;&gt;&quot;2&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getMeisaiGokei&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &amp;lt;!-- juchu.phpにて計算 --&amp;gt;&lt;br /&gt;円&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;EOD;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$html&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// 表示開始&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$manager&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Manager&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;re0&quot;&gt;$manager&lt;/span&gt;-&amp;gt;__constract&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
manager.phpの実行結果（&lt;a href=&quot;./archives/238-PHP5OOP4-4-1.html&quot; &gt;4-4-1&lt;/a&gt;と同じ）
&lt;/p&gt;

&lt;div class=&quot;pre&quot;&gt;&lt;pre&gt;-----------------------------------
受注伝票
-----------------------------------
受注番号　：1
注文者　　：MS-K
注文者住所：札幌市てきとーなところ
&lt;/pre&gt;

&lt;table border=&quot;1&quot; cellpadding=&quot;3&quot; summary=&quot;注文明細一覧&quot;&gt;
&lt;tr class=&quot;col&quot;&gt;
&lt;th&gt;明細番号&lt;/th&gt;&lt;th&gt;注文商品&lt;/th&gt;&lt;th&gt;価格&lt;/th&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class=&quot;row&quot;&gt;1&lt;/td&gt;
&lt;td&gt;The CLASH&lt;/td&gt;
&lt;td&gt;2000円&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class=&quot;row&quot;&gt;2&lt;/td&gt;
&lt;td&gt;SHAM 69&lt;/td&gt;
&lt;td&gt;2200円&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;th class=&quot;row&quot;&gt;合計金額&lt;/th&gt;&lt;th colspan=&quot;2&quot;&gt;4200円&lt;/th&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;  
    </content:encoded>

    <pubDate>Fri, 05 Dec 2008 13:29:53 +0900</pubDate>
    <guid isPermaLink="false">http://blog.till-daylight.org/archives/239-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.1/jp/</creativeCommons:license>
</item>
<item>
    <title>PHP5でOOP演習：社長命令・起立！[4-4-1] 再掲（コンポジットパターン：関連）</title>
    <link>http://blog.till-daylight.org/archives/238-PHP5OOP4-4-1.html</link>
            <category>PHP</category>
    
    <comments>http://blog.till-daylight.org/archives/238-PHP5OOP4-4-1.html#comments</comments>
    <wfw:comment>http://blog.till-daylight.org/wfwcomment.php?cid=238</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.till-daylight.org/rss.php?version=2.0&amp;type=comments&amp;cid=238</wfw:commentRss>
    

    <author>nospam@example.com (MS-K)</author>
    <content:encoded>
    &lt;p&gt;
Java本、&lt;a href=&quot;http://www.amazon.co.jp/dp/4798104183/&quot;  title=&quot;amazonで確認&quot;&gt;オブジェクト脳のつくり方&lt;/a&gt;の演習をPHP5に書き換えたものであり、
昔、はてダに書いたものの備忘録です。&lt;br /&gt;
はてダの記事が消えるまたは消した時のために保守投稿。
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;juchu.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;chumonsha.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;meisai.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Juchu &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$juchuBango&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$meisai&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$meisais&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$chumonsha&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;__construct&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$juchuBango&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;juchuBango&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$juchuBango&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; addMeisai&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$meisai&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;meisais&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$meisai&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getMeisais&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;meisais&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; setChumonsha&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$chumonsha&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;chumonsha&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$chumonsha&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getChumonsha&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;chumonsha&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getJuchuBango&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;juchuBango&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;meisai.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Meisai &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$number&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$prodname&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$price&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;__construct&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$number&lt;/span&gt;, &lt;span class=&quot;re0&quot;&gt;$prodname&lt;/span&gt;, &lt;span class=&quot;re0&quot;&gt;$price&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;number&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$number&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;prodname&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$prodname&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;price&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$price&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getMeisaiBango&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;number&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getProdName&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;prodname&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getPrice&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;price&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;chumonsha.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Chumonsha &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$name&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$address&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;__construct&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$name&lt;/span&gt;, &lt;span class=&quot;re0&quot;&gt;$address&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;name&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$name&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;address&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$address&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getName&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;name&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getAddress&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;address&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;manager.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/header&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;header&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;Content-type: text/html; charset=UTF-8&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;juchu.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Manager &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; __constract&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// サンプルデータ挿入&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// num : 受注番号&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Juchu&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// name, address : 注文者&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$chumonsha&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Chumonsha&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;MS-K&#039;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&#039;札幌市てきとーなところ&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// $number, $prodname, $price : 明細&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisai1&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Meisai&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&#039;The CLASH&#039;&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisai2&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Meisai&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&#039;SHAM 69&#039;&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2200&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;setChumonsha&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$chumonsha&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;addMeisai&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$meisai1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;addMeisai&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$meisai2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$persontmp&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getChumonsha&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getMeisais&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 表示ロジック&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$html&lt;/span&gt; =&amp;lt;&amp;lt;&amp;lt; EOD&lt;br /&gt;&lt;br /&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;受注伝票&lt;br /&gt;-----------------------------------&lt;br /&gt;受注番号　：&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getJuchuBango&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;注文者　　：&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$persontmp&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;注文者住所：&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$persontmp&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getAddress&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;table border=&lt;span class=&quot;st0&quot;&gt;&quot;1&quot;&lt;/span&gt; cellpadding=&lt;span class=&quot;st0&quot;&gt;&quot;3&quot;&lt;/span&gt; summary=&lt;span class=&quot;st0&quot;&gt;&quot;注文明細一覧&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;明細番号&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;注文商品&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;価格&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br /&gt;EOD;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 格納されたデータを走査&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$gokei&lt;/span&gt; = &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$limit&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/count&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;count&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$juchu&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getMeisais&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;=&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;; &lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&amp;lt;&lt;span class=&quot;re0&quot;&gt;$limit&lt;/span&gt;; &lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;++&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisai&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$html&lt;/span&gt; .= &lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;tr&amp;gt;&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;lt;td&amp;gt;&quot;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getMeisaiBango&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;/td&amp;gt;&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;lt;td&amp;gt;&quot;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getProdName&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;/td&amp;gt;&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;lt;td&amp;gt;&quot;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getPrice&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span class=&quot;st0&quot;&gt;&#039;円&#039;&lt;/span&gt;.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;/td&amp;gt;&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;lt;/tr&amp;gt;&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$gokei&lt;/span&gt; += &lt;span class=&quot;re0&quot;&gt;$meisaistmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;getPrice&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$html&lt;/span&gt; .=&amp;lt;&amp;lt;&amp;lt; EOD&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;合計金額&amp;lt;/th&amp;gt;&amp;lt;th colspan=&lt;span class=&quot;st0&quot;&gt;&quot;2&quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$gokei&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;円&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;EOD;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$html&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// 表示開始&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$manager&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Manager&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;re0&quot;&gt;$manager&lt;/span&gt;-&amp;gt;__constract&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
manager.phpの実行結果
&lt;/p&gt;

&lt;div class=&quot;pre&quot;&gt;&lt;pre&gt;-----------------------------------
受注伝票
-----------------------------------
受注番号　：1
注文者　　：MS-K
注文者住所：札幌市てきとーなところ
&lt;/pre&gt;

&lt;table border=&quot;1&quot; cellpadding=&quot;3&quot; summary=&quot;注文明細一覧&quot;&gt;
&lt;tr class=&quot;col&quot;&gt;
&lt;th&gt;明細番号&lt;/th&gt;&lt;th&gt;注文商品&lt;/th&gt;&lt;th&gt;価格&lt;/th&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class=&quot;row&quot;&gt;1&lt;/td&gt;
&lt;td&gt;The CLASH&lt;/td&gt;
&lt;td&gt;2000円&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class=&quot;row&quot;&gt;2&lt;/td&gt;
&lt;td&gt;SHAM 69&lt;/td&gt;
&lt;td&gt;2200円&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;th class=&quot;row&quot;&gt;合計金額&lt;/th&gt;&lt;th colspan=&quot;2&quot;&gt;4200円&lt;/th&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;  
    </content:encoded>

    <pubDate>Thu, 04 Dec 2008 12:33:48 +0900</pubDate>
    <guid isPermaLink="false">http://blog.till-daylight.org/archives/238-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.1/jp/</creativeCommons:license>
</item>
<item>
    <title>PHP5でOOP演習：社長命令・起立！[3-6] 再掲</title>
    <link>http://blog.till-daylight.org/archives/237-PHP5OOP3-6.html</link>
            <category>PHP</category>
    
    <comments>http://blog.till-daylight.org/archives/237-PHP5OOP3-6.html#comments</comments>
    <wfw:comment>http://blog.till-daylight.org/wfwcomment.php?cid=237</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.till-daylight.org/rss.php?version=2.0&amp;type=comments&amp;cid=237</wfw:commentRss>
    

    <author>nospam@example.com (MS-K)</author>
    <content:encoded>
    &lt;p&gt;
Java本、&lt;a href=&quot;http://www.amazon.co.jp/dp/4798104183/&quot;  title=&quot;amazonで確認&quot;&gt;オブジェクト脳のつくり方&lt;/a&gt;の演習をPHP5に書き換えたものであり、
昔、はてダに書いたものの備忘録です。&lt;br /&gt;
はてダの記事が消えるまたは消した時のために保守投稿。
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;shain.php, tanto.php, shunin.php, bucho.php&lt;/em&gt;
は、&lt;a href=&quot;./archives/236-PHP5OOP3-5.html&quot; &gt;3-5&lt;/a&gt;と全く同じものを使用します。
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;shain_factory.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; ShainFactory &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; shain_factory&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$param&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 基本給を1,000円に設定&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$kihon&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;1000&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// フォームのselectを利用して役職切り替え&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 担当&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;tanto&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Tanto&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$kihon&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 主任&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shunin&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Shunin&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$kihon&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 部長&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;bucho&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Bucho&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$kihon&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// フォームに必要な値を単に返しているだけ&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt;, &lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt;, &lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt;, &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;shacho.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/header&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;header&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;Content-type: text/html; charset=UTF-8&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$myfile&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;shacho.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;tanto.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shunin.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;bucho.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shain_factory.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// これらをShainFactoryクラスにまかせる。&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*&lt;br /&gt;if(isset($_POST[&#039;param&#039;])) {&lt;br /&gt;&amp;#160; &amp;#160; switch($_POST[&#039;param&#039;]) {&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; // 担当&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; case &#039;tanto&#039;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; $sel1 = &#039; selected=\&#039;selected\&#039;&#039;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; $shain = new Tanto($kihon);&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; break;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; // 主任&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; case &#039;shunin&#039;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; $sel2 = &#039; selected=\&#039;selected\&#039;&#039;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; $shain = new Shunin($kihon);&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; break;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; // 部長&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; case &#039;bucho&#039;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; $sel3 = &#039; selected=\&#039;selected\&#039;&#039;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; $shain = new Bucho($kihon);&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; break;&lt;br /&gt;&amp;#160; &amp;#160; }&lt;br /&gt;}&lt;br /&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/list&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;list&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt;, &lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt;, &lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt;, &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; =&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; ShainFactory::&lt;span class=&quot;me2&quot;&gt;shain_factory&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// 切り替え用のフォーム生成&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$form&lt;/span&gt; =&amp;lt;&amp;lt;&amp;lt; EOD&lt;br /&gt;&amp;lt;form method=&lt;span class=&quot;st0&quot;&gt;&quot;post&quot;&lt;/span&gt; action=&lt;span class=&quot;st0&quot;&gt;&quot;{$myfile}&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;select name=&lt;span class=&quot;st0&quot;&gt;&quot;param&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;-&quot;&lt;/span&gt;&amp;gt;-&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;tanto&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&amp;gt;担当&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;shunin&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&amp;gt;主任&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;bucho&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&amp;gt;部長&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;/select&amp;gt;&lt;br /&gt;&amp;lt;input type=&lt;span class=&quot;st0&quot;&gt;&quot;submit&quot;&lt;/span&gt; value=&lt;span class=&quot;st0&quot;&gt;&quot;切り替え&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;EOD;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// HTML出力&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;re0&quot;&gt;$form&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; != &lt;span class=&quot;kw2&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; -&amp;gt; &lt;span class=&quot;me1&quot;&gt;standup&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$kyuryo&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; -&amp;gt; &lt;span class=&quot;me1&quot;&gt;getKyuryo&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;p&amp;gt;給料は{$kyuryo}円です。&amp;lt;/p&amp;gt;&quot;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$bonus&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; -&amp;gt; &lt;span class=&quot;me1&quot;&gt;getBonus&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;p&amp;gt;ボーナスは{$bonus}円です。&amp;lt;/p&amp;gt;&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;役職未選択です。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
shacho.phpの実行結果
&lt;/p&gt;

&lt;pre&gt;（初期状態 -）役職未選択です。

（担当の場合）担当が普通に起立しました。
    　　　　　給料は1000円です。
    　　　　　ボーナスは3000円です。

（主任の場合）主任がすばやく起立しました。
    　　　　　給料は2001円です。
    　　　　　ボーナスは3000円です。

（部長の場合）部長がだるそうに起立しました。
    　　　　　給料は3000円です。
    　　　　　ボーナスは3000円です。
&lt;/pre&gt;  
    </content:encoded>

    <pubDate>Tue, 02 Dec 2008 15:11:11 +0900</pubDate>
    <guid isPermaLink="false">http://blog.till-daylight.org/archives/237-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.1/jp/</creativeCommons:license>
</item>
<item>
    <title>PHP5でOOP演習：社長命令・起立！[3-5] 再掲</title>
    <link>http://blog.till-daylight.org/archives/236-PHP5OOP3-5.html</link>
            <category>PHP</category>
    
    <comments>http://blog.till-daylight.org/archives/236-PHP5OOP3-5.html#comments</comments>
    <wfw:comment>http://blog.till-daylight.org/wfwcomment.php?cid=236</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.till-daylight.org/rss.php?version=2.0&amp;type=comments&amp;cid=236</wfw:commentRss>
    

    <author>nospam@example.com (MS-K)</author>
    <content:encoded>
    &lt;p&gt;
Java本、&lt;a href=&quot;http://www.amazon.co.jp/dp/4798104183/&quot;  title=&quot;amazonで確認&quot;&gt;オブジェクト脳のつくり方&lt;/a&gt;の演習をPHP5に書き換えたものであり、
昔、はてダに書いたものの備忘録です。&lt;br /&gt;
はてダの記事が消えるまたは消した時のために保守投稿。
&lt;/p&gt;

&lt;p&gt;
演習3-4は&lt;a href=&quot;./archives/235-PHP5OOP3-3.html&quot; &gt;3-3&lt;/a&gt;に役職をひとつ追加するだけの練習問題なので省略して、3-5に進みます。
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;shain.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw5&quot;&gt;abstract&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$kihonkyu&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;__construct&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$kihonkyu&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;kihonkyu&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$kihonkyu&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getKyuryo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;kihonkyu&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// ボーナスは役職を問わず一律&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getBonus&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;kihonkyu&lt;/span&gt; * &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;tanto.php&lt;/em&gt;&lt;small&gt; （shain.phpを継承。動作結果を変えているだけ）&lt;/small&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shain.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Tanto &lt;span class=&quot;kw5&quot;&gt;extends&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; standup&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;担当が普通に起立しました。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getKyuryo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;kihonkyu&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;shunin.php&lt;/em&gt;&lt;small&gt; （shain.phpを継承。動作結果を変えているだけ）&lt;/small&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shain.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Shunin &lt;span class=&quot;kw5&quot;&gt;extends&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; standup&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;主任がすばやく起立しました。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getKyuryo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;kihonkyu&lt;/span&gt; * &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; + &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;bucho.php&lt;/em&gt;&lt;small&gt; （shain.phpを継承。動作結果を変えているだけ）&lt;/small&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shain.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Bucho &lt;span class=&quot;kw5&quot;&gt;extends&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; standup&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;部長がだるそうに起立しました。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getKyuryo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span class=&quot;me1&quot;&gt;kihonkyu&lt;/span&gt; * &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;shacho.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/header&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;header&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;Content-type: text/html; charset=UTF-8&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$myfile&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;shacho.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;tanto.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shunin.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;bucho.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// フォームのselectを利用して役職切り替え&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// selectedの初期化&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// 基本給を1,000円に設定&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$kihon&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;1000&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 担当&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;tanto&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Tanto&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$kihon&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 主任&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shunin&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Shunin&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$kihon&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 部長&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;bucho&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Bucho&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$kihon&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// 切り替え用のフォーム生成&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$form&lt;/span&gt; =&amp;lt;&amp;lt;&amp;lt; EOD&lt;br /&gt;&amp;lt;form method=&lt;span class=&quot;st0&quot;&gt;&quot;post&quot;&lt;/span&gt; action=&lt;span class=&quot;st0&quot;&gt;&quot;{$myfile}&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;select name=&lt;span class=&quot;st0&quot;&gt;&quot;param&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;-&quot;&lt;/span&gt;&amp;gt;-&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;tanto&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&amp;gt;担当&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;shunin&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&amp;gt;主任&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;bucho&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&amp;gt;部長&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;/select&amp;gt;&lt;br /&gt;&amp;lt;input type=&lt;span class=&quot;st0&quot;&gt;&quot;submit&quot;&lt;/span&gt; value=&lt;span class=&quot;st0&quot;&gt;&quot;切り替え&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;EOD;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// HTML出力&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;re0&quot;&gt;$form&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; != &lt;span class=&quot;kw2&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; -&amp;gt; &lt;span class=&quot;me1&quot;&gt;standup&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$kyuryo&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; -&amp;gt; &lt;span class=&quot;me1&quot;&gt;getKyuryo&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;p&amp;gt;給料は{$kyuryo}円です。&amp;lt;/p&amp;gt;&quot;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$bonus&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; -&amp;gt; &lt;span class=&quot;me1&quot;&gt;getBonus&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;p&amp;gt;ボーナスは{$bonus}円です。&amp;lt;/p&amp;gt;&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;役職未選択です。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
shacho.phpの実行結果
&lt;/p&gt;

&lt;pre&gt;（初期状態 -）役職未選択です。

（担当の場合）担当が普通に起立しました。
    　　　　　給料は1000円です。
    　　　　　ボーナスは3000円です。

（主任の場合）主任がすばやく起立しました。
    　　　　　給料は2001円です。
    　　　　　ボーナスは3000円です。

（部長の場合）部長がだるそうに起立しました。
    　　　　　給料は3000円です。
    　　　　　ボーナスは3000円です。&lt;/pre&gt;  
    </content:encoded>

    <pubDate>Mon, 01 Dec 2008 13:12:07 +0900</pubDate>
    <guid isPermaLink="false">http://blog.till-daylight.org/archives/236-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.1/jp/</creativeCommons:license>
</item>
<item>
    <title>PHP5でOOP演習：社長命令・起立！[3-3] 再掲</title>
    <link>http://blog.till-daylight.org/archives/235-PHP5OOP3-3.html</link>
            <category>PHP</category>
    
    <comments>http://blog.till-daylight.org/archives/235-PHP5OOP3-3.html#comments</comments>
    <wfw:comment>http://blog.till-daylight.org/wfwcomment.php?cid=235</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.till-daylight.org/rss.php?version=2.0&amp;type=comments&amp;cid=235</wfw:commentRss>
    

    <author>nospam@example.com (MS-K)</author>
    <content:encoded>
    &lt;p&gt;
Java本、&lt;a href=&quot;http://www.amazon.co.jp/dp/4798104183/&quot;  title=&quot;amazonで確認&quot;&gt;オブジェクト脳のつくり方&lt;/a&gt;の演習をPHP5に書き換えたものであり、
昔、はてダに書いたものの備忘録です。&lt;br /&gt;
はてダの記事が消えるまたは消した時のために保守投稿。
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;shain.php&lt;/em&gt; （インターフェイス）
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw5&quot;&gt;interface&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; standup&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getKyuryo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$kihonkyu&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;tanto.php&lt;/em&gt;&lt;small&gt; （shain.phpを継承。動作結果を変えているだけ）&lt;/small&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shain.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Tanto &lt;span class=&quot;kw5&quot;&gt;implements&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; standup&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;担当が普通に起立しました。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getKyuryo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$kihonkyu&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$kihonkyu&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;shunin.php&lt;/em&gt;&lt;small&gt; （shain.phpを継承。動作結果を変えているだけ）&lt;/small&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shain.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Shunin &lt;span class=&quot;kw5&quot;&gt;implements&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; standup&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;主任がすばやく起立しました。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getKyuryo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$kihonkyu&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$kihonkyu&lt;/span&gt;*&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;+&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;bucho.php&lt;/em&gt;&lt;small&gt; （shain.phpを継承。動作結果を変えているだけ）&lt;/small&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shain.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Bucho &lt;span class=&quot;kw5&quot;&gt;implements&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; standup&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;部長がだるそうに起立しました。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; getKyuryo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$kihonkyu&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$kihonkyu&lt;/span&gt;*&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;shacho.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/header&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;header&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;Content-type: text/html; charset=UTF-8&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$myfile&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;shacho.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;tanto.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shunin.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;bucho.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// フォームのselectを利用して役職切り替え&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// selectedの初期化&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 担当&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;tanto&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Tanto&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 主任&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shunin&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Shunin&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 部長&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;bucho&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Bucho&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// 基本給を1,000円に設定&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$kihon&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;1000&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// 切り替え用のフォーム生成&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$form&lt;/span&gt; =&amp;lt;&amp;lt;&amp;lt; EOD&lt;br /&gt;&amp;lt;form method=&lt;span class=&quot;st0&quot;&gt;&quot;post&quot;&lt;/span&gt; action=&lt;span class=&quot;st0&quot;&gt;&quot;{$myfile}&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;select name=&lt;span class=&quot;st0&quot;&gt;&quot;param&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;-&quot;&lt;/span&gt;&amp;gt;-&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;tanto&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&amp;gt;担当&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;shunin&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&amp;gt;主任&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&lt;span class=&quot;st0&quot;&gt;&quot;bucho&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&amp;gt;部長&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;/select&amp;gt;&lt;br /&gt;&amp;lt;input type=&lt;span class=&quot;st0&quot;&gt;&quot;submit&quot;&lt;/span&gt; value=&lt;span class=&quot;st0&quot;&gt;&quot;切り替え&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;input type=&lt;span class=&quot;st0&quot;&gt;&quot;hidden&quot;&lt;/span&gt; name=&lt;span class=&quot;st0&quot;&gt;&quot;kihonkyu&quot;&lt;/span&gt; value=&lt;span class=&quot;st0&quot;&gt;&quot;{$kihon}&quot;&lt;/span&gt;&amp;gt; &lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;EOD;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// HTML出力&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;re0&quot;&gt;$form&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; != &lt;span class=&quot;kw2&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; -&amp;gt; &lt;span class=&quot;me1&quot;&gt;standup&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$kyuryo&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/intval&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;intval&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; -&amp;gt; &lt;span class=&quot;me1&quot;&gt;getKyuryo&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;kihonkyu&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&quot;&amp;lt;p&amp;gt;給料は{$kyuryo}円です。&amp;lt;/p&amp;gt;&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;役職未選択です。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;


&lt;p&gt;
shacho.phpの実行結果
&lt;/p&gt;

&lt;pre&gt;（初期状態 -）役職未選択です。

（担当の場合）担当が普通に起立しました。給料は1000円です。

（主任の場合）主任がすばやく起立しました。給料は2001円です。

（部長の場合）部長がだるそうに起立しました。給料は3000円です。&lt;/pre&gt;  
    </content:encoded>

    <pubDate>Mon, 01 Dec 2008 12:31:23 +0900</pubDate>
    <guid isPermaLink="false">http://blog.till-daylight.org/archives/235-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.1/jp/</creativeCommons:license>
</item>
<item>
    <title>PHP5でOOP演習：社長命令・起立！[3-2] 再掲</title>
    <link>http://blog.till-daylight.org/archives/234-PHP5OOP3-2.html</link>
            <category>PHP</category>
    
    <comments>http://blog.till-daylight.org/archives/234-PHP5OOP3-2.html#comments</comments>
    <wfw:comment>http://blog.till-daylight.org/wfwcomment.php?cid=234</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.till-daylight.org/rss.php?version=2.0&amp;type=comments&amp;cid=234</wfw:commentRss>
    

    <author>nospam@example.com (MS-K)</author>
    <content:encoded>
    &lt;p&gt;
Java本、&lt;a href=&quot;http://www.amazon.co.jp/dp/4798104183/&quot;  title=&quot;amazonで確認&quot;&gt;オブジェクト脳のつくり方&lt;/a&gt;の演習をPHP5に書き換えたものであり、
昔、はてダに書いたものの備忘録です。&lt;br /&gt;
はてダの記事が消えるまたは消した時のために保守投稿。
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;shain.php&lt;/em&gt; （インターフェイス）
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw5&quot;&gt;interface&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; standup&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;tanto.php&lt;/em&gt;&lt;small&gt; （shain.phpを継承。動作結果を変えているだけ）&lt;/small&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shain.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Tanto &lt;span class=&quot;kw5&quot;&gt;implements&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; standup&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;担当が普通に起立しました。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;shunin.php&lt;/em&gt;&lt;small&gt; （shain.phpを継承。動作結果を変えているだけ）&lt;/small&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shain.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Shunin &lt;span class=&quot;kw5&quot;&gt;implements&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; standup&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;主任がすばやく起立しました。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;bucho.php&lt;/em&gt;&lt;small&gt; （shain.phpを継承。動作結果を変えているだけ）&lt;/small&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shain.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Bucho &lt;span class=&quot;kw5&quot;&gt;implements&lt;/span&gt; Shain &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw4&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; standup&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&#039;&amp;lt;p&amp;gt;部長がだるそうに起立しました。&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw2&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;


&lt;p&gt;
&lt;em&gt;shacho.php&lt;/em&gt;
&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/header&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;header&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;Content-type: text/html; charset=UTF-8&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$myfile&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;shacho.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;tanto.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shunin.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;bucho.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// フォームのselectを利用して役職切り替え&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;span class=&quot;co1&quot;&gt;// selectedの初期化&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt; = &lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039;&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 担当&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;tanto&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel1&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Tanto&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 主任&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;shunin&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel2&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Shunin&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;co1&quot;&gt;// 部長&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;bucho&#039;&lt;/span&gt;:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$sel3&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&#039; selected=&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;selected&lt;span class=&quot;es0&quot;&gt;\&#039;&lt;/span&gt;&#039;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span class=&quot;re0&quot;&gt;$shain&lt;/span&gt; = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Bucho&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;spa