<?
//***************************************************
// http://www.scriptindonesia.com
// Solusi Hemat Script Bisnis Online Anda
// Menerima Jasa Pembuatan Website & Template Website
//***************************************************
?>
<?
//Edit Script AW 20160221
//if (session_is_registered("valid_admin")) {
  if (isset($_SESSION['valid_admin'])) {
?>
<h2><img src="images/icon-48-article.png" width="48" height="48" align="absmiddle"> Setting Banner ... </h2>
<?
switch($page) {
	default :
	//$db->select("slider1, sliderket1, slider2, sliderket2, slider3, sliderket3", "setting", "id=1");
	if($act == 1 or $act) {
?>
<div id="notice" align="center"><img src="images/notice-info.png" width="29" height="29" align="absmiddle" /><br />Banner telah berhasil diupdate !<br />Tekan F5 untuk melihat perubahan</div>
	<?
	}
	?>

<!-- BANNER 1 -->
<form id="form2" name="form2" method="post" action="?m=setbanner&amp;page=submit" enctype="multipart/form-data">

<table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#bfd6ed">
  <tr>
    <td width="100%" height="2" bgcolor="#cccccc">
    </td>
  </tr>
</table>

<table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#bfd6ed">
  <tr>
    <td width="100%" height="2" bgcolor="#cccccc">
        <!-- ------------------------------------- -->
        <div id="menu_button2" align="center">
            <strong><?= $db->config("bank2") ?></strong>
        </div>
        <!-- ------------------------------------- -->
    </td>
  </tr>
</table>

<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td height="30" bgcolor="#8c759a"><div align="center"><span class="title">&nbsp;&nbsp;<strong><u>Setting Banner Promosi</u></strong><u></u></span></div></td>
  </tr>
  <tr>
    <td width="956" bgcolor="#EF9400"><img src="../images/px1.gif" width="1" height="1" alt="" border="0"></td>
  </tr>
</table>

  <br />

  <!-- BANNER 1 -->
  <table width="70%" border="0" align="center" cellpadding="4" cellspacing="1">
    <!-- ***************************************************************** -->
    <tr class="tbl_header">
        <td colspan="2" style=""><center>Pengaturan Banner (468 x 60)</center></td>
    </tr>
    <tr> 
      <td width="45%" align="right" valign="top"></td>
      <td><input name="no" type="hidden" id="no" value="1" size="10" /></td>
    </tr>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->

    <tr>
      <? $gambargerak = "banner-468.gif";  ?>
      <td align="right" valign="top">Image Banner (1) :</td>
      <td>
                      <label>
                      <?
		  	if($gambargerak <> "") {
                      ?>
                      <img class="img-responsive" src="../images/<?= $gambargerak; ?>" alt="<?= $judul; ?>" width='468' height='60' /><br />
                      <?
                        }
                      ?>
                      <input name="imggerak" type="file" id="imggerak" size="20" class="form" />
                      </label>
                      <input name="gambargerak" type="hidden" class="form" id="gambargerak" value="<?= $gambargerak; ?>" size="12" />
      </td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left"><div align="left" class="style1 style13">Upload
                      gambar baru banner anda<br>
                      Ukuran maksimal 100KB, dimensi lebar maksimal 468 x 60 pixels,
        </div></td>
      </tr>
<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->


      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left">&nbsp;-------------------------------------------------------</td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left" class="bingkai-ket">
           <br />
           <label>
           <input name="Submit" type="submit" class="button"  value="SAVE" />
           </label>
           <label>
           <input type="button" name="cancel" id="cancel" value="CANCEL" onclick="javascript:history.go(-1)" class="cancelbutton" />
           </label>
           <br /><br />
        </td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left">&nbsp;-------------------------------------------------------</td>
      </tr>

    <!-- ***************************************************************** -->

  <tr><td colspan="2"><hr /></td></tr>
    
  </table>
</form>
<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx- -->
















<!-- BANNER 2 -->
<form id="form2" name="form2" method="post" action="?m=setbanner&amp;page=submit2" enctype="multipart/form-data">

  <!-- BANNER 2 -->
  <table width="70%" border="0" align="center" cellpadding="4" cellspacing="1">
    <!-- ***************************************************************** -->
    <tr class="tbl_header">
        <td colspan="2" style=""><center>Pengaturan Banner (125 x 125)</center></td>
    </tr>
    <tr>
      <td width="45%" align="right" valign="top"></td>
      <td><input name="no" type="hidden" id="no" value="1" size="10" /></td>
    </tr>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->

    <tr>
      <? $gambargerak = "banner-125.gif";  ?>
      <td align="right" valign="top">Image Banner (2) :</td>
      <td>
                      <label>
                      <?
		  	if($gambargerak <> "") {
                      ?>
                      <img class="img-responsive" src="../images/<?= $gambargerak; ?>" alt="<?= $judul; ?>" width='125' height='125' /><br />
                      <?
                        }
                      ?>
                      <input name="imggerak" type="file" id="imggerak" size="20" class="form" />
                      </label>
                      <input name="gambargerak" type="hidden" class="form" id="gambargerak" value="<?= $gambargerak; ?>" size="12" />
      </td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left"><div align="left" class="style1 style13">Upload
                      gambar baru banner anda<br>
                      Ukuran maksimal 100KB, dimensi lebar maksimal 125 x 125 pixels,
        </div></td>
      </tr>
<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->


      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left">&nbsp;-------------------------------------------------------</td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left" class="bingkai-ket">
           <br />
           <label>
           <input name="Submit" type="submit" class="button"  value="SAVE" />
           </label>
           <label>
           <input type="button" name="cancel" id="cancel" value="CANCEL" onclick="javascript:history.go(-1)" class="cancelbutton" />
           </label>
           <br /><br />
        </td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left">&nbsp;-------------------------------------------------------</td>
      </tr>

    <!-- ***************************************************************** -->

  <tr><td colspan="2"><hr /></td></tr>

  </table>
</form>
<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx- -->
















<!-- BANNER 3 -->
<form id="form2" name="form2" method="post" action="?m=setbanner&amp;page=submit3" enctype="multipart/form-data">

  <!-- BANNER 3 -->
  <table width="70%" border="0" align="center" cellpadding="4" cellspacing="1">
    <!-- ***************************************************************** -->
    <tr class="tbl_header">
        <td colspan="2" style=""><center>Pengaturan Banner (300 x 250)</center></td>
    </tr>
    <tr>
      <td width="45%" align="right" valign="top"></td>
      <td><input name="no" type="hidden" id="no" value="1" size="10" /></td>
    </tr>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->

    <tr>
      <? $gambargerak = "banner-300.gif";  ?>
      <td align="right" valign="top">Image Banner (3) :</td>
      <td>
                      <label>
                      <?
		  	if($gambargerak <> "") {
                      ?>
                      <img class="img-responsive" src="../images/<?= $gambargerak; ?>" alt="<?= $judul; ?>" width='300' height='250' /><br />
                      <?
                        }
                      ?>
                      <input name="imggerak" type="file" id="imggerak" size="20" class="form" />
                      </label>
                      <input name="gambargerak" type="hidden" class="form" id="gambargerak" value="<?= $gambargerak; ?>" size="12" />
      </td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left"><div align="left" class="style1 style13">Upload
                      gambar baru banner anda<br>
                      Ukuran maksimal 100KB, dimensi lebar maksimal 300 x 250 pixels,
        </div></td>
      </tr>
<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->


      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left">&nbsp;-------------------------------------------------------</td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left" class="bingkai-ket">
           <br />
           <label>
           <input name="Submit" type="submit" class="button"  value="SAVE" />
           </label>
           <label>
           <input type="button" name="cancel" id="cancel" value="CANCEL" onclick="javascript:history.go(-1)" class="cancelbutton" />
           </label>
           <br /><br />
        </td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left">&nbsp;-------------------------------------------------------</td>
      </tr>

    <!-- ***************************************************************** -->

  <tr><td colspan="2"><hr /></td></tr>

  </table>
</form>
<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx- -->







  <!-- KETERANGAN -->
  <table width="70%" border="0" align="center" cellpadding="4" cellspacing="1">
    <!-- ***************************************************************** -->
    <tr class="tbl_header">
        <td colspan="2" style=""><center>Keterangan</center></td>
    </tr>
    <tr>
      <td width="45%" align="right" valign="top"></td>
      <td><input name="no" type="hidden" id="no" value="1" size="10" /></td>
    </tr>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left"><div align="left" class="style1 style13">Gambar
                      banner akan tampil di halaman member area<br>
                      tujuannya untuk memudahkan member-member mempromosikan bisnis yang sedang dijalankan saat ini.
        </div></td>
      </tr>

    <tr>
      <td align="right" valign="top"></td>
      <td><u>Tampil disini :</u> <br /><br /><a href="../images/ketadminbanner.jpg" target="_blank"><img class="img-responsive" src="../images/ketadminbanner.jpg" width='442' height='521' title='klik untuk memperbesar' /></a><br /><br /></td>
    </tr>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->



    <!-- ***************************************************************** -->

  <tr><td colspan="2"><hr /></td></tr>

  </table>

















<p>&nbsp;</p>
<?
	break;

        // BANNER1
	case submit :
            function getFileExtension($filename){
            return substr($filename, strrpos($filename, '.'));
            }

            if(getFileExtension($img1_name) == ".php" or getFileExtension($img1_name) == ".PHP" or getFileExtension($img1_name) == ".php4" or getFileExtension($img1_name) == ".PHP4" or getFileExtension($img1_name) == ".php5" or getFileExtension($img1_name) == ".PHP5" or getFileExtension($img1_name) == ".exe" or getFileExtension($img1_name) == ".EXE "or getFileExtension($img1_name) == ".htm" or getFileExtension($img1_name) == ".HTM" or getFileExtension($img1_name) == ".html" or getFileExtension($img1_name) == ".HTML" or getFileExtension($img1_name) == ".bat" or getFileExtension($img1_name) == ".BAT") {
                echo "<p>&nbsp;</p><p align=center style='color:red'><b>File harus berupa file image (jpg, gif atau png)</b></p>";

	} else {

	//---------upload foto slider
		if($imggerak <> "") {
			$imggerak_name="banner-468.gif";
                        $gambargerak = $imggerak_name;
			$file = "../images/$imggerak_name";
			@copy("$imggerak" , $file);
		} else {
                        //$foto = $foto2;
		}

                echo "<meta http-equiv='refresh' content='0;URL=?m=setbanner&act=1'>";
                break;
                }





                
        // BANNER2
	case submit2 :
            function getFileExtension($filename){
            return substr($filename, strrpos($filename, '.'));
            }

            if(getFileExtension($img1_name) == ".php" or getFileExtension($img1_name) == ".PHP" or getFileExtension($img1_name) == ".php4" or getFileExtension($img1_name) == ".PHP4" or getFileExtension($img1_name) == ".php5" or getFileExtension($img1_name) == ".PHP5" or getFileExtension($img1_name) == ".exe" or getFileExtension($img1_name) == ".EXE "or getFileExtension($img1_name) == ".htm" or getFileExtension($img1_name) == ".HTM" or getFileExtension($img1_name) == ".html" or getFileExtension($img1_name) == ".HTML" or getFileExtension($img1_name) == ".bat" or getFileExtension($img1_name) == ".BAT") {
                echo "<p>&nbsp;</p><p align=center style='color:red'><b>File harus berupa file image (jpg, gif atau png)</b></p>";

	} else {

	//---------upload foto slider
		if($imggerak <> "") {
			$imggerak_name="banner-125.gif";
                        $gambargerak = $imggerak_name;
			$file = "../images/$imggerak_name";
			@copy("$imggerak" , $file);
		} else {
                        //$foto = $foto2;
		}

                echo "<meta http-equiv='refresh' content='0;URL=?m=setbanner&act=1'>";
                break;
                }


        // BANNER3
	case submit3 :
            function getFileExtension($filename){
            return substr($filename, strrpos($filename, '.'));
            }

            if(getFileExtension($img1_name) == ".php" or getFileExtension($img1_name) == ".PHP" or getFileExtension($img1_name) == ".php4" or getFileExtension($img1_name) == ".PHP4" or getFileExtension($img1_name) == ".php5" or getFileExtension($img1_name) == ".PHP5" or getFileExtension($img1_name) == ".exe" or getFileExtension($img1_name) == ".EXE "or getFileExtension($img1_name) == ".htm" or getFileExtension($img1_name) == ".HTM" or getFileExtension($img1_name) == ".html" or getFileExtension($img1_name) == ".HTML" or getFileExtension($img1_name) == ".bat" or getFileExtension($img1_name) == ".BAT") {
                echo "<p>&nbsp;</p><p align=center style='color:red'><b>File harus berupa file image (jpg, gif atau png)</b></p>";

	} else {

	//---------upload foto slider
		if($imggerak <> "") {
			$imggerak_name="banner-300.gif";
                        $gambargerak = $imggerak_name;
			$file = "../images/$imggerak_name";
			@copy("$imggerak" , $file);
		} else {
                        //$foto = $foto2;
		}

                echo "<meta http-equiv='refresh' content='0;URL=?m=setbanner&act=1'>";
                break;
                }


}
?>	
<?
} else {
echo "<meta http-equiv=\"refresh\" content=\"1; url=illegal.html\">";
}
?>