я пытаюсь отключить дату в зависимости от дней отпуска, используя этот синтаксис, но вместо этого получаю, что все даты отключены
function GetHariLibur(){
$tanggal = date('Y');
$sql = ("select DATE_FORMAT(TANGGAL, '%d-%m-%Y') as TANGGAL from m_hari_libur where TANGGAL like '" . $tanggal . "%'");
$rows = $this->db->Execute($sql)->GetRows();
return $rows;
}
m_hari_libur — это таблица, содержащая список дней отпуска», а «Tanggal — это пример даты 01-02-2020»
это еще одна функция, которая называется «GetHariLibur»
function jurnal_harian_form() {
setlocale(LC_ALL,"US");
echo "Jurnal Harian :: Daftar SKP :: Form Jurnal Harian";
$_GET['nip'] = ($_SESSION['NIP']);
$data_profil_pegawai = $this->jurnal_mdl->get_data_statistik_Jabatan();
$harilibur = $this->jurnal_mdl->GetHariLibur();
$currentYear = date("Y");
$month = strftime("%B");
$min = date('Y-m-d', strtotime("$month $currentYear +5 days"));
$now = date('Y-m-d');
$r =0;
for ($i=1; $i < 6 ; $i++) {
$gg = date('Y-m-d',strtotime("$i $month $currentYear"));
$issun = date('w',strtotime("$gg"));
if ($issun == '6' || $issun == '0') {
$min = date('Y-m-d', strtotime("$min +1 days"));
$r++;
}
}
$hasilmin = '';
$hasilmax = '';
if($now >= $min){
$hasilmin = date('Y-m-d', strtotime("first day of $month $currentYear"));
if ($r == 1) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +1 month +6 days"));
} elseif($r == 2) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +1 month +7 days"));
}else{
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +1 month +5 days"));
}
}else if($now == $min){
$hasilmin = date('Y-m-d', strtotime("first day of $month $currentYear -1 month"));
if ($r == 1) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +5 days"));
} elseif($r == 2) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +6 days"));
}else{
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +4 days"));
}
}else{
$hasilmin = date('Y-m-d', strtotime("first day of $month $currentYear -1 month"));
if ($r == 1) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +5 days"));
} elseif($r == 2) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +6 days"));
}else{
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +4 days"));
}
}
$data = array(
"html_store" => $this->get_store_form_tambah_jurnal(),
"pegawai" => $data_profil_pegawai,
"harilibur" => $harilibur,
"minvalue" => $hasilmin,
"maxvalue" => $hasilmax
);
$this->load->view('jurnal/grid_jurnal_harian2', $data);
}
Ниже представлено представление под названиемgrid_jurnal_harian2.php. Это представление предназначено для отключения даты с помощью ext-js
items: [{
xtype: 'datefield',
name: 'TANGGAL',
fieldLabel: 'Tanggal',
value: tanggal,
disabledDays : [0,6],
disabledDates: '',
// disabledDates: ["01-01-2020", "25-01-2020", "22-03-2020", "25-03-2020", "10-04-2020", "01-05-2020", "07-05-2020", "21-05-2020", "22-05-2020", "24-05-2020", "25-05-2020", "26-05-2020", "27-05-2020", "01-06-2020", "31-07-2020", "17-08-2020", "20-08-2020", "29-11-2020", "25-12-2020"],
maxValue: '',
minValue: '',
format: 'd-m-Y',
submitFormat: 'Y-m-d',
allowBlank: false,
anchor: '50%',
handler: function() {
}
},
Подробнее здесь: https://stackoverflow.com/questions/616 ... e-in-mysql
Отключить дату в зависимости от дней отпуска в таблице в MySQL ⇐ Php
Кемеровские программисты php общаются здесь
-
Anonymous
1769415689
Anonymous
[b]я пытаюсь отключить дату в зависимости от дней отпуска, используя этот синтаксис, но вместо этого получаю, что все даты отключены[/b]
function GetHariLibur(){
$tanggal = date('Y');
$sql = ("select DATE_FORMAT(TANGGAL, '%d-%m-%Y') as TANGGAL from m_hari_libur where TANGGAL like '" . $tanggal . "%'");
$rows = $this->db->Execute($sql)->GetRows();
return $rows;
}
m_hari_libur — это таблица, содержащая список дней отпуска», а «Tanggal — это пример даты 01-02-2020»
[b]это еще одна функция, которая называется «GetHariLibur»[/b]
function jurnal_harian_form() {
setlocale(LC_ALL,"US");
echo "Jurnal Harian :: Daftar SKP :: Form Jurnal Harian";
$_GET['nip'] = ($_SESSION['NIP']);
$data_profil_pegawai = $this->jurnal_mdl->get_data_statistik_Jabatan();
$harilibur = $this->jurnal_mdl->GetHariLibur();
$currentYear = date("Y");
$month = strftime("%B");
$min = date('Y-m-d', strtotime("$month $currentYear +5 days"));
$now = date('Y-m-d');
$r =0;
for ($i=1; $i < 6 ; $i++) {
$gg = date('Y-m-d',strtotime("$i $month $currentYear"));
$issun = date('w',strtotime("$gg"));
if ($issun == '6' || $issun == '0') {
$min = date('Y-m-d', strtotime("$min +1 days"));
$r++;
}
}
$hasilmin = '';
$hasilmax = '';
if($now >= $min){
$hasilmin = date('Y-m-d', strtotime("first day of $month $currentYear"));
if ($r == 1) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +1 month +6 days"));
} elseif($r == 2) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +1 month +7 days"));
}else{
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +1 month +5 days"));
}
}else if($now == $min){
$hasilmin = date('Y-m-d', strtotime("first day of $month $currentYear -1 month"));
if ($r == 1) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +5 days"));
} elseif($r == 2) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +6 days"));
}else{
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +4 days"));
}
}else{
$hasilmin = date('Y-m-d', strtotime("first day of $month $currentYear -1 month"));
if ($r == 1) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +5 days"));
} elseif($r == 2) {
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +6 days"));
}else{
$hasilmax = date('Y-m-d', strtotime("$month $currentYear +4 days"));
}
}
$data = array(
"html_store" => $this->get_store_form_tambah_jurnal(),
"pegawai" => $data_profil_pegawai,
"harilibur" => $harilibur,
"minvalue" => $hasilmin,
"maxvalue" => $hasilmax
);
$this->load->view('jurnal/grid_jurnal_harian2', $data);
}
[b]Ниже представлено представление под названиемgrid_jurnal_harian2.php. Это представление предназначено для отключения даты с помощью ext-js[/b]
items: [{
xtype: 'datefield',
name: 'TANGGAL',
fieldLabel: 'Tanggal',
value: tanggal,
disabledDays : [0,6],
disabledDates: '',
// disabledDates: ["01-01-2020", "25-01-2020", "22-03-2020", "25-03-2020", "10-04-2020", "01-05-2020", "07-05-2020", "21-05-2020", "22-05-2020", "24-05-2020", "25-05-2020", "26-05-2020", "27-05-2020", "01-06-2020", "31-07-2020", "17-08-2020", "20-08-2020", "29-11-2020", "25-12-2020"],
maxValue: '',
minValue: '',
format: 'd-m-Y',
submitFormat: 'Y-m-d',
allowBlank: false,
anchor: '50%',
handler: function() {
}
},
Подробнее здесь: [url]https://stackoverflow.com/questions/61672030/disable-date-depend-on-vacation-days-on-table-in-mysql[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия