first commit

This commit is contained in:
Esolusindo_Official 2024-06-28 09:17:11 +07:00
parent 9e476a57ef
commit d8c19924e2
2998 changed files with 0 additions and 7599 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,71 +0,0 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "com.google.gms.google-services"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
android {
namespace "com.example.piring_baru"
compileSdkVersion 34
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.piring_baru"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 24
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation 'com.google.firebase:firebase-messaging:23.0.1'
}

View File

@ -1,30 +0,0 @@
{
"project_info": {
"project_number": "220117040868",
"firebase_url": "https://isipiringku-591ec-default-rtdb.firebaseio.com",
"project_id": "isipiringku-591ec",
"storage_bucket": "isipiringku-591ec.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:220117040868:android:de8af3f800a26174cc76f1",
"android_client_info": {
"package_name": "com.example.piring_baru"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDgfNsJMuy6btNq86dN0S4jqlf9Sljd18w"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@ -1,34 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="piring_baru"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>

View File

@ -1,32 +0,0 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}

View File

@ -1,5 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip

View File

@ -1,4 +0,0 @@
storePassword=solusindo
keyPassword=solusindo
keyAlias=upload
storeFile=C:/Users/fastabee/Pictures/piring/key/keystore.jks

View File

@ -1,108 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class AKG extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model("ModelAKG");
}
function index()
{
$kalori = $this->ModelAKG->get_data();
$data = array(
'body' => 'AKG/list',
'kalori' => $kalori
);
$this->load->view("index", $data);
}
public function input()
{
$kalori = $this->ModelAKG->get_data();
$data = array(
'body' => 'AKG/input',
'form' => 'AKG/form',
'kalori' => $kalori,
);
$this->load->view('index', $data);
}
public function insert()
{
$data = array(
'awal' => $this->input->post('awal'),
'akhir' => $this->input->post('akhir'),
'jenis_kelamin' => $this->input->post('jenis_kelamin'),
'energi' => $this->input->post('energi'),
'karbohidrat' => $this->input->post('karbohidrat'),
'protein' => $this->input->post('protein'),
'lemak' => $this->input->post('lemak'),
'besi' => $this->input->post('besi'),
'vitamina' => $this->input->post('vitamina'),
'vitaminc' => $this->input->post('vitaminc'),
);
if ($this->db->insert("kalori", $data)) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "AKG");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "AKG");
}
}
function edit()
{
$id = $this->uri->segment(3);
$kalori = $this->ModelAKG->get_data_edit($id);
$data = array(
'form' => 'AKG/form_edit',
'body' => 'AKG/edit',
'kalori' => $kalori,
);
$this->load->view('index', $data);
}
function update()
{
$id = $this->uri->segment(3);
$data = array(
'awal' => $this->input->post('awal'),
'akhir' => $this->input->post('akhir'),
'jenis_kelamin' => $this->input->post('jenis_kelamin'),
'energi' => $this->input->post('energi'),
'karbohidrat' => $this->input->post('karbohidrat'),
'protein' => $this->input->post('protein'),
'lemak' => $this->input->post('lemak'),
'besi' => $this->input->post('besi'),
'vitamina' => $this->input->post('vitamina'),
'vitaminc' => $this->input->post('vitaminc'),
);
$this->db->where("id_kalori", $id);
if ($this->db->update("kalori", $data)) {
// code...
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "AKG");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "AKG");
}
}
function delete()
{
$id = $this->input->post("id_kalori");
$this->db->where_in("id_kalori", $id);
if ($this->db->delete("kalori")) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "AKG");
// code...
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "AKG");
}
}
}

View File

@ -1,42 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Analisis extends CI_Controller{
public function __construct()
{
parent::__construct();
$this->load->model("ModelKonsumsi");
}
function index()
{
if (isset($_GET["start"]) && isset($_GET["end"])) { // jika ada parameter start dan end
$from = $this->input->get("start");
$till = $this->input->get("end");
$analisis = $this->ModelKonsumsi->get_analisis($from,$till);
} else { // jika tidak ada parameter start dan end maka ditampilkan semuanya
// butuh 3 data
$from = date("Y-m-d");
$till = date("Y-m-d");
$analisis = $this->ModelKonsumsi->get_analisis($from,$till);
}
$data = array(
'body' => 'Analisis/list',
'analisis' => $analisis
);
$this->load->view("index",$data);
}
public function cetak(){
$from = $this->input->post("tgl_mulai");
$till = $this->input->post("tgl_sampai");
$data = array(
'mulai' => date("d-m-Y",strtotime($from)),
'sampai' => date("d-m-Y",strtotime($till)),
'data' => $this->ModelAnalisis->get_data_darah2($from,$till)
);
$this->load->view("Analisis/cetak_analisis",$data);
}
}

View File

@ -1,216 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Artikel extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model("ModelArtikel");
}
function index()
{
$artikel = $this->ModelArtikel->get_data();
$data = array(
'body' => 'Artikel/list',
'artikel' => $artikel
);
$this->load->view('index', $data);
}
function view()
{
$id = $this->uri->segment(3);
$artikel = $this->ModelArtikel->get_data_edit($id);
$data = array(
'artikel' => $artikel,
);
$this->load->view('Artikel/view', $data);
}
public function input()
{
$artikel = $this->ModelArtikel->get_data();
$data = array(
'body' => 'Artikel/input',
'form' => 'Artikel/form',
'artikel' => $artikel,
);
$this->load->view('index', $data);
}
public function insert()
{
$patch = "desain/artikel/";
$config['upload_path'] = "" . $patch;
$config['allowed_types'] = 'jpeg|jpg|png';
$config['max_size'] = 11240;
$this->upload->initialize($config);
$this->load->library('upload', $config);
if ($this->upload->do_upload('gambar_artikel')) {
$data = array(
'judul' => $this->input->post('judul'),
'tanggal' => date("Y-m-d"),
'penulis' => $this->input->post('penulis'),
'konten' => $this->input->post('konten'),
'gambar' => $patch . $this->upload->data()["file_name"],
'gambar_artikel' => "https://isipiringku.esolusindo.com/" . $patch . $this->upload->data()["file_name"],
);
if($this->db->insert("artikel", $data)){
$id = $this->db->insert_id();
$data = array(
'view' => "https://isipiringku.esolusindo.com/Artikel/view/" . $id
);
$this->db->where("id_artikel", $id);
$this->db->update("artikel", $data);
redirect(base_url() . "Artikel");
}
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
} else {
$data = array(
'judul' => $this->input->post('judul'),
'tanggal' => date("Y-m-d"),
'penulis' => $this->input->post('penulis'),
'konten' => $this->input->post('konten'),
'gambar' => $patch . $this->upload->data()["file_name"],
'gambar_artikel' => "https://isipiringku.esolusindo.com/" . $patch . $this->upload->data()["file_name"],
'view' => "https://isipiringku.esolusindo.com/Artikel/view/" . $this->db->insert_id()
);
if ($this->db->insert("artikel", $data)) {
if($this->db->insert("artikel", $data)){
$id = $this->db->insert_id();
$data = array(
'view' => "https://isipiringku.esolusindo.com/Artikel/view/" . $id
);
$this->db->where("id_artikel", $id);
$this->db->update("artikel", $data);
}
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Artikel");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Artikel");
}
}
}
function edit()
{
$id = $this->uri->segment(3);
$artikel = $this->ModelArtikel->get_data_edit($id);
$data = array(
'body' => 'Artikel/edit',
'form' => 'Artikel/form_edit',
'artikel' => $artikel,
);
$this->load->view('index', $data);
}
public function update()
{
$id = $this->uri->segment(3);
$patch = "desain/artikel/";
$config['upload_path'] = "./" . $patch;
$config['allowed_types'] = 'jpeg|jpg|png';
$config['max_size'] = 11240;
$this->upload->initialize($config);
$this->load->library('upload', $config);
if ($_FILES["gambar_artikel"]["name"] == null) {
$data = array(
'judul' => $this->input->post('judul'),
'tanggal' => date("Y-m-d"),
'penulis' => $this->input->post('penulis'),
'konten' => $this->input->post('konten'),
//'gambar_artikel' => $patch . $this->upload->data()["file_name"],
);
$this->db->where("id_artikel", $id);
if ($this->db->update("artikel", $data)) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Artikel");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Artikel");
}
} else {
if ($this->upload->do_upload('gambar_artikel')) {
$data = array(
'judul' => $this->input->post('judul'),
'tanggal' => date("Y-m-d"),
'penulis' => $this->input->post('penulis'),
'konten' => $this->input->post('konten'),
'gambar' => $patch . $this->upload->data()["file_name"],
'gambar_artikel' => "https://isipiringku.esolusindo.com/" . $patch . $this->upload->data()["file_name"],
);
$this->db->where("id_artikel", $id);
$this->db->update("artikel", $data);
$artikel = $this->ModelArtikel->get_data_edit($id);
unlink('./'.$artikel['gambar']);
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Artikel");
} else {
$data = array(
'judul' => $this->input->post('judul'),
'tanggal' => date("Y-m-d"),
'penulis' => $this->input->post('penulis'),
'konten' => $this->input->post('konten'),
'gambar_artikel' => "https://isipiringku.esolusindo.com/" . $patch . $this->upload->data()["file_name"],
);
$this->db->where("id_artikel", $id);
if ($this->db->update("artikel", $data)) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Artikel");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Artikel");
}
}
}
}
function delete()
{
$id = $this->input->post("id_artikel");
$this->db->where_in("id_artikel", $id);
if ($this->db->delete("artikel")) {
//$this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Artikel");
// code...
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Artikel");
}
}
// function upload_file($file)
// {
// $msg = "";
// $nama = "";
// $config['upload_path'] = './desain/artikel';
// $config['allowed_types'] = '*';
// $config['max_size'] = 11240;
// echo $_FILES[$file]["name"];
// if ($_FILES[$file]["name"]) {
// $this->load->library('upload', $config);
// if (!$this->upload->do_upload($file)) {
// $msg = $this->upload->display_errors();
// echo $msg;
// die();
// } else {
// $upload = $this->upload->data();
// $nama = $upload['file_name'];
// $msg = "Berhasil Upload " . $nama;
// }
// } else {
// $msg = "File Kosong";
// }
// return array(
// 'pesan' => $msg,
// 'nama' => $nama,
// 'link' => "desain/artikel/" . $nama
// );
// }
}

View File

@ -1,168 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class FAQ extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model("ModelPertanyaan");
$this->load->model("ModelJawaban");
}
function index()
{
$pertanyaan = $this->ModelPertanyaan->get_data();
// $jawaban = $this->ModelJawaban->get_data();
$data = array(
'body' => 'FAQ/list',
'pertanyaan' => $pertanyaan,
// 'jawaban' => $jawaban,
);
$this->load->view('index', $data);
}
public function input_pertanyaan()
{
$pertanyaan = $this->ModelPertanyaan->get_data();
$data = array(
'body' => 'FAQ/input',
'form' => 'FAQ/form',
'pertanyaan' => $pertanyaan,
);
$this->load->view('index', $data);
}
public function insert_pertanyaan()
{
$data = array(
'pertanyaan' => $this->input->post('pertanyaan'),
);
if ($this->db->insert("pertanyaan", $data)) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "FAQ");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "FAQ");
}
// echo json_encode($data);
}
function edit_pertanyaan(){
$id = $this->uri->segment(3);
$pertanyaan = $this->ModelPertanyaan->get_data_edit($id);
$data = array(
'body' => 'FAQ/edit',
'form' => 'FAQ/form',
'pertanyaan' => $pertanyaan,
);
$this->load->view('index', $data);
}
function update_pertanyaan()
{
$id = $this->uri->segment(3);
$data = array(
'pertanyaan' => $this->input->post('pertanyaan'),
);
$this->db->where("id_pertanyaan", $id);
if ($this->db->update("pertanyaan", $data)) {
// code...
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "FAQ");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "FAQ");
}
}
function delete_pertanyaan()
{
$id = $this->input->post("id_pertanyaan");
$this->db->where_in("id_pertanyaan", $id);
if ($this->db->delete("pertanyaan")) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "FAQ");
// code...
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "FAQ");
}
}
function jawaban()
{
$jawaban = $this->ModelJawaban->get_jawaban_edit();
$data = array(
'body' => 'Jawaban/list',
'jawaban' => $jawaban,
);
$this->load->view('index', $data);
}
public function input_jawaban()
{
$pertanyaan = $this->ModelPertanyaan->get_data();
$data = array(
'body' => 'Jawaban/input',
'form' => 'Jawaban/form',
'pertanyaan' => $pertanyaan,
);
$this->load->view('index', $data);
}
public function insert_jawaban()
{
$data = array(
'id_pertanyaan' => $this->input->post('id_pertanyaan'),
'jawaban' => $this->input->post('jawaban'),
);
if ($this->db->insert("jawaban", $data)) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "FAQ/Jawaban");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "FAQ/Jawaban");
}
// echo json_encode($data);
}
function edit_jawaban(){
$id = $this->uri->segment(3);
$jawaban = $this->ModelJawaban->get_data_edit($id);
$pertanyaan = $this->ModelPertanyaan->get_data();
$data = array(
'body' => 'Jawaban/edit',
'form' => 'Jawaban/form',
'jawaban' => $jawaban,
'pertanyaan' => $pertanyaan,
);
$this->load->view('index', $data);
}
function update_jawaban()
{
$id = $this->uri->segment(3);
$data = array(
'jawaban' => $this->input->post('jawaban'),
);
$this->db->where("id_jawaban", $id);
if ($this->db->update("jawaban", $data)) {
// code...
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "FAQ/Jawaban");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "FAQ/Jawaban");
}
}
function delete_jawaban()
{
$id = $this->input->post("id_jawaban");
$this->db->where_in("id_jawaban", $id);
if ($this->db->delete("jawaban")) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "FAQ/Jawaban");
// code...
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "FAQ/Jawaban");
}
}
}

View File

@ -1,94 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class IMT extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model("ModelIMT");
}
function index()
{
$imt = $this->ModelIMT->get_data();
$data = array(
'body' => 'IMT/list',
'imt' => $imt
);
$this->load->view("index", $data);
}
public function input()
{
$imt = $this->ModelIMT->get_data();
$data = array(
'body' => 'IMT/input',
'form' => 'IMT/form',
'imt' => $imt,
);
$this->load->view('index', $data);
}
public function insert()
{
$data = array(
'klasifikasi' => $this->input->post('klasifikasi'),
'nilai_awal' => $this->input->post('nilai_awal'),
'nilai_akhir' => $this->input->post('nilai_akhir'),
);
if ($this->db->insert("imt", $data)) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "IMT");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "IMT");
}
}
function edit()
{
$id = $this->uri->segment(3);
$imt = $this->ModelIMT->get_data_edit($id);
$data = array(
'form' => 'IMT/form_edit',
'body' => 'IMT/edit',
'imt' => $imt,
);
$this->load->view('index', $data);
}
function update()
{
$id = $this->uri->segment(3);
$data = array(
'klasifikasi' => $this->input->post('klasifikasi'),
'nilai_awal' => $this->input->post('nilai_awal'),
'nilai_akhir' => $this->input->post('nilai_akhir'),
);
$this->db->where("id_imt", $id);
if ($this->db->update("imt", $data)) {
// code...
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "IMT");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "IMT");
}
}
function delete()
{
$id = $this->input->post("id_imt");
$this->db->where_in("id_imt", $id);
if ($this->db->delete("imt")) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "IMT");
// code...
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "IMT");
}
}
}

View File

@ -1,86 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Kategori extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model("ModelKategori");
}
function index()
{
$kategori = $this->ModelKategori->get_data();
$data = array(
'body' => 'Kategori/list',
'kategori' => $kategori
);
$this->load->view('index', $data);
}
public function input()
{
$kategori = $this->ModelKategori->get_data();
$data = array(
'body' => 'Kategori/input',
'form' => 'Kategori/form',
'kategori' => $kategori,
);
$this->load->view('index', $data);
}
public function insert()
{
$data = array(
'nama_kategori' => $this->input->post('nama_kategori'),
);
if ($this->db->insert("kategori", $data)) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Kategori");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Kategori");
}
}
function edit(){
$id = $this->uri->segment(3);
$kategori = $this->ModelKategori->get_data_edit($id);
$data = array(
'body' => 'Kategori/edit',
'form' => 'Kategori/form',
'kategori' => $kategori,
);
$this->load->view('index', $data);
}
function update()
{
$id = $this->uri->segment(3);
$data = array(
'nama_kategori' => $this->input->post('nama_kategori'),
);
$this->db->where("id_kategori", $id);
if ($this->db->update("kategori", $data)) {
// code...
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Kategori");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Kategori");
}
}
function delete()
{
$id = $this->input->post("id_kategori");
$this->db->where_in("id_kategori", $id);
if ($this->db->delete("kategori")) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Kategori");
// code...
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Kategori");
}
}
}

View File

@ -1,49 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class LaporanDarah extends CI_Controller{
public $data_user = array();
public function __construct()
{
parent::__construct();
$this->load->model("ModelDarah");
}
function index()
{
$darah = $this->ModelDarah->get_data();
$data = array(
'body' => 'Laporan/darah',
'darah' => $darah
);
$this->load->view("index",$data);
}
function searchLaporanDarah()
{
$bulan = $this->input->post("bulan");
$tahun = $this->input->post("tahun");
// $bulan = "10";
// $tahun = "2021";
$blnthn = date("Y-m", strtotime($tahun."-".$bulan."-01"));
$darah = $this->ModelDarah->get_data_darah2($bulan,$tahun);
$data = array(
'darah' => $darah,
);
$this->load->view('Laporan/darah_detail', $data);
}
public function cetak(){
$bulan = $this->input->post("bulan");
$tahun = $this->input->post("tahun");
$data = array(
'bulan' => $bulan,
'tahun' => $tahun,
'data' => $this->ModelDarah->get_data_darah2($bulan,$tahun)
);
$this->load->view("Laporan/cetak_darah",$data);
}
}

View File

@ -1,42 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class LaporanGizi extends CI_Controller{
public function __construct()
{
parent::__construct();
$this->load->model("ModelKonsumsi");
}
function index()
{
if (isset($_GET["start"]) && isset($_GET["end"])) { // jika ada parameter start dan end
$from = $this->input->get("start");
$till = $this->input->get("end");
$gizi = $this->ModelKonsumsi->get_status2($from,$till);
} else { // jika tidak ada parameter start dan end maka ditampilkan semuanya
// butuh 3 data
$from = date("Y-m-d");
$till = date("Y-m-d");
$gizi = $this->ModelKonsumsi->get_status2($from,$till);
}
$data = array(
'body' => 'Laporan/gizi',
'gizi' => $gizi
);
$this->load->view("index",$data);
}
public function cetak(){
$from = $this->input->post("start");
$till = $this->input->post("end");
$data = array(
'mulai' => date("d-m-Y",strtotime($from)),
'sampai' => date("d-m-Y",strtotime($till)),
'data' => $this->ModelKonsumsi->get_status2($from,$till)
);
$this->load->view("Laporan/cetak_gizi",$data);
}
}

View File

@ -1,44 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class LaporanKonsumsi extends CI_Controller{
public function __construct()
{
parent::__construct();
$this->load->model("ModelKonsumsi");
}
function index()
{
if (isset($_GET["start"]) && isset($_GET["end"])) { // jika ada parameter start dan end
$from = $this->input->get("start");
$till = $this->input->get("end");
$konsumsi = $this->ModelKonsumsi->get_data2($from,$till);
} else { // jika tidak ada parameter start dan end maka ditampilkan semuanya
// butuh 3 data
$from = date("Y-m-d");
$till = date("Y-m-d");
$konsumsi = $this->ModelKonsumsi->get_data2($from,$till);
}
$data = array(
'body' => 'Laporan/konsumsi',
'konsumsi' => $konsumsi
);
$this->load->view("index",$data);
}
public function cetak(){
$from = $this->input->post("start");
$till = $this->input->post("end");
$data = array(
'mulai' => date("d-m-Y",strtotime($from)),
'sampai' => date("d-m-Y",strtotime($till)),
'data' => $this->ModelKonsumsi->get_data2($from,$till)
);
$this->load->view("Laporan/cetak_konsumsi",$data);
}
}

View File

@ -1,111 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Makanan extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model("ModelMakanan");
$this->load->model("ModelKategori");
}
function index()
{
$makanan = $this->ModelMakanan->get_data();
$data = array(
'body' => 'Makanan/list',
'makanan' => $makanan
);
$this->load->view('index', $data);
}
public function input()
{
$makanan = $this->ModelMakanan->get_data();
$kategori = $this->ModelKategori->get_data();
$data = array(
'body' => 'Makanan/input',
'form' => 'Makanan/form',
'makanan' => $makanan,
'kategori' => $kategori,
);
$this->load->view('index', $data);
}
public function insert()
{
$data = array(
'kategori' => $this->input->post('kategori'),
'nama_makanan' => $this->input->post('nama_makanan'),
'kuantitas' => $this->input->post('kuantitas'),
'besaran' => $this->input->post('besaran'),
'urt' => $this->input->post('urt'),
'energi' => $this->input->post('energi'),
'karbohidrat' => $this->input->post('karbohidrat'),
'protein' => $this->input->post('protein'),
'lemak' => $this->input->post('lemak'),
'besi' => $this->input->post('besi'),
'vitamina' => $this->input->post('vitamina'),
'vitaminc' => $this->input->post('vitaminc'),
);
if ($this->db->insert("bahan_makanan", $data)) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Makanan");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Makanan");
}
}
function edit(){
$id = $this->uri->segment(3);
$makanan = $this->ModelMakanan->get_data_edit($id);
$kategori = $this->ModelKategori->get_data();
$data = array(
'body' => 'Makanan/edit',
'form' => 'Makanan/form_edit',
'makanan' => $makanan,
'kategori' => $kategori,
);
$this->load->view('index', $data);
}
function update()
{
$id = $this->uri->segment(3);
$data = array(
'kategori' => $this->input->post('kategori'),
'nama_makanan' => $this->input->post('nama_makanan'),
'kuantitas' => $this->input->post('kuantitas'),
'besaran' => $this->input->post('besaran'),
'urt' => $this->input->post('urt'),
'energi' => $this->input->post('energi'),
'karbohidrat' => $this->input->post('karbohidrat'),
'protein' => $this->input->post('protein'),
'lemak' => $this->input->post('lemak'),
'besi' => $this->input->post('besi'),
'vitamina' => $this->input->post('vitamina'),
'vitaminc' => $this->input->post('vitaminc'),
);
$this->db->where("id_makanan", $id);
if ($this->db->update("bahan_makanan", $data)) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Makanan");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Makanan");
}
}
function delete()
{
$id = $this->input->post("id_makanan");
$this->db->where_in("id_makanan", $id);
if ($this->db->delete("bahan_makanan")) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Makanan");
// code...
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Makanan");
}
}
}

View File

@ -1,87 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Pertanyaan extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model("ModelPertanyaan");
}
function index()
{
$pertanyaan = $this->ModelPertanyaan->get_data();
$data = array(
'body' => 'Pertanyaan/list',
'pertanyaan' => $pertanyaan
);
$this->load->view('index', $data);
}
public function input()
{
$pertanyaan = $this->ModelPertanyaan->get_data();
$data = array(
'body' => 'Pertanyaan/input',
'form' => 'Pertanyaan/form',
'pertanyaan' => $pertanyaan,
);
$this->load->view('index', $data);
}
public function insert()
{
$data = array(
'pertanyaan' => $this->input->post('pertanyaan'),
);
if ($this->db->insert("pertanyaan", $data)) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Pertanyaan");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Pertanyaan");
}
// echo json_encode($data);
}
function edit(){
$id = $this->uri->segment(3);
$pertanyaan = $this->ModelPertanyaan->get_data_edit($id);
$data = array(
'body' => 'Pertanyaan/edit',
'form' => 'Pertanyaan/form',
'pertanyaan' => $pertanyaan,
);
$this->load->view('index', $data);
}
function update()
{
$id = $this->uri->segment(3);
$data = array(
'pertanyaan' => $this->input->post('pertanyaan'),
);
$this->db->where("id_pertanyaan", $id);
if ($this->db->update("pertanyaan", $data)) {
// code...
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Pertanyaan");
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Pertanyaan");
}
}
function delete()
{
$id = $this->input->post("id_pertanyaan");
$this->db->where_in("id_pertanyaan", $id);
if ($this->db->delete("pertanyaan")) {
// $this->session->set_flashdata("notif", $this->Notif->berhasil("Berhasil Input Data"));
redirect(base_url() . "Pertanyaan");
// code...
} else {
$this->session->set_flashdata("notif", $this->Notif->gagal("gagal Input Data"));
redirect(base_url() . "Pertanyaan");
}
}
}

View File

@ -1,19 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Question extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('ModelPertanyaan');
}
public function get_FAQ($id_user) {
$questions = $this->ModelPertanyaan->FAQ($id_user);
if (!empty($questions)) {
$this->output->set_output(json_encode($questions));
} else {
$this->output->set_output(json_encode(['message' => 'Tidak ada pertanyaan ditemukan untuk id_user ini.']));
}
}
}

View File

