1) || ($wscale > 1)) $scale = ($hscale > $wscale)?$hscale:$wscale; else $scale = 1; return array("w"=>floor($width / $scale),"h"=>floor($height / $scale)); } //------------------------------------------------------------------------------------------------------------------------------------------------ function displayUserID($userID,$country) { $prefixUserThai = "T"; $prefixUserFore = "F"; $country == "TH"?$newUserID=$prefixUserThai.$userID:$newUserID=$prefixUserFore.$userID; return $newUserID; } //------------------------------------------------------------------------------------------------------------------------------------------------ function setPageHeader($str="ทุนการศึกษาบุตรพนักงาน",$str2="") { ?>

load->database(); $ci->db->select('ccID,contentName,urlCI as url'); $ci->db->where('visible', 'y'); $ci->db->order_by('orderNo', 'ASC'); //$ci->db->from('content_cate'); $query = $ci->db->get('content_cate'); foreach ($query->result_array() as $row) { $mainDropdown[$row['ccID']]['name']=$row['contentName']; $mainDropdown[$row['ccID']]['url']=$row['url']; } while ($element=each($mainDropdown)) { $ci->db->select('cpID,cpID,pageName, content, contentType'); $ci->db->where('visible', 'y'); $ci->db->where('ccID', $element['key']); $ci->db->order_by('orderNo', 'ASC'); $query = $ci->db->get('content_page'); if ($query->num_rows()) { ?>
  • load->database(); $maxID = 0; $row = $ci->db->query("SELECT MAX(".strtoupper($field).") AS MAXID FROM ".strtoupper($dbName)."")->row(); if ($row) $maxID = $row->MAXID; return $maxID+1; } //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function breadcrumb($str) { ?> Please contact theatre"; $msgTxt['insertData']="Please Insert required Data."; $msgTxt['thisFile']="Please enter pdf, doc, docx, xls, xlsx, jpg, png and gif extension"; if (array_key_exists($str, $msgTxt)) return $msgTxt[$str]; else return false; } //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function showMsg($msg,$msgType='msg',$display='box') { ?> "alert-danger text-danger","fontColor"=>"fontMsgRed","faIcon"=>"fa-exclamation-triangle"):$msgArr=array("divClass"=>"text-danger","fontColor"=>"text-danger","faIcon"=>"fa-exclamation-triangle"); else $display=="box"?$msgArr=array("divClass"=>"alert-success text-success","fontColor"=>"fontMsgGreen","faIcon"=>"fa-check"):$msgArr=array("divClass"=>"text-success","fontColor"=>"text-success","faIcon"=>"fa-check"); if ((empty($msg)) or ($msg == "")) $msg = "Cannot Save Your Data. Please try again."; if ($display=="box") { ?>
      
    "เฉพาะรายชื่อใน Mail List","sendToJITMM"=>"เฉพาะสมาชิก","sentToOral"=>"เฉพาะ Oral","sentToPoster"=>"เฉพาะ Poster"); } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function get_timeTable($str) { $timeTable['regTimeup']=date('Y')."-12-15"; // ปิดการลงทะเบียน $timeTable['absTimeUpOral']=date('Y')."-08-30"; // ปิดการส่ง oral $timeTable['absTimeUp']=date('Y')."-09-30"; // ปิดการส่ง Abs $timeTable['editAbsDate']=date('Y')."-10-31"; // ปิดการแก้้ไข $timeTable['firstDate']=date('Y')."-10-31"; // หมดลงทะเบียนรอบแรก $timeTable['secondDate']=date('Y')."-11-15"; // หมดลงทะเบียนรอบสองหลังจากนี้ใช้ on site $timeTable['regTime']=array($timeTable['firstDate'],$timeTable['secondDate']); // เวลาลงทะเบียนแบบ array $timeTable['jitmmDate']="12-14 December ".date('Y'); $timeTable['jitmmDateShort']="12-14 Dec ".date('Y'); return $timeTable[$str]; } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function get_setForYear() { $setForYearDate="2020-12-31"; // ใช้ข้อมูลของปีไหย list($setForYear, $setForMonth, $setForDate) = explode("-", $setForYearDate); return $setForYear; } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function emailInfo() { return array("senderName"=> "JITMM".date("Y"),"senderEmail"=>"jitmm@mahidol.ac.th"); } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function coreMemberFee($fee=0) { return $fee; } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function coreMemberTime() { return array("startDate"=>date('Y'),"endDate"=>(date('Y')+5)); } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function pf() { return "jitmm_"; } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function webTitle() { $seoArr = unserialize (SEO_ARRAY); return $seoArr[0]; } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function get_thaiCode() { return "TH"; } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function get_prefixUser($str) { $str="thai"?$returnVal="T":$returnVal= "F"; return $returnVal; } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function get_respPayment($str) { $reponsePaymentArr['canceled'] = "Customer canceled from Payment System, No payment has been done."; $reponsePaymentArr['error'] = "Payment application error."; $reponsePaymentArr['inprocess'] = "Your transaction in process, waiting for creditcard approval result."; $reponsePaymentArr['approved'] = "Your payment has been sent."; $reponsePaymentArr['declined'] = "Creditcard authorization declined."; $reponsePaymentArr['outofservice'] = "Payment System temporary out of service"; return $reponsePaymentArr[$str]; } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function get_configPath($str="") { $imgType="gif|jpg|png"; $docType="xls|xlsx|doc|docx|pdf|jpg|png|gif"; $whSize=array(200,150); $fileSize=array("img"=>2048,"doc"=>5120); if ($str=="noImg") return "assets/img/no-profile-img.gif"; else if ($str=="qrPath") return "uploadQr/"; else if ($str=="cerPath") return array("cerImg/",$imgType,$fileSize['img'],$whSize[0],$whSize[1]); else if ($str=="userPhoto") return array("userPhoto/",$imgType,$fileSize['img'],$whSize[0],$whSize[1]); else if ($str=="adminPhoto") return array("adminPhoto/",$imgType,$fileSize['img'],$whSize[0],$whSize[1]); else if ($str=="uploadDoc") return array("uploadDoc/",$docType,$fileSize['doc']); else return array("uploadTmp/",$docType."|".$imgType,$fileSize['doc'],$whSize[0],$whSize[1]); } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ?> db->select($field); if ($cpID!="") $this->db->where('cpID', $cpID); if ($ccID!="") $this->db->where('ccID', $ccID); if ($visible!="") $this->db->where('visible', $visible); if ($smVisible!="") $this->db->where('siteMapVisible', $smVisible); $this->db->order_by($orderBy, $orderType); $query = $this->db->get('content_page'); if ($cpID!="") return $query->row_array(); else return $query->result_array(); } //---------------------------------------------------------------------------------------------------------------------------------------------------------- public function get_content_cate($ccID="",$cpID="",$visible="",$adminVisible="",$field="*",$orderBy="orderNo",$orderType="asc") { $this->db->select($field); if ($visible!="") $this->db->where('visible', $visible); if ($adminVisible!="") $this->db->where('adminVisible', $adminVisible); if ($cpID!="") $this->db->where('cpID', $cpID); if ($ccID!="") $this->db->where('ccID', $ccID); $this->db->order_by($orderBy, $orderType); $query = $this->db->get('content_cate'); if ($ccID!="") return $query->row_array(); else return $query->result_array(); } //---------------------------------------------------------------------------------------------------------------------------------------------------------- public function set_email() { $this->db->set('title',insertText($this->input->post('title'))); $this->db->set('content',insertText($this->input->post('message'))); $this->db->set('createDate',now()); if ($this->input->post('submit')=="Save") { $this->db->set('adminID',$_SESSION['veriUser']); $this->db->insert('email'); } else { $this->db->where('eID',$this->input->post('eID')); $this->db->update('email'); } if ($this->db->trans_status() === false) return false; else return true; } //---------------------------------------------------------------------------------------------------------------------------------------------------------- public function get_email($eID="",$field="*") { $this->db->select($field); if ($eID!="") $this->db->where('eID', $eID); $query = $this->db->get('email'); if ($eID!="") return $query->row_array(); else return $query->result_array(); } //---------------------------------------------------------------------------------------------------------------------------------------------------------- public function set_newsletter() { if ($this->input->post('SubmitNews')=="Submit") { $this->db->trans_start(); $this->db->set('email', $this->input->post('email')); $this->db->insert('mail_list'); } if ($this->db->trans_status() === false) { $this->db->trans_rollback(); $this->db->trans_complete(); return false; } else { $this->db->trans_commit(); $this->db->trans_complete(); return true; } } //----------------------------------------------------------------------------------------------------------------------------------------------------------------- public function get_news($nID="",$limit=3) { if ($nID!="") { $query = $this->db->query("select nID,title,content,startDate from ".pf()."news where visibleIndexPage='y' and ((`endDate` > '".dateOnly()."') or (endDate is NULL)) and ((startDate is NULL) or (startDate <= '".dateOnly()."')) and nID='".$nID."' "); return $query->row_array(); } else { $limit=="all"?$setLimit="":$setLimit="LIMIT 0,".$limit; $query = $this->db->query("select nID,title,content,startDate from ".pf()."news where visibleIndexPage='y' and ((`endDate` > '".dateOnly()."') or (endDate is NULL)) and ((startDate is NULL) or (startDate <= '".dateOnly()."')) order by startDate DESC ".$setLimit); return $query->result_array(); } } //----------------------------------------------------------------------------------------------------------------------------------------------------------------- public function get_impDate($imID="",$limit=3) { if ($imID!="") { $query = $this->db->query("select imID,impDate,title,content,startTime,endTime from ".pf()."imp_date where visible='y' and ((impDate >= '".dateOnly()."') or (endDate >= '".dateOnly()."')) and imID='".$imID."' "); return $query->row_array(); } else { $limit=="all"?$setLimit="":$setLimit="LIMIT 0,".$limit; $query = $this->db->query("select imID,impDate,title from ".pf()."imp_date where visible='y' and ((impDate >= '".dateOnly()."') or (endDate >= '".dateOnly()."')) order by impDate ASC ".$setLimit); //echo "select imID,impDate,title from ".pf()."imp_date where visible='y' and ((impDate >= '".dateOnly()."') or (endDate >= '".dateOnly()."')) order by impDate ASC LIMIT 0,3"; return $query->result_array(); } } //----------------------------------------------------------------------------------------------------------------------------------------------------------------- public function get_content($cpID) { $this->db->select('ccID,cpID,pageName,content'); $this->db->from('content_page'); $this->db->where('cpID', $cpID); $this->db->where('visible', 'y'); $query = $this->db->get(); return $query->row_array(); } } ?>