<?
//***************************************************
// 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 Slider ... </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 />Data telah berhasil diupdate !<br />Tekan F5 untuk melihat perubahan</div>
	<?
	}
	?>
<form id="form2" name="form2" method="post" action="?m=setslider&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 Slider Website</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 />

  <!-- SLIDER 1 -->
  <table width="70%" border="0" align="center" cellpadding="4" cellspacing="1">
    <!-- ***************************************************************** -->
    <tr class="tbl_header">
        <td colspan="2" style=""><center>Pengaturan Slider (1)</center></td>
    </tr>
    <tr> 
      <td width="45%" align="right" valign="top">Slider (1) :</td>
      <td><textarea name="slider1" cols="60" rows="3" id="slider1" maxlength="150"><?= $db->result(0, "slider1"); ?></textarea><br />
      <input name="no" type="hidden" id="no" value="1" size="10" /></td>
    </tr>
    <tr> 
      <td align="right" valign="top">Informasi Slider (1) :</td>
      <td><textarea name="sliderket1" cols="60" rows="3" id="sliderket1" maxlength="250"><?= $db->result(0, "sliderket1"); ?></textarea><br />
    </tr>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
    <tr>
      <? $foto = "bg1.jpg";  ?>
      <td align="right" valign="top">Background Slider (1) :</td>
      <td>
                      <label>
                      <?
		  	if($foto <> "") {
                      ?>
                      <img class="img-responsive" src="../images/slider/<?= $foto; ?>" alt="<?= $judul; ?>" width='400' height='164' /><br />
                      <?
                        }
                      ?>
                      <input name="img1" type="file" id="img1" size="20" class="form" />
                      </label>
                      <input name="foto" type="hidden" class="form" id="foto" value="<?= $foto; ?>" size="12" />          
      </td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left"><div align="left" class="style1 style13">Upload
                      gambar baru anda (hanya JPG, GIF)<br>
                      Ukuran maksimal 300KB, dimensi lebar maksimal 1400 x 501 pixels,
        </div></td>
      </tr>