@ -1,305 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Core extends CI_Model{
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_select_unit($id_unit){
$idresponden = $this->session->tempdata("id_responden");
$data = $this->db->get_where("jawaban_responden",array('responden_idresponden'=>$idresponden,'unit_idunit'=>$id_unit))->num_rows();
return $data;
}
function get_role(){
$role = json_decode($this->session->userdata("roles"));
$menu = $this->db->where_in("idmenu",$role)->get("menu")->result();
$response = array();
foreach ($menu as $value) {
array_push($response,$value->idmenu);
array_push($response,$value->parent);
}
return $response;
}
function get_menu(){
$kategori = $this->db->get_where("menu",array("categories"=>1))->result();
$response = array();
// die(var_dump($kategori));
$no_kat = 0;
foreach ($kategori as $kat) {
$res_kategori = array(
'id' => $kat->idmenu,
'nama' => $kat->nama_menu,
'menu' => array()
);
$menu = $this->db->get_where("menu",array("parent"=>$kat->idmenu))->result();
if (empty($menu)) {
continue;
}
array_push($response,$res_kategori);
$no_menu = 0;
foreach ($menu as $mymenu) {
$res_menu = array(
'id' => $mymenu->idmenu,
'nama' => $mymenu->nama_menu,
'icon' => $mymenu->icon,
'url' => $mymenu->url,
'sub' => array(),
);
array_push($response[$no_kat]['menu'],$res_menu);
$sub_menu = $this->db->get_where("menu",array("parent"=>$mymenu->idmenu))->result();
foreach ($sub_menu as $sub) {
$res_sub = array(
'id' => $sub->idmenu,
'nama' => $sub->nama_menu,
'url' => $sub->url,
'icon' => $sub->icon,
);
array_push($response[$no_kat]['menu'][$no_menu]['sub'],$res_sub);
}
$no_menu++;
}
$no_kat++;
}
return $response;
}
function get_dokumentasi($nokun){
return $this->db->get_where("foto_pemeriksaan",array("kunjungan_no_urutkunjungan"=>$nokun))->result();
}
function get_numdokumentasi($nokun){
return $this->db->get_where("foto_pemeriksaan",array("kunjungan_no_urutkunjungan"=>$nokun))->num_rows();
}
function generate_kode($panjang){
$karakter = "asdfghjklqwertyuipzxcvbnm1234567890ZXCVBNMASDFGHJKLQWERTYUIOP";
$kode = "";
for($i=0;$i<$panjang;$i++){
$pos= rand(0,strlen($karakter)-1);
$kode .= $karakter[$pos];
}
return $kode;
}
public function get_kadaluarsa()
{
$date = date("Y-m-d");
$batas = date("Y-m-d",strtotime("+30 days"));
return $this->db
->select("(IFNULL(jumlah,0)-IFNULL(jumlah_terjual,0)) as jumlah,tanggal_expired")
->get_where("detail_pembelian_obat",array("DATE(tanggal_expired) >="=>$date,"DATE(tanggal_expired) <="=>$batas,'jumlah !='=>0))
->num_rows();
}
public function get_jatuh_tempo(){
$sekarang = date("Y-m-d");
$j_tempo = date("Y-m-d",strtotime("+7 days"));
// die(var_dump($j_tempo));
return $this->db
->join('hutang','hutang.pembelian_obat_no_nota=pembelian_obat.no_nota')
->get_where("pembelian_obat",array("tanggal_jatuh_tempo <="=>$j_tempo,'status !='=>"Lunas"))
->num_rows();
}
public function get_kunjungan($poli){
return $this->db
->get_where("kunjungan",array("tupel_kode_tupel"=>$poli,'tgl'=>date("Y-m-d"),'sudah'=>0))
->num_rows();
}
public function get_kunjungan_lab(){
return $this->db
->get_where("labkunjungan",array('DATE(jam)'=>date("Y-m-d"),'status'=>1))
->num_rows();
}
public function hit_data($tgl){
$this->db->distinct();
$this->db->group_by("no_urutkunjungan");
$this->db->join('pasien', 'pasien.noRM = kunjungan.pasien_noRM');
$this->db->join('tujuan_pelayanan', 'tujuan_pelayanan.kode_tupel = kunjungan.tupel_kode_tupel');
$this->db->join('rujukan_internal','kunjungan.no_urutkunjungan=rujukan_internal.kunjungan_no_urutkunjungan');
return $this->db->get_where('kunjungan',array('sudah <='=>5,'tujuan_poli'=>'RANAP','acc_ranap'=>0))->num_rows();
}
function get_billing()
{
$date = date("Y-m-d");
$this->db->select("count(*) as total");
$query = $this->db->get_where("kunjungan",array("tgl"=>$date,"billing"=>NULL))->row_array() ;
return $query['total'];
}
function combine_harga($harga)
{
$jml_bayar = "";
$ex_jml_bayar = explode(",", $harga);
for ($i=0; $i < count($ex_jml_bayar); $i++) {
$jml_bayar = $jml_bayar."".$ex_jml_bayar[$i];
}
return $jml_bayar;
}
function Fungsi_JS_Hapus()
{
return "<script type=\"text/javascript\">
$('document').ready(function() {
$(\"#alert\").show();
$(\"#modal\").hide();
$(\".id_checkbox\").on('click', function (e) {
$(\"#jumlah_pilih\").html($(\"input.id_checkbox:checked\").length);
if ($(\"input.id_checkbox:checked\").length == 0) {
$(\"#alert\").show();
$(\"#modal\").hide();
} else {
$(\"#alert\").hide();
$(\"#modal\").show();
}
});
});
</script>";
}
public function Hapus_aktif()
{
return "
<div class=\"modal fade\" id=\"Hapus_aktif\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"smallmodalLabel\" aria-hidden=\"true\">
<div class=\"modal-dialog modal-sm\" role=\"document\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\" id=\"smallmodalLabel\">Hapus Data</h5>
<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
<span aria-hidden=\"true\">&times;</span>
</button>
</div>
<div class=\"modal-body\">
<p>
Apakah Anda Yakin Untuk Menghapus Data
</p>
</div>
<div class=\"modal-footer\">
<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Cancel</button>
<button type=\"submit\" class=\"btn btn-danger\">Hapus</button>
</div>
</div>
</div>
</div>";
}
public function Hapus_disable()
{
return "
<div class=\"modal fade\" id=\"Hapus_disable\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"smallmodalLabel\" aria-hidden=\"true\">
<div class=\"modal-dialog modal-sm\" role=\"document\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\" id=\"smallmodalLabel\">Hapus Data</h5>
<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
<span aria-hidden=\"true\">&times;</span>
</button>
</div>
<div class=\"modal-body\">
<p>
Pilih Data Terlebih Dahulu !!!!
</p>
</div>
<div class=\"modal-footer\">
<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Cancel</button>
</div>
</div>
</div>
</div>";
}
public function alert_succcess($isi)
{
return "<div class=\"sufee-alert alert with-close alert-success alert-dismissible \">
<span class=\"badge badge-pill badge-success\">Success</span> $isi
<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">
<span aria-hidden=\"true\">&times;</span>
</button>";
}
public function alert_danger($isi)
{
return "<div class=\"sufee-alert alert with-close alert-danger alert-dismissible \">
<span class=\"badge badge-pill badge-danger\">Peringatan</span> $isi
<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">
<span aria-hidden=\"true\">&times;</span>
</button>";
}
public function modal($name, $judul, $isi)
{
return "<button type=\"button\" class=\"btn btn-secondary mb-1\" data-toggle=\"modal\" data-target=\"#$name\">
$name
</button>
<div class=\"modal fade\" id=\"$name\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"smallmodalLabel\" aria-hidden=\"true\">
<div class=\"modal-dialog modal-sm\" role=\"document\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\" id=\"smallmodalLabel\">$judul</h5>
<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
<span aria-hidden=\"true\">&times;</span>
</button>
</div>
<div class=\"modal-body\">
<p>
$isi
</p>
</div>
<div class=\"modal-footer\">
<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Cancel</button>
<button type=\"button\" class=\"btn btn-primary\">Confirm</button>
</div>
</div>
</div>
</div>";
}
public function Kembali()
{
return "<button type=\"button\" class=\"btn btn-outline-secondary btn-sm\" onclick=\"window.history.back()\"><i class=\"fas fa-reply\"></i> Kembali</button>";
}
public function btn_input()
{
return "<div class=\"card-footer\" style=' display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
/* flex-wrap: wrap; */'>
<div class=\"col col-sm-12 com-md-12\">
<button type=\"button\" class=\"btn btn-outline-secondary btn-sm pull-left\" onclick=\"window.history.back()\"><i class=\"fa fa-reply\"></i> Kembali</button>
<button type=\"submit\" class=\"btn btn-primary btn-sm pull-right\">SIMPAN</button>
</div>
</div>";
}
public function save_riwayat(){}
public function notif_success($text)
{
return "
";
}
public function umur($tgl_lahir='')
{
if ($tgl_lahir==null) {
return;
}
// Tanggal Lahir
$birthday = $tgl_lahir;
// Convert Ke Date Time
$biday = new DateTime($birthday);
$today = new DateTime();
$diff = $today->diff($biday);
// Display
return $diff->y ." Tahun";
}
}

View File

@ -1,31 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class CoreUploadFoto extends CI_Model{
private $nama_foto;
public function __construct()
{
parent::__construct();
$this->load->library('upload');
//Codeigniter : Write Less Do More
}
public function get_nama_foto(){
return $this->nama_foto;
}
public function upload_foto($path){
$config['upload_path'] = $path; //path folder
$config['allowed_types'] = 'gif|jpg|png|jpeg|bmp|JPG|PNG|JPEG|BMP|GIF'; //type yang dapat diakses
$config['encrypt_name'] = TRUE; //nama yang terupload nantinya
$this->upload->initialize($config);
if(!empty($_FILES['filefoto']['name'])){
if ($this->upload->do_upload('filefoto')){
$gbr = $this->upload->data();
$this->nama_foto = $gbr['file_name'];
return true;
}
}
return false;
}
}

View File

@ -1,21 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ModelAKG extends CI_Model
{
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_data()
{
return $this->db->get_where("kalori")->result();
}
public function get_data_edit($id)
{
return $this->db->get_where("kalori", array("id_kalori" => $id))->row_array();
}
}

View File

@ -1,29 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class GetAPI extends CI_Model {
private $base_url = 'https://isipiringku.esolusindo.com/api/Token/token';
public function get_access_token() {
$client = new Client();
// Konfigurasi permintaan untuk mengambil token
$request = $client->request('POST', $this->base_url, [
'form_params' => [
'grant_type' => 'client_credentials',
'client_id' => 'PKL2023',
'client_secret' => 'PKLSERU'
]
]);
// Ambil respons JSON dari server
$response = $request->getBody()->getContents();
// Parsing respons JSON untuk mendapatkan token
$data = json_decode($response, true);
// Mengembalikan access token
return $data['access_token'];
}
}

View File

@ -1,56 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class ModelAlamat extends CI_Model{
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_data($id_user){
return $this->db
->where("data_user_iddata_user",$id_user)
->get("alamat_user")->result();
}
public function get_data_edit($id){
return $this->db
->where("idalamat_user",$id)
->get("alamat_user")->row();
}
public function get_Provinsi($index=0, $end=0)
{
if ($index > 0) {
$this->db->limit($index, $end);
}
return $this->db->get("provinces");
}
public function get_Kabupaten($id_provinsi)
{
$this->db->where("province_id", $id_provinsi);
return $this->db->get("regencie");
}
public function get_Kecamatan($id_kabupaten="")
{
$this->db->where("regency_id", $id_kabupaten);
return $this->db->get("districts");
}
public function getNamaProvinsi($id)
{
$this->db->where("id",$id);
return $this->db->get("provinces")->row_array()['name'];
}
public function getNamaKabupaten($id)
{
$this->db->where("id",$id);
return $this->db->get("regencie")->row_array()['name'];
}
}

View File

@ -1,143 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ModelAnalisis extends CI_Model
{
/**
* @author Fendrik Nurul Jadid <fendrik1311@gmail.com>
* @since v.1.0
**/
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_data()
{
$this->db->select('kalori.energi, konsumsi.user_id_user, user.nama, GROUP_CONCAT(bahan_makanan.nama_makanan SEPARATOR ", ") as nama_makanan, GROUP_CONCAT(bahan_makanan.urt SEPARATOR ", ") as urt, GROUP_CONCAT(bahan_makanan.energi SEPARATOR ", ") as energi, SUM(bahan_makanan.energi) as total_kalori');
$this->db->from('bahan_makanan');
$this->db->join('konsumsi_detail', 'konsumsi_detail.id_makanan = bahan_makanan.id_makanan');
$this->db->join('konsumsi', 'konsumsi.idkonsumsi = konsumsi_detail.id_konsumsi');
$this->db->join('user', 'user.id_user = konsumsi.user_id_user');
$this->db->join('kalori', 'kalori.jenis_kelamin = user.jekel');
$this->db->group_by('konsumsi.waktu');
$result = $this->db->get()->result();
// Menambahkan status kalori ke setiap entri dalam hasil
foreach ($result as $record) {
if ($record->total_kalori < $record->energi) {
$record->kalori_status = "Kalori tidak tercukupi";
} else {
$record->kalori_status = "Kalori mencukupi";
}
}
return $result;
}
public function get_data2($from, $till)
{
$this->db->select('konsumsi.waktu, bahan_makanan.nama_makanan, user.nama, SUM(bahan_makanan.energi) as total_kalori');
$this->db->from('bahan_makanan');
$this->db->join('konsumsi_detail', 'konsumsi_detail.id_makanan = bahan_makanan.id_makanan');
$this->db->join('konsumsi', 'konsumsi.idkonsumsi = konsumsi_detail.id_konsumsi');
$this->db->join('user', 'user.id_user = konsumsi.user_id_user');
$this->db->group_by('konsumsi.waktu');
// Add WHERE conditions for date range
$this->db->where('konsumsi.waktu >=', $from);
$this->db->where('konsumsi.waktu <=', $till);
$result = $this->db->get()->result();
return $result;
}
public function get_status()
{
$this->db->select('konsumsi.waktu, konsumsi.user_id_user, user.nama, GROUP_CONCAT(bahan_makanan.nama_makanan SEPARATOR ", ") as nama_makanan, SUM(bahan_makanan.energi) as total_kalori, SUM(bahan_makanan.karbohidrat) as total_karbohidrat, SUM(bahan_makanan.protein) as total_protein, SUM(bahan_makanan.lemak) as total_lemak, SUM(bahan_makanan.besi) as total_besi, SUM(bahan_makanan.vitamina) as total_vitamina, SUM(bahan_makanan.vitaminc) as total_vitaminc, kalori.*');
$this->db->from('bahan_makanan');
$this->db->join('konsumsi_detail', 'konsumsi_detail.id_makanan = bahan_makanan.id_makanan');
$this->db->join('konsumsi', 'konsumsi.idkonsumsi = konsumsi_detail.id_konsumsi');
$this->db->join('user', 'user.id_user = konsumsi.user_id_user');
$this->db->join('kalori', 'kalori.jenis_kelamin = user.jekel');
$this->db->where('kalori.awal <=', 'user.umur');
$this->db->where('kalori.akhir >=', 'user.umur');
$this->db->where('kalori.jenis_kelamin', 'user.jekel');
$this->db->group_by('konsumsi.waktu');
$result = $this->db->get()->result();
// Menambahkan kondisi untuk memeriksa jika total kalori kurang dari target
foreach ($result as $record) {
if ($record->total_kalori < $record->kalori_target) {
$record->kalori_status = "Kalori tidak tercukupi";
} else {
$record->kalori_status = "Kalori mencukupi";
}
}
return $result;
}
public function get_status2()
{
$this->db->select('konsumsi.waktu, konsumsi.user_id_user, user.nama');
$this->db->select('GROUP_CONCAT(bahan_makanan.nama_makanan SEPARATOR ", ") as nama_makanan');
$this->db->select('SUM(bahan_makanan.energi) as total_kalori');
$this->db->select('SUM(bahan_makanan.karbohidrat) as total_karbohidrat');
$this->db->select('SUM(bahan_makanan.protein) as total_protein');
$this->db->select('SUM(bahan_makanan.lemak) as total_lemak');
$this->db->select('SUM(bahan_makanan.besi) as total_besi');
$this->db->select('SUM(bahan_makanan.vitamina) as total_vitamina');
$this->db->select('SUM(bahan_makanan.vitaminc) as total_vitaminc');
$this->db->select('kalori.*');
$this->db->from('bahan_makanan');
$this->db->join('konsumsi_detail', 'konsumsi_detail.id_makanan = bahan_makanan.id_makanan');
$this->db->join('konsumsi', 'konsumsi.idkonsumsi = konsumsi_detail.id_konsumsi');
$this->db->join('user', 'user.id_user = konsumsi.user_id_user');
$this->db->join('kalori', 'kalori.jenis_kelamin = user.jekel');
$this->db->where('user.umur >= kalori.awal');
$this->db->where('user.umur <= kalori.akhir');
$this->db->group_by('konsumsi.waktu');
$query = $this->db->get()->result();
return $query;
}
public function getketer($id_user, $waktu, $keterangan)
{
$this->db->select(
'bahan_makanan.kategori, bahan_makanan.nama_makanan, bahan_makanan.kuantitas, ' .
'bahan_makanan.besaran, bahan_makanan.urt, bahan_makanan.energi, ' .
'bahan_makanan.karbohidrat, bahan_makanan.protein, bahan_makanan.lemak, ' .
'bahan_makanan.besi, bahan_makanan.vitamina, bahan_makanan.vitaminc, ' .
'konsumsi.idkonsumsi, konsumsi.waktu, bahan_makanan.id_makanan, ' .
'user.id_user, konsumsi.keterangan'
);
$this->db->from('konsumsi');
$this->db->join('konsumsi_detail', 'konsumsi.idkonsumsi = konsumsi_detail.id_konsumsi');
$this->db->join('bahan_makanan', 'bahan_makanan.id_makanan = konsumsi_detail.id_makanan');
$this->db->join('user', 'konsumsi.user_id_user = user.id_user');
$this->db->where('id_user', $id_user);
$this->db->where('waktu', $waktu);
$this->db->where('keterangan', $keterangan);
$query = $this->db->get();
return $query->result();
}
}

View File

@ -1,17 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class ModelAnggota extends CI_Model{
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_anggota($iddata_user)
{
return $this->db->get_where("data_user",["iddata_user"=>$iddata_user]);
}
}

View File

@ -1,49 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ModelArtikel extends CI_Model
{
protected $table = 'general_consent';
protected $primaryKey = 'id';
protected $returnType = 'object';
/**
* @author Fendrik Nurul Jadid <fendrik1311@gmail.com>
* @since v.1.0
**/
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_data()
{
return $this->db->get_where("artikel")->result();
}
public function insert($data)
{
return $this->db->table($this->table)->insert($data);
}
public function count_artikel()
{
return $this->db->count_all("artikel");
}
public function get_data_edit($id)
{
$result = $this->db->get_where("artikel", array("id_artikel" => $id))->row_array();
if ($result !== null) {
return $result;
} else {
// Handle the case where no matching data was found, e.g., by returning an empty array or showing an error message.
return array(); // You can customize this based on your requirements.
}
}
}

View File

@ -1,20 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ModelBunga extends CI_Model
{
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_bunga($idjenis_rekening)
{
return $this->db
->where("pusat_idpusat", $this->session->userdata('idpusat'))
->where("idjenis_rekening", $idjenis_rekening)
->get("bunga_pinjaman")->row_array();
}
}

View File

@ -1,70 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ModelDarah extends CI_Model
{
/**
* @author Fendrik Nurul Jadid <fendrik1311@gmail.com>
* @since v.1.0
**/
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_data()
{
$this->db->select('darah.id_darah, darah.status, DATE_FORMAT(darah.tanggal, "%Y-%m") AS bulan, user.nama');
$this->db->select('GROUP_CONCAT(darah.tanggal SEPARATOR ", ") as tanggal');
$this->db->select('GROUP_CONCAT(darah.status SEPARATOR ", ") as status');
$this->db->from('darah');
$this->db->join('user', 'user.id_user = darah.id_user');
$this->db->group_by('bulan, user.nama');
$result = $this->db->get()->result();
// Tambahkan status "lengkap" atau "tidak lengkap" ke setiap entri
foreach ($result as $record) {
if ($record->status === 'sudah') {
$record->status_darah = 'lengkap';
} else {
$record->status_darah = 'tidak lengkap';
}
}
return $result;
}
public function get_data_darah2($bulan,$tahun)
{
$this->db->select('darah.id_darah, darah.status, DATE_FORMAT(darah.tanggal, "%Y-%m") AS bulan, user.nama');
$this->db->select('GROUP_CONCAT(darah.tanggal SEPARATOR ", ") as tanggal');
$this->db->select('GROUP_CONCAT(darah.status SEPARATOR ", ") as status');
$this->db->from('darah');
$this->db->join('user', 'user.id_user = darah.id_user');
$this->db->group_by('bulan, user.nama');
$this->db->where('DATE_FORMAT(darah.tanggal, "%Y-%m") =', date("Y-m", strtotime($tahun . "-" . $bulan)));
$result = $this->db->get()->result();
foreach ($result as $record) {
if ($record->status === 'sudah') {
$record->status_darah = 'lengkap';
} else {
$record->status_darah = 'tidak lengkap';
}
}
return $result;
}
}

View File

@ -1,21 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ModelIMT extends CI_Model
{
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_data()
{
return $this->db->get_where("imt")->result();
}
public function get_data_edit($id)
{
return $this->db->get_where("imt", array("id_imt" => $id))->row_array();
}
}

View File

@ -1,39 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ModelJawaban extends CI_Model
{
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_data()
{
return $this->db->get_where("jawaban")->result();
}
public function get_data_edit($id)
{
return $this->db->get_where("jawaban", array("id_jawaban" => $id))->row_array();
}
public function get_jawaban_edit()
{
return $this->db
->select('*')
->from('jawaban')
->join('pertanyaan', 'pertanyaan.id_pertanyaan = jawaban.id_pertanyaan', 'left')
->get()->result();
}
public function get_data2()
{
return $this->db
->join("user","user.id_user=pertanyaan.id_user")
->join("jawaban","jawaban.id_pertanyaan=pertanyaan.id_pertanyaan")
->where("pertanyaan.is_answer", "1")
->get("pertanyaan")->result();
}
}

View File

@ -1,32 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ModelKategori extends CI_Model
{
/**
* @author Fendrik Nurul Jadid <fendrik1311@gmail.com>
* @since v.1.0
**/
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_data()
{
return $this->db->get_where("kategori")->result();
}
public function get_data_edit($id)
{
return $this->db->get_where("kategori", array("id_kategori" => $id))->row_array();
}
}

View File

@ -1,293 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ModelKonsumsi extends CI_Model
{
/**
* @author Fendrik Nurul Jadid <fendrik1311@gmail.com>
* @since v.1.0
**/
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_data()
{
$this->db->select('konsumsi.waktu, konsumsi.user_id_user, user.nama,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 1 THEN bahan_makanan.nama_makanan END SEPARATOR ", ") as makanan_pokok,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 2 THEN bahan_makanan.nama_makanan END SEPARATOR ", ") as lauk_pauk,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 3 THEN bahan_makanan.nama_makanan END SEPARATOR ", ") as sayuran,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 4 THEN bahan_makanan.nama_makanan END SEPARATOR ", ") as buah_buahan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 5 THEN bahan_makanan.nama_makanan END SEPARATOR ", ") as jajanan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 1 THEN bahan_makanan.urt END SEPARATOR ", ") as urt_makanan_pokok,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 2 THEN bahan_makanan.urt END SEPARATOR ", ") as urt_lauk_pauk,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 3 THEN bahan_makanan.urt END SEPARATOR ", ") as urt_sayuran,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 4 THEN bahan_makanan.urt END SEPARATOR ", ") as urt_buah_buahan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 5 THEN bahan_makanan.urt END SEPARATOR ", ") as urt_jajanan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 1 THEN bahan_makanan.energi * konsumsi_detail.kuantitas END SEPARATOR ", ") as energi_makanan_pokok,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 2 THEN bahan_makanan.energi * konsumsi_detail.kuantitas END SEPARATOR ", ") as energi_lauk_pauk,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 3 THEN bahan_makanan.energi * konsumsi_detail.kuantitas END SEPARATOR ", ") as energi_sayuran,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 4 THEN bahan_makanan.energi * konsumsi_detail.kuantitas END SEPARATOR ", ") as energi_buah_buahan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 5 THEN bahan_makanan.energi * konsumsi_detail.kuantitas END SEPARATOR ", ") as energi_jajanan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 1 THEN konsumsi_detail.kuantitas END SEPARATOR ", ") as kuantitas_makanan_pokok,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 2 THEN konsumsi_detail.kuantitas END SEPARATOR ", ") as kuantitas_lauk_pauk,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 3 THEN konsumsi_detail.kuantitas END SEPARATOR ", ") as kuantitas_sayuran,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 4 THEN konsumsi_detail.kuantitas END SEPARATOR ", ") as kuantitas_buah_buahan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 5 THEN konsumsi_detail.kuantitas END SEPARATOR ", ") as kuantitas_jajanan,
SUM(bahan_makanan.energi * konsumsi_detail.kuantitas) as total_kalori');
$this->db->from('bahan_makanan');
$this->db->join('konsumsi_detail', 'konsumsi_detail.id_makanan = bahan_makanan.id_makanan');
$this->db->join('konsumsi', 'konsumsi.idkonsumsi = konsumsi_detail.id_konsumsi');
$this->db->join('user', 'user.id_user = konsumsi.user_id_user');
$this->db->group_by('konsumsi.waktu');
$result = $this->db->get()->result();
return $result;
}
public function get_data2($from, $till)
{
$this->db->select('konsumsi.waktu, bahan_makanan.nama_makanan, user.nama,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 1 THEN bahan_makanan.nama_makanan END SEPARATOR ", ") as makanan_pokok,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 2 THEN bahan_makanan.nama_makanan END SEPARATOR ", ") as lauk_pauk,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 3 THEN bahan_makanan.nama_makanan END SEPARATOR ", ") as sayuran,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 4 THEN bahan_makanan.nama_makanan END SEPARATOR ", ") as buah_buahan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 5 THEN bahan_makanan.nama_makanan END SEPARATOR ", ") as jajanan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 1 THEN bahan_makanan.urt END SEPARATOR ", ") as urt_makanan_pokok,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 2 THEN bahan_makanan.urt END SEPARATOR ", ") as urt_lauk_pauk,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 3 THEN bahan_makanan.urt END SEPARATOR ", ") as urt_sayuran,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 4 THEN bahan_makanan.urt END SEPARATOR ", ") as urt_buah_buahan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 5 THEN bahan_makanan.urt END SEPARATOR ", ") as urt_jajanan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 1 THEN bahan_makanan.energi * konsumsi_detail.kuantitas END SEPARATOR ", ") as energi_makanan_pokok,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 2 THEN bahan_makanan.energi * konsumsi_detail.kuantitas END SEPARATOR ", ") as energi_lauk_pauk,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 3 THEN bahan_makanan.energi * konsumsi_detail.kuantitas END SEPARATOR ", ") as energi_sayuran,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 4 THEN bahan_makanan.energi * konsumsi_detail.kuantitas END SEPARATOR ", ") as energi_buah_buahan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 5 THEN bahan_makanan.energi * konsumsi_detail.kuantitas END SEPARATOR ", ") as energi_jajanan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 1 THEN konsumsi_detail.kuantitas END SEPARATOR ", ") as kuantitas_makanan_pokok,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 2 THEN konsumsi_detail.kuantitas END SEPARATOR ", ") as kuantitas_lauk_pauk,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 3 THEN konsumsi_detail.kuantitas END SEPARATOR ", ") as kuantitas_sayuran,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 4 THEN konsumsi_detail.kuantitas END SEPARATOR ", ") as kuantitas_buah_buahan,
GROUP_CONCAT(CASE WHEN bahan_makanan.kategori = 5 THEN konsumsi_detail.kuantitas END SEPARATOR ", ") as kuantitas_jajanan,
SUM(bahan_makanan.energi * konsumsi_detail.kuantitas) as total_kalori');
$this->db->from('bahan_makanan');
$this->db->join('konsumsi_detail', 'konsumsi_detail.id_makanan = bahan_makanan.id_makanan');
$this->db->join('konsumsi', 'konsumsi.idkonsumsi = konsumsi_detail.id_konsumsi');
$this->db->join('user', 'user.id_user = konsumsi.user_id_user');
$this->db->group_by('konsumsi.waktu, konsumsi.user_id_user');
// Add WHERE conditions for date range
$this->db->where('konsumsi.waktu >=', $from);
$this->db->where('konsumsi.waktu <=', $till);
$result = $this->db->get()->result();
return $result;
}
public function get_status()
{
$this->db->select('konsumsi.waktu, konsumsi.user_id_user, user.nama');
$this->db->select('GROUP_CONCAT(bahan_makanan.nama_makanan SEPARATOR ", ") as nama_makanan');
$this->db->select('SUM(bahan_makanan.energi * konsumsi_detail.kuantitas) as total_kalori');
$this->db->select('SUM(bahan_makanan.karbohidrat * konsumsi_detail.kuantitas) as total_karbohidrat');
$this->db->select('SUM(bahan_makanan.protein * konsumsi_detail.kuantitas) as total_protein');
$this->db->select('SUM(bahan_makanan.lemak * konsumsi_detail.kuantitas) as total_lemak');
$this->db->select('SUM(bahan_makanan.besi * konsumsi_detail.kuantitas) as total_besi');
$this->db->select('SUM(bahan_makanan.vitamina * konsumsi_detail.kuantitas) as total_vitamina');
$this->db->select('SUM(bahan_makanan.vitaminc * konsumsi_detail.kuantitas) as total_vitaminc');
$this->db->select('kalori.*');
$this->db->from('bahan_makanan');
$this->db->join('konsumsi_detail', 'konsumsi_detail.id_makanan = bahan_makanan.id_makanan');
$this->db->join('konsumsi', 'konsumsi.idkonsumsi = konsumsi_detail.id_konsumsi');
$this->db->join('user', 'user.id_user = konsumsi.user_id_user');
$this->db->join('kalori', 'kalori.jenis_kelamin = user.jekel');
$this->db->where('user.umur >= kalori.awal');
$this->db->where('user.umur <= kalori.akhir');
$this->db->group_by('konsumsi.waktu');
$query = $this->db->get()->result();
return $query;
}
public function get_status2($from, $till)
{
$this->db->select('konsumsi.waktu, konsumsi.user_id_user, user.nama');
$this->db->select('GROUP_CONCAT(bahan_makanan.nama_makanan SEPARATOR ", ") as nama_makanan');
$this->db->select('SUM(bahan_makanan.energi * konsumsi_detail.kuantitas) as total_kalori');
$this->db->select('SUM(bahan_makanan.karbohidrat * konsumsi_detail.kuantitas) as total_karbohidrat');
$this->db->select('SUM(bahan_makanan.protein * konsumsi_detail.kuantitas) as total_protein');
$this->db->select('SUM(bahan_makanan.lemak * konsumsi_detail.kuantitas) as total_lemak');
$this->db->select('SUM(bahan_makanan.besi * konsumsi_detail.kuantitas) as total_besi');
$this->db->select('SUM(bahan_makanan.vitamina * konsumsi_detail.kuantitas) as total_vitamina');
$this->db->select('SUM(bahan_makanan.vitaminc * konsumsi_detail.kuantitas) as total_vitaminc');
$this->db->select('kalori.*');
$this->db->from('bahan_makanan');
$this->db->join('konsumsi_detail', 'konsumsi_detail.id_makanan = bahan_makanan.id_makanan');
$this->db->join('konsumsi', 'konsumsi.idkonsumsi = konsumsi_detail.id_konsumsi');
$this->db->join('user', 'user.id_user = konsumsi.user_id_user');
$this->db->join('kalori', 'kalori.jenis_kelamin = user.jekel');
$this->db->where('user.umur >= kalori.awal');
$this->db->where('user.umur <= kalori.akhir');
$this->db->where('konsumsi.waktu >=', $from);
$this->db->where('konsumsi.waktu <=', $till);
$this->db->group_by('konsumsi.waktu, konsumsi.user_id_user');
$query = $this->db->get()->result();
return $query;
}
public function get_analisis($from,$till)
{
$this->db->select('konsumsi.waktu, konsumsi.user_id_user, user.nama');
$this->db->select('GROUP_CONCAT(bahan_makanan.nama_makanan SEPARATOR ", ") as nama_makanan');
$this->db->select('SUM(bahan_makanan.energi * konsumsi_detail.kuantitas) as total_kalori');
$this->db->select('SUM(CASE WHEN konsumsi.keterangan = "Sarapan" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_sarapan');
$this->db->select('SUM(CASE WHEN konsumsi.keterangan = "Makan Siang" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_siang');
$this->db->select('SUM(CASE WHEN konsumsi.keterangan = "Makan Malam" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_malam');
// Sarapan
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 1 AND konsumsi.keterangan = "Sarapan" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_sarapan_pokok');
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 2 AND konsumsi.keterangan = "Sarapan" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_sarapan_lauk');
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 3 AND konsumsi.keterangan = "Sarapan" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_sarapan_sayur');
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 4 AND konsumsi.keterangan = "Sarapan" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_sarapan_buah');
// Makan Siang
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 1 AND konsumsi.keterangan = "Makan Siang" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_siang_pokok');
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 2 AND konsumsi.keterangan = "Makan Siang" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_siang_lauk');
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 3 AND konsumsi.keterangan = "Makan Siang" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_siang_sayur');
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 4 AND konsumsi.keterangan = "Makan Siang" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_siang_buah');
// Makan Malam
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 1 AND konsumsi.keterangan = "Makan Malam" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_malam_pokok');
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 2 AND konsumsi.keterangan = "Makan malam" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_malam_lauk');
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 3 AND konsumsi.keterangan = "Makan Malam" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_malam_sayur');
$this->db->select('SUM(CASE WHEN bahan_makanan.kategori = 4 AND konsumsi.keterangan = "Makan Malam" THEN bahan_makanan.energi * konsumsi_detail.kuantitas ELSE 0 END) as total_malam_buah');
// Subquery untuk total kalori makanan pokok pada sarapan
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Sarapan" AND bm.kategori = 1 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_sarapan_pokok');
// Subquery untuk total kalori lauk pauk pada sarapan
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Sarapan" AND bm.kategori = 2 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_sarapan_lauk');
// Subquery untuk total kalori sayuran pada sarapan
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Sarapan" AND bm.kategori = 3 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_sarapan_sayur');
// Subquery untuk total kalori buah-buahan pada sarapan
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Sarapan" AND bm.kategori = 4 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_sarapan_buah');
// Subquery untuk total kalori makanan pokok pada makan siang
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Makan Siang" AND bm.kategori = 1 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_siang_pokok');
// Subquery untuk total kalori lauk pauk pada makan siang
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Makan Siang" AND bm.kategori = 2 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_siang_lauk');
// Subquery untuk total kalori sayuran pada makan siang
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Makan Siang" AND bm.kategori = 3 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_siang_sayur');
// Subquery untuk total kalori buah-buahan pada makan siang
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Makan Siang" AND bm.kategori = 4 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_siang_buah');
// Subquery untuk total kalori makanan pokok pada makan malam
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Makan Malam" AND bm.kategori = 1 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_malam_pokok');
// Subquery untuk total kalori lauk pauk pada makan malam
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Makan Malam" AND bm.kategori = 2 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_malam_lauk');
// Subquery untuk total kalori sayuran pada makan malam
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Makan Malam" AND bm.kategori = 3 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_malam_sayur');
// Subquery untuk total kalori buah-buahan pada makan malam
// $this->db->select('(
// SELECT SUM(bm.energi * konsumsi_detail.kuantitas)
// FROM bahan_makanan AS bm
// JOIN konsumsi_detail AS kd ON kd.id_makanan = bm.id_makanan
// WHERE konsumsi.keterangan = "Makan Malam" AND bm.kategori = 4 AND kd.id_konsumsi = konsumsi.idkonsumsi
// ) as total_malam_buah');
$this->db->select('kalori.*');
$this->db->from('bahan_makanan');
$this->db->join('konsumsi_detail', 'konsumsi_detail.id_makanan = bahan_makanan.id_makanan');
$this->db->join('konsumsi', 'konsumsi.idkonsumsi = konsumsi_detail.id_konsumsi');
$this->db->join('user', 'user.id_user = konsumsi.user_id_user');
$this->db->join('kalori', 'kalori.jenis_kelamin = user.jekel');
$this->db->where('user.umur >= kalori.awal');
$this->db->where('user.umur <= kalori.akhir');
$this->db->where('konsumsi.waktu >=', $from);
$this->db->where('konsumsi.waktu <=', $till);
$this->db->group_by('konsumsi.waktu, konsumsi.user_id_user');
$query = $this->db->get()->result();
return $query;
}
}

View File

@ -1,98 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class ModelLaporan extends CI_Model{
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function getGrafik()
{
$this->db->select('*, SUM(total_pembayaran) as totalSemua,tanggal as tgl');
$this->db->where('status_pemesanan', '4');
$this->db->where("mitra_idmitra", $_SESSION["idmitra"]);
$this->db->group_by('tanggal');
return $this->db->get('pemesanan');
}
public function getAnggota()
{
return $this->db->get('data_user');
}
public function getBarang()
{
return $this->db->get("barang");
}
public function getTransaksi($tgl = null)
{
if ($tgl != null || $tgl != "") {
$this->db->where("tanggal", date("Y-m-d", strtotime($tgl)));
}
$this->db->where('status_pemesanan', '4');
$this->db->where("mitra_idmitra", $_SESSION["idmitra"]);
return $this->db->get('pemesanan');
}
public function getPendapatan($tgl = null)
{
$this->db->select('*, SUM(total_pembayaran) as totalSemua');
if ($tgl != null || $tgl != "") {
$this->db->where("tanggal", date("Y-m-d", strtotime($tgl)));
}
$this->db->group_by('tanggal');
$this->db->where('status_pemesanan', '4');
$this->db->where("mitra_idmitra", $_SESSION["idmitra"]);
return $this->db->get('pemesanan');
}
public function getSisaHutangAnggota($id)
{
$this->db->select("(SUM(harus_dibayar) - SUM(pembayaran)) as total");
$this->db->join("bayar_hutang","bayar_hutang.pemesanan_idpemesanan = pemesanan.idpemesanan", "left");
// $this->db->where("data_user_iddata_user", $id);
$this->db->where("metode_pembayaran", 2);
$this->db->where("status_hutang", 0);
$this->db->group_by("pemesanan_idpemesanan");
return $this->db->get("pemesanan");
}
public function getHutangAnggota($id)
{
$this->db->select("SUM(harus_dibayar) as total");
$this->db->where("data_user_iddata_user", $id);
$this->db->where("metode_pembayaran", 2);
$this->db->where("status_hutang", 0);
return $this->db->get("pemesanan");
}
public function getListHutangAnggota($id)
{
$this->db->where("data_user_iddata_user", $id);
$this->db->where("metode_pembayaran", 2);
$this->db->where("status_hutang", 0);
return $this->db->get("pemesanan");
}
public function getListCicilanHutangAnggota($id)
{
$this->db->where("pemesanan_idpemesanan", $id);
return $this->db->get("bayar_hutang");
}
public function getListSisaHutangAnggota($id)
{
$this->db->select("pemesanan.idpemesanan, pemesanan.tanggal, pemesanan.status_hutang, harus_dibayar - SUM(pembayaran) as harus_dibayar");
$this->db->join("bayar_hutang","bayar_hutang.pemesanan_idpemesanan = pemesanan.idpemesanan", "left");
// $this->db->where("data_user_iddata_user", $id);
$this->db->where("metode_pembayaran", 2);
$this->db->where("status_hutang", 0);
$this->db->group_by("pemesanan_idpemesanan");
return $this->db->get("pemesanan");
}
}

View File

@ -1,33 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class ModelLinear extends CI_Model {
public function get_cases_data() {
// Data jumlah kasus stunting
return [
'years' => [2020, 2021, 2022, 2023, 2024],
'cases' => [156, 86, 43, 66, 62]
];
}
public function calculate_regression($years, $cases) {
$n = count($years);
$sum_x = array_sum($years);
$sum_y = array_sum($cases);
$sum_x_squared = array_sum(array_map(function($x) { return $x * $x; }, $years));
$sum_xy = array_sum(array_map(function($x, $y) { return $x * $y; }, $years, $cases));
$slope = ($n * $sum_xy - $sum_x * $sum_y) / ($n * $sum_x_squared - $sum_x * $sum_x);
$intercept = ($sum_y - $slope * $sum_x) / $n;
return [
'slope' => $slope,
'intercept' => $intercept
];
}
public function forecast($slope, $intercept, $next_year) {
return $slope * $next_year + $intercept;
}
}

View File

@ -1,43 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ModelMakanan extends CI_Model
{
/**
* @author Fendrik Nurul Jadid <fendrik1311@gmail.com>
* @since v.1.0
**/
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_data()
{
return $this->db
->join("kategori","kategori.id_kategori=bahan_makanan.kategori")
->get("bahan_makanan")->result();
}
public function insert($data)
{
return $this->db->table($this->table)->insert($data);
}
public function count_makanan()
{
return $this->db->count_all("bahan_makanan");
}
public function get_data_edit($id)
{
return $this->db->get_where("bahan_makanan", array("id_makanan" => $id))->row_array();
}
}

View File

@ -1,32 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class ModelMitra extends CI_Model{
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_pusat()
{
return $this->db->get("pusat");
}
public function get_data($idpusat = null){
if ($idpusat != null || $idpusat != "") {
$this->db->where("pusat_idpusat",$idpusat);
}
return $this->db->get('mitra');
}
public function get_data_mitra($idmitra=null)
{
if ($idmitra != null || $idmitra != "") {
$this->db->where("mitra.idmitra",$idmitra);
}
return $this->db->get('mitra');
}
}

View File

@ -1,39 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ModelPertanyaan extends CI_Model
{
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
public function get_data()
{
return $this->db->get_where("pertanyaan")->result();
}
public function get_data_edit($id)
{
return $this->db->get_where("pertanyaan", array("id_pertanyaan" => $id))->row_array();
}
public function get_jawaban_edit($id)
{
return $this->db
->join("pertanyaan", "pertanyaan.id_pertanyaan = jawaban.id_pertanyaan")
->where("jawaban.id_pertanyaan", $id)
->get("jawaban")
->row_array();
}
public function get_data2()
{
return $this->db
->join("user","user.id_user=pertanyaan.id_user")
->join("jawaban","jawaban.id_pertanyaan=pertanyaan.id_pertanyaan")
->where("pertanyaan.is_answer", "1")
->get("pertanyaan")->result();
}
}

View File

@ -1,55 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class ModelVoucer extends CI_Model{
public function __construct()
{
parent::__construct();
//Codeigniter : Write Less Do More
}
function getData_all($idpusat = null)
{
if ($idpusat != null || $idpusat != "") {
$this->db->where("pusat_idpusat", $idpusat);
}
return $this->db->get("voucer");
}
function getData($idvoucer)
{
$this->db->where("idvoucer", $idvoucer);
return $this->db->get("voucer");
}
function get_anggota($id, $idpusat = null)
{
$this->db->join("voucer_user", "voucer_user.data_user_iddata_user = data_user.iddata_user AND voucer_user.voucer_idvoucer = ".$id,"left");
$this->db->where("data_user.status_anggota", 1);
if ($idpusat != null || $idpusat != "") {
$this->db->where("data_user.pusat_idpusat", $idpusat);
}
return $this->db->get("data_user");
}
public function get_voucer_anggota($iduser=null, $idvoucer = null, $status_voucer = null, $idpemesanan = null)
{
if ($idpemesanan != null) {
$this->db->where("pemesanan_idpemesanan", $idpemesanan);
}
if ($iduser != null) {
$this->db->where("data_user_iddata_user", $iduser);
}
if ($idvoucer != null) {
$this->db->where("voucer_idvoucer", $idvoucer);
}
if ($status_voucer != null) {
$this->db->where("status_voucer", $status_voucer);
}
$this->db->join("voucer", "voucer.idvoucer = voucer_user.voucer_idvoucer");
return $this->db->get("voucer_user");
}
}

View File

@ -1,25 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3">
<h3>Ubah Data Gizi</h3>
</a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('AKG/update/' . $this->uri->segment(3)); ?>
<?php echo @$error; ?>
<?php $this->load->view($form) ?>
<?php echo $this->Core->btn_input() ?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,74 +0,0 @@
<div class="card" style="border-radius: 5px;">
<div class="card-body">
<div class="form-group animated flipIn">
<label class="">Angka Kecukupan Gizi</label>
<div class="">
<div class="row">
<div class="col-md-6 col-xl-6">
<label class="mt-3">Awal</label>
<input type="text" class="form-control" value="<?php echo @$kalori['awal'] ?>" name="awal" id="numericInput" oninput="formatNumber(this)" required>
</div>
<div class="col-md-6 col-xl-6">
<label class="mt-3">Akhir</label>
<input type="text" class="form-control" value="<?php echo @$kalori['akhir'] ?>" name="akhir" id="numericInput" oninput="formatNumber(this)" required>
</div>
<div class="col-md-6 col-xl-6">
<label class="mt-3">Jenis Kelamin</label>
<select class="select2 custom-select" style="width: 100%; height:36px;" name="jenis_kelamin" id="inlineFormCustomSelect">
<option selected="">Choose...</option>
<option value="Laki-Laki">Laki-Laki</option>
<option value="Perempuan">Perempuan</option>
</select>
</div>
<div class="col-md-6 col-xl-6">
<label class="mt-3">Energi ( kkal )</label>
<input type="text" class="form-control" value="<?php echo @$kalori['energi'] ?>" name="energi" id="numericInput" oninput="formatNumber(this)" required>
</div>
<div class="col-md-6 col-xl-6">
<label class="mt-3">Karbohidrat ( g )</label>
<input type="text" class="form-control" value="<?php echo @$kalori['karbohidrat'] ?>" name="karbohidrat" id="numericInput" oninput="formatNumber(this)" required>
</div>
<div class="col-md-6 col-xl-6">
<label class="mt-3">Protein ( g )</label>
<input type="text" class="form-control" value="<?php echo @$kalori['protein'] ?>" name="protein" id="numericInput" oninput="formatNumber(this)" required>
</div>
</div>
</div>
<div class="">
<div class="row">
<div class="col-md-6 col-xl-6">
<label class="mt-3">Lemak ( g )</label>
<input type="text" class="form-control" value="<?php echo @$kalori['lemak'] ?>" name="lemak" id="numericInput" oninput="formatNumber(this)">
</div>
<div class="col-md-6 col-xl-6">
<label class="mt-3">Besi ( mg )</label>
<input type="text" class="form-control" value="<?php echo @$kalori['besi'] ?>" name="besi" id="numericInput" oninput="formatNumber(this)">
</div>
<div class="col-md-6 col-xl-6">
<label class="mt-3">Vitamin A ( mcg )</label>
<input type="text" class="form-control" value="<?php echo @$kalori['vitamina'] ?>" name="vitamina" id="numericInput" oninput="formatNumber(this)">
</div>
<div class="col-md-6 col-xl-6">
<label class="mt-3">Vitamin C ( mg )</label>
<input type="text" class="form-control" value="<?php echo @$kalori['vitaminc'] ?>" name="vitaminc" id="numericInput" oninput="formatNumber(this)">
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function formatNumber(input) {
// Hapus semua karakter non-digit dan non-titik
input.value = input.value.replace(/[^\d.]/g, '');
// Pastikan hanya satu titik yang diperbolehkan
input.value = input.value.replace(/(\..*)\./g, '$1');
// Pastikan titik berada setelah digit pertama
if (input.value.indexOf('.') === 0) {
input.value = input.value.substring(1);
}
}
</script>

View File

@ -1,121 +0,0 @@
<div class="row p-t-20">
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Awal</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="fa-solid fa-user"></i></span>
</div>
<input type="text" name="awal" class="form-control" value="<?php echo $kalori['awal'] ?>" required>
</div>
</div>
</div>
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Akhir</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="ti-calendar"></i></span>
</div>
<input type="text" name="akhir" class="form-control" value="<?php echo $kalori['akhir'] ?>" required>
</div>
</div>
</div>
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label class="">Jenis Kelamin</label>
<select class="select2 custom-select" style="width: 100%; height:36px;" name="jenis_kelamin" id="inlineFormCustomSelect" required>
<?php if($user['jenis_kelamin']=="Laki-Laki"){
?>
<option value="Laki-Laki" selected>Laki-Laki</option>
<option value="Perempuan">Perempuan</option>
<?php }elseif($user['jenis_kelamin']=="Perempuan"){ ?>
<option value="Laki-Laki">Laki-Laki</option>
<option value="Perempuan" selected>Perempuan</option>
<?php }else{ ?>
<option value="Laki-Laki">Laki-Laki</option>
<option value="Perempuan">Perempuan</option>
<?php } ?>
</select>
</div>
</div>
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Energi ( kkal )</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="ti-calendar"></i></span>
</div>
<input type="text" name="energi" class="form-control" value="<?php echo $kalori['energi'] ?>"required>
</div>
</div>
</div>
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Karbohidrat ( g )</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="ti-calendar"></i></span>
</div>
<input type="text" name="karbohidrat" class="form-control" value="<?php echo @$kalori['karbohidrat'] ?>" required>
</div>
</div>
</div>
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Protein ( g )</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="ti-calendar"></i></span>
</div>
<input type="text" name="protein" class="form-control" value="<?php echo $kalori['protein'] ?>" required>
</div>
</div>
</div>
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Lemak ( g )</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="ti-calendar"></i></span>
</div>
<input type="text" name="lemak" class="form-control" value="<?php echo $kalori['lemak'] ?>" required>
</div>
</div>
</div>
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Besi ( mg )</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="ti-calendar"></i></span>
</div>
<input type="text" name="besi" class="form-control" value="<?php echo $kalori['besi'] ?>" required>
</div>
</div>
</div>
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Vitamin A ( mcg )</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="ti-calendar"></i></span>
</div>
<input type="text" name="vitamina" class="form-control" value="<?php echo $kalori['vitamina'] ?>" required>
</div>
</div>
</div>
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Vitamin C ( mg )</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="ti-calendar"></i></span>
</div>
<input type="text" name="vitaminc" class="form-control" value="<?php echo $kalori['vitaminc'] ?>" required>
</div>
</div>
</div>
</div>

View File

@ -1,27 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3">
<h3>Masukkan Data Gizi</h3>
</a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('AKG/insert'); ?>
<?php echo @$error; ?>
<?php $this->load->view($form) ?>
<?php echo $this->Core->btn_input() ?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,80 +0,0 @@
<?php echo form_open('AKG/delete'); ?>
<div class="row">
<div class="col-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<div>
<button type="button" class="btn btn_hapus btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Hapus Data"><i class="ti-trash mt-0"></i></button>
<button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Jumlah Item Terpilih"><span id="jumlah_pilih">0</span></button>
</div>
<a href="" class="white-text mx-3">Angka Kecukupan Gizi</a>
<div>
<a href="<?php base_url(); ?>AKG/input" class="float-right">
<button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Tambah Data Baru"><i class="fa fa-plus m-1"></i></button>
</a>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="myTable" class="table table-striped table-bordered ">
<thead>
<tr>
<th width="10%"><input type="checkbox" class="form-check-input select-all" id="tableMaterialChec">
<label class="form-check-label" for="tableMaterialChec"></label>
</th>
<th>Umur</th>
<th>Jenis Kelamin</th>
<th>Energi</th>
<th>Karbohidrat</th>
<th>Protein</th>
<th>Lemak</th>
<th>Besi</th>
<th>Vitamin A</th>
<th>Vitamin C</th>
<th width="10%">Opsi</th>
</tr>
</thead>
<tbody>
<?php $no = 1;
foreach ($kalori as $data) { ?>
<?php $id_check = $data->id_kalori; ?>
<tr>
<td><input type="checkbox" class="form-check-input id_checkbox" id="tableMaterialCheck<?php echo $id_check ?>" name="id_kalori[]" value="<?php echo $id_check ?>">
<label class="form-check-label" for="tableMaterialCheck<?php echo $id_check ?>"></label>
</td>
<td>
<?php echo $data->awal . "-" . $data->akhir ?>
</td>
<td> <?php echo $data->jenis_kelamin ?> </td>
<td> <?php echo $data->energi.' kkal'; ?> </td>
<td> <?php echo $data->karbohidrat.' g'; ?> </td>
<td> <?php echo $data->protein.' g'; ?> </td>
<td> <?php echo $data->lemak.' g'; ?> </td>
<td> <?php echo $data->besi.' mg'; ?> </td>
<td> <?php echo $data->vitamina.' mcg'; ?> </td>
<td> <?php echo $data->vitaminc.' mg'; ?> </td>
</td>
<td><a href="<?php base_url() ?>AKG/edit/<?php echo $id_check; ?>">
<button type="button" class="btn btn-warning btn-sm btn-circle" data-toggle="tooltip" data-placement="top" title="" data-original-title="Ubah">
<i class="fa fa-edit"></i>
</button>
</a></td>
</tr>
<?php
$no++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="alert">
<?php echo $this->Core->Hapus_disable(); ?>
</div>
<div id="modal">
<?php echo $this->Core->Hapus_aktif(); ?>
</div>
<?php echo form_close(); ?>

View File

@ -1,342 +0,0 @@
<div class="row">
<div class="col-12">
<div class="card card-cascade narrower z-depth-1">
<div
class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-center align-items-center">
<h4><a href="" class="white-text mx-3">Hasil Analisis Kalori dan Isi Piringku Pengguna</a></h4>
</div>
<div class="card-body">
<div class="row p-t-20">
<div class="col">
<form action="<?php echo base_url(); ?>Analisis/index" method="get">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Dari Tanggal</label>
<div class="input-group mb-3">
<?php $tgl_awal = isset($_GET["start"]) ? date("Y-m-d", strtotime($_GET["start"])) : date("Y-m-d") ?>
<input type="date" name="start" id="start" class="form-control"
value="<?php echo date('Y-m-d', strtotime($tgl_awal)); ?>" required>
</div>
</div>
</div>
<div class="col">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Sampai Tanggal</label>
<div class="input-group mb-3">
<?php $tgl_akhir = isset($_GET["end"]) ? date("Y-m-d", strtotime($_GET["end"])) : date("Y-m-d") ?>
<input type="date" name="end" id="end" class="form-control"
value="<?php echo date('Y-m-d', strtotime($tgl_akhir)); ?>" required>
</div>
</div>
</div>
<div class="col">
<label for="exampleInputuname">Tombol Filter</label>
<div class="form-group animated flipIn">
<div class="input-group mb-3">
<button type="submit" class="btn btn-info"><i class="fa fa-filter">Filter</i> </button>
</div>
</div>
</div>
<?php echo form_open('LaporanKonsumsi/cetak'); ?>
</div>
<div class="row col-md-12">
<div class="table-responsive">
<table id="myTable" class="table table-striped table-bordered ">
<thead>
<tr>
<th>Tanggal</th>
<th>Nama</th>
<th>Total Kalori</th>
<th>Keterangan</th>
<th width="10%">Opsi</th>
</tr>
</thead>
<tbody>
<?php $no = 1;
foreach ($analisis as $data) { ?>
<tr>
<td>
<?php echo date("d/m/Y", strtotime($data->waktu)) ?>
</td>
<td>
<?php echo $data->nama ?>
</td>
<td>
<?php
$total_kalori = round($data->total_kalori, 0);
echo $total_kalori.' kkal'; ?>
</td>
<td>
<?php
// Sarapan
$sarapan = $data->energi * 40 / 100;
$ppokok = $sarapan * 30 / 100;
$plauk = $sarapan * 20 / 100;
$psayur = $sarapan * 30 / 100;
$pbuah = $sarapan * 20 / 100;
// Makan Siang
$siang = $data->energi * 40 / 100;
$spokok = $siang * 30 / 100;
$slauk = $siang * 20 / 100;
$ssayur = $siang * 30 / 100;
$sbuah = $siang * 20 / 100;
// Makan Malam
$malam = $data->energi * 20 / 100;
$mpokok = $malam * 30 / 100;
$mlauk = $malam * 20 / 100;
$msayur = $malam * 30 / 100;
$mbuah = $malam * 20 / 100;
?>
<?php if($data->total_sarapan != $sarapan && $data->total_siang != $siang && $data->total_malam != $malam){
if($data->total_sarapan_pokok != $ppokok && $data->total_sarapan_lauk != $plauk && $data->total_sarapan_sayur != $psayur && $data->total_sarapan_buah != $pbuah && $data->total_siang_pokok != $spokok && $data->total_siang_lauk != $slauk && $data->total_siang_sayur != $ssayur && $data->total_siang_buah != $sbuah && $data->total_malam_pokok != $mpokok && $data->total_malam_lauk != $mlauk && $data->total_malam_sayur != $msayur && $data->total_malam_buah != $mbuah){
echo "Kalori tidak sesuai, isi piringku tidak sesuai";
}else{
echo "Kalori tidak sesuai, isi piringku sesuai";
}
}else{
if($data->total_sarapan_pokok != $ppokok && $data->total_sarapan_lauk != $plauk && $data->total_sarapan_sayur != $psayur && $data->total_sarapan_buah != $pbuah && $data->total_siang_pokok != $spokok && $data->total_siang_lauk != $slauk && $data->total_siang_sayur != $ssayur && $data->total_siang_buah != $sbuah && $data->total_malam_pokok != $mpokok && $data->total_malam_lauk != $mlauk && $data->total_malam_sayur != $msayur && $data->total_malam_buah != $mbuah){
echo "Kalori sesuai, isi piringku tidak sesuai";
}else{
echo "Kalori sesuai, isi piringku sesuai";
}
} ?>
<?php //echo $data->total_sarapan_pokok ?>
</td>
<!-- <td><a href="<?php base_url() ?>LaporanKonsumsi/detail/<?php echo $data->waktu; ?>/<?php echo $data->user_id_user; ?>">
<button type="button" class="btn btn-warning btn-sm btn-circle" data-toggle="tooltip"
data-placement="top" title="" data-original-title="Detail">
<i class="fa fa-edit"></i>
</button>
</a></td> -->
<td>
<div class="button-box">
<button type="button" class="btn btn-warning btn-sm btn-circle"
data-toggle="modal" data-target="#exampleModal<?php echo $no; ?>"
data-whatever="@mdo" data-original-title="Detail">
<i class="fa fa-info"></i>
</button>
</div>
</td>
</tr>
<!-- Modal -->
<div class="modal fade" id="exampleModal<?php echo $no; ?>" tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel<?php echo $no; ?>">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="exampleModalLabel<?php echo $no; ?>">Detail
Konsumsi</h4>
<button type="button" class="close" data-dismiss="modal"
aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<p>Tanggal: <?php echo date("d/m/Y", strtotime($data->waktu)) ?></p>
<p>Nama: <?php echo $data->nama ?></p>
<p>Total Kalori: <?php $total_kalori = round($data->total_kalori, 0);
echo $total_kalori.' kkal'; ?></p>
<!-- Loop through nama_makanan -->
<div class="row">
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">&nbsp;</div>
<div class="font-weight-bold bg-primary border border-dark">Sarapan :</div>
<div class="font-weight-bold bg-primary border border-dark">Makanan Pokok</div>
<div class="font-weight-bold bg-primary border border-dark">Lauk Pauk</div>
<div class="font-weight-bold bg-primary border border-dark">Sayuran</div>
<div class="font-weight-bold bg-primary border border-dark">Buah-Buahan</div>
</div>
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">Total Kalori</div>
<?php $total_sarapan = round($data->total_sarapan, 0); ?>
<div class="border border-dark"><?php echo $total_sarapan.' kkal'; ?></div>
<?php $total_sarapan_pokok = round($data->total_sarapan_pokok, 0); ?>
<div class="border border-dark"><?php if($total_sarapan_pokok==NULL){echo "0".' kkal';; }else{echo $total_sarapan_pokok.' kkal';;} ?></div>
<?php $total_sarapan_lauk = round($data->total_sarapan_lauk, 0); ?>
<div class="border border-dark"><?php if($total_sarapan_lauk==NULL){echo "0".' kkal';; }else{echo $total_sarapan_lauk.' kkal';;} ?></div>
<?php $total_sarapan_sayur = round($data->total_sarapan_sayur, 0); ?>
<div class="border border-dark"><?php if($total_sarapan_sayur==NULL){echo "0".' kkal';; }else{echo $total_sarapan_sayur.' kkal';;} ?></div>
<?php $total_sarapan_buah = round($data->total_sarapan_buah, 0); ?>
<div class="border border-dark"><?php if($total_sarapan_buah==NULL){echo "0".' kkal';; }else{echo $total_sarapan_buah.' kkal';;} ?></div>
</div>
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">Target Kalori</div>
<div class="border border-dark"><?php echo $sarapan.' kkal'; ?></div>
<div class="border border-dark"><?php echo $ppokok.' kkal'; ?></div>
<div class="border border-dark"><?php echo $plauk.' kkal'; ?></div>
<div class="border border-dark"><?php echo $psayur.' kkal'; ?></div>
<div class="border border-dark"><?php echo $pbuah.' kkal'; ?></div>
</div>
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">Keterangan</div>
<?php if($data->total_sarapan!=$sarapan){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_sarapan_pokok!=$ppokok){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_sarapan_lauk!=$plauk){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_sarapan_sayur!=$psayur){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_sarapan_buah!=$pbuah){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
</div>
</div>
<div class="row mt-3">
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">&nbsp;</div>
<div class="font-weight-bold bg-primary border border-dark">Makan Siang :</div>
<div class="font-weight-bold bg-primary border border-dark">Makanan Pokok</div>
<div class="font-weight-bold bg-primary border border-dark">Lauk Pauk</div>
<div class="font-weight-bold bg-primary border border-dark">Sayuran</div>
<div class="font-weight-bold bg-primary border border-dark">Buah-Buahan</div>
</div>
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">Total Kalori</div>
<?php $total_siang = round($data->total_siang, 0); ?>
<div class="border border-dark"><?php echo $total_siang.' kkal'; ?></div>
<?php $total_siang_pokok = round($data->total_siang_pokok, 0); ?>
<div class="border border-dark"><?php if($total_siang_pokok==NULL){echo "0".' kkal';; }else{echo $total_siang_pokok.' kkal';;} ?></div>
<?php $total_siang_lauk = round($data->total_siang_lauk, 0); ?>
<div class="border border-dark"><?php if($total_siang_lauk==NULL){echo "0".' kkal';; }else{echo $total_siang_lauk.' kkal';;} ?></div>
<?php $total_siang_sayur = round($data->total_siang_sayur, 0); ?>
<div class="border border-dark"><?php if($total_siang_sayur==NULL){echo "0".' kkal';; }else{echo $total_siang_sayur.' kkal';;} ?></div>
<?php $total_siang_buah = round($data->total_siang_buah, 0); ?>
<div class="border border-dark"><?php if($total_siang_buah==NULL){echo "0".' kkal';; }else{echo $total_siang_buah.' kkal';;} ?></div>
</div>
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">Target Kalori</div>
<div class="border border-dark"><?php echo $siang.' kkal'; ?></div>
<div class="border border-dark"><?php echo $spokok.' kkal'; ?></div>
<div class="border border-dark"><?php echo $slauk.' kkal'; ?></div>
<div class="border border-dark"><?php echo $ssayur.' kkal'; ?></div>
<div class="border border-dark"><?php echo $sbuah.' kkal'; ?></div>
</div>
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">Keterangan</div>
<?php if($data->total_siang!=$siang){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_siang_pokok!=$spokok){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_siang_lauk!=$slauk){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_siang_sayur!=$ssayur){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_siang_buah!=$sbuah){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
</div>
</div>
<div class="row mt-3">
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">&nbsp;</div>
<div class="font-weight-bold bg-primary border border-dark">Makan Malam :</div>
<div class="font-weight-bold bg-primary border border-dark">Makanan Pokok</div>
<div class="font-weight-bold bg-primary border border-dark">Lauk Pauk</div>
<div class="font-weight-bold bg-primary border border-dark">Sayuran</div>
<div class="font-weight-bold bg-primary border border-dark">Buah-Buahan</div>
</div>
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">Total Kalori</div>
<?php $total_malam = round($data->total_malam, 0); ?>
<div class="border border-dark"><?php echo $total_malam.' kkal'; ?></div>
<?php $total_malam_pokok = round($data->total_malam_pokok, 0); ?>
<div class="border border-dark"><?php if($total_malam_pokok==NULL){echo "0".' kkal';; }else{echo $total_malam_pokok.' kkal';;} ?></div>
<?php $total_malam_lauk = round($data->total_malam_lauk, 0); ?>
<div class="border border-dark"><?php if($total_malam_lauk==NULL){echo "0".' kkal';; }else{echo $total_malam_lauk.' kkal';;} ?></div>
<?php $total_malam_sayur = round($data->total_malam_sayur, 0); ?>
<div class="border border-dark"><?php if($total_malam_sayur==NULL){echo "0".' kkal';; }else{echo $total_malam_sayur.' kkal';;} ?></div>
<?php $total_malam_buah = round($data->total_malam_buah, 0); ?>
<div class="border border-dark"><?php if($total_malam_buah==NULL){echo "0".' kkal';; }else{echo $total_malam_buah.' kkal';;} ?></div>
</div>
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">Target Kalori</div>
<div class="border border-dark"><?php echo $malam.' kkal'; ?></div>
<div class="border border-dark"><?php echo $mpokok.' kkal'; ?></div>
<div class="border border-dark"><?php echo $mlauk.' kkal'; ?></div>
<div class="border border-dark"><?php echo $msayur.' kkal'; ?></div>
<div class="border border-dark"><?php echo $mbuah.' kkal'; ?></div>
</div>
<div class="col-3 p-0">
<div class="font-weight-bold bg-primary border border-dark">Keterangan</div>
<?php if($data->total_malam!=$malam){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_malam_pokok!=$mpokok){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_malam_lauk!=$mlauk){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_malam_sayur!=$msayur){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
<?php if($data->total_malam_buah!=$mbuah){ ?>
<div class="border border-dark"><?php echo "Tidak Sesuai"; ?></div>
<?php }else{ ?>
<div class="border border-dark"><?php echo "Sesuai"; ?></div>
<?php } ?>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close
</button>
</div>
</div>
</div>
</div>
<?php
$no++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo form_close(); ?>

View File

@ -1,25 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3"><h3>Ubah Artikel</h3></a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('Artikel/update/'.$this->uri->segment(3));?>
<?php echo @$error;?>
<?php $this->load->view($form)?>
<?php echo $this->Core->btn_input()?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,31 +0,0 @@
<div class="card" style="border-radius: 5px;">
<div class="card-body">
<div class="form-group animated flipIn">
<div class="">
<label class="mt-3">Judul</label>
<input type="text" class="form-control" value="<?php echo @$artikel['judul'] ?>" name="judul" required>
</div>
<div class="">
<label class="mt-3">Penulis</label>
<input type="text" class="form-control" value="<?php echo @$artikel['penulis'] ?>" name="penulis" required>
</div>
<div class="">
<label class="mt-3">Gambar</label>
<input type="file" id="gambar_artikel" class="dropify" name="gambar_artikel" required/>
</div>
<div class="">
<label class="mt-3">Deskripsi</label>
<textarea name="konten" id="konten" class="texteditor" required><?php echo @$artikel['konten']?></textarea>
</div>
</div>
</div>
</div>
<!-- panggil ckeditor.js -->
<script type="text/javascript" src="<?php echo base_url() ?>desain/ckeditor/ckeditor.js"></script>
<!-- panggil adapter jquery ckeditor -->
<script type="text/javascript" src="<?php echo base_url() ?>desain/ckeditor/adapters/jquery.js"></script>
<!-- setup selector -->
<script type="text/javascript">
$('textarea.texteditor').ckeditor();
</script>

View File

@ -1,31 +0,0 @@
<div class="card" style="border-radius: 5px;">
<div class="card-body">
<div class="form-group animated flipIn">
<div class="">
<label class="mt-3">Judul</label>
<input type="text" class="form-control" value="<?php echo @$artikel['judul'] ?>" name="judul" required>
</div>
<div class="">
<label class="mt-3">Penulis</label>
<input type="text" class="form-control" value="<?php echo @$artikel['penulis'] ?>" name="penulis" required>
</div>
<div class="">
<label class="mt-3">Gambar</label>
<input type="file" id="gambar_artikel" class="dropify" name="gambar_artikel" data-default-file="<?php echo base_url() . $artikel['gambar'] ?>"/>
</div>
<div class="">
<label class="mt-3">Deskripsi</label>
<textarea name="konten" id="konten" class="texteditor" required><?php echo @$artikel['konten']?></textarea>
</div>
</div>
</div>
</div>
<!-- panggil ckeditor.js -->
<script type="text/javascript" src="<?php echo base_url() ?>desain/ckeditor/ckeditor.js"></script>
<!-- panggil adapter jquery ckeditor -->
<script type="text/javascript" src="<?php echo base_url() ?>desain/ckeditor/adapters/jquery.js"></script>
<!-- setup selector -->
<script type="text/javascript">
$('textarea.texteditor').ckeditor();
</script>

View File

@ -1,25 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3"><h3>Tambahkan Artikel</h3></a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('Artikel/insert');?>
<?php echo @$error;?>
<?php $this->load->view($form)?>
<?php echo $this->Core->btn_input()?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,73 +0,0 @@
<?php echo form_open('Artikel/delete');?>
<div class="row">
<div class="col-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<div>
<button type="button" class="btn btn_hapus btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Hapus Data"><i class="ti-trash mt-0"></i></button>
<button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Jumlah Item Terpilih"><span id="jumlah_pilih">0</span></button>
</div>
<a href="" class="white-text mx-3">Daftar Artikel</a>
<div>
<a href="<?php base_url(); ?>Artikel/input" class="float-right">
<button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Tambah Data Baru"><i class="fa fa-plus m-1"></i></button>
</a>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="myTable" class="table table-striped table-bordered ">
<thead>
<tr>
<th width="10%"><input type="checkbox" class="form-check-input select-all" id="tableMaterialChec">
<label class="form-check-label" for="tableMaterialChec"></label>
</th>
<th>Judul</th>
<th>Tanggal</th>
<th>Penulis</th>
<th>Konten</th>
<th>gambar</th>
<th width="10%">Opsi</th>
</tr>
</thead>
<tbody>
<?php $no=1; foreach ($artikel as $data) {?>
<?php $id_check = $data->id_artikel;?>
<tr>
<td><input type="checkbox" class="form-check-input id_checkbox" id="tableMaterialCheck<?php echo $id_check ?>" name="id_artikel[]" value="<?php echo $id_check ?>">
<label class="form-check-label" for="tableMaterialCheck<?php echo $id_check ?>"></label>
</td>
<td><?php echo $data->judul?></td>
<td><?php echo date("d-m-Y", strtotime($data->tanggal))?></td>
<td><?php echo $data->penulis?></td>
<td><?php echo $data->konten?></td>
<td><?php echo $data->gambar_artikel?></td>
<td>
<a href="<?php base_url()?>Artikel/edit/<?php echo $id_check;?>">
<button type="button" class="btn btn-warning btn-sm btn-circle" data-toggle="tooltip" data-placement="top" title="" data-original-title="Ubah">
<i class="fa fa-edit"></i>
</button>
</a>
<a href="<?php base_url()?>Artikel/view/<?php echo $id_check;?>">
<button type="button" class="btn btn-warning btn-sm btn-circle" data-toggle="tooltip" data-placement="top" title="" data-original-title="Ubah">
<i class="fa fa-edit"></i>
</button>
</a>
</td>
</tr>
<?php
$no++;
}?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="alert"><?php echo $this->Core->Hapus_disable(); ?></div>
<div id="modal"><?php echo $this->Core->Hapus_aktif(); ?></div>
<?php echo form_close();?>

View File

@ -1 +0,0 @@
<?php echo @$artikel['konten']?>

View File

@ -1,25 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3"><h3>Ubah Pertanyaan</h3></a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('FAQ/update_pertanyaan/'.$this->uri->segment(3));?>
<?php echo @$error;?>
<?php $this->load->view($form)?>
<?php echo $this->Core->btn_input()?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,10 +0,0 @@
<div class="card" style="border-radius: 5px;">
<div class="card-body">
<div class="form-group animated flipIn">
<div class="">
<label class="mt-3">Pertanyaan</label>
<input type="text" class="form-control" value="<?php echo @$pertanyaan['pertanyaan'] ?>" name="pertanyaan" required>
</div>
</div>
</div>
</div>

View File

@ -1,25 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3"><h3>Masukkan Pertanyaan</h3></a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('FAQ/insert_pertanyaan');?>
<?php echo @$error;?>
<?php $this->load->view($form)?>
<?php echo $this->Core->btn_input()?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,75 +0,0 @@
<?php echo form_open('FAQ/delete_pertanyaan'); ?>
<div class="row">
<div class="col-12">
<div class="card card-cascade narrower z-depth-1">
<div
class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<div>
<button type="button" class="btn btn_hapus btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip"
data-placement="top" title="" data-original-title="Hapus Data"><i class="ti-trash mt-0"></i></button>
<button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip"
data-placement="top" title="" data-original-title="Jumlah Item Terpilih"><span
id="jumlah_pilih">0</span></button>
</div>
<a href="" class="white-text mx-3">Daftar Pertanyaan</a>
<div>
<a href="<?php base_url(); ?>FAQ/input_pertanyaan" class="float-right">
<button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip"
data-placement="top" title="" data-original-title="Tambah Data Baru"><i
class="fa fa-plus m-1"></i></button>
</a>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="myTable" class="table table-striped table-bordered ">
<thead>
<tr>
<th width="10%"><input type="checkbox" class="form-check-input select-all" id="tableMaterialChec">
<label class="form-check-label" for="tableMaterialChec"></label>
</th>
<th>Pertanyaan</th>
<!-- <th>Jawaban</th> -->
<th width="10%">Opsi</th>
</tr>
</thead>
<tbody>
<?php $no = 1;
foreach ($pertanyaan as $data) { ?>
<?php $id_check = $data->id_pertanyaan; ?>
<tr>
<td><input type="checkbox" class="form-check-input id_checkbox"
id="tableMaterialCheck<?php echo $id_check ?>" name="id_pertanyaan[]"
value="<?php echo $id_check ?>">
<label class="form-check-label" for="tableMaterialCheck<?php echo $id_check ?>"></label>
</td>
<td>
<?php echo $data->pertanyaan ?>
<!-- <?php echo $data->jawaban ?> -->
</td>
</td>
<td><a href="<?php base_url() ?>FAQ/edit_pertanyaan/<?php echo $id_check; ?>">
<button type="button" class="btn btn-warning btn-sm btn-circle" data-toggle="tooltip"
data-placement="top" title="" data-original-title="Ubah">
<i class="fa fa-edit"></i>
</button>
</a></td>
</tr>
<?php
$no++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="alert">
<?php echo $this->Core->Hapus_disable(); ?>
</div>
<div id="modal">
<?php echo $this->Core->Hapus_aktif(); ?>
</div>
<?php echo form_close(); ?>

View File

@ -1,25 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3">
<h3>Ubah Data IMT</h3>
</a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('IMT/update/' . $this->uri->segment(3)); ?>
<?php echo @$error; ?>
<?php $this->load->view($form) ?>
<?php echo $this->Core->btn_input() ?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,38 +0,0 @@
<div class="card" style="border-radius: 5px;">
<div class="card-body">
<div class="form-group animated flipIn">
<label class="">Indeks Masa Tubuh</label>
<div class="">
<div class="row">
<div class="col-md-6 col-xl-6">
<label class="mt-3">Klasifikasi</label>
<input type="text" class="form-control" value="<?php echo @$imt['klasifikasi'] ?>" name="klasifikasi" required>
</div>
<div class="col-md-6 col-xl-6">
<label class="mt-3">Nilai Awal</label>
<input type="text" class="form-control" value="<?php echo @$imt['nilai_awal'] ?>" name="nilai_awal" id="numericInput" oninput="formatNumber(this)" required>
</div>
<div class="col-md-6 col-xl-6">
<label class="mt-3">Nilai Akhir</label>
<input type="text" class="form-control" value="<?php echo @$imt['nilai_akhir'] ?>" name="nilai_akhir" id="numericInput" oninput="formatNumber(this)" required>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function formatNumber(input) {
// Hapus semua karakter non-digit dan non-titik
input.value = input.value.replace(/[^\d.]/g, '');
// Pastikan hanya satu titik yang diperbolehkan
input.value = input.value.replace(/(\..*)\./g, '$1');
// Pastikan titik berada setelah digit pertama
if (input.value.indexOf('.') === 0) {
input.value = input.value.substring(1);
}
}
</script>

View File

@ -1,35 +0,0 @@
<div class="row p-t-20">
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Klasifikasi</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="fa-solid fa-user"></i></span>
</div>
<input type="text" name="klasifikasi" class="form-control" value="<?php echo $imt['klasifikasi'] ?>" required>
</div>
</div>
</div>
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Nilai Awal</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="ti-calendar"></i></span>
</div>
<input type="text" name="nilai_awal" class="form-control" value="<?php echo $imt['nilai_awal'] ?>" required>
</div>
</div>
</div>
<div class="col-md-12 col-xl-6">
<div class="form-group animated flipIn">
<label for="exampleInputuname">Nilai Akhir</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="ti-calendar"></i></span>
</div>
<input type="text" name="nilai_akhir" class="form-control" value="<?php echo $imt['nilai_akhir'] ?>" required>
</div>
</div>
</div>
</div>

View File

@ -1,27 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3">
<h3>Masukkan Data IMT</h3>
</a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('IMT/insert'); ?>
<?php echo @$error; ?>
<?php $this->load->view($form) ?>
<?php echo $this->Core->btn_input() ?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,66 +0,0 @@
<?php echo form_open('IMT/delete'); ?>
<div class="row">
<div class="col-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<div>
<button type="button" class="btn btn_hapus btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Hapus Data"><i class="ti-trash mt-0"></i></button>
<button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Jumlah Item Terpilih"><span id="jumlah_pilih">0</span></button>
</div>
<a href="" class="white-text mx-3">Indeks Masa Tubuh</a>
<div>
<a href="<?php base_url(); ?>IMT/input" class="float-right">
<button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Tambah Data Baru"><i class="fa fa-plus m-1"></i></button>
</a>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="myTable" class="table table-striped table-bordered ">
<thead>
<tr>
<th width="10%"><input type="checkbox" class="form-check-input select-all" id="tableMaterialChec">
<label class="form-check-label" for="tableMaterialChec"></label>
</th>
<th>Klasifikasi</th>
<th>Rentang Nilai</th>
<th width="10%">Opsi</th>
</tr>
</thead>
<tbody>
<?php $no = 1;
foreach ($imt as $data) { ?>
<?php $id_check = $data->id_imt; ?>
<tr>
<td><input type="checkbox" class="form-check-input id_checkbox" id="tableMaterialCheck<?php echo $id_check ?>" name="id_imt[]" value="<?php echo $id_check ?>">
<label class="form-check-label" for="tableMaterialCheck<?php echo $id_check ?>"></label>
</td>
<td> <?php echo $data->klasifikasi ?> </td>
<td>
<?php echo $data->nilai_awal . "-" . $data->nilai_akhir ?>
</td>
</td>
<td><a href="<?php base_url() ?>IMT/edit/<?php echo $id_check; ?>">
<button type="button" class="btn btn-warning btn-sm btn-circle" data-toggle="tooltip" data-placement="top" title="" data-original-title="Ubah">
<i class="fa fa-edit"></i>
</button>
</a></td>
</tr>
<?php
$no++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="alert">
<?php echo $this->Core->Hapus_disable(); ?>
</div>
<div id="modal">
<?php echo $this->Core->Hapus_aktif(); ?>
</div>
<?php echo form_close(); ?>

View File

@ -1,25 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3"><h3>Ubah Jawaban</h3></a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('FAQ/update_jawaban/'.$this->uri->segment(3));?>
<?php echo @$error;?>
<?php $this->load->view($form)?>
<?php echo $this->Core->btn_input()?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,34 +0,0 @@
<div class="card" style="border-radius: 5px;">
<div class="card-body">
<div class="form-group animated flipIn">
<label class="">Pertanyaan</label>
<select class="select2 form-control custom-select" style="width: 100%; height:36px;" name="id_pertanyaan" required>
<option value="">Pilih Pertanyaan</option>
<?php foreach ($pertanyaan as $value): ?>
<option value="<?php echo $value->id_pertanyaan ?>">
<?php echo $value->pertanyaan; ?>
</option>
<?php endforeach; ?>
</select>
<div class="">
<label class="mt-3">Jawaban</label>
<input type="text" class="form-control" value="<?php echo @$jawaban['jawaban'] ?>" name="jawaban" required>
</div>
</div>
</div>
</div>
<script>
function formatNumber(input) {
// Hapus semua karakter non-digit dan non-titik
input.value = input.value.replace(/[^\d.]/g, '');
// Pastikan hanya satu titik yang diperbolehkan
input.value = input.value.replace(/(\..*)\./g, '$1');
// Pastikan titik berada setelah digit pertama
if (input.value.indexOf('.') === 0) {
input.value = input.value.substring(1);
}
}
</script>

View File

@ -1,25 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3"><h3>Masukkan Jawaban</h3></a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('FAQ/insert_jawaban');?>
<?php echo @$error;?>
<?php $this->load->view($form)?>
<?php echo $this->Core->btn_input()?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,59 +0,0 @@
<?php echo form_open('FAQ/delete_jawaban');?>
<div class="row">
<div class="col-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<div>
<button type="button" class="btn btn_hapus btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Hapus Data"><i class="ti-trash mt-0"></i></button>
<button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Jumlah Item Terpilih"><span id="jumlah_pilih">0</span></button>
</div>
<a href="" class="white-text mx-3">Daftar Jawaban</a>
<div>
<a href="<?php base_url(); ?>input_jawaban" class="float-right">
<button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Tambah Data Baru"><i class="fa fa-plus m-1"></i></button>
</a>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="myTable" class="table table-striped table-bordered ">
<thead>
<tr>
<th width="10%"><input type="checkbox" class="form-check-input select-all" id="tableMaterialChec">
<label class="form-check-label" for="tableMaterialChec"></label>
</th>
<th>Pertanyaan</th>
<th>Jawaban</th>
<th width="10%">Opsi</th>
</tr>
</thead>
<tbody>
<?php $no=1; foreach ($jawaban as $data) {?>
<?php $id_check = $data->id_jawaban;?>
<tr>
<td><input type="checkbox" class="form-check-input id_checkbox" id="tableMaterialCheck<?php echo $id_check ?>" name="id_jawaban[]" value="<?php echo $id_check ?>">
<label class="form-check-label" for="tableMaterialCheck<?php echo $id_check ?>"></label>
</td>
<td><?php echo $data->pertanyaan?></td>
<td><?php echo $data->jawaban?></td>
<td><a href="<?php base_url()?>edit_jawaban/<?php echo $id_check;?>">
<button type="button" class="btn btn-warning btn-sm btn-circle" data-toggle="tooltip" data-placement="top" title="" data-original-title="Ubah">
<i class="fa fa-edit"></i>
</button>
</a></td>
</tr>
<?php
$no++;
}?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="alert"><?php echo $this->Core->Hapus_disable(); ?></div>
<div id="modal"><?php echo $this->Core->Hapus_aktif(); ?></div>
<?php echo form_close();?>

View File

@ -1,25 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3"><h3>Ubah Kategori</h3></a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('Kategori/update/'.$this->uri->segment(3));?>
<?php echo @$error;?>
<?php $this->load->view($form)?>
<?php echo $this->Core->btn_input()?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,10 +0,0 @@
<div class="card" style="border-radius: 5px;">
<div class="card-body">
<div class="form-group animated flipIn">
<div class="">
<label class="mt-3">Nama Kategori</label>
<input type="text" class="form-control" value="<?php echo @$kategori['nama_kategori'] ?>" name="nama_kategori" required>
</div>
</div>
</div>
</div>

View File

@ -1,25 +0,0 @@
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card card-cascade narrower z-depth-1">
<div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
<a href="" class="white-text mx-3"><h3>Masukkan Kategori</h3></a>
</div>
<div class="card-body card-block">
<?php echo form_open_multipart('Kategori/insert');?>
<?php echo @$error;?>
<?php $this->load->view($form)?>
<?php echo $this->Core->btn_input()?>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More