<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
    <tr>
      <? $gambargerak = "img1.png";  ?>
      <td align="right" valign="top">Image Slider (1) :</td>
      <td>
                      <label>
                      <?
		  	if($gambargerak <> "") {
                      ?>
                      <img class="img-responsive" src="../images/slider/<?= $gambargerak; ?>" alt="<?= $judul; ?>" width='200' height='160' /><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 anda (hanya PNG / Transparant)<br>
                      Ukuran maksimal 200KB, dimensi lebar maksimal 425 x 340 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">&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- -->
















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

  <!-- SLIDER 2 -->
  <table width="70%" border="0" align="center" cellpadding="4" cellspacing="1">
    <tr class="tbl_header">
        <td colspan="2" style=""><center>Pengaturan Slider (2)</center></td>
    </tr>
    <tr>
      <td width="45%" align="right" valign="top">Slider (2) :</td>
      <td><textarea name="slider2" cols="60" rows="3" id="slider2" maxlength="150"><?= $db->result(0, "slider2"); ?></textarea><br />
      <input name="no" type="hidden" id="no" value="1" size="10" /></td>
    </tr>
    <tr>
      <td align="right" valign="top">Informasi Slider (2) :</td>
      <td><textarea name="sliderket2" cols="60" rows="3" id="sliderket2" maxlength="250"><?= $db->result(0, "sliderket2"); ?></textarea><br />
    </tr>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
    <tr>
      <? $foto = "bg2.jpg";  ?>
      <td align="right" valign="top">Background Slider (2) :</td>
      <td>
                      <label>
                      <?
		  	if($foto <> "") {
                      ?>
                      <img class="img-responsive" src="../images/slider/<?= $foto; ?>" alt="<?= $judul; ?>" width='400' height='164' /><br />
                      <?
                        }
                      ?>
                      <input name="img1" type="file" id="img1" size="20" class="form" />
                      </label>
                      <input name="foto" type="hidden" class="form" id="foto" value="<?= $foto; ?>" size="12" />
      </td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left"><div align="left" class="style1 style13">Upload
                      gambar baru anda (hanya JPG, GIF)<br>
                      Ukuran maksimal 300KB, dimensi lebar maksimal 1400 x 501 pixels,
        </div></td>
      </tr>
<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
    <tr>
      <? $gambargerak = "img2.png";  ?>
      <td align="right" valign="top">Image Slider (2) :</td>
      <td>
                      <label>
                      <?
		  	if($gambargerak <> "") {
                      ?>
                      <img class="img-responsive" src="../images/slider/<?= $gambargerak; ?>" alt="<?= $judul; ?>" width='200' height='160' /><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 anda (hanya PNG / Transparant)<br>
                      Ukuran maksimal 200KB, dimensi lebar maksimal 425 x 340 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">&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- -->
















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

  <!-- SLIDER 2 -->
  <table width="70%" border="0" align="center" cellpadding="4" cellspacing="1">
    <tr class="tbl_header">
        <td colspan="2" style=""><center>Pengaturan Slider (3)</center></td>
    </tr>
    <tr>
      <td width="45%" align="right" valign="top">Slider (3) :</td>
      <td><textarea name="slider3" cols="60" rows="3" id="slider3" maxlength="150"><?= $db->result(0, "slider3"); ?></textarea><br />
      <input name="no" type="hidden" id="no" value="1" size="10" /></td>
    </tr>
    <tr>
      <td align="right" valign="top">Informasi Slider (3) :</td>
      <td><textarea name="sliderket3" cols="60" rows="3" id="sliderket3" maxlength="250"><?= $db->result(0, "sliderket3"); ?></textarea><br />
    </tr>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
    <tr>
      <? $foto = "bg3.jpg";  ?>
      <td align="right" valign="top">Background Slider (3) :</td>
      <td>
                      <label>
                      <?
		  	if($foto <> "") {
                      ?>
                      <img class="img-responsive" src="../images/slider/<?= $foto; ?>" alt="<?= $judul; ?>" width='400' height='164' /><br />
                      <?
                        }
                      ?>
                      <input name="img1" type="file" id="img1" size="20" class="form" />
                      </label>
                      <input name="foto" type="hidden" class="form" id="foto" value="<?= $foto; ?>" size="12" />
      </td>
      </tr>

      <tr>
        <td valign="top">&nbsp;</td>
        <td align="left"><div align="left" class="style1 style13">Upload
                      gambar baru anda (hanya JPG, GIF)<br>
                      Ukuran maksimal 300KB, dimensi lebar maksimal 1400 x 501 pixels,
        </div></td>
      </tr>
<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
    <tr>
      <? $gambargerak = "img3.png";  ?>
      <td align="right" valign="top">Image Slider (3) :</td>
      <td>
                      <label>
                      <?
		  	if($gambargerak <> "") {
                      ?>
                      <img class="img-responsive" src="../images/slider/<?= $gambargerak; ?>" alt="<?= $judul; ?>" width='200' height='160' /><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 anda (hanya PNG / Transparant)<br>
                      Ukuran maksimal 200KB, dimensi lebar maksimal 425 x 340 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">&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- -->




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

        // SLIDER1
	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 background
		if($img1 <> "") {
			$img1_name="bg1.jpg";
                        $foto = $img1_name;
			$file = "../images/slider/$img1_name";
			@copy("$img1" , $file);
		} else {
                        //$foto = $foto2;
		}

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

                $db->update("setting", "slider1='$slider1', sliderket1='$sliderket1'", "id='$no'");
                echo "<meta http-equiv='refresh' content='0;URL=?m=setslider&act=1'>";
                break;
                }





                
        // SLIDER2
	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 background
		if($img1 <> "") {
			$img1_name="bg2.jpg";
                        $foto = $img1_name;
			$file = "../images/slider/$img1_name";
			@copy("$img1" , $file);
		} else {
		      //$foto = $foto2;
		}

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

                $db->update("setting", "slider2='$slider2', sliderket2='$sliderket2'", "id='$no'");
                echo "<meta http-equiv='refresh' content='0;URL=?m=setslider&act=1'>";
                break;
                }


        // SLIDER3
	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 background
		if($img1 <> "") {
			$img1_name="bg3.jpg";
                        $foto = $img1_name;
			$file = "../images/slider/$img1_name";
			@copy("$img1" , $file);
		} else {
		        //$foto = $foto2;
		}

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

                $db->update("setting", "slider3='$slider3', sliderket3='$sliderket3'", "id='$no'");
                echo "<meta http-equiv='refresh' content='0;URL=?m=setslider&act=1'>";
                break;
                }


	
//	case publish :
//		$db->update("content", "published='$pub'", "id='$no'");
//		echo "<meta http-equiv='refresh' content='0;URL=?m=content'>";
//	break;
//	case delete :
//		//echo "delete no $no";
//		$db->delete("content", "id=$no");
//		echo "<meta http-equiv='refresh' content='0;URL=?m=content'>";
//	break;
//
//	case frontpage :
//		$db->update("content", "frontpage='$pub'", "id='$no'");
//		echo "<meta http-equiv='refresh' content='0;URL=?m=content'>";
//	break;
}
?>	
<?
} else {
echo "<meta http-equiv=\"refresh\" content=\"1; url=illegal.html\">";
}
?>