first commit

This commit is contained in:
kicap1992
2021-06-23 15:53:56 +08:00
commit 9ace48125c
843 changed files with 265486 additions and 0 deletions

6
application/.htaccess Normal file
View File

@ -0,0 +1,6 @@
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>

11
application/cache/index.html vendored Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,135 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
| is made regarding whether you intend to use it. This file lets
| you globally define which systems you would like loaded with every
| request.
|
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Packages
| 2. Libraries
| 3. Drivers
| 4. Helper files
| 5. Custom config files
| 6. Language files
| 7. Models
|
*/
/*
| -------------------------------------------------------------------
| Auto-load Packages
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in system/libraries/ or your
| application/libraries/ directory, with the addition of the
| 'database' library, which is somewhat of a special case.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'email', 'session');
|
| You can also supply an alternative library name to be assigned
| in the controller:
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array('database','email','session');
/*
| -------------------------------------------------------------------
| Auto-load Drivers
| -------------------------------------------------------------------
| These classes are located in system/libraries/ or in your
| application/libraries/ directory, but are also placed inside their
| own subdirectory and they extend the CI_Driver_Library class. They
| offer multiple interchangeable driver options.
|
| Prototype:
|
| $autoload['drivers'] = array('cache');
|
| You can also supply an alternative property name to be assigned in
| the controller:
|
| $autoload['drivers'] = array('cache' => 'cch');
|
*/
$autoload['drivers'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url','form');
/*
| -------------------------------------------------------------------
| Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files. Otherwise, leave it blank.
|
*/
$autoload['config'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
$autoload['language'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['model'] = array('first_model', 'second_model');
|
| You can also supply an alternative model name to be assigned
| in the controller:
|
| $autoload['model'] = array('first_model' => 'first');
*/
$autoload['model'] = array();

View File

@ -0,0 +1,525 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$root = "http://".$_SERVER['HTTP_HOST'];
$root .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
$config['base_url'] = "$root";
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'REQUEST_URI' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
|
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/
$config['uri_protocol'] = 'REQUEST_URI';
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| https://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = '';
/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
| See http://php.net/htmlspecialchars for a list of supported charsets.
|
*/
$config['charset'] = 'UTF-8';
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = FALSE;
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| https://codeigniter.com/user_guide/general/core_classes.html
| https://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'MY_';
/*
|--------------------------------------------------------------------------
| Composer auto-loading
|--------------------------------------------------------------------------
|
| Enabling this setting will tell CodeIgniter to look for a Composer
| package auto-loader script in application/vendor/autoload.php.
|
| $config['composer_autoload'] = TRUE;
|
| Or if you have your vendor/ directory located somewhere else, you
| can opt to set a specific path as well:
|
| $config['composer_autoload'] = '/path/to/vendor/autoload.php';
|
| For more information about Composer, please visit http://getcomposer.org/
|
| Note: This will NOT disable or override the CodeIgniter-specific
| autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = FALSE;
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| The configured value is actually a regular expression character group
| and it will be executed as: ! preg_match('/^[<permitted_uri_chars>]+$/i
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
/*
|--------------------------------------------------------------------------
| Allow $_GET array
|--------------------------------------------------------------------------
|
| By default CodeIgniter enables access to the $_GET array. If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['allow_get_array'] = TRUE;
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| You can also pass an array with threshold levels to show individual error types
|
| array(2) = Debug Messages, without Error Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0;
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ directory. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
/*
|--------------------------------------------------------------------------
| Log File Extension
|--------------------------------------------------------------------------
|
| The default filename extension for log files. The default 'php' allows for
| protecting the log files via basic scripting, when they are to be stored
| under a publicly accessible directory.
|
| Note: Leaving it blank will default to 'php'.
|
*/
$config['log_file_extension'] = '';
/*
|--------------------------------------------------------------------------
| Log File Permissions
|--------------------------------------------------------------------------
|
| The file system permissions to be applied on newly created log files.
|
| IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
| integer notation (i.e. 0700, 0644, etc.)
*/
$config['log_file_permissions'] = 0644;
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
|--------------------------------------------------------------------------
| Error Views Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/views/errors/ directory. Use a full server path with trailing slash.
|
*/
$config['error_views_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/cache/ directory. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Include Query String
|--------------------------------------------------------------------------
|
| Whether to take the URL query string into consideration when generating
| output cache files. Valid options are:
|
| FALSE = Disabled
| TRUE = Enabled, take all query parameters into account.
| Please be aware that this may result in numerous cache
| files generated for the same page over and over again.
| array('q') = Enabled, but only take into account the specified list
| of query parameters.
|
*/
$config['cache_query_string'] = FALSE;
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class, you must set an encryption key.
| See the user guide for more info.
|
| https://codeigniter.com/user_guide/libraries/encryption.html
|
*/
$config['encryption_key'] = '';
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'sess_driver'
|
| The storage driver to use: files, database, redis, memcached
|
| 'sess_cookie_name'
|
| The session cookie name, must contain only [0-9a-z_-] characters
|
| 'sess_expiration'
|
| The number of SECONDS you want the session to last.
| Setting to 0 (zero) means expire when the browser is closed.
|
| 'sess_save_path'
|
| The location to save sessions to, driver dependent.
|
| For the 'files' driver, it's a path to a writable directory.
| WARNING: Only absolute paths are supported!
|
| For the 'database' driver, it's a table name.
| Please read up the manual for the format with other session drivers.
|
| IMPORTANT: You are REQUIRED to set a valid save path!
|
| 'sess_match_ip'
|
| Whether to match the user's IP address when reading the session data.
|
| WARNING: If you're using the database driver, don't forget to update
| your session table's PRIMARY KEY when changing this setting.
|
| 'sess_time_to_update'
|
| How many seconds between CI regenerating the session ID.
|
| 'sess_regenerate_destroy'
|
| Whether to destroy session data associated with the old session ID
| when auto-regenerating the session ID. When set to FALSE, the data
| will be later deleted by the garbage collector.
|
| Other session cookie settings are shared with the rest of the application,
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
*/
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists.
| 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
|
| Note: These settings (with the exception of 'cookie_prefix' and
| 'cookie_httponly') will also affect sessions.
|
*/
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
/*
|--------------------------------------------------------------------------
| Standardize newlines
|--------------------------------------------------------------------------
|
| Determines whether to standardize newline characters in input data,
| meaning to replace \r\n, \r, \n occurrences with the PHP_EOL value.
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['standardize_newlines'] = FALSE;
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['global_xss_filtering'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
| 'csrf_regenerate' = Regenerate token on every submission
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/
$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| Only used if zlib.output_compression is turned off in your php.ini.
| Please do not use it together with httpd-level output compression.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are 'local' or any PHP supported timezone. This preference tells
| the system whether to use your server's local time as the master 'now'
| reference, or convert it to the configured one timezone. See the 'date
| helper' page of the user guide for information regarding date handling.
|
*/
$config['time_reference'] = 'local';
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
| Note: You need to have eval() enabled for this to work.
|
*/
$config['rewrite_short_tags'] = FALSE;
/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy
| IP addresses from which CodeIgniter should trust headers such as
| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
| the visitor's IP address.
|
| You can use both an array or a comma-separated list of proxy addresses,
| as well as specifying whole subnets. Here are a few examples:
|
| Comma-separated: '10.0.1.200,192.168.5.0/24'
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
$config['proxy_ips'] = '';

View File

@ -0,0 +1,85 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Display Debug backtrace
|--------------------------------------------------------------------------
|
| If set to TRUE, a backtrace will be displayed along with php errors. If
| error_reporting is disabled, the backtrace will not display, regardless
| of this setting
|
*/
defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE);
/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system. The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.). Octal values should
| always be used to set the mode correctly.
|
*/
defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644);
defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755);
defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755);
/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/
defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b');
defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
defined('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
/*
|--------------------------------------------------------------------------
| Exit Status Codes
|--------------------------------------------------------------------------
|
| Used to indicate the conditions under which the script is exit()ing.
| While there is no universal standard for error codes, there are some
| broad conventions. Three such conventions are mentioned below, for
| those who wish to make use of them. The CodeIgniter defaults were
| chosen for the least overlap with these conventions, while still
| leaving room for others to be defined in future versions and user
| applications.
|
| The three main conventions used for determining exit status codes
| are as follows:
|
| Standard C/C++ Library (stdlibc):
| http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
| (This link also contains other GNU-specific conventions)
| BSD sysexits.h:
| http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
| Bash scripting:
| http://tldp.org/LDP/abs/html/exitcodes.html
|
*/
defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors
defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error
defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error
defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found
defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input
defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error
defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code

View File

@ -0,0 +1,96 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
| (and in table creation queries made with DB Forge).
| There is an incompatibility in PHP with mysql_real_escape_string() which
| can make your site vulnerable to SQL injection if you are using a
| multi-byte character set and are running versions lower than these.
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
| ['encrypt'] Whether or not to use an encrypted connection.
|
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
| 'ssl_key' - Path to the private key file
| 'ssl_cert' - Path to the public key certificate file
| 'ssl_ca' - Path to the certificate authority file
| 'ssl_capath' - Path to a directory containing trusted CA certificates in PEM format
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not
|
| ['compress'] Whether or not to use client compression (MySQL only)
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
| NOTE: Disabling this will also effectively disable both
| $this->db->last_query() and profiling of DB queries.
| When you run a query, with this setting set to TRUE (default),
| CodeIgniter will store the SQL statement for debugging purposes.
| However, this may cause high memory usage, especially if you run
| a lot of SQL queries ... disable this to avoid that problem.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $query_builder variables lets you determine whether or not to load
| the query builder class.
*/
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'db_tambak',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);

View File

@ -0,0 +1,24 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$_doctypes = array(
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'xhtml-basic11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
'mathml1' => '<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">',
'mathml2' => '<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">',
'svg10' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">',
'svg11' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',
'svg11-basic' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">',
'svg11-tiny' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">',
'xhtml-math-svg-xh' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-math-svg-sh' => '<!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-rdfa-1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">',
'xhtml-rdfa-2' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">'
);

View File

@ -0,0 +1,103 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Foreign Characters
| -------------------------------------------------------------------
| This file contains an array of foreign characters for transliteration
| conversion used by the Text helper
|
*/
$foreign_characters = array(
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a',
'/Б/' => 'B',
'/б/' => 'b',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Д/' => 'D',
'/д/' => 'd',
'/Ð|Ď|Đ|Δ/' => 'Dj',
'/ð|ď|đ|δ/' => 'dj',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e',
'/Ф/' => 'F',
'/ф/' => 'f',
'/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G',
'/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Ķ|Κ|К/' => 'K',
'/ķ|κ|к/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l',
'/М/' => 'M',
'/м/' => 'm',
'/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N',
'/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o',
'/П/' => 'P',
'/п/' => 'p',
'/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R',
'/ŕ|ŗ|ř|ρ|р/' => 'r',
'/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S',
'/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's',
'/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T',
'/ț|ţ|ť|ŧ|т/' => 't',
'/Þ|þ/' => 'th',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u',
'/Ƴ|Ɏ|Ỵ|Ẏ|Ӳ|Ӯ|Ў|Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y',
'/ẙ|ʏ|ƴ|ɏ|ỵ|ẏ|ӳ|ӯ|ў|ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y',
'/В/' => 'V',
'/в/' => 'v',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Ź|Ż|Ž|Ζ|З/' => 'Z',
'/ź|ż|ž|ζ|з/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/' => 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f',
'/ξ/' => 'ks',
'/π/' => 'p',
'/β/' => 'v',
'/μ/' => 'm',
'/ψ/' => 'ps',
'/Ё/' => 'Yo',
'/ё/' => 'yo',
'/Є/' => 'Ye',
'/є/' => 'ye',
'/Ї/' => 'Yi',
'/Ж/' => 'Zh',
'/ж/' => 'zh',
'/Х/' => 'Kh',
'/х/' => 'kh',
'/Ц/' => 'Ts',
'/ц/' => 'ts',
'/Ч/' => 'Ch',
'/ч/' => 'ch',
'/Ш/' => 'Sh',
'/ш/' => 'sh',
'/Щ/' => 'Shch',
'/щ/' => 'shch',
'/Ъ|ъ|Ь|ь/' => '',
'/Ю/' => 'Yu',
'/ю/' => 'yu',
'/Я/' => 'Ya',
'/я/' => 'ya'
);

View File

@ -0,0 +1,13 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
| -------------------------------------------------------------------------
| This file lets you define "hooks" to extend CI without hacking the core
| files. Please see the user guide for info:
|
| https://codeigniter.com/user_guide/general/hooks.html
|
*/

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,19 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Memcached settings
| -------------------------------------------------------------------------
| Your Memcached servers can be specified below.
|
| See: https://codeigniter.com/user_guide/libraries/caching.html#memcached
|
*/
$config = array(
'default' => array(
'hostname' => '127.0.0.1',
'port' => '11211',
'weight' => '1',
),
);

View File

@ -0,0 +1,84 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default for security reasons.
| You should enable migrations whenever you intend to do a schema migration
| and disable it back when you're done.
|
*/
$config['migration_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migration Type
|--------------------------------------------------------------------------
|
| Migration file names may be based on a sequential identifier or on
| a timestamp. Options are:
|
| 'sequential' = Sequential migration naming (001_add_blog.php)
| 'timestamp' = Timestamp migration naming (20121031104401_add_blog.php)
| Use timestamp format YYYYMMDDHHIISS.
|
| Note: If this configuration value is missing the Migration library
| defaults to 'sequential' for backward compatibility with CI2.
|
*/
$config['migration_type'] = 'timestamp';
/*
|--------------------------------------------------------------------------
| Migrations table
|--------------------------------------------------------------------------
|
| This is the name of the table that will store the current migrations state.
| When migrations runs it will store in a database table which migration
| level the system is at. It then compares the migration level in this
| table to the $config['migration_version'] if they are not the same it
| will migrate up. This must be set.
|
*/
$config['migration_table'] = 'migrations';
/*
|--------------------------------------------------------------------------
| Auto Migrate To Latest
|--------------------------------------------------------------------------
|
| If this is set to TRUE when you load the migrations class and have
| $config['migration_enabled'] set to TRUE the system will auto migrate
| to your latest migration (whatever $config['migration_version'] is
| set to). This way you do not have to call migrations anywhere else
| in your code to have the latest migration.
|
*/
$config['migration_auto_latest'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->current() this is the version that schema will
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 0;
/*
|--------------------------------------------------------------------------
| Migrations Path
|--------------------------------------------------------------------------
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
|
*/
$config['migration_path'] = APPPATH.'migrations/';

View File

@ -0,0 +1,184 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| MIME TYPES
| -------------------------------------------------------------------
| This file contains an array of mime types. It is used by the
| Upload class to help identify allowed file types.
|
*/
return array(
'hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'),
'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => array('application/octet-stream', 'application/x-msdownload'),
'class' => 'application/octet-stream',
'psd' => array('application/x-photoshop', 'image/vnd.adobe.photoshop'),
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'),
'ai' => array('application/pdf', 'application/postscript'),
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => array('application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'),
'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', 'application/msword'),
'pptx' => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip'),
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'gzip' => 'application/x-gzip',
'php' => array('application/x-httpd-php', 'application/php', 'application/x-php', 'text/php', 'text/x-php', 'application/x-httpd-php-source'),
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => array('application/x-javascript', 'text/plain'),
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
'z' => 'application/x-compress',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', 'multipart/x-zip'),
'rar' => array('application/x-rar', 'application/rar', 'application/x-rar-compressed'),
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
'aif' => array('audio/x-aiff', 'audio/aiff'),
'aiff' => array('audio/x-aiff', 'audio/aiff'),
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
'bmp' => array('image/bmp', 'image/x-bmp', 'image/x-bitmap', 'image/x-xbitmap', 'image/x-win-bitmap', 'image/x-windows-bmp', 'image/ms-bmp', 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', 'application/x-win-bitmap'),
'gif' => 'image/gif',
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'jp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'j2k' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpf' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpg2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpx' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpm' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mj2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mjp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'png' => array('image/png', 'image/x-png'),
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'css' => array('text/css', 'text/plain'),
'html' => array('text/html', 'text/plain'),
'htm' => array('text/html', 'text/plain'),
'shtml' => array('text/html', 'text/plain'),
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => array('text/plain', 'text/x-log'),
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => array('application/xml', 'text/xml', 'text/plain'),
'xsl' => array('application/xml', 'text/xsl', 'text/xml'),
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
'movie' => 'video/x-sgi-movie',
'doc' => array('application/msword', 'application/vnd.ms-office'),
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
'dot' => array('application/msword', 'application/vnd.ms-office'),
'dotx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'),
'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'),
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822',
'json' => array('application/json', 'text/json'),
'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
'p10' => array('application/x-pkcs10', 'application/pkcs10'),
'p12' => 'application/x-pkcs12',
'p7a' => 'application/x-pkcs7-signature',
'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7r' => 'application/x-pkcs7-certreqresp',
'p7s' => 'application/pkcs7-signature',
'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
'crl' => array('application/pkix-crl', 'application/pkcs-crl'),
'der' => 'application/x-x509-ca-cert',
'kdb' => 'application/octet-stream',
'pgp' => 'application/pgp',
'gpg' => 'application/gpg-keys',
'sst' => 'application/octet-stream',
'csr' => 'application/octet-stream',
'rsa' => 'application/x-pkcs7',
'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'),
'3g2' => 'video/3gpp2',
'3gp' => array('video/3gp', 'video/3gpp'),
'mp4' => 'video/mp4',
'm4a' => 'audio/x-m4a',
'f4v' => array('video/mp4', 'video/x-f4v'),
'flv' => 'video/x-flv',
'webm' => 'video/webm',
'aac' => 'audio/x-acc',
'm4u' => 'application/vnd.mpegurl',
'm3u' => 'text/plain',
'xspf' => 'application/xspf+xml',
'vlc' => 'application/videolan',
'wmv' => array('video/x-ms-wmv', 'video/x-ms-asf'),
'au' => 'audio/x-au',
'ac3' => 'audio/ac3',
'flac' => 'audio/x-flac',
'ogg' => array('audio/ogg', 'video/ogg', 'application/ogg'),
'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'),
'ics' => 'text/calendar',
'ical' => 'text/calendar',
'zsh' => 'text/x-scriptzsh',
'7z' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
'7zip' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
'cdr' => array('application/cdr', 'application/coreldraw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'),
'wma' => array('audio/x-ms-wma', 'video/x-ms-asf'),
'jar' => array('application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed'),
'svg' => array('image/svg+xml', 'application/xml', 'text/xml'),
'vcf' => 'text/x-vcard',
'srt' => array('text/srt', 'text/plain'),
'vtt' => array('text/vtt', 'text/plain'),
'ico' => array('image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon'),
'odc' => 'application/vnd.oasis.opendocument.chart',
'otc' => 'application/vnd.oasis.opendocument.chart-template',
'odf' => 'application/vnd.oasis.opendocument.formula',
'otf' => 'application/vnd.oasis.opendocument.formula-template',
'odg' => 'application/vnd.oasis.opendocument.graphics',
'otg' => 'application/vnd.oasis.opendocument.graphics-template',
'odi' => 'application/vnd.oasis.opendocument.image',
'oti' => 'application/vnd.oasis.opendocument.image-template',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'otp' => 'application/vnd.oasis.opendocument.presentation-template',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
'odt' => 'application/vnd.oasis.opendocument.text',
'odm' => 'application/vnd.oasis.opendocument.text-master',
'ott' => 'application/vnd.oasis.opendocument.text-template',
'oth' => 'application/vnd.oasis.opendocument.text-web'
);

View File

@ -0,0 +1,14 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
| https://codeigniter.com/user_guide/general/profiling.html
|
*/

View File

@ -0,0 +1,55 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| https://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There are three reserved routes:
|
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
| $route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
$route['default_controller'] = 'Home';
$route['404_override'] = 'my404';
// $route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

View File

@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| SMILEYS
| -------------------------------------------------------------------
| This file contains an array of smileys for use with the emoticon helper.
| Individual images can be used to replace multiple smileys. For example:
| :-) and :) use the same image replacement.
|
| Please see user guide for more info:
| https://codeigniter.com/user_guide/helpers/smiley_helper.html
|
*/
$smileys = array(
// smiley image name width height alt
':-)' => array('grin.gif', '19', '19', 'grin'),
':lol:' => array('lol.gif', '19', '19', 'LOL'),
':cheese:' => array('cheese.gif', '19', '19', 'cheese'),
':)' => array('smile.gif', '19', '19', 'smile'),
';-)' => array('wink.gif', '19', '19', 'wink'),
';)' => array('wink.gif', '19', '19', 'wink'),
':smirk:' => array('smirk.gif', '19', '19', 'smirk'),
':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'),
':-S' => array('confused.gif', '19', '19', 'confused'),
':wow:' => array('surprise.gif', '19', '19', 'surprised'),
':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'),
':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'),
'%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'),
';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'),
':P' => array('raspberry.gif', '19', '19', 'raspberry'),
':blank:' => array('blank.gif', '19', '19', 'blank stare'),
':long:' => array('longface.gif', '19', '19', 'long face'),
':ohh:' => array('ohh.gif', '19', '19', 'ohh'),
':grrr:' => array('grrr.gif', '19', '19', 'grrr'),
':gulp:' => array('gulp.gif', '19', '19', 'gulp'),
'8-/' => array('ohoh.gif', '19', '19', 'oh oh'),
':down:' => array('downer.gif', '19', '19', 'downer'),
':red:' => array('embarrassed.gif', '19', '19', 'red face'),
':sick:' => array('sick.gif', '19', '19', 'sick'),
':shut:' => array('shuteye.gif', '19', '19', 'shut eye'),
':-/' => array('hmm.gif', '19', '19', 'hmmm'),
'>:(' => array('mad.gif', '19', '19', 'mad'),
':mad:' => array('mad.gif', '19', '19', 'mad'),
'>:-(' => array('angry.gif', '19', '19', 'angry'),
':angry:' => array('angry.gif', '19', '19', 'angry'),
':zip:' => array('zip.gif', '19', '19', 'zipper'),
':kiss:' => array('kiss.gif', '19', '19', 'kiss'),
':ahhh:' => array('shock.gif', '19', '19', 'shock'),
':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'),
':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'),
':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'),
':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'),
':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'),
':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
':snake:' => array('snake.gif', '19', '19', 'snake'),
':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'),
':question:' => array('question.gif', '19', '19', 'question')
);

View File

@ -0,0 +1,215 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| USER AGENT TYPES
| -------------------------------------------------------------------
| This file contains four arrays of user agent data. It is used by the
| User Agent Class to help identify browser, platform, robot, and
| mobile device data. The array keys are used to identify the device
| and the array values are used to set the actual name of the item.
*/
$platforms = array(
'windows nt 10.0' => 'Windows 10',
'windows nt 6.3' => 'Windows 8.1',
'windows nt 6.2' => 'Windows 8',
'windows nt 6.1' => 'Windows 7',
'windows nt 6.0' => 'Windows Vista',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.1' => 'Windows XP',
'windows nt 5.0' => 'Windows 2000',
'windows nt 4.0' => 'Windows NT 4.0',
'winnt4.0' => 'Windows NT 4.0',
'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT',
'windows 98' => 'Windows 98',
'win98' => 'Windows 98',
'windows 95' => 'Windows 95',
'win95' => 'Windows 95',
'windows phone' => 'Windows Phone',
'windows' => 'Unknown Windows OS',
'android' => 'Android',
'blackberry' => 'BlackBerry',
'iphone' => 'iOS',
'ipad' => 'iOS',
'ipod' => 'iOS',
'os x' => 'Mac OS X',
'ppc mac' => 'Power PC Mac',
'freebsd' => 'FreeBSD',
'ppc' => 'Macintosh',
'linux' => 'Linux',
'debian' => 'Debian',
'sunos' => 'Sun Solaris',
'beos' => 'BeOS',
'apachebench' => 'ApacheBench',
'aix' => 'AIX',
'irix' => 'Irix',
'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX',
'netbsd' => 'NetBSD',
'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD',
'gnu' => 'GNU/Linux',
'unix' => 'Unknown Unix OS',
'symbian' => 'Symbian OS'
);
// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$browsers = array(
'OPR' => 'Opera',
'Flock' => 'Flock',
'Edge' => 'Edge',
'Chrome' => 'Chrome',
// Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string
'Opera.*?Version' => 'Opera',
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
'Trident.* rv' => 'Internet Explorer',
'Shiira' => 'Shiira',
'Firefox' => 'Firefox',
'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird',
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Safari' => 'Safari',
'Mozilla' => 'Mozilla',
'Konqueror' => 'Konqueror',
'icab' => 'iCab',
'Lynx' => 'Lynx',
'Links' => 'Links',
'hotjava' => 'HotJava',
'amaya' => 'Amaya',
'IBrowse' => 'IBrowse',
'Maxthon' => 'Maxthon',
'Ubuntu' => 'Ubuntu Web Browser'
);
$mobiles = array(
// legacy array, old values commented out
'mobileexplorer' => 'Mobile Explorer',
// 'openwave' => 'Open Wave',
// 'opera mini' => 'Opera Mini',
// 'operamini' => 'Opera Mini',
// 'elaine' => 'Palm',
'palmsource' => 'Palm',
// 'digital paths' => 'Palm',
// 'avantgo' => 'Avantgo',
// 'xiino' => 'Xiino',
'palmscape' => 'Palmscape',
// 'nokia' => 'Nokia',
// 'ericsson' => 'Ericsson',
// 'blackberry' => 'BlackBerry',
// 'motorola' => 'Motorola'
// Phones and Manufacturers
'motorola' => 'Motorola',
'nokia' => 'Nokia',
'nexus' => 'Nexus',
'palm' => 'Palm',
'iphone' => 'Apple iPhone',
'ipad' => 'iPad',
'ipod' => 'Apple iPod Touch',
'sony' => 'Sony Ericsson',
'ericsson' => 'Sony Ericsson',
'blackberry' => 'BlackBerry',
'cocoon' => 'O2 Cocoon',
'blazer' => 'Treo',
'lg' => 'LG',
'amoi' => 'Amoi',
'xda' => 'XDA',
'mda' => 'MDA',
'vario' => 'Vario',
'htc' => 'HTC',
'samsung' => 'Samsung',
'sharp' => 'Sharp',
'sie-' => 'Siemens',
'alcatel' => 'Alcatel',
'benq' => 'BenQ',
'ipaq' => 'HP iPaq',
'mot-' => 'Motorola',
'playstation portable' => 'PlayStation Portable',
'playstation 3' => 'PlayStation 3',
'playstation vita' => 'PlayStation Vita',
'hiptop' => 'Danger Hiptop',
'nec-' => 'NEC',
'panasonic' => 'Panasonic',
'philips' => 'Philips',
'sagem' => 'Sagem',
'sanyo' => 'Sanyo',
'spv' => 'SPV',
'zte' => 'ZTE',
'sendo' => 'Sendo',
'nintendo dsi' => 'Nintendo DSi',
'nintendo ds' => 'Nintendo DS',
'nintendo 3ds' => 'Nintendo 3DS',
'wii' => 'Nintendo Wii',
'open web' => 'Open Web',
'openweb' => 'OpenWeb',
// Operating Systems
'android' => 'Android',
'symbian' => 'Symbian',
'SymbianOS' => 'SymbianOS',
'elaine' => 'Palm',
'series60' => 'Symbian S60',
'windows ce' => 'Windows CE',
// Browsers
'obigo' => 'Obigo',
'netfront' => 'Netfront Browser',
'openwave' => 'Openwave Browser',
'mobilexplorer' => 'Mobile Explorer',
'operamini' => 'Opera Mini',
'opera mini' => 'Opera Mini',
'opera mobi' => 'Opera Mobile',
'fennec' => 'Firefox Mobile',
// Other
'digital paths' => 'Digital Paths',
'avantgo' => 'AvantGo',
'xiino' => 'Xiino',
'novarra' => 'Novarra Transcoder',
'vodafone' => 'Vodafone',
'docomo' => 'NTT DoCoMo',
'o2' => 'O2',
// Fallback
'mobile' => 'Generic Mobile',
'wireless' => 'Generic Mobile',
'j2me' => 'Generic Mobile',
'midp' => 'Generic Mobile',
'cldc' => 'Generic Mobile',
'up.link' => 'Generic Mobile',
'up.browser' => 'Generic Mobile',
'smartphone' => 'Generic Mobile',
'cellphone' => 'Generic Mobile'
);
// There are hundreds of bots but these are the most common.
$robots = array(
'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot',
'baiduspider' => 'Baiduspider',
'bingbot' => 'Bing',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'ask jeeves' => 'Ask Jeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos',
'yandex' => 'YandexBot',
'mediapartners-google' => 'MediaPartners Google',
'CRAZYWEBCRAWLER' => 'Crazy Webcrawler',
'adsbot-google' => 'AdsBot Google',
'feedfetcher-google' => 'Feedfetcher Google',
'curious george' => 'Curious George',
'ia_archiver' => 'Alexa Crawler',
'MJ12bot' => 'Majestic-12',
'Uptimebot' => 'Uptimebot'
);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,349 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Home extends CI_Controller {
// var $table = $this->mhome->;
public function __construct()
{
parent::__construct();
// $this->load->helper('form');
// $this->load->library('form_validation');
$this->load->model('mhome');
}
function index()
{
if ($this->uri->segment(2) == '') {
$main['main']='home/main';
$main['header']='Halaman Utama';
$main['kecamatan'] = $this->mhome->tampil_data_keseluruhan('tb_kecamatan');
$main['lahan'] = $this->mhome->tampil_data_keseluruhan('tb_lahan');
$main['cek_hasil'] = $this->mhome->tampil_data_keseluruhan('tb_hasil_produksi');
$this->load->view('home/index',$main);
// echo $this->uri->segment(2);
// echo "string";
}else{
redirect('/home');
}
}
function data_petambak()
{
if ($this->uri->segment(3) == 'lihat') {
if (is_numeric($this->uri->segment(4))) {
$id = $this->uri->segment(4);
$cek_lahan = $this->mhome->tampil_data_where('tb_lahan',array('id_lahan' => $id));
if (count($cek_lahan->result())>0) {
// echo "sini";
$array = explode('-',$this->uri->segment(5));
$data_transaksi_produksi = $this->mhome->tampil_data_where('tb_data_produksi_lahan', array('no_lahan' => $id));
if (count($data_transaksi_produksi->result())>0) {
foreach ($data_transaksi_produksi->result() as $key => $value) ;
$ket = json_decode($value->ket,true);
// print_r(count($ket));
$ada = 0;
$array_ket = null;
foreach ($ket as $key1 => $value1) {
if ($value1['tahun'] == $array[0] and $value1['musim'] == $array[1]) {
$ada = 1;
$array_ket = $value1;
break;
}
}
if ($ada == 1) {
// echo "sini tampilan";
$main['lahan'] = $cek_lahan;
$main['elemen_produksi'] = $this->mhome->tampil_data_keseluruhan('tb_elemen_produksi');
$main['data_transaksi_produksi'] = $this->mhome->tampil_data_where('tb_data_produksi_lahan', array('no_lahan' => $id));
$main['kode_lahan'] = $id;
$main['ket_nya'] = $array_ket;
$main['main']='home/menu/data_lahan_lihat_detail';
$this->load->view('home/index',$main);
// print_r($main['ket']);
}elseif ($ada == 0) {
redirect('/home');
}
}else{
redirect('/home');
}
}else{
// $this->session->set_flashdata('error','<b>Error</b><br>Halaman Yang Diakses Tiada Dalam');
// redirect('/penyuluh');
redirect('/home');
}
}else{
echo "bukan";
}
}elseif (is_numeric($this->uri->segment(3))) {
// echo "sini";
$id = $this->uri->segment(3);
$cek_lahan = $this->mhome->tampil_data_where('tb_lahan',array('id_lahan' => $id));
if (count($cek_lahan->result())>0) {
$main['header']='Halaman Utama Lahan';
$main['kecamatan'] = $this->mhome->tampil_data_keseluruhan('tb_kecamatan');
$main['lahan'] = $cek_lahan;
$main['data_transaksi_produksi'] = $this->mhome->tampil_data_where('tb_data_produksi_lahan', array('no_lahan' => $id));
$main['elemen_produksi'] = $this->mhome->tampil_data_keseluruhan('tb_elemen_produksi');
$main['main']='home/menu/data_lahan_lihat';
$this->load->view('home/index',$main);
}else{
// $this->session->set_flashdata('error','<b>Error</b><br>Halaman Yang Diakses Tiada Dalam');
redirect('/home');
}
}else{
redirect('/home');
}
}
function json_hasil()
{
$cek_data = $this->mhome->tampil_data_keseluruhan('tb_hasil_produksi');
$kira = count($cek_data->result());
$i = 1;
$coba = null;
$teks= '['; /// idperlukan untuk teks JSON
foreach ($cek_data->result() as $key => $value) {
$hasil[$i] = $value->hasil;
// if ($i!=1) {
// $array_baru = array_merge($array_baru,$array);
// }
/////// batas awal kalau pakai teks di php ////////
if ($i != 1 and $i !=2 and $i != 3) {
$jumlah = ($hasil[$i-3] + $hasil[$i-2] + $hasil[$i-1])/3;
// print_r($jumlah);print_r('<br>');
$teks .= '{"tahun":"'.$value->tahun.'-'.$value->musim.'","produksi":'. $value->hasil.',"prediksi":'. round($jumlah,2).'},';
}else{
$kosong = 0;
$teks .= '{"tahun":"'.$value->tahun.'-'.$value->musim.'","produksi":'. $value->hasil.',"prediksi":'.$kosong.'},';
}
////// batas akhir kalau pakai teks di php //////
///// batas awal kalo pakai array php ////////
if ($i != 1 and $i !=2 and $i != 3) {
$jumlah = ($hasil[$i-3] + $hasil[$i-2] + $hasil[$i-1])/3;
$arraycoba[$i]= array(array('tahun' => $value->tahun.'-'.$value->musim, 'produksi' => $value->hasil,'prediksi' => round($jumlah,0)));
$coba = array_merge($coba,$arraycoba[$i-1]);
}else{
$arraycoba[$i]= array(array('tahun' => $value->tahun.'-'.$value->musim, 'produksi' => $value->hasil,'prediksi' => 0));
if ($i == 1) {
}elseif ($i == 2) {
$coba = array_merge($arraycoba[$i-1],$arraycoba[$i]);
}elseif ($i ==3 ){
$coba = array_merge($coba,$arraycoba[$i-1]);
}
}
///// batas akhir kalo pakai array php /////
$i++;
}
/////// ini untuk tampung array last /////
$coba = array_merge($coba,$arraycoba[$kira]);
/////// ini untuk tampung array last /////
// print_r($kira);
$teks = mb_substr($teks, 0, -1); /// diperlukan untuk teks JSON
$teks.= ']'; /// diperlukan untuk teks JSON
// print_r($coba);
// print_r($teks);
// unset($array_baru[0]);
// print_r(json_encode($coba));
// $array_baru =(object) $array_baru;
// $array_baru = json_encode($array_baru);
// $array_baru = json_decode($array_baru,true);
// print_r(json_encode($array_baru));
// print_r('<br><br>');
// $data = '[{"tahun":2008,"produksi":20,"prediksi":25},{"tahun":2009,"produksi":10,"prediksi":19},{"tahun":2010,"produksi":5,"prediksi":17},{"tahun":2011,"produksi":5,"prediksi":14},{"tahun":2012,"produksi":20,"prediksi":10}]';
$array_baru11 = array('tahun' => 'tahun');
// $array_baru1 = array('ket' => $coba);
// print_r(json_encode($array_baru1));
// print_r(json_decode($data,true));
print_r(json_encode(array_merge($array_baru11,array('ket' => $coba))));
}
function pendaftaran()
{
$main['header']='Halaman Pendaftaran';
$main['kecamatan'] = $this->mhome->tampil_data_keseluruhan('tb_kecamatan');
if ($this->uri->segment(3) != '' or $this->uri->segment(3) != null) {
$id_kecamatan = $this->uri->segment(3);
$cek_kecamatan = $this->mhome->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $id_kecamatan));
if (count($cek_kecamatan->result())>0) {
$main['kecamatan_terpilih'] = $cek_kecamatan;
$main['kelurahan'] = $this->mhome->tampil_data_where('tb_kelurahan',array('id_kecamatan' => $id_kecamatan));
if ($this->uri->segment(4) != '' or $this->uri->segment(4) != null) {
$id_kelurahan = $this->uri->segment(4);
$cek_kelurahan = $this->mhome->tampil_data_where('tb_kelurahan',array('id_kecamatan' => $id_kecamatan,'id_kelurahan' => $id_kelurahan));
if (count($cek_kelurahan->result())>0) {
$main['main']='home/menu/pendaftaran_kelurahan';
$main['kelurahan_terpilih'] = $cek_kelurahan;
$main['tambak'] = $this->mhome->tampil_data_keseluruhan('tb_tambak');;
$this->load->view('home/index',$main);
}else{
echo "tiada kelurahan";
}
}else{
$main['main']='home/menu/pendaftaran_kecamatan';
$this->load->view('home/index',$main);
}
}else{
echo "tiada";
}
}else{
$main['main']='home/menu/pendaftaran';
$this->load->view('home/index',$main);
}
}
function pendaftaran_tambak()
{
$kecamatan = $this->input->post('kecamatan');
$kelurahan = $this->input->post('kelurahan');
$nik = $this->input->post('nik');
$nama = $this->input->post('nama');
$pbb = $this->input->post('pbb');
$tambak = $this->input->post('tambak');
$point = $this->input->post('point');
$luas_lahan = $this->input->post('luas_lahan');
$cek_nik = $this->mhome->tampil_data_where('tb_petambak',array('nik' => $nik));
$cek_pbb = $this->mhome->tampil_data_where('tb_lahan',array('no_pbb' => $pbb));
if (count($cek_nik->result()) > 0) {
echo "true1";
}elseif (count($cek_pbb->result()) > 0) {
echo "true2";
}else{
$this->mhome->insert('tb_petambak',array('nik' => $nik, 'nama' => $nama));
$this->mhome->insert('tb_user',array('nik_user' => $nik, 'username' => $nik, 'password' => '12345678', 'level' => 'petambak'));
$this->mhome->insert('tb_lahan',array('nik_petambak' => $nik, 'no_pbb' => $pbb ,'tek_tambak' => $tambak, 'point' => $point, 'kecamatan' => $kecamatan , 'kelurahan' => $kelurahan, 'luas_lahan' => $luas_lahan));
$this->session->set_flashdata('success', '<b>Success</b><br>Anda Berhasil Terdaftar Dalam Sistem<br>Silakan Login Ke Sistem Dengan NIK Menjadi Username dan Password Default = 12345678');
echo "false";
}
}
function login()
{
if ($this->input->post('login')) {
$username = $this->input->post('username');
$password = $this->input->post('password');
$cek_data = $this->mhome->tampil_data_where('tb_user',array('username' => $username,'password' => $password));
if (count($cek_data->result()) > 0) {
// echo "username ada";
foreach ($cek_data->result() as $key => $value);
if ($value->level == 'admin') {
$cek_data_admin = $this->mhome->tampil_data_where('tb_admin',array('nik_admin' => $value->nik_admin));
foreach ($cek_data_admin->result() as $key2 => $value2);
$nik_admin = $value2->nik_admin;
$nama_admin = $value2->nama;
$jabatan_admin = $value2->jabatan;
$this->session->set_userdata(array('nik' => $nik_admin,'nama'=>$nama_admin,'jabatan'=>$jabatan_admin,'level'=>'Admin'));
$this->session->set_flashdata('success', '<b>SELAMAT DATANG</b><br>Admin '.$nama_admin.' telah berhasil login');
redirect('/admin');
}elseif ($value->level == 'petambak') {
$cek_data_petambak = $this->mhome->tampil_data_where('tb_petambak',array('nik' => $value->nik_user));
foreach ($cek_data_petambak->result() as $key2 => $value2);
$nik_petambak = $value2->nik;
$nama_petambak = $value2->nama;
$this->session->set_userdata(array('nik' => $nik_petambak,'nama'=>$nama_petambak,'level'=>'Petambak'));
$this->session->set_flashdata('success', '<b>SELAMAT DATANG</b><br>Petambak '.$nama_petambak.' telah berhasil login');
redirect('/petambak');
}elseif($value->level == 'penyuluh') {
$cek_data_penyuluh = $this->mhome->tampil_data_where('tb_penyuluh',array('nik' => $value->nik_penyuluh));
// print_r(count($cek_data_penyuluh->result()));
foreach ($cek_data_penyuluh->result() as $key2 => $value2);
$nik_penyuluh = $value2->nik;
$nama_penyuluh = $value2->nama;
// echo $nama_peyuluh;
$this->session->set_userdata('penyuluh', array('nik' => $nik_penyuluh,'nama'=>$nama_penyuluh,'kecamatan'=> $value2->kecamatan,'level'=>'Petambak'));
$this->session->set_flashdata('success', '<b>SELAMAT DATANG</b><br>Penyuluh '.$nama_penyuluh.' telah berhasil login');
redirect('/penyuluh');
}
// $this->session->set_userdata('nik',)
}else{
$this->session->set_flashdata('warning', '<b>Error</b><br>Username dan Password Yang Dimasukkan Salah');
redirect('/home/login');
}
}else{
$main['header']='Halaman Pendaftaran';
$this->load->view('home/login',$main);
}
}
function kecamatan()
{
if ($this->uri->segment(2) == 'kecamatan') {
// $kecamatan = $this->uri->segment(3);
$main['main']='home/menu/kecamatan';
$main['header']='Halaman Utama';
$main['kecamatan'] = $this->mhome->tampil_data_where('tb_kecamatan', array('id_kecamatan' => $this->uri->segment(3)));
$main['lahan'] = $this->mhome->tampil_data_where('tb_lahan',array('kecamatan' => $this->uri->segment(3)));
$main['cek_hasil'] = $this->mhome->tampil_data_keseluruhan('tb_hasil_produksi');
$this->load->view('home/index',$main);
}else{
redirect('/home');
}
}
function destroy_segala()
{
// $this->session->sess_destroy();
$this->session->set_userdata('nik',1234);
$this->session->set_userdata('nama','asdasdas');
$this->session->set_userdata('level','Petambak');
}
// function petanya() {
// $peta = '';
// $peta = json_decode($peta);
// print_r($peta[0]->kordinat);
// }
}
?>

View File

@ -0,0 +1,19 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class My404 extends CI_Controller {
public function __construct()
{
parent::__construct();
}
function index()
{
// $this->session->sess_destroy();
$this->load->view('home/404');
}
}
?>

View File

@ -0,0 +1,791 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Penyuluh extends CI_Controller {
public function __construct()
{
parent::__construct();
// $this->load->helper('form');
// $this->load->library('form_validation');
$this->load->model('mpenyuluh');
$penyuluh = $this->session->userdata('penyuluh');
$cek_data_dulu = $this->mpenyuluh->tampil_data_where('tb_penyuluh',array('nik'=>$penyuluh['nik'], 'nama' => $penyuluh['nama']));
if ($penyuluh != '' and $penyuluh != null) {
if (count($cek_data_dulu->result()) > 0) {
foreach ($cek_data_dulu->result() as $key => $value) ;
$kecamatan = $value->kecamatan;
// redirect('/petambak');
// echo "<script>console.log('heheheh')</script>";
}else{
$this->session->set_flashdata('error', '<b>Error</b><br>Halaman Yang Diakses Tiada Dalam Sistem');
redirect('/home');
}
}else{
$this->session->set_flashdata('error', '<b>Error</b><br>Halaman Yang Diakses Tiada Dalam Sistem');
redirect('/home');
}
}
function index()
{
if ($this->uri->segment(2) == '') {
$penyuluh = $this->session->userdata('penyuluh');
$cek_kecamatan = $this->mpenyuluh->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $penyuluh['kecamatan']));
foreach ($cek_kecamatan->result() as $key => $value) ;
$main['nama_kecamatan'] = $value->kecamatan;
$main['no_kecamatan'] = $value->id_kecamatan;
$main['cek_lahan_kecamatan'] = $this->mpenyuluh->tampil_data_where('tb_lahan', array('kecamatan' => $penyuluh['kecamatan']));
$main['main']='penyuluh/main';
$main['header']='Halaman Utama Penyuluh';
$main['kecamatan'] = $this->mpenyuluh->tampil_data_keseluruhan('tb_kecamatan');
// $main['lahan'] = $this->mpenyuluh->tampil_data_where('tb_lahan',array('nik_petambak' => $nik));
$this->load->view('penyuluh/index',$main);
}else{
redirect('/penyuluh');
}
}
function analisa()
{
$main['header']='Halaman Analisa Penyuluh';
$penyuluh = $this->session->userdata('penyuluh');
$elemen_produksi = $this->mpenyuluh->tampil_data_keseluruhan('tb_elemen_produksi');
if ($this->input->post('hari')!= '' and $this->input->post('hari') != null and $this->input->post('kode') != '' and $this->input->post('kode') != null) {
$id = $this->input->post('kode');
$hari = $this->input->post('hari');
$cari = $this->mpenyuluh->cari_data($id,$hari);
if ($this->input->post('id') == 1) { ?>
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>Bahan</th>
<th>Harga</th>
<th>Satuan</th>
<th width="20%">Jumlah</th>
</tr>
</thead>
<tbody>
<tr>
<?php
// $r = 1;
// print_r($satuan->$r);
foreach ($elemen_produksi->result() as $key2 => $value2):?>
<tr>
<td><?=$value2->nama_elemen?></td>
<td>Rp. <?=$cari['harga'.$value2->id_elemen]?></td>
<td><?=number_format($cari['satuan'.$value2->id_elemen])?> <?=$value2->satuan?></td>
<td>Rp. <?=number_format($cari['jumlahbahan'.$value2->id_elemen])?></td>
<?php endforeach ?>
</tbody>
</table>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"pageLength": 10,
"searching": false,
"paging": false,
"ordering": false,
"info": false,
});
});
</script>
<?php }elseif ($this->input->post('id') == 2) {?>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">Biaya Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="Rp. <?=number_format($cari['biayaproduksi'])?>" title="Biaya Produksi" disabled="" name="biaya">
</div>
<div class="col-sm-4">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">Biaya Persiapan Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="Rp. <?=number_format($cari['biayapersiapanlahan'])?>" title="Biaya Produksi" disabled="" name="biaya">
</div>
<div class="col-sm-4">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">Jumlah Hasil Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=number_format($cari['jumlahproduksi'])?> kg" title="Jumlah Hasil Produksi" disabled="">
</div>
<div class="col-sm-4">
</div>
</div>
<?php
}
}elseif ($this->uri->segment(3) != '' or $this->uri->segment(3) != null) {
$id = $this->uri->segment(3);
$cek_lahan = $this->mpenyuluh->tampil_data_where('tb_lahan',array('id_lahan' => $id, 'kecamatan' => $penyuluh['kecamatan']));
if (count($cek_lahan->result())>0) {
$main['lahan'] = $cek_lahan;
$main['elemen_produksi'] = $this->mpenyuluh->tampil_data_keseluruhan('tb_elemen_produksi');
$main['main']='penyuluh/menu/analisa_lahan';
$this->load->view('penyuluh/index',$main);
}else{
$this->session->set_flashdata('error','<b>Error</b><br>Halaman Yang Diakses Tiada Dalam');
redirect('/penyuluh');
}
}elseif ($this->uri->segment(3) == '') {
$penyuluh = $this->session->userdata('penyuluh');
$cek_kecamatan = $this->mpenyuluh->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $penyuluh['kecamatan']));
foreach ($cek_kecamatan->result() as $key => $value) ;
$main['nama_kecamatan'] = $value->kecamatan;
$main['no_kecamatan'] = $value->id_kecamatan;
$main['cek_lahan_kecamatan'] = $this->mpenyuluh->tampil_data_where('tb_lahan', array('kecamatan' => $penyuluh['kecamatan']));
$main['main']='penyuluh/menu/analisa';
$main['kecamatan'] = $this->mpenyuluh->tampil_data_keseluruhan('tb_kecamatan');
// $main['lahan'] = $this->mpenyuluh->tampil_data_where('tb_lahan',array('nik_petambak' => $nik));
$this->load->view('penyuluh/index',$main);
}else{
redirect('/penyuluh');
}
}
function perkiraan_produksi()
{
$main['header']='Halaman Perkiraan Produksi Penyuluh';
$penyuluh = $this->session->userdata('penyuluh');
$elemen_produksi = $this->mpenyuluh->tampil_data_keseluruhan('tb_elemen_produksi');
if ($this->input->post('hari')!= '' and $this->input->post('hari') != null and $this->input->post('kode') != '' and $this->input->post('kode') != null) {
$id = $this->input->post('kode');
$hari = $this->input->post('hari');
$cari = $this->mpenyuluh->cari_data($id,$hari);
if ($this->input->post('no') == 'tabel') { ?>
<div class="form-horizontal" style="overflow-x: auto">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>Bahan</th>
<th>Harga</th>
<th>Satuan</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
<tr>
<?php foreach ($elemen_produksi->result() as $key => $value):?>
<tr>
<td><?=$value->nama_elemen?></td>
<td>Rp. <?=$cari['harga'.$value->id_elemen]?></td>
<td><?=number_format($cari['satuan'.$value->id_elemen])?> <?=$value->satuan?></td>
<td>Rp. <?=number_format($cari['jumlahbahan'.$value->id_elemen])?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jumlah Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$cari['jumlahproduksi']?> kg" title="Jumlah Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
<?php
}elseif ($this->input->post('tanggal')) {
$tanggal = $this->input->post('tanggal');
$tanggal = date('Y-m-d', strtotime($tanggal. ' + '.$hari.' days'));
$tanggal = date("d/m/Y", strtotime($tanggal));
?>
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<!-- /.box-title -->
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Panen</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Panen" value="<?=$tanggal?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Saiz</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Saiz" value="+- <?=$cari['saiz']?> ekor/kg" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Total Biaya</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Jumlah" value="Rp . <?=number_format($cari['totalbiaya'])?>" disabled="">
</div>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Harga Jual</label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="Enter your email" title="Harga Jual" value="Rp. <?=number_format($cari['hargajual'])?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Nilai Produksi</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Nilai" value="Rp. <?=number_format($cari['nilaiproduksi'])?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Keuntungan</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Keuntungan" value="Rp. <?=number_format($cari['keuntungan'])?>" disabled="">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Status Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$cari['status']?>" title="Status Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
</div>
</div>
<?php
}
}elseif ($this->uri->segment(3) != '' or $this->uri->segment(3) != null) {
$id = $this->uri->segment(3);
$cek_lahan = $this->mpenyuluh->tampil_data_where('tb_lahan',array('id_lahan' => $id, 'kecamatan' => $penyuluh['kecamatan']));
if (count($cek_lahan->result())>0) {
$main['lahan'] = $cek_lahan;
$main['elemen_produksi'] = $this->mpenyuluh->tampil_data_keseluruhan('tb_elemen_produksi');
$main['main']='penyuluh/menu/perkiraan_produksi_proses';
$this->load->view('penyuluh/index',$main);
}else{
$this->session->set_flashdata('error','<b>Error</b><br>Halaman Yang Diakses Tiada Dalam');
redirect('/penyuluh');
}
}elseif ($this->uri->segment(3) == '') {
$penyuluh = $this->session->userdata('penyuluh');
$cek_kecamatan = $this->mpenyuluh->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $penyuluh['kecamatan']));
foreach ($cek_kecamatan->result() as $key => $value) ;
$main['nama_kecamatan'] = $value->kecamatan;
$main['no_kecamatan'] = $value->id_kecamatan;
$main['cek_lahan_kecamatan'] = $this->mpenyuluh->tampil_data_where('tb_lahan', array('kecamatan' => $penyuluh['kecamatan']));
$main['main']='penyuluh/menu/perkiraan_produksi';
$main['kecamatan'] = $this->mpenyuluh->tampil_data_keseluruhan('tb_kecamatan');
// $main['lahan'] = $this->mpenyuluh->tampil_data_where('tb_lahan',array('nik_petambak' => $nik));
$this->load->view('penyuluh/index',$main);
}else{
redirect('/penyuluh');
}
}
function transaksi()
{
$main['header']='Halaman Transaksi Penyuluh';
$penyuluh = $this->session->userdata('penyuluh');
$elemen_produksi = $this->mpenyuluh->tampil_data_keseluruhan('tb_elemen_produksi');
if ($this->input->post('hari') != '' and $this->input->post('hari') != null and $this->input->post('data') != '' and $this->input->post('data') != null and $this->input->post('kode') != '' and $this->input->post('kode') != null and $this->input->post('tanggal') != '' and $this->input->post('tanggal') != null) {
$elemen_produksi = $this->mpenyuluh->tampil_data_keseluruhan('tb_elemen_produksi');
$kode = $this->input->post('kode');
$hari = $this->input->post('hari');
$tanggal = $this->input->post('tanggal');
$data = $this->input->post('data');
$keys = array_column($this->input->post('data'),'name');
$values = array_column($this->input->post('data'),'value');
$data = array_combine($keys, $values);
$cari_data_harga = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' =>1));
foreach ($cari_data_harga->result() as $key3 => $value3);
$ket = json_decode($value3->ket);
$cari = $this->mpenyuluh->kira_data($kode,$hari,$tanggal,$data);
$tanggal_selesai = new DateTime($tanggal);
$tanggal_selesai->modify('+'.$hari.' day');
$tanggal_selesai =date('Y-m-d', strtotime($tanggal_selesai->format('Y-m-d')));
$nama_elemen_coba;
$nama_elemen = array();
$jumlah_elemen_coba;
$jumlah_elemen = array();
foreach ($elemen_produksi->result() as $key4 => $value4) {
$nama_elemen_coba = array($key4 => $value4->id_elemen);
$nama_elemen = array_merge($nama_elemen,$nama_elemen_coba);
$jumlahnya = str_replace( ',', '', $values[$key4]);
$jumlah_elemen_coba = array($key4 => $jumlahnya);
$jumlah_elemen = array_merge($jumlah_elemen,$jumlah_elemen_coba);
}
$array_elemen = array_combine($nama_elemen, $jumlah_elemen);
$tahun_selesai = date('Y', strtotime($tanggal_selesai));
if ($tanggal_selesai > date('Y-m-d',strtotime($tahun_selesai.'-06-30')) and $tanggal_selesai <= date('Y-m-d',strtotime($tahun_selesai.'-12-31'))) {
$musim = 2;
$array_full = array('tahun' => date($tahun_selesai),'musim'=> 2,'waktu_tebar' => $tanggal, 'masa_tumbuh' => $hari , 'masa_panen' => $tanggal_selesai ,'jumlah_produksi' => $cari['jumlahproduksi'], 'nilai_produksi' => $cari['nilaiproduksi'],'ket_elemen_produksi' => $array_elemen);
}elseif ($tanggal_selesai >= date('Y-m-d',strtotime($tahun_selesai.'-01-31')) and $tanggal_selesai <= date('Y-m-d',strtotime($tahun_selesai.'-06-30'))) {
$musim = 1;
$array_full = array('tahun' => date($tahun_selesai),'musim'=> 1,'waktu_tebar' => $tanggal, 'masa_tumbuh' => $hari,'masa_panen' => $tanggal_selesai ,'jumlah_produksi' => $cari['jumlahproduksi'], 'nilai_produksi' => $cari['nilaiproduksi'], 'ket_elemen_produksi' => $array_elemen);
}
// $key = array_keys($array_info_1);
// $val = array_values($array_info_1);
// $new_key = array_merge($key, array_keys($array_elemen));
// $new_val = array_merge($val, array_values($array_elemen));
// $array_full = array(array_combine($new_key, $new_val));
if ($this->input->post('no') == 'tabel') {
$cek_tabel_produksi = $this->mpenyuluh->tampil_data_where('tb_data_produksi_lahan',array("no_lahan" => $kode));
if (count($cek_tabel_produksi->result()) > 0) {
foreach ($cek_tabel_produksi->result() as $key5 => $value5) ;
$ket = json_decode($value5->ket,true);
// print_r($ket);
// print_r('<br><br><br>');
$array_baru_ini = null;
$jika_ada = "tiada";
foreach ($ket as $key6 => $value6) {
// print_r($key6);
if ($value6['tahun'] == $tahun_selesai and $value6['musim'] == $musim) {
$ket[$key6]['waktu_tebar'] = $tanggal;
$ket[$key6]['masa_tumbuh'] = $hari;
$ket[$key6]['masa_panen'] = $tanggal_selesai;
$ket[$key6]['jumlah_produksi'] = $cari['jumlahproduksi'];
$ket[$key6]['nilai_produksi'] = $cari['nilaiproduksi'];
$ket[$key6]['ket_elemen_produksi'] = $array_elemen;
$jika_ada = 'ada';
// unset($ket[$key6]);
// $array_baru_ini = $ket;
break;
}
}
if ($jika_ada == 'ada') {
$array_baru_ini = $ket;
}elseif ($jika_ada == 'tiada') {
$array_baru_ini = array_merge(array($array_full),$ket);
}
// print_r($jika_ada);
// print_r($array_baru_ini);
// print_r(count($array_baru_ini));
$this->mpenyuluh->update('tb_data_produksi_lahan',array("no_lahan" => $kode),array('ket'=> json_encode($array_baru_ini)));
}else{
$this->mpenyuluh->insert('tb_data_produksi_lahan',array("no_lahan" => $kode,'ket'=> json_encode(array($array_full))));
}
// print_r($tahun_selesai);
// print_r($cari['jumlahproduksi']);
$cek_tabel_hasil = $this->mpenyuluh->tampil_data_where('tb_hasil_produksi',array('tahun' => $tahun_selesai, 'musim' => $musim));
// print_r(count($cek_tabel_hasil->result()));
if (count($cek_tabel_hasil->result()) > 0) {
$tampil_semua_produksi = $this->mpenyuluh->tampil_data_keseluruhan('tb_data_produksi_lahan');
$hasil = 0;
foreach ($tampil_semua_produksi->result() as $key => $value) {
$ket = json_decode($value->ket);
foreach ($ket as $key1 => $value1) {
if ($value1->tahun == $tahun_selesai and $value1->musim == $musim) {
$hasil = $hasil + $value1->jumlah_produksi;
break;
}
}
}
$this->mpenyuluh->update('tb_hasil_produksi',array('tahun' => $tahun_selesai, 'musim' => $musim) , array('hasil' => $hasil));
// print_r($hasil);
}else{
$this->mpenyuluh->insert('tb_hasil_produksi',array('tahun' => $tahun_selesai, 'musim' => $musim, 'hasil' => $cari['jumlahproduksi']));
}
// print_r($musim);
?>
<form class="form-horizontal" style="overflow-x: auto" id="elemen_produksi">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>Bahan</th>
<th>Harga</th>
<th width="20%">Satuan</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$ket = json_decode($value3->ket);
$satuan = json_decode($value3->satuan);
$r = 1;
// print_r($satuan->$r);
foreach ($elemen_produksi->result() as $key2 => $value2):
$no = $value2->id_elemen;
$satu = $satuan->$no;
$harga = $ket->$no;
if ($harga == '' and $harga == null) {
$harga = '';
}else{
$harga = number_format($harga);
}
?>
<tr>
<td><?=$value2->nama_elemen?></td>
<td>Rp. <?=$harga?> </td>
<td>
<input type="text" style="width: 200px;" class="form-control" id="inputan<?=$value2->id_elemen?>" placeholder="Jumlah <?=$value2->nama_elemen?>" name="<?=$value2->id_elemen?>" value="<?=$data[$no]?>" minlegth='5' maxlength='10'>
</td>
<td>Rp . <?=number_format($cari['jumlah'.$no])?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</form>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jumlah Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=number_format($cari['jumlahproduksi'])?> kg" title="Jumlah Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"pageLength": 10,
"searching": false,
"paging": false,
"ordering": false,
"info": false,
});
});
</script>
<script type="text/javascript">
<?php foreach ($elemen_produksi->result() as $key => $value): ?>
var elem = document.getElementById("inputan<?=$value->id_elemen?>");
elem.addEventListener("keydown",function(event){
var key = event.which;
if((key<48 || key>57) && key != 8) event.preventDefault();
});
elem.addEventListener("keyup",function(event){
var value = this.value.replace(/,/g,"");
this.dataset.currentValue=parseInt(value);
var caret = value.length-1;
while((caret-3)>-1)
{
caret -= 3;
value = value.split('');
value.splice(caret+1,0,",");
value = value.join('');
}
this.value = value;
});
<?php endforeach ?>
</script>
<?php
}elseif ($this->input->post('no') == 'detail') {
$tanggal = $this->input->post('tanggal');
$tanggal = date('Y-m-d', strtotime($tanggal. ' + '.$hari.' days'));
$tanggal = date("d/m/Y", strtotime($tanggal));
?>
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<!-- /.box-title -->
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Panen</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Panen" value="<?=$tanggal?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Saiz</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Saiz" value="+- <?=$cari['saiz']?> ekor/kg" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Total Biaya</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Jumlah" value="Rp . <?=number_format($cari['totalbiaya'])?>" disabled="">
</div>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Harga Jual</label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="Enter your email" title="Harga Jual" value="Rp. <?=number_format($cari['hargajual'])?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Nilai Produksi</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Nilai" value="Rp. <?=number_format($cari['nilaiproduksi'])?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Keuntungan</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Keuntungan" value="Rp. <?=number_format($cari['keuntungan'])?>" disabled="">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Status Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$cari['status']?>" title="Status Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
</div>
</div>
<?php
}elseif ($this->input->post('no') == 'tabel_transaksi') {
$data_transaksi_produksi = $this->mpenyuluh->tampil_data_where('tb_data_produksi_lahan', array('no_lahan' => $kode));
?>
<table id="tabel-data1" class="table table-bordered">
<thead>
<tr>
<th>No</th>
<th>Tahun</th>
<th>Musim</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php if (count($data_transaksi_produksi->result())>0): ?>
<?php foreach ($data_transaksi_produksi->result() as $key => $value):
$ket = json_decode($value->ket);
?>
<?php $i=1; foreach ($ket as $key1 => $value1): ?>
<tr>
<td><?=$i?></td>
<td><?=$value1->tahun?></td>
<td><?=$value1->musim?></td>
<td align="center">
<a href=""><button type="button" title="Lihat Transaksi Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a>
<a href=""><button type="button" title="Edit Transaksi Produksi" class="btn btn-warning btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-file-text"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
<?php endforeach ?>
<?php endif ?>
</tbody>
</table>
<script>
$(document).ready(function(){
$('#tabel-data1').DataTable({
"pageLength": 10,
"searching": true,
"paging": true,
"ordering": true,
"info": true,
});
});
</script>
<script type="text/javascript">
swal({
title: "Transaksi Produksi Berhasil Diupdate",
text: "Anda Bisa Mengeditnya Pada Tabel Yang Tersedia",
icon: "success",
// buttons: false,
dangerMode: true,
confirmButtonText: 'Save',
showLoaderOnConfirm: true,
})
.then((logout) => {
if (logout) {
window.location.replace("<?=base_url()?>penyuluh/transaksi/lihat/<?=$kode?>/<?=$tahun_selesai?>-<?=$musim?>");
}
});
</script>
<?php
}
}elseif ($this->uri->segment(3) == 'lihat') {
if (is_numeric($this->uri->segment(4))) {
$id = $this->uri->segment(4);
$cek_lahan = $this->mpenyuluh->tampil_data_where('tb_lahan',array('id_lahan' => $id, 'kecamatan' => $penyuluh['kecamatan']));
if (count($cek_lahan->result())>0) {
// echo "sini";
$array = explode('-',$this->uri->segment(5));
$data_transaksi_produksi = $this->mpenyuluh->tampil_data_where('tb_data_produksi_lahan', array('no_lahan' => $id));
if (count($data_transaksi_produksi->result())>0) {
foreach ($data_transaksi_produksi->result() as $key => $value) ;
$ket = json_decode($value->ket,true);
// print_r(count($ket));
$ada = 0;
$array_ket = null;
foreach ($ket as $key1 => $value1) {
if ($value1['tahun'] == $array[0] and $value1['musim'] == $array[1]) {
$ada = 1;
$array_ket = $value1;
break;
}
}
if ($ada == 1) {
// echo "sini tampilan";
$main['lahan'] = $cek_lahan;
$main['elemen_produksi'] = $this->mpenyuluh->tampil_data_keseluruhan('tb_elemen_produksi');
$main['data_transaksi_produksi'] = $this->mpenyuluh->tampil_data_where('tb_data_produksi_lahan', array('no_lahan' => $id));
$main['kode_lahan'] = $id;
$main['ket_nya'] = $array_ket;
$main['main']='penyuluh/menu/transaksi_lihat';
$this->load->view('penyuluh/index',$main);
// print_r($main['ket']);
}elseif ($ada == 0) {
echo "bukan tampilan";
}
}else{
echo "tiada";
}
}else{
// $this->session->set_flashdata('error','<b>Error</b><br>Halaman Yang Diakses Tiada Dalam');
// redirect('/penyuluh');
echo "bukan";
}
}else{
echo "bukan";
}
}elseif (is_numeric($this->uri->segment(3))) {
$id = $this->uri->segment(3);
$cek_lahan = $this->mpenyuluh->tampil_data_where('tb_lahan',array('id_lahan' => $id, 'kecamatan' => $penyuluh['kecamatan']));
if (count($cek_lahan->result())>0) {
$main['kode_lahan'] = $id;
$main['lahan'] = $cek_lahan;
$main['elemen_produksi'] = $this->mpenyuluh->tampil_data_keseluruhan('tb_elemen_produksi');
$main['data_transaksi_produksi'] = $this->mpenyuluh->tampil_data_where('tb_data_produksi_lahan', array('no_lahan' => $id));
$main['main']='penyuluh/menu/transaksi_proses';
$this->load->view('penyuluh/index',$main);
}else{
$this->session->set_flashdata('error','<b>Error</b><br>Halaman Yang Diakses Tiada Dalam');
redirect('/penyuluh');
}
}elseif ($this->uri->segment(3) == '') {
$penyuluh = $this->session->userdata('penyuluh');
$cek_kecamatan = $this->mpenyuluh->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $penyuluh['kecamatan']));
foreach ($cek_kecamatan->result() as $key => $value) ;
$main['nama_kecamatan'] = $value->kecamatan;
$main['no_kecamatan'] = $value->id_kecamatan;
$main['cek_lahan_kecamatan'] = $this->mpenyuluh->tampil_data_where('tb_lahan', array('kecamatan' => $penyuluh['kecamatan']));
$main['main']='penyuluh/menu/transaksi';
$main['kecamatan'] = $this->mpenyuluh->tampil_data_keseluruhan('tb_kecamatan');
// $main['lahan'] = $this->mpenyuluh->tampil_data_where('tb_lahan',array('nik_petambak' => $nik));
$this->load->view('penyuluh/index',$main);
}else{
redirect('/penyuluh');
}
}
function logout()
{
$this->session->unset_userdata('penyuluh');
$this->session->unset_userdata(array('nama','nik','level'));
$this->session->set_flashdata('success', '<b>Anda Berhasil Logout</b><br>Terima Kasih Telah Menggunakan Sistem Ini');
redirect('/home');
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see https://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
$this->load->view('welcome_message');
}
}

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

11
application/index.html Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,83 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Madmin extends CI_Model {
public function __construct()
{
parent::__construct();
}
function index(){
}
function tampil_data_keseluruhan($namatabel) //gunakan ini untuk menampilkan tabel yg lebih spesifik 'where'
{
$this->db->select("*");
$this->db->from($namatabel);
$query = $this->db->get();
return $query;
}
function tampil_data_where($namatabel,$array) //gunakan ini untuk menampilkan tabel yg lebih spesifik 'where'
{
$this->db->select("*");
$this->db->from($namatabel);
$this->db->where($array);
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}
function tampil_data_last($namatabel,$kolom)
{
$this->db->select("*");
$this->db->from($namatabel);
$this->db->limit(1);
$this->db->order_by($kolom,"DESC");
$query = $this->db->get();
return $query;
}
function insert($namatabel,$array)
{
return $this->db->insert($namatabel,$array);
}
function update($table,$array,$array_condition)
{
$this->db->where($array);
$this->db->update($table, $array_condition);
}
function delete($namatabel,$array){
$this->db->where($array);
$this->db->delete($namatabel);
}
function like($namatabel,$field,$like,$kategori)
{
if ($kategori == '') {
$this->db->select("*");
$this->db->from($namatabel);
$this->db->like($field, $like, 'both');
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}else{
$this->db->select("*");
$this->db->from($namatabel);
$this->db->where(array('kategori'=>$kategori));
$this->db->like($field, $like, 'both');
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}
}
}

View File

@ -0,0 +1,75 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Mhome extends CI_Model {
public function __construct()
{
parent::__construct();
}
function index(){
}
function tampil_data_keseluruhan($namatabel) //gunakan ini untuk menampilkan tabel yg lebih spesifik 'where'
{
$this->db->select("*");
$this->db->from($namatabel);
$query = $this->db->get();
return $query;
}
function tampil_data_where($namatabel,$array) //gunakan ini untuk menampilkan tabel yg lebih spesifik 'where'
{
$this->db->select("*");
$this->db->from($namatabel);
$this->db->where($array);
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}
function insert($namatabel,$array)
{
return $this->db->insert($namatabel,$array);
}
function update($table,$array,$array_condition)
{
$this->db->where($array);
$this->db->update($table, $array_condition);
}
function like($namatabel,$field,$like,$kategori)
{
if ($kategori == '') {
$this->db->select("*");
$this->db->from($namatabel);
$this->db->like($field, $like, 'both');
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}else{
$this->db->select("*");
$this->db->from($namatabel);
$this->db->where(array('kategori'=>$kategori));
$this->db->like($field, $like, 'both');
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}
}
function produksi_kecamatan($kecamatan)
{
$query = $this->db->query("SELECT * FROM tb_lahan a join tb_data_produksi_lahan b on a.id_lahan = b.no_lahan where a.kecamatan = $kecamatan");
return $query;
}
}

View File

@ -0,0 +1,279 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Mpenyuluh extends CI_Model {
public function __construct()
{
parent::__construct();
}
function index(){
}
function tampil_data_keseluruhan($namatabel) //gunakan ini untuk menampilkan tabel yg lebih spesifik 'where'
{
$this->db->select("*");
$this->db->from($namatabel);
$query = $this->db->get();
return $query;
}
function tampil_data_where($namatabel,$array) //gunakan ini untuk menampilkan tabel yg lebih spesifik 'where'
{
$this->db->select("*");
$this->db->from($namatabel);
$this->db->where($array);
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}
function tampil_data_group_by($namatabel,$array,$kolum) //gunakan ini untuk menampilkan tabel yg lebih spesifik 'where'
{
$this->db->select("*");
$this->db->from($namatabel);
$this->db->where($array);
$this->db->group_by($kolum);
$query = $this->db->get();
return $query;
}
function insert($namatabel,$array)
{
return $this->db->insert($namatabel,$array);
}
function update($table,$array,$array_condition)
{
$this->db->where($array);
$this->db->update($table, $array_condition);
}
function like($namatabel,$field,$like,$kategori)
{
if ($kategori == '') {
$this->db->select("*");
$this->db->from($namatabel);
$this->db->like($field, $like, 'both');
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}else{
$this->db->select("*");
$this->db->from($namatabel);
$this->db->where(array('kategori'=>$kategori));
$this->db->like($field, $like, 'both');
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}
}
function kira_data($kode,$hari,$tanggal,$data)
{
// $nik = $this->session->userdata('nik');
$penyuluh = $this->session->userdata('penyuluh');
$elemen_produksi = $this->tampil_data_keseluruhan('tb_elemen_produksi');
// foreach ($elemen_produksi->result() as $key => $value) {
// $no = $value->id_elemen;
// $satuan[$no] = $data[$no];
// $main['satuan'.$no] = $satuan;
// }
// return $main;
$cek_lahan = $this->tampil_data_where('tb_lahan',array('id_lahan' => $kode, 'kecamatan' => $penyuluh['kecamatan']));
foreach ($cek_lahan->result() as $key => $value);
$luas = $value->luas_lahan;
$tek_tambak = $value->tek_tambak;
$cek_tek_tambak = $this->tampil_data_where('tb_tambak',array('id_tambak' => $tek_tambak));
foreach ($cek_tek_tambak->result() as $key1 => $value1) ;
$ket = json_decode($value1->ket);
// $satuan = json_decode($value1->satuan);
$biaya = 0;
foreach ($elemen_produksi->result() as $key2 => $value2) {
$no = $value2->id_elemen;
$satu = $data[$no];
$satu = str_replace(',', '', $satu);
$harga = $ket->$no;
$main['belakangsatuan'.$no] = $value2->satuan;
if ($harga == '' and $harga == null) {
$harga = '';
}else{
$harga = $harga;
}
if ($value2->id_elemen != 4) {
$satu = $satu * $harga;
}else{
$satu = $satu * $harga * $hari;
}
$biaya = $biaya + $satu;
$main['jumlah'.$no] = $satu;
}
$data1 = str_replace(',', '', $data[1]);
$jumlah_produksi = round(($data1*0.02)+$hari-150);
$persiapan_lahan = $biaya * 10 / 100;
$main['biayaproduksi'] = $biaya;
$main['jumlahproduksi'] = $jumlah_produksi;
$main['biayapersiapanlahan'] = $persiapan_lahan;
$main['totalbiaya'] = $biaya + $persiapan_lahan;
$ekor = $data1;
$main['saiz'] = ceil(($ekor / $jumlah_produksi) - (($hari/($ekor / $jumlah_produksi))*13));
if ($main['saiz'] >= 45) {
$main['hargajual'] = 35000;
}elseif ($main['saiz'] >= 30) {
$main['hargajual'] = 60000;
}elseif ($main['saiz'] >= 25) {
$main['hargajual'] = 80000;
}elseif ($main['saiz'] >= 20) {
$main['hargajual'] = 110000;
}elseif ($main['saiz'] >= 17) {
$main['hargajual'] = 120000;
}elseif ($main['saiz'] >= 8) {
$main['hargajual'] = 180000;
}elseif ($main['saiz'] >= 1) {
$main['hargajual'] = 185000;
}
$main['nilaiproduksi'] = $main['hargajual'] * $jumlah_produksi;
$main['keuntungan'] = $main['nilaiproduksi'] - $biaya - $persiapan_lahan;
if ($main['keuntungan'] <= 0 ) {
$main['status'] = 'Tidak Berhasil';
}else{
$main['status'] = 'Berhasil';
}
return $main;
}
function cari_data($kode,$hari)
{
$penyuluh = $this->session->userdata('penyuluh');
$kode = $kode;
$hari = $hari;
$elemen_produksi = $this->tampil_data_keseluruhan('tb_elemen_produksi');
$cek_lahan = $this->tampil_data_where('tb_lahan',array('id_lahan' => $kode, 'kecamatan' => $penyuluh['kecamatan']));
foreach ($cek_lahan->result() as $key => $value);
$luas = $value->luas_lahan;
$tek_tambak = $value->tek_tambak;
$cek_tek_tambak = $this->tampil_data_where('tb_tambak',array('id_tambak' => $tek_tambak));
foreach ($cek_tek_tambak->result() as $key1 => $value1) ;
$ket = json_decode($value1->ket);
$satuan = json_decode($value1->satuan);
$biaya = 0;
foreach ($elemen_produksi->result() as $key2 => $value2) {
$no = $value2->id_elemen;
$satu = $satuan->$no;
$harga = $ket->$no;
$main['belakangsatuan'.$no] = $value2->satuan;
// echo $no;
if ($value2->id_elemen != 4) {
$jum = $satuan->$no * $luas;
$jum = ceil($jum);
$satuanjadi[$value2->id_elemen] = $jum;
$elemen[$no] = $ket->$no * $jum ;
}else{
$org = $satuan->$no *$luas;
$org = ceil($org);
$elemen[$no] = $ket->$no * $org * $hari;
}
if ($harga == '' and $harga == null) {
$harga = '';
}else{
$harga = number_format($harga);
}
if ($satu == '' and $satu == null) {
$satu = '';
}else{
$satu = $satu * $luas;
$satu = ceil($satu);
}
$main['harga'.$no] = $harga;
$main['satuan'.$no] = $satu;
}
foreach ($elemen_produksi->result() as $key2 => $value2) {
$biaya = $biaya + $elemen[$value2->id_elemen];
$main['jumlahbahan'.$value2->id_elemen]= $elemen[$value2->id_elemen];
}
$jumlah_produksi = round(($satuanjadi[1]*0.02)+$hari-150);
$persiapan_lahan = $biaya * 10 / 100;
$main['biayaproduksi'] = $biaya;
$main['jumlahproduksi'] = $jumlah_produksi;
$main['biayapersiapanlahan'] = $persiapan_lahan;
$main['totalbiaya'] = $biaya + $persiapan_lahan;
$ekor = $main['satuan1'];
$main['saiz'] = ceil(($ekor / $jumlah_produksi) - (($hari/($ekor / $jumlah_produksi))*13));
if ($main['saiz'] >= 45) {
$main['hargajual'] = 35000;
}elseif ($main['saiz'] >= 30) {
$main['hargajual'] = 60000;
}elseif ($main['saiz'] >= 25) {
$main['hargajual'] = 80000;
}elseif ($main['saiz'] >= 20) {
$main['hargajual'] = 110000;
}elseif ($main['saiz'] >= 17) {
$main['hargajual'] = 120000;
}elseif ($main['saiz'] >= 8) {
$main['hargajual'] = 180000;
}elseif ($main['saiz'] >= 1) {
$main['hargajual'] = 185000;
}
$main['nilaiproduksi'] = $main['hargajual'] * $jumlah_produksi;
$main['keuntungan'] = $main['nilaiproduksi'] - $biaya - $persiapan_lahan;
if ($main['keuntungan'] <= 0 ) {
$main['status'] = 'Tidak Berhasil';
}else{
$main['status'] = 'Berhasil';
}
return $main;
}
}

View File

@ -0,0 +1,278 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Mpetambak extends CI_Model {
public function __construct()
{
parent::__construct();
}
function index(){
}
function tampil_data_keseluruhan($namatabel) //gunakan ini untuk menampilkan tabel yg lebih spesifik 'where'
{
$this->db->select("*");
$this->db->from($namatabel);
$query = $this->db->get();
return $query;
}
function tampil_data_where($namatabel,$array) //gunakan ini untuk menampilkan tabel yg lebih spesifik 'where'
{
$this->db->select("*");
$this->db->from($namatabel);
$this->db->where($array);
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}
function tampil_data_group_by($namatabel,$array,$kolum) //gunakan ini untuk menampilkan tabel yg lebih spesifik 'where'
{
$this->db->select("*");
$this->db->from($namatabel);
$this->db->where($array);
$this->db->group_by($kolum);
$query = $this->db->get();
return $query;
}
function insert($namatabel,$array)
{
return $this->db->insert($namatabel,$array);
}
function update($table,$array,$array_condition)
{
$this->db->where($array);
$this->db->update($table, $array_condition);
}
function like($namatabel,$field,$like,$kategori)
{
if ($kategori == '') {
$this->db->select("*");
$this->db->from($namatabel);
$this->db->like($field, $like, 'both');
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}else{
$this->db->select("*");
$this->db->from($namatabel);
$this->db->where(array('kategori'=>$kategori));
$this->db->like($field, $like, 'both');
// $this->db->limit(1);
$query = $this->db->get();
return $query;
}
}
function kira_data($kode,$hari,$tanggal,$data)
{
$nik = $this->session->userdata('nik');
$elemen_produksi = $this->tampil_data_keseluruhan('tb_elemen_produksi');
// foreach ($elemen_produksi->result() as $key => $value) {
// $no = $value->id_elemen;
// $satuan[$no] = $data[$no];
// $main['satuan'.$no] = $satuan;
// }
// return $main;
$cek_lahan = $this->tampil_data_where('tb_lahan',array('id_lahan' => $kode, 'nik_petambak' => $nik));
foreach ($cek_lahan->result() as $key => $value);
$luas = $value->luas_lahan;
$tek_tambak = $value->tek_tambak;
$cek_tek_tambak = $this->tampil_data_where('tb_tambak',array('id_tambak' => $tek_tambak));
foreach ($cek_tek_tambak->result() as $key1 => $value1) ;
$ket = json_decode($value1->ket);
// $satuan = json_decode($value1->satuan);
$biaya = 0;
foreach ($elemen_produksi->result() as $key2 => $value2) {
$no = $value2->id_elemen;
$satu = $data[$no];
$satu = str_replace(',', '', $satu);
$harga = $ket->$no;
$main['belakangsatuan'.$no] = $value2->satuan;
if ($harga == '' and $harga == null) {
$harga = '';
}else{
$harga = $harga;
}
if ($value2->id_elemen != 4) {
$satu = $satu * $harga;
}else{
$satu = $satu * $harga * $hari;
}
$biaya = $biaya + $satu;
$main['jumlah'.$no] = $satu;
}
$data1 = str_replace(',', '', $data[1]);
$jumlah_produksi = round(($data1*0.02)+$hari-150);
$persiapan_lahan = $biaya * 10 / 100;
$main['biayaproduksi'] = $biaya;
$main['jumlahproduksi'] = $jumlah_produksi;
$main['biayapersiapanlahan'] = $persiapan_lahan;
$main['totalbiaya'] = $biaya + $persiapan_lahan;
$ekor = $data1;
$main['saiz'] = ceil(($ekor / $jumlah_produksi) - (($hari/($ekor / $jumlah_produksi))*13));
if ($main['saiz'] >= 45) {
$main['hargajual'] = 35000;
}elseif ($main['saiz'] >= 30) {
$main['hargajual'] = 60000;
}elseif ($main['saiz'] >= 25) {
$main['hargajual'] = 80000;
}elseif ($main['saiz'] >= 20) {
$main['hargajual'] = 110000;
}elseif ($main['saiz'] >= 17) {
$main['hargajual'] = 120000;
}elseif ($main['saiz'] >= 8) {
$main['hargajual'] = 180000;
}elseif ($main['saiz'] >= 1) {
$main['hargajual'] = 185000;
}
$main['nilaiproduksi'] = $main['hargajual'] * $jumlah_produksi;
$main['keuntungan'] = $main['nilaiproduksi'] - $biaya - $persiapan_lahan;
if ($main['keuntungan'] <= 0 ) {
$main['status'] = 'Tidak Berhasil';
}else{
$main['status'] = 'Berhasil';
}
return $main;
}
function cari_data($kode,$hari)
{
$nik = $this->session->userdata('nik');
$kode = $kode;
$hari = $hari;
$elemen_produksi = $this->tampil_data_keseluruhan('tb_elemen_produksi');
$cek_lahan = $this->tampil_data_where('tb_lahan',array('id_lahan' => $kode, 'nik_petambak' => $nik));
foreach ($cek_lahan->result() as $key => $value);
$luas = $value->luas_lahan;
$tek_tambak = $value->tek_tambak;
$cek_tek_tambak = $this->tampil_data_where('tb_tambak',array('id_tambak' => $tek_tambak));
foreach ($cek_tek_tambak->result() as $key1 => $value1) ;
$ket = json_decode($value1->ket);
$satuan = json_decode($value1->satuan);
$biaya = 0;
foreach ($elemen_produksi->result() as $key2 => $value2) {
$no = $value2->id_elemen;
$satu = $satuan->$no;
$harga = $ket->$no;
$main['belakangsatuan'.$no] = $value2->satuan;
// echo $no;
if ($value2->id_elemen != 4) {
$jum = $satuan->$no * $luas;
$jum = ceil($jum);
$satuanjadi[$value2->id_elemen] = $jum;
$elemen[$no] = $ket->$no * $jum ;
}else{
$org = $satuan->$no *$luas;
$org = ceil($org);
$elemen[$no] = $ket->$no * $org * $hari;
}
if ($harga == '' and $harga == null) {
$harga = '';
}else{
$harga = number_format($harga);
}
if ($satu == '' and $satu == null) {
$satu = '';
}else{
$satu = $satu * $luas;
$satu = ceil($satu);
}
$main['harga'.$no] = $harga;
$main['satuan'.$no] = $satu;
}
foreach ($elemen_produksi->result() as $key2 => $value2) {
$biaya = $biaya + $elemen[$value2->id_elemen];
$main['jumlahbahan'.$value2->id_elemen]= $elemen[$value2->id_elemen];
}
$jumlah_produksi = round(($satuanjadi[1]*0.02)+$hari-150);
$persiapan_lahan = $biaya * 10 / 100;
$main['biayaproduksi'] = $biaya;
$main['jumlahproduksi'] = $jumlah_produksi;
$main['biayapersiapanlahan'] = $persiapan_lahan;
$main['totalbiaya'] = $biaya + $persiapan_lahan;
$ekor = $main['satuan1'];
$main['saiz'] = ceil(($ekor / $jumlah_produksi) - (($hari/($ekor / $jumlah_produksi))*13));
if ($main['saiz'] >= 45) {
$main['hargajual'] = 35000;
}elseif ($main['saiz'] >= 30) {
$main['hargajual'] = 60000;
}elseif ($main['saiz'] >= 25) {
$main['hargajual'] = 80000;
}elseif ($main['saiz'] >= 20) {
$main['hargajual'] = 110000;
}elseif ($main['saiz'] >= 17) {
$main['hargajual'] = 120000;
}elseif ($main['saiz'] >= 8) {
$main['hargajual'] = 180000;
}elseif ($main['saiz'] >= 1) {
$main['hargajual'] = 185000;
}
$main['nilaiproduksi'] = $main['hargajual'] * $jumlah_produksi;
$main['keuntungan'] = $main['nilaiproduksi'] - $biaya - $persiapan_lahan;
if ($main['keuntungan'] <= 0 ) {
$main['status'] = 'Tidak Berhasil';
}else{
$main['status'] = 'Berhasil';
}
return $main;
}
}

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

11
application/third_party/index.html vendored Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,14 @@
<div class="fixed-navbar">
<div class="pull-left">
<button type="button" class="menu-mobile-button glyphicon glyphicon-menu-hamburger js__menu_mobile"></button>
<h1 class="page-title">Sistem Analisa Produksi Perikanan Tambak</h1>
<!-- /.page-title -->
</div>
<!-- /.pull-left -->
<div class="pull-right">
<!-- /.ico-item -->
<!-- <a href="#" class="ico-item mdi mdi-logout js__logout"></a> -->
</div>
<!-- /.pull-right -->
</div>

View File

@ -0,0 +1,8 @@
<footer class="footer">
<ul class="list-inline">
<li>2020 © SAPITA.</li>
<li><a href="#">Privacy</a></li>
<li><a href="#">Terms</a></li>
<li><a href="#">Help</a></li>
</ul>
</footer>

View File

@ -0,0 +1,48 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<title>SAPITA - <?=$header?></title>
<!-- Main Styles -->
<link rel="stylesheet" href="<?=base_url()?>assets/styles/style.min.css">
<!-- Material Design Icon -->
<link rel="stylesheet" href="<?=base_url()?>assets/fonts/material-design/css/materialdesignicons.css">
<!-- mCustomScrollbar -->
<link rel="stylesheet" href="<?=base_url()?>assets/plugin/datatables/media/css/dataTables.bootstrap.min.css">
<link rel="stylesheet" href="<?=base_url()?>assets/plugin/datatables/extensions/Responsive/css/responsive.bootstrap.min.css">
<!-- Sweet Alert -->
<!-- <link rel="stylesheet" href="<?=base_url()?>assets/plugin/sweet-alert/sweetalert.css"> -->
<link rel="stylesheet" href="<?php echo base_url() ?>sweet-alert/sweetalert.css">
<script src="<?php echo base_url() ?>sweet-alert/sweetalert.js"></script>
<style>
#map_canvas {
height: 600px;
width: 100%;
margin: 0px;
padding: 0px
}
.nowrap {
white-space: nowrap ;
}
</style>
<?php if ($this->uri->segment(2) == 'prediksi' or $this->uri->segment(2) == 'hasil_tahunan'): ?>
<link rel="stylesheet" href="<?php echo base_url() ?>/morris/morris.css">
<script src="<?php echo base_url() ?>/morris/jquery.min.js"></script>
<script src="<?php echo base_url() ?>assets/plugin/chart/morris/raphael-min.js"></script>
<script src="<?php echo base_url() ?>/morris/morris.min.js"></script>
<?php endif ?>
</head>

View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:47:34 GMT -->
<?php $this->load->view("admin/head"); ?>
<body>
<?php $this->load->view('admin/main_menu'); ?>
<!-- /.main-menu -->
<?php $this->load->view("admin/fixed_navbar") ; ?>
<!-- /.fixed-navbar -->
<!-- /#notification-popup -->
<!-- /#message-popup -->
<div id="wrapper">
<div class="main-content">
<?php $this->load->view($main); ?>
<!-- /.row -->
<?php $this->load->view("admin/footer"); ?>
</div>
<!-- /.main-content -->
</div><!--/#wrapper -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/script/html5shiv.min.js"></script>
<script src="assets/script/respond.min.js"></script>
<![endif]-->
<!--
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<?php $this->load->view("admin/script"); ?>
</body>
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:09 GMT -->
</html>

View File

@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<title><?=$header?></title>
<link rel="stylesheet" href="<?=base_url()?>assets/styles/style.min.css">
<!-- Waves Effect -->
<link rel="stylesheet" href="<?=base_url()?>assets/plugin/waves/waves.min.css">
</head>
<body>
<div id="single-wrapper">
<form method="post" class="frm-single">
<div class="inside">
<div class="title"><strong>SAPITA</strong></div>
<!-- /.title -->
<div class="frm-title">Login</div>
<!-- /.frm-title -->
<div class="frm-input"><input type="text" placeholder="Username" class="frm-inp" name="username"><i class="fa fa-user frm-ico"></i></div>
<!-- /.frm-input -->
<div class="frm-input"><input type="password" placeholder="Password" class="frm-inp" name="password"><i class="fa fa-lock frm-ico"></i></div>
<input type="submit" class="frm-submit" name="login" value="Login">
<!-- /.row -->
<a href="<?=base_url()?>home/pendaftaran" class="a-link"><i class="fa fa-archive"></i>Silakan Daftar Lahan Anda.</a>
<div class="frm-footer">Dinas Pertanian Kelautan Dan Perikanan <br> Kota Parepare © 2020.</div>
<!-- /.footer -->
</div>
<!-- .inside -->
</form>
<!-- /.frm-single -->
</div><!--/#single-wrapper -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/script/html5shiv.min.js"></script>
<script src="assets/script/respond.min.js"></script>
<![endif]-->
<!--
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="<?=base_url()?>assets/scripts/jquery.min.js"></script>
<script src="<?=base_url()?>assets/scripts/modernizr.min.js"></script>
<script src="<?=base_url()?>assets/plugin/bootstrap/js/bootstrap.min.js"></script>
<script src="<?=base_url()?>assets/plugin/nprogress/nprogress.js"></script>
<script src="<?=base_url()?>assets/plugin/waves/waves.min.js"></script>
<script src="<?=base_url()?>assets/plugin/toastr/toastr.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>assets/plugin/toastr/toastr.css">
<?php if ($this->session->flashdata('warning')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.warning("<?php echo $this->session->flashdata('warning')?>");
</script>
<?php endif ?>
<script src="<?=base_url()?>assets/scripts/main.min.js"></script>
</body>
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
</html>

View File

@ -0,0 +1,87 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content">
<h4 class="box-title">Luas Lahan Petambak : <span class="nowrap" id="luas1"></span> Ha </h4>
<h4 class="box-title">Jumlah Lahan : <?=count($lahan->result())?> </h4>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">PILIH KECAMATAN :</label>
<div class="col-sm-6">
<select class="form-control" onchange="changeFuncKecamatan(value);" name="kecamatan">
<option value="" se>-Pilih Kecamatan</option>
<?php foreach ($kecamatan->result() as $key => $value) {
if ($this->uri->segment(3) == $value->id_kecamatan) {
$selected = "selected";
}else{
$selected = '';
}
?>
<option value="<?=$value->id_kecamatan?>" <?=$selected?>><?=$value->kecamatan?></option>
<?php } ?>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div id="peta">
</div>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
<!-- /.box-content -->
</div>
<?php
$kira = count($cek_hasil->result()) - 1;
$jumlah = 0;
// print_r($kira);
foreach ($cek_hasil->result() as $key => $value) {
$hasil[$key] = $value->hasil;
}
// $jumlah = ($hasil[$kira-3] + $hasil[$kira-2] + $hasil[$kira-1])/3;
$jumlah = ($hasil[$kira-3] + $hasil[$kira-2] + $hasil[$kira-1])/3;
$hasil = $cek_hasil->result()[$kira]->hasil;
$tahun = $cek_hasil->result_array()[$kira]['tahun'];
$musim = $cek_hasil->result_array()[$kira]['musim'];
// print_r($hasil[$kira]);
?>
<div class="row small-spacing">
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="box-content bg-success text-white">
<div class="statistics-box with-icon">
<i class="ico small fa fa-diamond"></i>
<p class="text text-white">Produksi Tahun <?=$tahun?> Musim <?=$musim?></p>
<h2 class="counter"><?=number_format(round($hasil,0))?> Kg</h2>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-3 col-md-6 col-xs-12 -->
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="box-content bg-info text-white">
<div class="statistics-box with-icon">
<i class="ico small fa fa-download"></i>
<p class="text text-white">Prediksi Tahun <?=$tahun?> Musim <?=$musim?></p>
<h2 class="counter"><?=number_format(round($jumlah,0))?> Kg</h2>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-3 col-md-6 col-xs-12 -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,85 @@
<div class="main-menu">
<header class="header">
<a href="index-2.html" class="logo"><img src="<?=base_url()?>logo.png" width="25" height="25"> SAPITA</a>
<!-- <button type="button" class="button-close fa fa-times js__menu_close"></button> -->
<div class="user">
<a href="#" class="avatar"><img src="<?=base_url()?>logo.png" alt="" width="50" height="50"></a>
<h4><a href="profile.html"><?=$this->session->userdata('nama')?></a></h4>
<h5 class="position"><?=$this->session->userdata('level')?></h5>
<!-- /.name -->
<div class="control-wrap js__drop_down">
<i class="fa fa-caret-down js__drop_down_button"></i>
<div class="control-list">
<div class="control-item"><a href="profile.html"><i class="fa fa-user"></i> Profile</a></div>
<div class="control-item"><a href="<?=base_url()?>admin/logout"><i class="fa fa-sign-out"></i> Log out</a></div>
</div>
<!-- /.control-list -->
</div>
<!-- /.control-wrap -->
</div>
<!-- /.user -->
</header>
<!-- /.header -->
<div class="content">
<div class="navigation">
<h5 class="title">Menu</h5>
<!-- /.title -->
<ul class="menu js__accordion">
<li <?php if ($this->uri->segment(2) == '') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>admin"><i class="menu-icon mdi mdi-view-dashboard"></i><span>Halaman Utama</span></a>
</li>
<li <?php if ($this->uri->segment(2) == 'data_petambak' or $this->uri->segment(2) == 'data_produksi' or $this->uri->segment(2) == 'data_penyuluh' or $this->uri->segment(2) == 'data_petambak1') { echo 'class="current"'; } ?>>
<!-- <a class="waves-effect" href="<?=base_url()?>home/pendaftaran"><i class="menu-icon mdi mdi-cube-outline"></i><span>Pendaftaran</a> -->
<a class="waves-effect parent-item js__control" href="#"><i class="menu-icon mdi mdi-desktop-mac"></i><span>Master Data</span><span class="menu-arrow fa fa-angle-down"></span></a>
<ul class="sub-menu js__content">
<li><a href="<?=base_url()?>admin/data_petambak">Data Lahan</a></li>
<li><a href="<?=base_url()?>admin/data_petambak1">Data Petambak</a></li>
<li><a href="<?=base_url()?>admin/data_penyuluh">Data Penyuluh</a></li>
<li><a href="<?=base_url()?>admin/data_produksi">Data Produksi</a></li>
</ul>
</li>
<li <?php if ($this->uri->segment(2) == 'prediksi') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>admin/prediksi"><i class="menu-icon mdi mdi-calendar"></i><span>Hasil Produksi / Prediksi</span></a>
</li>
<li <?php if ($this->uri->segment(2) == 'hasil_kecamatan' or $this->uri->segment(2) == 'hasil_tahunan') { echo 'class="current"'; } ?>>
<!-- <a class="waves-effect" href="<?=base_url()?>home/pendaftaran"><i class="menu-icon mdi mdi-cube-outline"></i><span>Pendaftaran</a> -->
<a class="waves-effect parent-item js__control" href="#"><i class="menu-icon mdi mdi-desktop-mac"></i><span>Laporan</span><span class="menu-arrow fa fa-angle-down"></span></a>
<ul class="sub-menu js__content">
<li><a href="<?=base_url()?>admin/hasil_kecamatan">Hasil Kecamatan</a></li>
<li><a href="<?=base_url()?>admin/hasil_tahunan">Hasil Tahunan</a></li>
</ul>
</li>
<li>
<a class="waves-effect" href="<?=base_url()?>admin/logout"><i class="menu-icon mdi mdi-calendar"></i><span>Logout</span></a>
</li>
<li>
&nbsp<br>&nbsp
</li>
</ul>
<!-- /.menu js__accordion -->
</div>
<!-- /.navigation -->
</div>
<!-- /.content -->
</div>

View File

@ -0,0 +1,82 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Daftar Lahan</h4>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">PILIH KECAMATAN :</label>
<div class="col-sm-6">
<select class="form-control" onchange="changeFuncKecamatan(value);" name="kecamatan">
<option value="" se>-Pilih Kecamatan</option>
<?php foreach ($kecamatan->result() as $key => $value) {
if ($this->uri->segment(3) == $value->id_kecamatan) {
$selected = "selected";
}else{
$selected = '';
}
?>
<option value="<?=$value->id_kecamatan?>" <?=$selected?>><?=$value->kecamatan?></option>
<?php } ?>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
<div id="disini_tabel" class="form-group">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th width="3%">No</th>
<th>Kode Lahan</th>
<th>Petambak</th>
<th>Kecamatan</th>
<th>Kelurahan</th>
<th>Luas</th>
<th>Teknologi Tambak</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php $i = 1; foreach ($lahan->result() as $key => $value) {
$cek_petambak =$this->madmin->tampil_data_where('tb_petambak',array('nik' => $value->nik_petambak));
foreach ($cek_petambak->result() as $key1 => $value1) ;
$cek_kecamatan = $this->madmin->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $value->kecamatan));
foreach ($cek_kecamatan->result() as $key2 => $value2) ;
$cek_kelurahan = $this->madmin->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
$cek_teknologi = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_teknologi->result() as $key4 => $value4) ;
?>
<tr>
<td><?=$i?></td>
<td><?=$value->id_lahan?></td>
<td><?=$value1->nama?></td>
<td><?=$value2->kecamatan?></td>
<td><?=$value3->kelurahan?></td>
<td><?=$value->luas_lahan?></td>
<td><?=$value4->tambak?></td>
<td align="center"><a href="<?=base_url()?>admin/data_petambak/<?=$value->id_lahan?>"><button type="button" title="Lihat Informasi Lahan" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a></td>
</tr>
<?php $i++;} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,253 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Daftar Transaksi Produksi</h4>
<div class="card-content">
<div class="form-group" style="overflow-x: auto" id="tabel_transaksi">
<table id="tabel-data" class="table table-bordered">
<thead>
<tr>
<th>No</th>
<th>Tahun</th>
<th>Musim</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php if (count($data_transaksi_produksi->result())>0): ?>
<?php foreach ($data_transaksi_produksi->result() as $key => $value):
$ket = json_decode($value->ket);
?>
<?php $i=1; foreach ($ket as $key1 => $value1): ?>
<tr>
<td><?=$i?></td>
<td><?=$value1->tahun?></td>
<td><?=$value1->musim?></td>
<td align="center">
<a href="<?=base_url()?>admin/data_petambak/lihat/<?=$this->uri->segment(3)?>/<?=$value1->tahun?>-<?=$value1->musim?>"><button type="button" title="Lihat Transaksi Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
<?php endforeach ?>
<?php endif ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Luas Lahan Petambak : <span class="nowrap" id="luas1"></span> Ha </h4>
<h4 class="box-title">Jumlah Lahan : <?=count($lahan->result())?> </h4>
<div class="card-content">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript">
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 12,
center: new google.maps.LatLng(-4.0741291, 119.63409424),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
<?php ////////////// sini awal tampil kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
<?php
if ($value->id_kecamatan == 1) {
$color = "#5C00B3";
}elseif ($value->id_kecamatan == 2) {
$color = "#FFFF00";
}elseif ($value->id_kecamatan == 3) {
$color = "#0D0811";
}elseif ($value->id_kecamatan == 4) {
$color = "#B85612";
}
?>
var polygon_<?=$value->id_kecamatan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil kecamatan ////////////////////////// ?>
<?php ////////////// sini awal tampil lahan ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) { ?>
<?php
if ($value->tek_tambak == 1) {
$color = "#FE2D00";
}elseif ($value->tek_tambak == 2) {
$color = "#77FE00";
}elseif ($value->tek_tambak == 3) {
$color = "#1F00FE";
}
?>
var lahan_<?=$value->id_lahan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->point?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil lahan ////////////////////////// ?>
<?php ////////////// sini awal infowindows kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
google.maps.event.addListener(polygon_<?=$value->id_kecamatan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$value->kecamatan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
// for (var i = 0; i < polygon_<?=$value->id_kecamatan?>.getPath().getLength(); i++) {
// bounds.extend(polygon_<?=$value->id_kecamatan?>.getPath().getAt(i));
// }
<?php } ?>
<?php ////////////// sini akhir infowindows kecamatan ////////////////////////// ?>
<?php ////////////// sini awal infowindows lahan ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) {
$cek_tek_tambak = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->madmin->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
$cek_kecamatan = $this->madmin->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $value->kecamatan));
foreach ($cek_kecamatan->result() as $key4 => $value4) ;
?>
google.maps.event.addListener(lahan_<?=$value->id_lahan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>ID Lahan: <?=$value->id_lahan?></h5>"+
"<h5>Teknologi Tambak : <?=$value2->tambak?></h5>"+
"<h5>Kecamatan : <?=$value4->kecamatan?></h5>"+
"<h5>Kelurahan : <?=$value3->kelurahan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < lahan_<?=$value->id_lahan?>.getPath().getLength(); i++) {
bounds.extend(lahan_<?=$value->id_lahan?>.getPath().getAt(i));
}
<?php } ?>
<?php ////////////// sini akhir infowindows lahan ////////////////////////// ?>
<?php ////////////// sini awal kira luas lahan petambak ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) { ?>
var luasl<?=$value->id_lahan?> =google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath());
<?php } ?>
var luaslahan = <?php foreach ($lahan->result() as $key => $value) { echo "luasl".$value->id_lahan."+";} ?>0;
luaslahan = luaslahan / 10000;
document.getElementById("luas1").innerHTML = numberWithCommas(luaslahan.toFixed(2));
<?php ////////////// sini akhir kira luas lahan petambak ////////////////////////// ?>
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
// document.getElementById('luas').value = luas;
</script>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,327 @@
<div class="row small-spacing">
<?php
$tahunnya = explode('-',$this->uri->segment(5));
?>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-xs-12 col-lg-12">
<div class="box-content card">
<h4 class="box-title">Daftar Transaksi Produksi</h4>
<div class="card-content">
<div class="form-group" style="overflow-x: auto" id="tabel_transaksi">
<table id="tabel-data" class="table table-bordered">
<thead>
<tr>
<th>No</th>
<th>Tahun</th>
<th>Musim</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php if (count($data_transaksi_produksi->result())>0): ?>
<?php foreach ($data_transaksi_produksi->result() as $key => $value):
$ket = json_decode($value->ket);
?>
<?php $i=1; foreach ($ket as $key1 => $value1): ?>
<tr>
<td><?=$i?></td>
<td><?=$value1->tahun?></td>
<td><?=$value1->musim?></td>
<td align="center">
<a href="<?=base_url()?>admin/data_petambak/lihat/<?=$kode_lahan?>/<?=$value1->tahun?>-<?=$value1->musim?>"><button type="button" title="Lihat Transaksi Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
<?php endforeach ?>
<?php endif ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-xs-12">
<div class="box-content card ">
<h4 class="box-title">Form Transaksi Produksi Tahun <?=$tahunnya[0]?> Musim <?=$tahunnya[1]?> </h4>
<!-- /.box-title -->
<div class="card-content">
<?php foreach ($lahan->result() as $key => $value) ;
$cari_data_harga = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' =>$value->tek_tambak));
foreach ($cari_data_harga->result() as $key3 => $value3);
$ket = json_decode($value3->ket);
?>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Kode Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->id_lahan?>" title="ID Lahan" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Luas Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->luas_lahan?> Ha" title="Luas Lahan" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jenis Tambak</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value3->tambak?>" title="Jenis Tambak" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Waktu Tebar</label>
<div class="col-sm-4">
<?php
$min_date = date('Y-m-d');
$min_date = new DateTime($min_date);
$min_date->modify('-30 day');
$min_date =date('Y-m-d', strtotime($min_date->format('Y-m-d')));
$max_date = date('Y-m-d');
$max_date = new DateTime($max_date);
$max_date->modify('+30 day');
$max_date =date('Y-m-d', strtotime($max_date->format('Y-m-d')));
// print_r($ket_nya);
$produksi_pya = $ket_nya['ket_elemen_produksi'];
// print_r($produksi_pya);
$jumlah_produksi = round(($produksi_pya[1]*0.02)+$ket_nya['masa_tumbuh']-150);
$ekor = $produksi_pya[1];
$saiz = ceil(($ekor / $jumlah_produksi) - (($ket_nya['masa_tumbuh']/($ekor / $jumlah_produksi))*13));
foreach ($produksi_pya as $key4 => $value4) {
if ($key4 != 4) {
$jumlah_ini[$key4] = $value4;
}else{
$jumlah_ini[$key4] = $value4 * $ket_nya['masa_tumbuh'];
}
}
if ($saiz >= 45) {
$hargajual = 35000;
}elseif ($saiz >= 30) {
$hargajual = 60000;
}elseif ($saiz >= 25) {
$hargajual = 80000;
}elseif ($saiz >= 20) {
$hargajual = 110000;
}elseif ($saiz >= 17) {
$hargajual = 120000;
}elseif ($saiz >= 8) {
$hargajual = 180000;
}elseif ($saiz >= 1) {
$hargajual = 185000;
}
// print_r($jumlah_ini);
$nilaiproduksi = $hargajual * $jumlah_produksi;
?>
<input type="date" class="form-control" id="tanggal" title="Waktu Tebar" min="<?=$min_date?>" max="<?=$max_date?>" value="<?=$ket_nya['waktu_tebar']?>" disabled>
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inp-type-1" class="col-sm-5 control-label">Masa Tumbuh :</label>
<div class="col-sm-4">
<select class="form-control" id="masa_tumbuh" disabled="">
<option value="" disabled="">-Sila Pilih Masa Pertumbuhan</option>
<option value="60" <?php if ($ket_nya['masa_tumbuh'] == 60): ?>selected <?php endif ?>>60</option>
<option value="90" <?php if ($ket_nya['masa_tumbuh'] == 90): ?>selected <?php endif ?>>90</option>
<option value="150" <?php if ($ket_nya['masa_tumbuh'] == 150): ?>selected <?php endif ?> >150</option>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</div>
<div id="sinitabel">
<form class="form-horizontal" style="overflow-x: auto" id="elemen_produksi">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>Bahan</th>
<th>Harga</th>
<th width="20%">Satuan</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$ket = json_decode($value3->ket);
$satuan = json_decode($value3->satuan);
$r = 1;
$biaya = 0;
// print_r($satuan->$r);
foreach ($elemen_produksi->result() as $key2 => $value2):
$no = $value2->id_elemen;
$satu = $satuan->$no;
$harga = $ket->$no;
if ($harga == '' and $harga == null) {
$harga = '';
}else{
$harga = number_format($harga);
}
$jumlah = $jumlah_ini[$value2->id_elemen] * $ket->$no;
// if ($produksi_pya['Tenaga']) {
// $satu = $satu * $harga;
// }else{
// $satu = $satu * $harga * $hari;
// }
$biaya = $biaya + $jumlah;
?>
<tr>
<td><?=$value2->nama_elemen?></td>
<td>Rp. <?=$harga?> </td>
<td>
<input type="text" style="width: 200px;" class="form-control" id="inputan<?=$no?>" placeholder="Jumlah <?=$value2->nama_elemen?>" name="<?=$value2->id_elemen?>" minlegth='5' maxlength='10' value='<?=number_format($produksi_pya[$value2->id_elemen])?>' disabled>
</td>
<td>Rp. <?=number_format($jumlah)?></td>
</tr>
<?php endforeach ;
$persiapan_lahan = $biaya * 10 / 100;
$totalbiaya = $biaya + $persiapan_lahan;
$keuntungan = $nilaiproduksi - $biaya - $persiapan_lahan;
if ($keuntungan <= 0 ) {
$status = 'Tidak Berhasil';
}else{
$status = 'Berhasil';
}
?>
</tbody>
</table>
</form>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jumlah Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=number_format($jumlah_produksi)?> kg" title="Jumlah Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
<div class="form-horizontal">
<div class="form-group">
<center><button type="button" class="btn btn-primary btn-sm waves-effect waves-light" onclick="submitdata()" id="button_submit" style="display: none">Proses Transaksi Produksi</button> &nbsp &nbsp <a href="<?=base_url()?>penyuluh/transaksi/lihat/<?=$this->uri->segment(4).'/'.$this->uri->segment(5)?>"><button type="button" class="btn btn-danger btn-sm waves-effect waves-light" id="button_batal" style="display: none">Batal Edit</button></a><button type="button" class="btn btn-warning btn-sm waves-effect waves-light" onclick="editdata()" id="button_edit" style="display: none">Edit Transaksi Produksi ?</button></center>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
<!-- /.box-content card white -->
</div>
<div id="detailsini">
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<!-- /.box-title -->
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Panen</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Panen" value="<?=$ket_nya['masa_panen']?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Saiz</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Saiz" value="+- <?=$saiz?> ekor/kg" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Total Biaya</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Jumlah" value="Rp . <?=number_format($totalbiaya)?>" disabled="">
</div>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Harga Jual</label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="Enter your email" title="Harga Jual" value="Rp. <?=number_format($hargajual)?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Nilai Produksi</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Nilai" value="Rp. <?=number_format($nilaiproduksi)?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Keuntungan</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Keuntungan" value="Rp. <?=number_format($keuntungan)?>" disabled="">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Status Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$status?>" title="Status Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,49 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Daftar Petambak</h4>
<div class="card-content">
<div id="disini_tabel" class="form-group">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th width="3%">No</th>
<th>N I K </th>
<th>Nama</th>
<th>Wilayah</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php $i = 1; foreach ($penyuluh->result() as $key => $value) {
$cek_kecamatan = $this->madmin->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $value->kecamatan));
foreach ($cek_kecamatan->result() as $key1 => $value1) ;
?>
<tr>
<td><?=$i?></td>
<td><?=$value->nik?></td>
<td><?=$value->nama?></td>
<td><?=$value1->kecamatan?></td>
<td align="center"><button type="button" title="Analisa Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></td>
</tr>
<?php $i++;} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,46 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Daftar Petambak</h4>
<div class="card-content">
<div id="disini_tabel" class="form-group">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th width="3%">No</th>
<th>N I K </th>
<th>Nama</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php $i = 1; foreach ($petambak->result() as $key => $value) {
?>
<tr>
<td><?=$i?></td>
<td><?=$value->nik?></td>
<td><?=$value->nama?></td>
<td align="center"><a href="<?=base_url()?>admin/data_petambak1/<?=$value->nik?>"><button type="button" title="Analisa Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a></td>
</tr>
<?php $i++;} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,274 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">List Lahan Petambak <?=$nama?></h4>
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label class="col-sm-4 control-label">Jumlah Lahan</label>
<div class="col-sm-5">
<input type="text" disabled="" class="form-control" value="<?=count($lahan->result())?>">
</div>
<div class="col-sm-3"></div>
</div>
</div>
<div class="form-group" style="overflow-x: auto">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>No</th>
<th>Kode Lahan</th>
<th>Petambak</th>
<th>No PBB</th>
<th>Jenis Tambak</th>
<th>Luas</th>
<th>Kelurahan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php $i =1; foreach ($lahan->result() as $key => $value):
$cek_tek_tambak = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->madmin->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
$cek_kecamatan = $this->madmin->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $value->kecamatan));
foreach ($cek_kecamatan->result() as $key4 => $value4) ;
?>
<tr>
<td><?=$i?></td>
<td><?=$value->id_lahan?></td>
<td><?=$value->no_pbb?></td>
<td><?=$value2->tambak?></td>
<td><?=$value->luas_lahan?></td>
<td><?=$value4->kecamatan?></td>
<td><?=$value3->kelurahan?></td>
<td>
<a href="<?=base_url()?>admin/data_petambak/<?=$value->id_lahan?>"><button type="button" title="Lihat Informasi Lahan" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Luas Lahan Petambak : <span class="nowrap" id="luas1"></span> Ha </h4>
<h4 class="box-title">Jumlah Lahan : <?=count($lahan->result())?> </h4>
<div class="card-content">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript">
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 12,
center: new google.maps.LatLng(-4.0741291, 119.63409424),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
<?php ////////////// sini awal tampil kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
<?php
if ($value->id_kecamatan == 1) {
$color = "#5C00B3";
}elseif ($value->id_kecamatan == 2) {
$color = "#FFFF00";
}elseif ($value->id_kecamatan == 3) {
$color = "#0D0811";
}elseif ($value->id_kecamatan == 4) {
$color = "#B85612";
}
?>
var polygon_<?=$value->id_kecamatan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil kecamatan ////////////////////////// ?>
<?php ////////////// sini awal tampil lahan ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) { ?>
<?php
if ($value->tek_tambak == 1) {
$color = "#FE2D00";
}elseif ($value->tek_tambak == 2) {
$color = "#77FE00";
}elseif ($value->tek_tambak == 3) {
$color = "#1F00FE";
}
?>
var lahan_<?=$value->id_lahan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->point?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil lahan ////////////////////////// ?>
<?php ////////////// sini awal infowindows kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
google.maps.event.addListener(polygon_<?=$value->id_kecamatan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$value->kecamatan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
// for (var i = 0; i < polygon_<?=$value->id_kecamatan?>.getPath().getLength(); i++) {
// bounds.extend(polygon_<?=$value->id_kecamatan?>.getPath().getAt(i));
// }
<?php } ?>
<?php ////////////// sini akhir infowindows kecamatan ////////////////////////// ?>
<?php ////////////// sini awal infowindows lahan ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) {
$cek_tek_tambak = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->madmin->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
$cek_kecamatan = $this->madmin->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $value->kecamatan));
foreach ($cek_kecamatan->result() as $key4 => $value4) ;
?>
google.maps.event.addListener(lahan_<?=$value->id_lahan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>ID Lahan: <?=$value->id_lahan?></h5>"+
"<h5>Teknologi Tambak : <?=$value2->tambak?></h5>"+
"<h5>Kecamatan : <?=$value4->kecamatan?></h5>"+
"<h5>Kelurahan : <?=$value3->kelurahan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
'<center><a href="<?=base_url()?>admin/data_petambak/<?=$value->id_lahan?>"><button type="button" title="Lihat Informasi Lahan" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a></center>'+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < lahan_<?=$value->id_lahan?>.getPath().getLength(); i++) {
bounds.extend(lahan_<?=$value->id_lahan?>.getPath().getAt(i));
}
<?php } ?>
<?php ////////////// sini akhir infowindows lahan ////////////////////////// ?>
<?php ////////////// sini awal kira luas lahan petambak ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) { ?>
var luasl<?=$value->id_lahan?> =google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath());
<?php } ?>
var luaslahan = <?php foreach ($lahan->result() as $key => $value) { echo "luasl".$value->id_lahan."+";} ?>0;
luaslahan = luaslahan / 10000;
document.getElementById("luas1").innerHTML = numberWithCommas(luaslahan.toFixed(2));
<?php ////////////// sini akhir kira luas lahan petambak ////////////////////////// ?>
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
// document.getElementById('luas').value = luas;
</script>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,298 @@
<div class="row small-spacing">
<!-- <div class="col-lg-5 col-xs-12">
<div class="box-content card">
<h4 class="box-title">Form Penambahan Elemen Produksi</h4>
<div class="card-content">
<form id="penambahan_produksi">
<div class="form-group">
<label for="inputEmail3" class="control-label">Faktor Produksi</label>
<input type="text" name="nama_elemen" id="faktor_produksi" class="form-control" placeholder="Masukkan Faktor Produksi">
</div>
<div class="form-group">
<label for="inputEmail3" class="control-label">Satuan</label>
<input type="text" name="satuan" id="satuan_input" class="form-control" placeholder="Masukkan Satuan Faktor Produksi">
</div>
</form>
<div class="form-group">
<center><button type="submit" class="btn btn-info btn-sm waves-effect waves-light" onclick="tambah_satuan()">Tambah Elemen Produksi</button></center>
</div>
</div>
</div>
<div class="box-content card">
<h4 class="box-title">Form Elemen Produksi</h4>
<div class="card-content">
<form>
<table id="tabel-data" class="table table-striped table-bordered display">
<thead>
<tr>
<th width="7%"><center>Id</center></th>
<th>Faktor Produksi</th>
<th>Satuan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php foreach ($produksi->result() as $key => $value) {?>
<tr>
<td align="center"><?=$value->id_elemen?></td>
<td><?=$value->nama_elemen?></td>
<td><?=$value->satuan?></td>
<td><button type="button" title="Hapus Elemen?" class="btn btn-danger btn-circle btn-sm waves-effect waves-light" onclick="hapus_elemen(<?=$value->id_elemen?>,'<?=$value->nama_elemen?>')"><i class="ico fa fa-trash"></i></button></td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
</div>
</div>
</div> -->
<div class="col-lg-12 col-xs-12">
<div class="box-content card">
<h4 class="box-title" style="cursor: pointer;" onclick="myFunction(0)">Elemen Produksi Untuk Tambak Tradisional</h4>
<div style="overflow-x: auto; display: none;" class="card-content" id="myDIV">
<form id="elemen_produksi_tradisional">
<table id="tabel-data" class="table table-striped table-bordered display">
<thead>
<tr>
<th width="7%"><center>Id</center></th>
<th>Faktor Produksi</th>
<th>Satuan</th>
<th width="30%">Harga</th>
</tr>
</thead>
<tbody>
<?php foreach ($produksi->result() as $key => $value) {?>
<tr>
<td align="center"><?=$value->id_elemen?></td>
<td><?=$value->nama_elemen?></td>
<td><?=$value->satuan?></td>
<?php
$data_keterangan = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' => 1));
foreach ($data_keterangan->result() as $key1 => $value1) {
$keterangan = json_decode($value1->ket);
$kode = $value->id_elemen;
$harganya = $keterangan->$kode;
if ($harganya == '' or $harganya == null) {
$harganya = '';
}else{
$harganya = number_format($harganya);
}
}
?>
<td><input type="text" style="width: 275px;" class="form-control" id="inputan<?=$value->id_elemen?>tradisional" placeholder="Masukkan Harga <?=$value->nama_elemen?>/<?=$value->satuan?>" name="<?=$value->id_elemen?>" value="<?=$harganya?>" minlegth='5' maxlength='10'></td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
<div class="form-horizontal">
<div class="form-group">
<center><button type="button" class="btn btn-sm waves-effect waves-light" onclick="update_tambak(1)">Update Elemen Produksi Tambak Tradisional</button></center>
</div>
</div><br><br>
<div class="box-content card white">
<h4 class="box-title">Jumlah Satuan Per / 1 Hektar</h4>
<div class="card-content">
<form id="satuan_produksi_tradisional">
<?php foreach ($produksi->result() as $key => $value): ?>
<div class="form-group">
<label for="inputEmail3" class="control-label"><?=$value->nama_elemen?></label>
<?php
$data_keterangan = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' => 1));
foreach ($data_keterangan->result() as $key1 => $value1) {
$satuan = json_decode($value1->satuan);
$kode = $value->id_elemen;
$satuannya = $satuan->$kode;
if ($satuannya == '' or $satuannya == null) {
$satuannya = '';
}else{
$satuannya = number_format($satuannya);
}
}
?>
<input type="text" name="<?=$value->id_elemen?>" id="elemen<?=$value->id_elemen?>tradisional" class="form-control" placeholder="Masukkan Satuan <?=$value->nama_elemen?> / 1 Hektar" minlength="2" maxlength="10" value="<?=$satuannya?>">
</div>
<?php endforeach ?>
</form>
<div class="form-group">
<center><button class="btn btn-info btn-sm waves-effect waves-light" onclick="satuan_produksi(1)">Update Satuan Produksi Tambak Tradisional</button></center>
</div>
</div>
</div>
</div>
</div>
<div class="box-content card">
<h4 class="box-title" style="cursor: pointer;" onclick="myFunction(1)">Elemen Produksi Untuk Tambak Semi Modern</h4>
<div style="overflow-x: auto ; display: none;" class="card-content" id="myDIV1">
<form id="elemen_produksi_semi_modern">
<table id="tabel-data" class="table table-striped table-bordered display">
<thead>
<tr>
<th width="7%"><center>Id</center></th>
<th>Faktor Produksi</th>
<th>Satuan</th>
<th width="30%">Harga</th>
</tr>
</thead>
<tbody>
<?php foreach ($produksi->result() as $key => $value) {?>
<tr>
<td align="center"><?=$value->id_elemen?></td>
<td><?=$value->nama_elemen?></td>
<td><?=$value->satuan?></td>
<?php
$data_keterangan = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' => 2));
foreach ($data_keterangan->result() as $key1 => $value1) {
$keterangan = json_decode($value1->ket);
$kode = $value->id_elemen;
$harganya = $keterangan->$kode;
if ($harganya == '' or $harganya == null) {
$harganya = '';
}else{
$harganya = number_format($harganya);
}
}
?>
<td><input type="text" style="width: 275px;" class="form-control" id="inputan<?=$value->id_elemen?>semi_modern" placeholder="Masukkan Harga <?=$value->nama_elemen?>/<?=$value->satuan?>" name="<?=$value->id_elemen?>" value="<?=$harganya?>" minlegth='5' maxlength='10'></td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
<div class="form-horizontal">
<div class="form-group">
<center><button type="button" class="btn btn-sm waves-effect waves-light" onclick="update_tambak(2)">Update Elemen Produksi Tambak Tradisional</button></center>
</div>
</div><br><br>
<div class="box-content card white">
<h4 class="box-title">Jumlah Satuan Per / 1 Hektar</h4>
<div class="card-content">
<form id="satuan_produksi_semi_modern">
<?php foreach ($produksi->result() as $key => $value): ?>
<div class="form-group">
<label for="inputEmail3" class="control-label"><?=$value->nama_elemen?></label>
<?php
$data_keterangan = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' => 2));
foreach ($data_keterangan->result() as $key1 => $value1) {
$satuan = json_decode($value1->satuan);
$kode = $value->id_elemen;
$satuannya = $satuan->$kode;
if ($satuannya == '' or $satuannya == null) {
$satuannya = '';
}else{
$satuannya = number_format($satuannya);
}
}
?>
<input type="text" name="<?=$value->id_elemen?>" id="elemen<?=$value->id_elemen?>semi_modern" class="form-control" placeholder="Masukkan Satuan <?=$value->nama_elemen?> / 1 Hektar" minlength="2" maxlength="10" value="<?=$satuannya?>">
</div>
<?php endforeach ?>
</form>
<div class="form-group">
<center><button class="btn btn-info btn-sm waves-effect waves-light" onclick="satuan_produksi(2)">Update Satuan Produksi Tambak Tradisional</button></center>
</div>
</div>
</div>
</div>
</div>
<div class="box-content card">
<h4 class="box-title" style="cursor: pointer;" onclick="myFunction(2)">Elemen Produksi Untuk Tambak Semi Modern</h4>
<div style="overflow-x: auto; display: none;" class="card-content" id="myDIV2">
<form id="elemen_produksi_modern">
<table id="tabel-data" class="table table-striped table-bordered display">
<thead>
<tr>
<th width="7%"><center>Id</center></th>
<th>Faktor Produksi</th>
<th>Satuan</th>
<th width="30%">Harga</th>
</tr>
</thead>
<tbody>
<?php foreach ($produksi->result() as $key => $value) {?>
<tr>
<td align="center"><?=$value->id_elemen?></td>
<td><?=$value->nama_elemen?></td>
<td><?=$value->satuan?></td>
<?php
$data_keterangan = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' => 3));
foreach ($data_keterangan->result() as $key1 => $value1) {
$keterangan = json_decode($value1->ket);
$kode = $value->id_elemen;
$harganya = $keterangan->$kode;
if ($harganya == '' or $harganya == null) {
$harganya = '';
}else{
$harganya = number_format($harganya);
}
}
?>
<td><input type="text" style="width: 275px;" class="form-control" id="inputan<?=$value->id_elemen?>modern" placeholder="Masukkan Harga <?=$value->nama_elemen?>/<?=$value->satuan?>" name="<?=$value->id_elemen?>" value="<?=$harganya?>" minlegth='5' maxlength='10'></td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
<div class="form-horizontal">
<div class="form-group">
<center><button type="button" class="btn btn-sm waves-effect waves-light" onclick="update_tambak(3)">Update Elemen Produksi Tambak Tradisional</button></center>
</div>
</div><br><br>
<div class="box-content card white">
<h4 class="box-title">Jumlah Satuan Per / 1 Hektar</h4>
<div class="card-content">
<form id="satuan_produksi_modern">
<?php foreach ($produksi->result() as $key => $value): ?>
<div class="form-group">
<label for="inputEmail3" class="control-label"><?=$value->nama_elemen?></label>
<?php
$data_keterangan = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' => 3));
foreach ($data_keterangan->result() as $key1 => $value1) {
$satuan = json_decode($value1->satuan);
$kode = $value->id_elemen;
$satuannya = $satuan->$kode;
if ($satuannya == '' or $satuannya == null) {
$satuannya = '';
}else{
$satuannya = number_format($satuannya);
}
}
?>
<input type="text" name="<?=$value->id_elemen?>" id="elemen<?=$value->id_elemen?>modern" class="form-control" placeholder="Masukkan Satuan <?=$value->nama_elemen?> / 1 Hektar" minlength="2" maxlength="10" value="<?=$satuannya?>">
</div>
<?php endforeach ?>
</form>
<div class="form-group">
<center><button class="btn btn-info btn-sm waves-effect waves-light" onclick="satuan_produksi(3)">Update Satuan Produksi Tambak Tradisional</button></center>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,80 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Hasil Kecamatan</h4>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">PILIH KECAMATAN :</label>
<div class="col-sm-6">
<select class="form-control" onchange="changeFuncKecamatan(value);" name="kecamatan">
<option value="" se>-Pilih Kecamatan</option>
<?php foreach ($kecamatan->result() as $key => $value) {
if ($this->uri->segment(3) == $value->id_kecamatan) {
$selected = "selected";
}else{
$selected = '';
}
?>
<option value="<?=$value->id_kecamatan?>" <?=$selected?>><?=$value->kecamatan?></option>
<?php } ?>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
<div id="disini_tabel" class="form-group">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>ID Lokasi</th>
<th>Nama Petambak</th>
<th>Kecamatan</th>
<th>Kelurahan</th>
<th>Luas</th>
<th>Teknologi Tambak</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php foreach ($lahan->result() as $key => $value) {
$cek_petambak =$this->madmin->tampil_data_where('tb_petambak',array('nik' => $value->nik_petambak));
foreach ($cek_petambak->result() as $key1 => $value1) ;
$cek_kecamatan = $this->madmin->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $value->kecamatan));
foreach ($cek_kecamatan->result() as $key2 => $value2) ;
$cek_kelurahan = $this->madmin->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
$cek_teknologi = $this->madmin->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_teknologi->result() as $key4 => $value4) ;
?>
<tr>
<td><?=$value->id_lahan?></td>
<td><?=$value1->nama?></td>
<td><?=$value2->kecamatan?></td>
<td><?=$value3->kelurahan?></td>
<td><?=$value->luas_lahan?></td>
<td><?=$value4->tambak?></td>
<td align="center"><a href="<?=base_url()?>admin/data_petambak/<?=$value->id_lahan?>"><button type="button" title="Lihat Informasi Lahan" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,79 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Form Hasil Produksi</h4>
<div class="card-content">
<form id="hasil_produksi">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th width="5%">No</th>
<th>Tahun</th>
<th>Musim</th>
<th width="20%">Hasil</th>
<th>Prediksi</th>
</tr>
</thead>
<tbody>
<?php $i = 1; foreach ($data_produksi->result() as $key => $value):
$hasil[$i] = $value->hasil;
if ($i != 1 and $i != 2 and $i != 3) {
$prediksi = ($hasil[$i-3] + $hasil[$i-2] + $hasil[$i-1])/3;
}else{
$prediksi = '-';
}
?>
<tr>
<td><?=$i?></td>
<td><?=$value->tahun?></td>
<td><?=$value->musim?></td>
<td>
<?php if ($i<=20): ?>
<input type="text" style="width: 200px;" class="form-control" id="inputan<?=$value->no?>" placeholder="Jumlah Nener" name="<?=$value->no?>" minlegth='5' maxlength='10' value="<?php if($value->hasil != '' or $value->hasil != null){ echo number_format($value->hasil);} ?>" disabled>
<?php endif ?>
<?php if ($i>20): ?>
<?=number_format($value->hasil)?>
<?php endif ?>
</td>
<td><?php
if ($i != 1 and $i != 2 and $i != 3) {
echo round($prediksi,0);
}else{
echo $prediksi;
}
?>
</td>
</tr>
<?php $i++; endforeach ?>
</tbody>
</table>
</form>
<div class="form-group">
<br>
<center>
<button type="button" class="btn btn-success btn-sm waves-effect waves-light" onclick="update_hasil()" style="display: none;" id="button_update">Update Hasil Tahun 2010 - 2019</button> &nbsp &nbsp
<button type="button" class="btn btn-danger btn-sm waves-effect waves-light" style="display: none;" id="button_cancel" onclick="cancel_button()" >Cancel</button>
<button type="button" class="btn btn-warning btn-sm waves-effect waves-light" onclick="edit_kah()" id="edit_kah">Edit Hasil Tahun 2010 - 2019 ?</button>
</center>
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Grafik Produksi Dan Prediksi</h4>
<div class="card-content">
<div id="myfirstchart" style="height: 400px;"></div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,88 @@
<div class="row small-spacing">
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<h4 class="box-title">Prediksi M+3</h4>
<!-- /.box-title -->
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Produksi Sebelumnya</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="inputEmail3" value="2019" title="Tahun Produksi Sebelumnya" disabled="">
</div>
<div class="col-sm-3">
<input type="text" class="form-control" id="inputEmail3" value="1" title="Musim Produksi Sebelumnya" disabled="">
</div>
<div class="col-sm-4">
<input type="text" class="form-control" id="inputEmail3" value="25" title="Hasil Produksi Sebelumnya" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Prediksi Produksi</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="inputPassword3" value="77.09" title="Prediksi Produksi" disabled="">
</div>
<div class="col-sm-5">
</div>
</div>
<div class="form-group margin-bottom-0">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-info btn-sm waves-effect waves-light">Proses Prediksi Produksi</button>
</div>
</div>
</form>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<h4 class="box-title">Hasil Pengujian</h4>
<!-- /.box-title -->
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">MSE (Mean Square Error)</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="inputEmail3" value="77.09" title="Mean Square Error" disabled="">
</div>
<div class="col-sm-4">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">RMSE (Root Mean Square Error)</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="inputEmail3" value="77.09" title="Root Mean Square Error" disabled="">
</div>
<div class="col-sm-4">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">MAE (Mean Absolute Error)</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="inputEmail3" value="77.09" title="Mean Absolute Error" disabled="">
</div>
<div class="col-sm-4">
</div>
</div>
</form>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
<!-- /.box-content card white -->
</div>
</div>

View File

@ -0,0 +1,881 @@
<script src="<?=base_url()?>assets/scripts/jquery.min.js"></script>
<script src="<?=base_url()?>assets/scripts/modernizr.min.js"></script>
<script src="<?=base_url()?>assets/plugin/bootstrap/js/bootstrap.min.js"></script>
<script src="<?=base_url()?>assets/plugin/nprogress/nprogress.js"></script>
<!-- <script src="<?=base_url()?>assets/plugin/sweet-alert/sweetalert.min.js"></script> -->
<script src="<?=base_url()?>assets/plugin/waves/waves.min.js"></script>
<!-- <script src="<?=base_url()?>assets/toastr/toastr.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>assets/toastr/toastr.min.css"> -->
<script src="<?=base_url()?>assets/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="<?=base_url()?>assets/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script>
<script src="<?=base_url()?>assets/plugin/toastr/toastr.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>assets/plugin/toastr/toastr.css">
<script src="<?php echo base_url() ?>sweet-alert/sweetalert.js"></script>
<?php if ($this->session->flashdata('my404')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<?php echo $this->session->flashdata('my404')?>");
</script>
<?php endif ?>
<?php if ($this->session->flashdata('success')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.success("<?php echo $this->session->flashdata('success')?>");
</script>
<?php endif ?>
<?php if ($this->session->flashdata('error')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<?php echo $this->session->flashdata('error')?>");
</script>
<?php endif ?>
<?php if ($this->uri->segment(2) == '' or $this->uri->segment(2) == null): ?>
<script type="text/javascript">
function changeFuncKecamatan($i) {
var value = $i;
if (value == '' || value == null) {
$.ajax({
type: "post",
url: "<?=base_url()?>admin/peta",
data: {data: "ambil"}, // appears as $_GET['id'] @ your backend side
dataType: "html",
success: function(data1) {
$('#peta').html(data1);
// console.log(data1);
}
});
}else{
$.ajax({
type: "post",
url: "<?=base_url()?>admin/peta_kecamatan",
data: {kecamatan: value}, // appears as $_GET['id'] @ your backend side
dataType: "html",
success: function(data1) {
$('#peta').html(data1);
// console.log(data1);
}
});
}
}
</script>
<script type="text/javascript">
$.ajax({
type: "post",
url: "<?=base_url()?>admin/peta",
data: {data: 'ambil'}, // appears as $_GET['id'] @ your backend side
dataType: "html",
success: function(data1) {
$('#peta').html(data1);
// console.log(data1);
}
});
</script>
<?php endif ?>
<?php if ($this->uri->segment(2)== 'data_petambak'): ?>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"pageLength": 50
});
});
</script>
<script type="text/javascript">
function changeFuncKecamatan($i) {
var value = $i;
if (value == '' || value == null) {
value=0;
$.ajax({
type: "post",
url: "<?=base_url()?>admin/data_petambak",
data: {kecamatan: value}, // appears as $_GET['id'] @ your backend side
dataType: "html",
success: function(data1) {
$('#disini_tabel').html(data1);
}
});
}else{
$.ajax({
type: "post",
url: "<?=base_url()?>admin/data_petambak",
data: {kecamatan: value}, // appears as $_GET['id'] @ your backend side
dataType: "html",
success: function(data1) {
$('#disini_tabel').html(data1);
}
});
}
}
</script>
<?php endif ?>
<?php if ($this->uri->segment(2)== 'data_petambak1'): ?>
<?php if ($this->uri->segment(3) == ''): ?>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"pageLength": 50
});
});
</script>
<?php endif ?>
<?php endif ?>
<?php if ($this->uri->segment(2)== 'data_penyuluh'): ?>
<?php if ($this->uri->segment(3) == ''): ?>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"pageLength": 50
});
});
</script>
<?php endif ?>
<?php endif ?>
<?php if ($this->uri->segment(2)== 'data_produksi'): ?>
<script type="text/javascript">
function myFunction(a) {
if (a == 0) {
var x = $("#myDIV");
var xx = document.getElementById("myDIV");
}else if (a == 1) {
var x = $("#myDIV1");
var xx = document.getElementById("myDIV1");
}else if (a == 2) {
var x = $("#myDIV2");
var xx = document.getElementById("myDIV2");
}
if (xx.style.display === "none") {
x.slideToggle();
} else {
x.slideToggle();
}
}
</script>
<script type="text/javascript">
<?php foreach ($produksi->result() as $key => $value): ?>
var elem = document.getElementById("inputan<?=$value->id_elemen?>tradisional");
elem.addEventListener("keydown",function(event){
var key = event.which;
if((key<48 || key>57) && key != 8) event.preventDefault();
});
elem.addEventListener("keyup",function(event){
var value = this.value.replace(/,/g,"");
this.dataset.currentValue=parseInt(value);
var caret = value.length-1;
while((caret-3)>-1)
{
caret -= 3;
value = value.split('');
value.splice(caret+1,0,",");
value = value.join('');
}
this.value = value;
});
<?php endforeach ?>
</script>
<script type="text/javascript">
<?php foreach ($produksi->result() as $key => $value): ?>
var elem = document.getElementById("inputan<?=$value->id_elemen?>semi_modern");
elem.addEventListener("keydown",function(event){
var key = event.which;
if((key<48 || key>57) && key != 8) event.preventDefault();
});
elem.addEventListener("keyup",function(event){
var value = this.value.replace(/,/g,"");
this.dataset.currentValue=parseInt(value);
var caret = value.length-1;
while((caret-3)>-1)
{
caret -= 3;
value = value.split('');
value.splice(caret+1,0,",");
value = value.join('');
}
this.value = value;
});
<?php endforeach ?>
</script>
<script type="text/javascript">
<?php foreach ($produksi->result() as $key => $value): ?>
var elem = document.getElementById("inputan<?=$value->id_elemen?>modern");
elem.addEventListener("keydown",function(event){
var key = event.which;
if((key<48 || key>57) && key != 8) event.preventDefault();
});
elem.addEventListener("keyup",function(event){
var value = this.value.replace(/,/g,"");
this.dataset.currentValue=parseInt(value);
var caret = value.length-1;
while((caret-3)>-1)
{
caret -= 3;
value = value.split('');
value.splice(caret+1,0,",");
value = value.join('');
}
this.value = value;
});
<?php endforeach ?>
</script>
<script type="text/javascript">
<?php foreach ($produksi->result() as $key => $value): ?>
var elem = document.getElementById("elemen<?=$value->id_elemen?>tradisional");
elem.addEventListener("keydown",function(event){
var key = event.which;
if((key<48 || key>57) && key != 8) event.preventDefault();
});
elem.addEventListener("keyup",function(event){
var value = this.value.replace(/,/g,"");
this.dataset.currentValue=parseInt(value);
var caret = value.length-1;
while((caret-3)>-1)
{
caret -= 3;
value = value.split('');
value.splice(caret+1,0,",");
value = value.join('');
}
this.value = value;
});
<?php endforeach ?>
</script>
<script type="text/javascript">
<?php foreach ($produksi->result() as $key => $value): ?>
var elem = document.getElementById("elemen<?=$value->id_elemen?>semi_modern");
elem.addEventListener("keydown",function(event){
var key = event.which;
if((key<48 || key>57) && key != 8) event.preventDefault();
});
elem.addEventListener("keyup",function(event){
var value = this.value.replace(/,/g,"");
this.dataset.currentValue=parseInt(value);
var caret = value.length-1;
while((caret-3)>-1)
{
caret -= 3;
value = value.split('');
value.splice(caret+1,0,",");
value = value.join('');
}
this.value = value;
});
<?php endforeach ?>
</script>
<script type="text/javascript">
<?php foreach ($produksi->result() as $key => $value): ?>
var elem = document.getElementById("elemen<?=$value->id_elemen?>modern");
elem.addEventListener("keydown",function(event){
var key = event.which;
if((key<48 || key>57) && key != 8) event.preventDefault();
});
elem.addEventListener("keyup",function(event){
var value = this.value.replace(/,/g,"");
this.dataset.currentValue=parseInt(value);
var caret = value.length-1;
while((caret-3)>-1)
{
caret -= 3;
value = value.split('');
value.splice(caret+1,0,",");
value = value.join('');
}
this.value = value;
});
<?php endforeach ?>
</script>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"pageLength": 50,
"searching": false,
"paging": false,
"ordering": true,
"info": false,
});
});
</script>
<script type="text/javascript">
function hahah(){
console.log('sini');
}
function update_tambak(a){
if (a == 1) {
x = 'tradisional';
xx ='Tradisional';
}else if(a == 2) {
x = 'semi_modern';
xx ='Semi Modern';
}else if(a == 3) {
x = 'modern';
xx ='Modern';
}
var data = $('#elemen_produksi_'+x).serializeArray();
var $emptyFields = $('#elemen_produksi_'+x+' :input').filter(function() {
return $.trim(this.value) === "";
// return this.name;
});
if (!$emptyFields.length) {
// console.log("form has been filled");
$.ajax({
type: "post",
url: "<?=base_url()?>admin/data_produksi",
data: {data_produksi_tambak: data, kode : a}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
window.location.replace("<?=base_url()?>admin/data_produksi/");
}
});
}else{
// console.log('tiada');
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Semua Data Pada Form Elemen Produksi TambaK "+xx+" Harus Terisi");
}
}
function satuan_produksi(a){
if (a == 1) {
x = 'tradisional';
xx ='Tradisional';
}else if(a == 2) {
x = 'semi_modern';
xx ='Semi Modern';
}else if(a == 3) {
x = 'modern';
xx ='Modern';
}
var data = $('#satuan_produksi_'+x).serializeArray();
<?php foreach ($produksi->result() as $key => $value): ?>
var elemen<?=$value->id_elemen?> = $('#satuan_produksi_'+x+' #elemen<?=$value->id_elemen?>'+x) ;
<?php endforeach ?>
<?php
$if = '';
foreach ($produksi->result() as $key => $value) {
$if.='if (elemen'.$value->id_elemen.'.val() == "" ) {
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Kolum Inputan '.$value->nama_elemen.' Harus Terisi");
elemen'.$value->id_elemen.'.focus();
}else ';
} echo $if;?>{
$.ajax({
type: "post",
url: "<?=base_url()?>admin/data_produksi",
data: {satuan_produksi_tambak: data, kode : a}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
window.location.replace("<?=base_url()?>admin/data_produksi/");
}
});
}
}
</script>
<script type="text/javascript">
function hapus_elemen(a,b){
// alert(a);
swal({
title: "Hapus Faktor Produksi?",
text: "Anda akan menghapus faktor produksi \n"+b,
icon: "warning",
buttons: true,
dangerMode: true,
})
.then((logout) => {
if (logout) {
$.ajax({
type: "post",
url: "<?=base_url()?>admin/data_produksi",
data: {no: a}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
// console.log(data1);
window.location.replace("<?=base_url()?>admin/data_produksi/");
}
});
}
});
}
function tambah_satuan(){
var data = $('#penambahan_produksi').serializeArray();
var fp = $("#faktor_produksi");
var satuan = $("#satuan_input");
console.log(data);
if (fp.val() == '' || fp.val() == null) {
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Faktor Produksi Harus Diisi");
fp.focus();
}else if(satuan.val() == '' || satuan.val() == null) {
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Satuan Faktor Produksi Harus Diisi");
satuan.focus();
}else{
$.ajax({
type: "post",
url: "<?=base_url()?>admin/data_produksi",
data: {data_produksi: data}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
// console.log(data1);
window.location.replace("<?=base_url()?>admin/data_produksi/");
}
});
}
}
</script>
<?php endif ?>
<?php if ($this->uri->segment(2)== 'prediksi' or $this->uri->segment(2)== 'hasil_tahunan'): ?>
<?php if ($this->uri->segment(3) == '' or $this->uri->segment(3) == null): ?>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"aLengthMenu": [[20, 40, 60, ,80, -1], [20, 40, 60, 80 ,"All"]],
"iDisplayLength": 20
// "pageLength": 5,
// "searching": false,
// "paging": false,
// "ordering": false,
// "info": false,
});
});
</script>
<script type="text/javascript">
<?php foreach ($data_produksi->result() as $key => $value): ?>
var elem = document.getElementById("inputan<?=$value->no?>");
elem.addEventListener("keydown",function(event){
var key = event.which;
if((key<48 || key>57) && key != 8) event.preventDefault();
});
elem.addEventListener("keyup",function(event){
var value = this.value.replace(/,/g,"");
this.dataset.currentValue=parseInt(value);
var caret = value.length-1;
while((caret-3)>-1)
{
caret -= 3;
value = value.split('');
value.splice(caret+1,0,",");
value = value.join('');
}
this.value = value;
});
<?php endforeach ?>
</script>
<script type="text/javascript">
function update_hasil()
{
var data = $('#hasil_produksi').serializeArray();
data = jQuery.grep(data, function(value) {
return value['name'] != 'tabel-data_length';
});
console.log(data);
<?php foreach ($data_produksi->result() as $key => $value): ?>
<?php if ($value->no <= 20): ?>
var inputan<?=$value->no?> = $('#inputan<?=$value->no?>') ;
<?php endif ?>
<?php endforeach ?>
<?php
$if = '';
foreach ($data_produksi->result() as $key => $value) {
if ($value->no <= 20) {
$if.='if (inputan'.$value->no.'.val() == "" ) {
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Kolum Inputan '.$value->no.' Harus Terisi");
inputan'.$value->no.'.focus();
}else ';
}
} echo $if;?>{
// console.log('sini');
$.ajax({
type: "post",
url: "<?=base_url()?>admin/prediksi",
data: {inputannya: data}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
// console.log(data1);
window.location.replace("<?=base_url()?>admin/prediksi/");
}
});
}
}
</script>
<script type="text/javascript">
function edit_kah(){
<?php
foreach ($data_produksi->result() as $key => $value) {
if ($value->no <= 20) {?>
$("#inputan<?=$value->no?>").prop("disabled", false);
<?php
}
}
?>
$('#edit_kah').hide();
$('#button_update').show();
$('#button_cancel').show();
}
function cancel_button(){
<?php
foreach ($data_produksi->result() as $key => $value) {
if ($value->no <= 20) {?>
$("#inputan<?=$value->no?>").prop("disabled", true);
$("#inputan<?=$value->no?>").val("<?=number_format($value->hasil)?>");
<?php
}
}
?>
$('#edit_kah').show();
$('#button_update').hide();
$('#button_cancel').hide();
}
$.ajax({
type: "post",
url: "<?=base_url()?>admin/json_hasil",
// data: {inputannya: data}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
// console.log(data1);
var data = JSON.parse(data1);
console.log(data);
// window.location.replace("<?=base_url()?>admin/data_produksi/");
new Morris.Line({
// ID of the element in which to draw the chart.
element: 'myfirstchart',
// Chart data records -- each entry in this array corresponds to a point on
// the chart.
data: data['ket'],
// The name of the data record attribute that contains x-values.
xkey: data['tahun'],
parseTime: false,
// A list of names of data record attributes that contain y-values.
ykeys: ['produksi','prediksi'],
// Labels for the ykeys -- will be displayed when you hover over the
// chart.
labels: ['Produksi','Prediksi'],
lineColors:['Green','Red']
});
}
});
</script>
<?php endif ?>
<?php endif ?>
<?php if ($this->uri->segment(2)== 'hasil_kecamatan'): ?>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"aLengthMenu": [[15, 30, 45, ,60, -1], [15, 30, 45, 60 ,"All"]],
"iDisplayLength": 15
// "pageLength": 5,
// "searching": false,
// "paging": false,
// "ordering": false,
// "info": false,
});
});
</script>
<script type="text/javascript">
function changeFuncKecamatan($i) {
var value = $i;
if (value == '' || value == null) {
value=0;
$.ajax({
type: "post",
url: "<?=base_url()?>admin/hasil_kecamatan",
data: {kecamatan: value}, // appears as $_GET['id'] @ your backend side
dataType: "html",
success: function(data1) {
$('#disini_tabel').html(data1);
}
});
}else{
$.ajax({
type: "post",
url: "<?=base_url()?>admin/hasil_kecamatan",
data: {kecamatan: value}, // appears as $_GET['id'] @ your backend side
dataType: "html",
success: function(data1) {
$('#disini_tabel').html(data1);
}
});
}
}
</script>
<?php endif ?>
<script src="<?=base_url()?>assets/scripts/main.min.js"></script>

View File

@ -0,0 +1,8 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
echo "\nERROR: ",
$heading,
"\n\n",
$message,
"\n\n";

View File

@ -0,0 +1,8 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
echo "\nDatabase error: ",
$heading,
"\n\n",
$message,
"\n\n";

View File

@ -0,0 +1,21 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
An uncaught Exception was encountered
Type: <?php echo get_class($exception), "\n"; ?>
Message: <?php echo $message, "\n"; ?>
Filename: <?php echo $exception->getFile(), "\n"; ?>
Line Number: <?php echo $exception->getLine(); ?>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
Backtrace:
<?php foreach ($exception->getTrace() as $error): ?>
<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?>
File: <?php echo $error['file'], "\n"; ?>
Line: <?php echo $error['line'], "\n"; ?>
Function: <?php echo $error['function'], "\n\n"; ?>
<?php endif ?>
<?php endforeach ?>
<?php endif ?>

View File

@ -0,0 +1,8 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
echo "\nERROR: ",
$heading,
"\n\n",
$message,
"\n\n";

View File

@ -0,0 +1,21 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
A PHP Error was encountered
Severity: <?php echo $severity, "\n"; ?>
Message: <?php echo $message, "\n"; ?>
Filename: <?php echo $filepath, "\n"; ?>
Line Number: <?php echo $line; ?>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
Backtrace:
<?php foreach (debug_backtrace() as $error): ?>
<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?>
File: <?php echo $error['file'], "\n"; ?>
Line: <?php echo $error['line'], "\n"; ?>
Function: <?php echo $error['function'], "\n\n"; ?>
<?php endif ?>
<?php endforeach ?>
<?php endif ?>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>404 Page Not Found</title>
<style type="text/css">
::selection { background-color: #E13300; color: white; }
::-moz-selection { background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html>

View File

@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Database Error</title>
<style type="text/css">
::selection { background-color: #E13300; color: white; }
::-moz-selection { background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html>

View File

@ -0,0 +1,32 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>An uncaught Exception was encountered</h4>
<p>Type: <?php echo get_class($exception); ?></p>
<p>Message: <?php echo $message; ?></p>
<p>Filename: <?php echo $exception->getFile(); ?></p>
<p>Line Number: <?php echo $exception->getLine(); ?></p>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
<p>Backtrace:</p>
<?php foreach ($exception->getTrace() as $error): ?>
<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?>
<p style="margin-left:10px">
File: <?php echo $error['file']; ?><br />
Line: <?php echo $error['line']; ?><br />
Function: <?php echo $error['function']; ?>
</p>
<?php endif ?>
<?php endforeach ?>
<?php endif ?>
</div>

View File

@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
<style type="text/css">
::selection { background-color: #E13300; color: white; }
::-moz-selection { background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html>

View File

@ -0,0 +1,33 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: <?php echo $severity; ?></p>
<p>Message: <?php echo $message; ?></p>
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
<p>Backtrace:</p>
<?php foreach (debug_backtrace() as $error): ?>
<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?>
<p style="margin-left:10px">
File: <?php echo $error['file'] ?><br />
Line: <?php echo $error['line'] ?><br />
Function: <?php echo $error['function'] ?>
</p>
<?php endif ?>
<?php endforeach ?>
<?php endif ?>
</div>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-404.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Home</title>
<link rel="stylesheet" href="<?=base_url()?>assets/styles/style.min.css">
<!-- Waves Effect -->
<link rel="stylesheet" href="<?=base_url()?>assets/plugin/waves/waves.min.css">
</head>
<body>
<div id="page-404">
<div class="content">
<div class="title-on-desktop">
<svg style="width: 600px; height: 200px" alignment-baseline="middle">
<defs>
<clipPath id="clip2">
<path d="M 0 0 L 600 0 L 600 80 L 0 80 L 0 0 L 0 125 L 600 125 L 600 200 L 0 200 Z" />
</clipPath>
</defs>
<text x="300" y="190" style="width: 600px; height: 200px" text-anchor="middle" font-family="Lato" font-weight="700" font-size="250" fill="#505458" clip-path="url(#clip2)">4<tspan fill="#35b8e0">0</tspan>4</text>
</svg>
<div class="title">Halaman Tidak Ditemukan</div>
</div>
<h1 class="title-on-mobile">Error 404: Halaman Tidak Ditemukan</h1>
<p>Sepertinya Anda Mencoba Untuk Memasuki Wilayah Terbatas. Jan Takut Bosku..Aman Itu...Klik Saja <b>"Kembali"</b>...Ndak Da Masalah...HAHAHAHAHAH</p>
<?php
if ($this->session->userdata('penyuluh') != '' and $this->session->userdata('pembeli') != null) {
$url = base_url('penyuluh');
}elseif ($this->session->userdata('level') != '' and $this->session->userdata('level') == 'Admin') {
$url = base_url('admin');
}elseif ($this->session->userdata('level') != '' and $this->session->userdata('level') == 'Petambak') {
$url = base_url('petambak');
}else{
$url = base_url();
}
?>
<a href="<?=$url?>" class="btn btn-info">Kembali BOSKU</a>
</div>
</div><!--/#single-wrapper -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/script/html5shiv.min.js"></script>
<script src="assets/script/respond.min.js"></script>
<![endif]-->
<!--
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="<?=base_url()?>assets/scripts/jquery.min.js"></script>
<script src="<?=base_url()?>assets/scripts/modernizr.min.js"></script>
<script src="<?=base_url()?>assets/plugin/bootstrap/js/bootstrap.min.js"></script>
<script src="<?=base_url()?>assets/plugin/nprogress/nprogress.js"></script>
<script src="<?=base_url()?>assets/plugin/waves/waves.min.js"></script>
<script src="<?=base_url()?>assets/scripts/main.min.js"></script>
</body>
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-404.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
</html>

View File

@ -0,0 +1,14 @@
<div class="fixed-navbar">
<div class="pull-left">
<button type="button" class="menu-mobile-button glyphicon glyphicon-menu-hamburger js__menu_mobile"></button>
<h1 class="page-title">Sistem Analisa Produksi Perikanan Tambak</h1>
<!-- /.page-title -->
</div>
<!-- /.pull-left -->
<div class="pull-right">
<!-- /.ico-item -->
<!-- <a href="#" class="ico-item mdi mdi-logout js__logout"></a> -->
</div>
<!-- /.pull-right -->
</div>

View File

@ -0,0 +1,8 @@
<footer class="footer">
<ul class="list-inline">
<li>2020 © SAPITA.</li>
<li><a href="#">Privacy</a></li>
<li><a href="#">Terms</a></li>
<li><a href="#">Help</a></li>
</ul>
</footer>

View File

@ -0,0 +1,46 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<title>SAPITA - <?=$header?></title>
<!-- Main Styles -->
<link rel="stylesheet" href="<?=base_url()?>assets/styles/style.min.css">
<!-- Material Design Icon -->
<link rel="stylesheet" href="<?=base_url()?>assets/fonts/material-design/css/materialdesignicons.css">
<!-- mCustomScrollbar -->
<link rel="stylesheet" href="<?=base_url()?>assets/plugin/datatables/media/css/dataTables.bootstrap.min.css">
<link rel="stylesheet" href="<?=base_url()?>assets/plugin/datatables/extensions/Responsive/css/responsive.bootstrap.min.css">
<!-- Sweet Alert -->
<link rel="stylesheet" href="<?=base_url()?>assets/plugin/sweet-alert/sweetalert.css">
<style>
#map_canvas {
height: 600px;
width: 100%;
margin: 0px;
padding: 0px
}
.nowrap {
white-space: nowrap ;
}
</style>
<?php if ($this->uri->segment(2) == '' or $this->uri->segment(2) == null): ?>
<link rel="stylesheet" href="<?php echo base_url() ?>assets/plugin/chart/morris/morris.css">
<script src="<?php echo base_url() ?>assets/scripts/jquery.min.js"></script>
<script src="<?php echo base_url() ?>assets/plugin/chart/morris/morris.min.js"></script>
<script src="<?php echo base_url() ?>assets/plugin/chart/morris/raphael-min.js"></script>
<script src="<?php echo base_url() ?>assets/scripts/chart.morris.init.min.js"></script>
<?php endif ?>
</head>

View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:47:34 GMT -->
<?php $this->load->view("home/head"); ?>
<body>
<?php $this->load->view('home/main_menu'); ?>
<!-- /.main-menu -->
<?php $this->load->view("home/fixed_navbar") ; ?>
<!-- /.fixed-navbar -->
<!-- /#notification-popup -->
<!-- /#message-popup -->
<div id="wrapper">
<div class="main-content">
<?php $this->load->view($main); ?>
<!-- /.row -->
<?php $this->load->view("home/footer"); ?>
</div>
<!-- /.main-content -->
</div><!--/#wrapper -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/script/html5shiv.min.js"></script>
<script src="assets/script/respond.min.js"></script>
<![endif]-->
<!--
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<?php $this->load->view("home/script"); ?>
</body>
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:09 GMT -->
</html>

View File

@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<title><?=$header?></title>
<link rel="stylesheet" href="<?=base_url()?>assets/styles/style.min.css">
<!-- Waves Effect -->
<link rel="stylesheet" href="<?=base_url()?>assets/plugin/waves/waves.min.css">
</head>
<body>
<div id="single-wrapper">
<form method="post" class="frm-single">
<div class="inside">
<div class="title"><strong>SAPITA</strong></div>
<!-- /.title -->
<div class="frm-title">Login</div>
<!-- /.frm-title -->
<div class="frm-input"><input type="text" placeholder="Username" class="frm-inp" name="username"><i class="fa fa-user frm-ico"></i></div>
<!-- /.frm-input -->
<div class="frm-input"><input type="password" placeholder="Password" class="frm-inp" name="password"><i class="fa fa-lock frm-ico"></i></div>
<input type="submit" class="frm-submit" name="login" value="Login">
<!-- /.row -->
<a href="<?=base_url()?>home/pendaftaran" class="a-link"><i class="fa fa-archive"></i>Silakan Daftar Lahan Anda.</a>
<div class="frm-footer">Dinas Pertanian Kelautan Dan Perikanan <br> Kota Parepare © 2020.</div>
<!-- /.footer -->
</div>
<!-- .inside -->
</form>
<!-- /.frm-single -->
</div><!--/#single-wrapper -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/script/html5shiv.min.js"></script>
<script src="assets/script/respond.min.js"></script>
<![endif]-->
<!--
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="<?=base_url()?>assets/scripts/jquery.min.js"></script>
<script src="<?=base_url()?>assets/scripts/modernizr.min.js"></script>
<script src="<?=base_url()?>assets/plugin/bootstrap/js/bootstrap.min.js"></script>
<script src="<?=base_url()?>assets/plugin/nprogress/nprogress.js"></script>
<script src="<?=base_url()?>assets/plugin/waves/waves.min.js"></script>
<script src="<?=base_url()?>assets/plugin/toastr/toastr.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>assets/plugin/toastr/toastr.css">
<?php if ($this->session->flashdata('warning')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.warning("<?php echo $this->session->flashdata('warning')?>");
</script>
<?php endif ?>
<script src="<?=base_url()?>assets/scripts/main.min.js"></script>
</body>
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
</html>

View File

@ -0,0 +1,255 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Luas Kota Parepare : <span class="nowrap" id="luas1"></span> Ha </h4>
<h4 class="box-title">Jumlah Tambak : <?=count($lahan->result())?> </h4>
<div class="box-content">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript">
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 12,
center: new google.maps.LatLng(-4.0741291, 119.63409424),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
<?php ////////////// sini awal tampil kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
var polygon_<?=$value->id_kecamatan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "#B85612",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil kecamatan ////////////////////////// ?>
<?php ////////////// sini awal tampil lahan ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) { ?>
<?php
if ($value->tek_tambak == 1) {
$color = "#FE2D00";
}elseif ($value->tek_tambak == 2) {
$color = "#77FE00";
}elseif ($value->tek_tambak == 3) {
$color = "#1F00FE";
}
?>
var lahan_<?=$value->id_lahan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->point?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil lahan ////////////////////////// ?>
<?php ////////////// sini awal infowindows kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
google.maps.event.addListener(polygon_<?=$value->id_kecamatan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$value->kecamatan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < polygon_<?=$value->id_kecamatan?>.getPath().getLength(); i++) {
bounds.extend(polygon_<?=$value->id_kecamatan?>.getPath().getAt(i));
}
<?php } ?>
<?php ////////////// sini akhir infowindows kecamatan ////////////////////////// ?>
<?php ////////////// sini awal infowindows lahan ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) {
$cek_tek_tambak = $this->mhome->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->mhome->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
$cek_kecamatan = $this->mhome->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $value->kecamatan));
foreach ($cek_kecamatan->result() as $key4 => $value4) ;
?>
google.maps.event.addListener(lahan_<?=$value->id_lahan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>ID Lahan: <?=$value->id_lahan?></h5>"+
"<h5>Teknologi Tambak : <?=$value2->tambak?></h5>"+
"<h5>Kecamatan : <?=$value4->kecamatan?></h5>"+
"<h5>Kelurahan : <?=$value3->kelurahan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
'<center><a href="<?=base_url()?>home/data_petambak/<?=$value->id_lahan?>"><button type="button" title="Lihat Informasi Lahan" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a></center>'+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < lahan_<?=$value->id_lahan?>.getPath().getLength(); i++) {
bounds.extend(lahan_<?=$value->id_lahan?>.getPath().getAt(i));
}
<?php } ?>
<?php ////////////// sini akhir infowindows lahan ////////////////////////// ?>
<?php ////////////// sini awal kira luas parepare ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
var luasl<?=$value->id_kecamatan?> =google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath());
<?php } ?>
var luaslahan = <?php foreach ($kecamatan->result() as $key => $value) { echo "luasl".$value->id_kecamatan."+";} ?>0;
luaslahan = luaslahan / 10000;
document.getElementById("luas1").innerHTML = numberWithCommas(luaslahan.toFixed(2));
<?php ////////////// sini akhir kira luas parepare ////////////////////////// ?>
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
// document.getElementById('luas').value = luas;
</script>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
</div>
<!-- /.box-content -->
</div>
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Grafik Produksi Dan Prediksi</h4>
<div class="card-content">
<div id="myfirstchart" style="height: 400px;"></div>
</div>
</div>
</div>
</div>
<?php
$kira = count($cek_hasil->result()) - 1;
$jumlah = 0;
// print_r($kira);
foreach ($cek_hasil->result() as $key => $value) {
$hasil[$key] = $value->hasil;
}
// $jumlah = ($hasil[$kira-3] + $hasil[$kira-2] + $hasil[$kira-1])/3;
$jumlah = ($hasil[$kira-3] + $hasil[$kira-2] + $hasil[$kira-1])/3;
$hasil = $cek_hasil->result()[$kira]->hasil;
$tahun = $cek_hasil->result_array()[$kira]['tahun'];
$musim = $cek_hasil->result_array()[$kira]['musim'];
// print_r($hasil[$kira]);
?>
<div class="row small-spacing">
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="box-content bg-success text-white">
<div class="statistics-box with-icon">
<i class="ico small fa fa-diamond"></i>
<p class="text text-white">Produksi Tahun <?=$tahun?> Musim <?=$musim?></p>
<h2 class="counter"><?=number_format(round($hasil,0))?> Kg</h2>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-3 col-md-6 col-xs-12 -->
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="box-content bg-info text-white">
<div class="statistics-box with-icon">
<i class="ico small fa fa-download"></i>
<p class="text text-white">Prediksi Tahun <?=$tahun?> Musim <?=$musim?></p>
<h2 class="counter"><?=number_format(round($jumlah,0))?> Kg</h2>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-3 col-md-6 col-xs-12 -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,85 @@
<div class="main-menu">
<header class="header">
<a href="<?=base_url()?>" class="logo"><img src="<?=base_url()?>logo.png" width="25" height="25"> SAPITA</a>
<!-- <button type="button" class="button-close fa fa-times js__menu_close"></button> -->
<div class="user">
<a href="#" class="avatar"><img src="<?=base_url()?>logo.png" alt="" width="50" height="50"></a>
<h4><a href="#">Guest</a></h4>
<!-- <h5 class="position">Administrator</h5> -->
<!-- /.name -->
<!-- /.control-wrap -->
</div>
<!-- /.user -->
</header>
<!-- /.header -->
<div class="content">
<div class="navigation">
<h5 class="title">Menu</h5>
<!-- /.title -->
<ul class="menu js__accordion">
<li <?php if ($this->uri->segment(2) == '' or $this->uri->segment(2) == 'data_petambak') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>"><i class="menu-icon mdi mdi-view-dashboard"></i><span>Halaman Utama</span></a>
</li>
<!-- <li>
<a class="waves-effect" href="index-2.html"><i class="menu-icon mdi mdi-desktop-mac"></i><span>ADMIN</span></a>
</li> -->
<li <?php if ($this->uri->segment(2) == 'pendaftaran') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>home/pendaftaran"><i class="menu-icon mdi mdi-cube-outline"></i><span>Pendaftaran</a>
</li>
<li>
<a class="waves-effect" href="<?=base_url()?>home/login"><i class="menu-icon mdi mdi-calendar"></i><span>Login</span></a>
</li>
<li>
&nbsp<br>&nbsp
</li>
</ul>
<!-- /.menu js__accordion -->
<!-- <h5 class="title">KECAMATAN</h5> -->
<!-- /.title -->
<!-- <ul class="menu js__accordion"> -->
<!-- <li <?php if ($this->uri->segment(2) == 'kecamatan' and $this->uri->segment(3) == '1') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>home/kecamatan/1"><i class="menu-icon mdi mdi-calendar"></i><span>BACUKIKI BARAT</span></a>
</li>
<li <?php if ($this->uri->segment(2) == 'kecamatan' and $this->uri->segment(3) == '2') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>home/kecamatan/2"><i class="menu-icon mdi mdi-calendar"></i><span>BACUKIKI</span></a>
</li>
<li <?php if ($this->uri->segment(2) == 'kecamatan' and $this->uri->segment(3) == '4') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>home/kecamatan/4"><i class="menu-icon mdi mdi-calendar"></i><span>UJUNG</span></a>
</li>
<li <?php if ($this->uri->segment(2) == 'kecamatan' and $this->uri->segment(3) == '3') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>home/kecamatan/3"><i class="menu-icon mdi mdi-calendar"></i><span>SOREANG</span></a>
</li>
<?php foreach ($kecamatan->result() as $key => $value): ?>
<li <?php if ($this->uri->segment(2) == 'kecamatan' and $this->uri->segment(3) == '<?=$value->id_kecamatan?>') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>home/kecamatan/<?=$value->id_kecamatan?>"><i class="menu-icon mdi mdi-calendar"></i><span><?=$value->kecamatan?></span></a>
</li>
<?php endforeach ?> -->
<!-- </ul> -->
<!-- /.menu js__accordion -->
</div>
<!-- /.navigation -->
</div>
<!-- /.content -->
</div>

View File

@ -0,0 +1,255 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Daftar Transaksi Produksi</h4>
<div class="card-content">
<div class="form-group" style="overflow-x: auto" id="tabel_transaksi">
<table id="tabel-data" class="table table-bordered">
<thead>
<tr>
<th>No</th>
<th>Tahun</th>
<th>Musim</th>
<th>Hasil</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php if (count($data_transaksi_produksi->result())>0): ?>
<?php foreach ($data_transaksi_produksi->result() as $key => $value):
$ket = json_decode($value->ket);
?>
<?php $i=1; foreach ($ket as $key1 => $value1): ?>
<tr>
<td><?=$i?></td>
<td><?=$value1->tahun?></td>
<td><?=$value1->musim?></td>
<td><?=$value1->jumlah_produksi?></td>
<td align="center">
<a href="<?=base_url()?>home/data_petambak/lihat/<?=$this->uri->segment(3)?>/<?=$value1->tahun?>-<?=$value1->musim?>"><button type="button" title="Lihat Transaksi Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
<?php endforeach ?>
<?php endif ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Luas Lahan Petambak : <span class="nowrap" id="luas1"></span> Ha </h4>
<h4 class="box-title">Jumlah Lahan : <?=count($lahan->result())?> </h4>
<div class="card-content">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript">
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 12,
center: new google.maps.LatLng(-4.0741291, 119.63409424),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
<?php ////////////// sini awal tampil kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
<?php
if ($value->id_kecamatan == 1) {
$color = "#5C00B3";
}elseif ($value->id_kecamatan == 2) {
$color = "#FFFF00";
}elseif ($value->id_kecamatan == 3) {
$color = "#0D0811";
}elseif ($value->id_kecamatan == 4) {
$color = "#B85612";
}
?>
var polygon_<?=$value->id_kecamatan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil kecamatan ////////////////////////// ?>
<?php ////////////// sini awal tampil lahan ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) { ?>
<?php
if ($value->tek_tambak == 1) {
$color = "#FE2D00";
}elseif ($value->tek_tambak == 2) {
$color = "#77FE00";
}elseif ($value->tek_tambak == 3) {
$color = "#1F00FE";
}
?>
var lahan_<?=$value->id_lahan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->point?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil lahan ////////////////////////// ?>
<?php ////////////// sini awal infowindows kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
google.maps.event.addListener(polygon_<?=$value->id_kecamatan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$value->kecamatan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
// for (var i = 0; i < polygon_<?=$value->id_kecamatan?>.getPath().getLength(); i++) {
// bounds.extend(polygon_<?=$value->id_kecamatan?>.getPath().getAt(i));
// }
<?php } ?>
<?php ////////////// sini akhir infowindows kecamatan ////////////////////////// ?>
<?php ////////////// sini awal infowindows lahan ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) {
$cek_tek_tambak = $this->mhome->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->mhome->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
$cek_kecamatan = $this->mhome->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $value->kecamatan));
foreach ($cek_kecamatan->result() as $key4 => $value4) ;
?>
google.maps.event.addListener(lahan_<?=$value->id_lahan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>ID Lahan: <?=$value->id_lahan?></h5>"+
"<h5>Teknologi Tambak : <?=$value2->tambak?></h5>"+
"<h5>Kecamatan : <?=$value4->kecamatan?></h5>"+
"<h5>Kelurahan : <?=$value3->kelurahan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < lahan_<?=$value->id_lahan?>.getPath().getLength(); i++) {
bounds.extend(lahan_<?=$value->id_lahan?>.getPath().getAt(i));
}
<?php } ?>
<?php ////////////// sini akhir infowindows lahan ////////////////////////// ?>
<?php ////////////// sini awal kira luas lahan petambak ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) { ?>
var luasl<?=$value->id_lahan?> =google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath());
<?php } ?>
var luaslahan = <?php foreach ($lahan->result() as $key => $value) { echo "luasl".$value->id_lahan."+";} ?>0;
luaslahan = luaslahan / 10000;
document.getElementById("luas1").innerHTML = numberWithCommas(luaslahan.toFixed(2));
<?php ////////////// sini akhir kira luas lahan petambak ////////////////////////// ?>
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
// document.getElementById('luas').value = luas;
</script>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,329 @@
<div class="row small-spacing">
<?php
$tahunnya = explode('-',$this->uri->segment(5));
?>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-xs-12 col-lg-12">
<div class="box-content card">
<h4 class="box-title">Daftar Transaksi Produksi</h4>
<div class="card-content">
<div class="form-group" style="overflow-x: auto" id="tabel_transaksi">
<table id="tabel-data" class="table table-bordered">
<thead>
<tr>
<th>No</th>
<th>Tahun</th>
<th>Musim</th>
<th>Hasil</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php if (count($data_transaksi_produksi->result())>0): ?>
<?php foreach ($data_transaksi_produksi->result() as $key => $value):
$ket = json_decode($value->ket);
?>
<?php $i=1; foreach ($ket as $key1 => $value1): ?>
<tr>
<td><?=$i?></td>
<td><?=$value1->tahun?></td>
<td><?=$value1->musim?></td>
<td><?=$value1->jumlah_produksi?></td>
<td align="center">
<a href="<?=base_url()?>home/data_petambak/lihat/<?=$kode_lahan?>/<?=$value1->tahun?>-<?=$value1->musim?>"><button type="button" title="Lihat Transaksi Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
<?php endforeach ?>
<?php endif ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-xs-12">
<div class="box-content card ">
<h4 class="box-title">Form Transaksi Produksi Tahun <?=$tahunnya[0]?> Musim <?=$tahunnya[1]?> </h4>
<!-- /.box-title -->
<div class="card-content">
<?php foreach ($lahan->result() as $key => $value) ;
$cari_data_harga = $this->mhome->tampil_data_where('tb_tambak',array('id_tambak' =>$value->tek_tambak));
foreach ($cari_data_harga->result() as $key3 => $value3);
$ket = json_decode($value3->ket);
?>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Kode Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->id_lahan?>" title="ID Lahan" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Luas Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->luas_lahan?> Ha" title="Luas Lahan" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jenis Tambak</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value3->tambak?>" title="Jenis Tambak" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Waktu Tebar</label>
<div class="col-sm-4">
<?php
$min_date = date('Y-m-d');
$min_date = new DateTime($min_date);
$min_date->modify('-30 day');
$min_date =date('Y-m-d', strtotime($min_date->format('Y-m-d')));
$max_date = date('Y-m-d');
$max_date = new DateTime($max_date);
$max_date->modify('+30 day');
$max_date =date('Y-m-d', strtotime($max_date->format('Y-m-d')));
// print_r($ket_nya);
$produksi_pya = $ket_nya['ket_elemen_produksi'];
// print_r($produksi_pya);
$jumlah_produksi = round(($produksi_pya[1]*0.02)+$ket_nya['masa_tumbuh']-150);
$ekor = $produksi_pya[1];
$saiz = ceil(($ekor / $jumlah_produksi) - (($ket_nya['masa_tumbuh']/($ekor / $jumlah_produksi))*13));
foreach ($produksi_pya as $key4 => $value4) {
if ($key4 != 4) {
$jumlah_ini[$key4] = $value4;
}else{
$jumlah_ini[$key4] = $value4 * $ket_nya['masa_tumbuh'];
}
}
if ($saiz >= 45) {
$hargajual = 35000;
}elseif ($saiz >= 30) {
$hargajual = 60000;
}elseif ($saiz >= 25) {
$hargajual = 80000;
}elseif ($saiz >= 20) {
$hargajual = 110000;
}elseif ($saiz >= 17) {
$hargajual = 120000;
}elseif ($saiz >= 8) {
$hargajual = 180000;
}elseif ($saiz >= 1) {
$hargajual = 185000;
}
// print_r($jumlah_ini);
$nilaiproduksi = $hargajual * $jumlah_produksi;
?>
<input type="date" class="form-control" id="tanggal" title="Waktu Tebar" min="<?=$min_date?>" max="<?=$max_date?>" value="<?=$ket_nya['waktu_tebar']?>" disabled>
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inp-type-1" class="col-sm-5 control-label">Masa Tumbuh :</label>
<div class="col-sm-4">
<select class="form-control" id="masa_tumbuh" disabled="">
<option value="" disabled="">-Sila Pilih Masa Pertumbuhan</option>
<option value="60" <?php if ($ket_nya['masa_tumbuh'] == 60): ?>selected <?php endif ?>>60</option>
<option value="90" <?php if ($ket_nya['masa_tumbuh'] == 90): ?>selected <?php endif ?>>90</option>
<option value="150" <?php if ($ket_nya['masa_tumbuh'] == 150): ?>selected <?php endif ?> >150</option>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</div>
<div id="sinitabel">
<form class="form-horizontal" style="overflow-x: auto" id="elemen_produksi">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>Bahan</th>
<th>Harga</th>
<th width="20%">Satuan</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$ket = json_decode($value3->ket);
$satuan = json_decode($value3->satuan);
$r = 1;
$biaya = 0;
// print_r($satuan->$r);
foreach ($elemen_produksi->result() as $key2 => $value2):
$no = $value2->id_elemen;
$satu = $satuan->$no;
$harga = $ket->$no;
if ($harga == '' and $harga == null) {
$harga = '';
}else{
$harga = number_format($harga);
}
$jumlah = $jumlah_ini[$value2->id_elemen] * $ket->$no;
// if ($produksi_pya['Tenaga']) {
// $satu = $satu * $harga;
// }else{
// $satu = $satu * $harga * $hari;
// }
$biaya = $biaya + $jumlah;
?>
<tr>
<td><?=$value2->nama_elemen?></td>
<td>Rp. <?=$harga?> </td>
<td>
<input type="text" style="width: 200px;" class="form-control" id="inputan<?=$no?>" placeholder="Jumlah <?=$value2->nama_elemen?>" name="<?=$value2->id_elemen?>" minlegth='5' maxlength='10' value='<?=number_format($produksi_pya[$value2->id_elemen])?>' disabled>
</td>
<td>Rp. <?=number_format($jumlah)?></td>
</tr>
<?php endforeach ;
$persiapan_lahan = $biaya * 10 / 100;
$totalbiaya = $biaya + $persiapan_lahan;
$keuntungan = $nilaiproduksi - $biaya - $persiapan_lahan;
if ($keuntungan <= 0 ) {
$status = 'Tidak Berhasil';
}else{
$status = 'Berhasil';
}
?>
</tbody>
</table>
</form>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jumlah Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=number_format($jumlah_produksi)?> kg" title="Jumlah Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
<div class="form-horizontal">
<div class="form-group">
<center><button type="button" class="btn btn-primary btn-sm waves-effect waves-light" onclick="submitdata()" id="button_submit" style="display: none">Proses Transaksi Produksi</button> &nbsp &nbsp <a href="<?=base_url()?>penyuluh/transaksi/lihat/<?=$this->uri->segment(4).'/'.$this->uri->segment(5)?>"><button type="button" class="btn btn-danger btn-sm waves-effect waves-light" id="button_batal" style="display: none">Batal Edit</button></a><button type="button" class="btn btn-warning btn-sm waves-effect waves-light" onclick="editdata()" id="button_edit" style="display: none">Edit Transaksi Produksi ?</button></center>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
<!-- /.box-content card white -->
</div>
<div id="detailsini">
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<!-- /.box-title -->
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Panen</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Panen" value="<?=$ket_nya['masa_panen']?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Saiz</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Saiz" value="+- <?=$saiz?> ekor/kg" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Total Biaya</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Jumlah" value="Rp . <?=number_format($totalbiaya)?>" disabled="">
</div>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Harga Jual</label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="Enter your email" title="Harga Jual" value="Rp. <?=number_format($hargajual)?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Nilai Produksi</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Nilai" value="Rp. <?=number_format($nilaiproduksi)?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Keuntungan</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Keuntungan" value="Rp. <?=number_format($keuntungan)?>" disabled="">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Status Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$status?>" title="Status Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,269 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Luas Kota Parepare : <span class="nowrap" id="luas1"></span> Ha </h4>
<h4 class="box-title">Jumlah Tambak : <?=count($lahan->result())?> </h4>
<div class="box-content">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript">
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 12,
center: new google.maps.LatLng(-4.0741291, 119.63409424),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
<?php ////////////// sini awal tampil kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
<?php
if ($value->id_kecamatan == 1) {
$color = "#5C00B3";
}elseif ($value->id_kecamatan == 2) {
$color = "#FFFF00";
}elseif ($value->id_kecamatan == 3) {
$color = "#0D0811";
}elseif ($value->id_kecamatan == 4) {
$color = "#B85612";
}
?>
var polygon_<?=$value->id_kecamatan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil kecamatan ////////////////////////// ?>
<?php ////////////// sini awal tampil lahan ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) { ?>
<?php
if ($value->tek_tambak == 1) {
$color = "#FE2D00";
}elseif ($value->tek_tambak == 2) {
$color = "#77FE00";
}elseif ($value->tek_tambak == 3) {
$color = "#1F00FE";
}
?>
var lahan_<?=$value->id_lahan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->point?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil lahan ////////////////////////// ?>
<?php ////////////// sini awal infowindows kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
google.maps.event.addListener(polygon_<?=$value->id_kecamatan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$value->kecamatan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < polygon_<?=$value->id_kecamatan?>.getPath().getLength(); i++) {
bounds.extend(polygon_<?=$value->id_kecamatan?>.getPath().getAt(i));
}
<?php } ?>
<?php ////////////// sini akhir infowindows kecamatan ////////////////////////// ?>
<?php ////////////// sini awal infowindows lahan ////////////////////////// ?>
<?php foreach ($lahan->result() as $key => $value) {
$cek_tek_tambak = $this->mhome->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->mhome->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
$cek_kecamatan = $this->mhome->tampil_data_where('tb_kecamatan',array('id_kecamatan' => $value->kecamatan));
foreach ($cek_kecamatan->result() as $key4 => $value4) ;
?>
google.maps.event.addListener(lahan_<?=$value->id_lahan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>ID Lahan: <?=$value->id_lahan?></h5>"+
"<h5>Teknologi Tambak : <?=$value2->tambak?></h5>"+
"<h5>Kecamatan : <?=$value4->kecamatan?></h5>"+
"<h5>Kelurahan : <?=$value3->kelurahan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
'<center><a href="<?=base_url()?>home/data_petambak/<?=$value->id_lahan?>"><button type="button" title="Lihat Informasi Lahan" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a></center>'+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < lahan_<?=$value->id_lahan?>.getPath().getLength(); i++) {
bounds.extend(lahan_<?=$value->id_lahan?>.getPath().getAt(i));
}
<?php } ?>
<?php ////////////// sini akhir infowindows lahan ////////////////////////// ?>
<?php ////////////// sini awal kira luas parepare ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
var luasl<?=$value->id_kecamatan?> =google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath());
<?php } ?>
var luaslahan = <?php foreach ($kecamatan->result() as $key => $value) { echo "luasl".$value->id_kecamatan."+";} ?>0;
luaslahan = luaslahan / 10000;
document.getElementById("luas1").innerHTML = numberWithCommas(luaslahan.toFixed(2));
<?php ////////////// sini akhir kira luas parepare ////////////////////////// ?>
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
// document.getElementById('luas').value = luas;
</script>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
</div>
<!-- /.box-content -->
</div>
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Hasil Produksi Kecamatan</h4>
<div class="card-content">
<div class="form-group" style="overflow-x: auto" id="tabel_transaksi">
<table id="tabel-data" class="table table-bordered">
<thead>
<tr>
<th>No</th>
<th>Tahun</th>
<th>Musim</th>
<th>Hasil Produksi</th>
</tr>
</thead>
<tbody>
<?php
$cek_musim = $this->mhome->tampil_data_keseluruhan('tb_hasil_produksi');
foreach ($cek_musim->result() as $key => $value){
if ($value->tahun >= 2020) {
$hasil[$value->tahun.$value->musim] = 0;
}
}
$i = 1;
$cek_data = $this->mhome->produksi_kecamatan($this->uri->segment(3));
// print_r(count($cek_data->result()));
if (count($cek_data->result()) > 0) {
foreach ($cek_data->result() as $key1 => $value1) {
$ket = json_decode($value1->ket,true);
foreach ($ket as $key2 => $value2) {
// print_r($value2['jumlah_produksi']);print_r('<br>');
$hasil[$value2['tahun'].$value2['musim']] = $hasil[$value2['tahun'].$value2['musim']] + $value2['jumlah_produksi'];
}
}
}
foreach ($cek_musim->result() as $key => $value){
if ($value->tahun >= 2020) {
?>
<tr>
<td><?=$i;$i++?></td>
<td><?=$value->tahun?></td>
<td><?=$value->musim?></td>
<td><?=$hasil[$value->tahun.$value->musim]?></td>
</tr>
<?php } } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,256 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content">
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">PILIH KECAMATAN :</label>
<div class="col-sm-6">
<select class="form-control" onchange="changeFuncKecamatan(value);">
<option value="">-Pilih Kecamatan</option>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
<option value="<?=$value->id_kecamatan?>"><?=$value->kecamatan?></option>
<?php } ?>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">PILIH KELURAHAN :</label>
<div class="col-sm-6">
<select class="form-control" disabled="">
<option value="">-Sila Pilih Kecamatan Dulu</option>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">N I K :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Pilih Kecamatan dan Kelurahan Dulu" disabled="">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">Nama Lengkap :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Pilih Kecamatan dan Kelurahan Dulu" disabled="">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
</div>
<!-- /.box-content -->
</div>
<div class="col-xs-12">
<div class="box-content">
<!-- <div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">ID LOKASI :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Otomatis">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div> -->
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">NO PBB :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Pilih Kecamatan dan Kelurahan Dulu" disabled="">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<!-- <div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">Luas Lahan: :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Otomatis">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div> -->
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">Teknologi Tambak :</label>
<div class="col-sm-6">
<select class="form-control" disabled="">
<option value="">-Pilih Kecamatan dan Kelurahan Dulu</option>
<!-- <option value="1">1</option>
<option value="2">2</option> -->
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
</div>
<!-- /.box-content -->
</div>
<div class="col-xs-12">
<div class="box-content">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript" >
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 16,
center: new google.maps.LatLng(-2.247762, 119.373063),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
<?php ///////////////// awal untuk kordinat//////////////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
var polygon_<?=$value->id_kecamatan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "#B85612",
fillOpacity: 0.4,
});
<?php } ?>
<?php ///////////////// akhir untuk kordinat//////////////////////////////////// ?>
<?php //////////////// awal untuk infowindows ///////////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
google.maps.event.addListener(polygon_<?=$value->id_kecamatan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$value->kecamatan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < polygon_<?=$value->id_kecamatan?>.getPath().getLength(); i++) {
bounds.extend(polygon_<?=$value->id_kecamatan?>.getPath().getAt(i));
}
<?php } ?>
map.fitBounds(bounds);
<?php //////////////// akhir untuk infowindows ///////////////////////////////// ?>
}
google.maps.event.addDomListener(window, 'load', initialize);
// document.getElementById('luas').value = luas;
</script>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
</div>
<div class="row small-spacing">
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="box-content bg-success text-white">
<div class="statistics-box with-icon">
<i class="ico small fa fa-diamond"></i>
<p class="text text-white">Produksi Sebelumnya</p>
<h2 class="counter">?? Kg</h2>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-3 col-md-6 col-xs-12 -->
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="box-content bg-info text-white">
<div class="statistics-box with-icon">
<i class="ico small fa fa-download"></i>
<p class="text text-white">Prediksi Produksi</p>
<h2 class="counter">?? Kg</h2>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-3 col-md-6 col-xs-12 -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,265 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content">
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">PILIH KECAMATAN :</label>
<div class="col-sm-6">
<select class="form-control" onchange="changeFuncKecamatan(value);">
<option value="" se>-Pilih Kecamatan</option>
<?php foreach ($kecamatan->result() as $key => $value) {
if ($this->uri->segment(3) == $value->id_kecamatan) {
$selected = "selected";
}else{
$selected = '';
}
?>
<option value="<?=$value->id_kecamatan?>" <?=$selected?>><?=$value->kecamatan?></option>
<?php } ?>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">PILIH KELURAHAN :</label>
<div class="col-sm-6">
<select class="form-control" onchange="changeFuncKelurahan(value);">
<option value="">-Pilih Kelurahan</option>
<?php foreach ($kelurahan->result() as $key => $value) { ?>
<option value="<?=$value->id_kelurahan?>"><?=$value->kelurahan?></option>
<?php } ?>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">N I K :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Pilih Kecamatan dan Kelurahan Dulu" disabled="">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">Nama Lengkap :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Pilih Kecamatan dan Kelurahan Dulu" disabled="">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
</div>
<!-- /.box-content -->
</div>
<div class="col-xs-12">
<div class="box-content">
<!-- <div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">ID LOKASI :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Otomatis">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div> -->
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">NO PBB :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Pilih Kecamatan dan Kelurahan Dulu" disabled="">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<!-- <div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">Luas Lahan: :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Otomatis">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div> -->
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">Teknologi Tambak :</label>
<div class="col-sm-6">
<select class="form-control" disabled="">
<option value="">-Pilih Kecamatan dan Kelurahan Dulu</option>
<!-- <option value="1">1</option>
<option value="2">2</option> -->
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
</div>
<!-- /.box-content -->
</div>
<div class="col-xs-12">
<div class="box-content">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript" >
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 16,
center: new google.maps.LatLng(-2.247762, 119.373063),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
///////////////// awal untuk kordinat////////////////////////////////////
<?php foreach ($kecamatan_terpilih->result() as $key => $value) { ?>
var polygon_<?=$value->id_kecamatan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "#B85612",
fillOpacity: 0.4,
});
<?php } ?>
///////////////// akhir untuk kordinat////////////////////////////////////
//////////////// awal untuk infowindows /////////////////////////////////
<?php foreach ($kecamatan_terpilih->result() as $key => $value) { ?>
google.maps.event.addListener(polygon_<?=$value->id_kecamatan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$value->kecamatan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < polygon_<?=$value->id_kecamatan?>.getPath().getLength(); i++) {
bounds.extend(polygon_<?=$value->id_kecamatan?>.getPath().getAt(i));
}
<?php } ?>
map.fitBounds(bounds);
//////////////// akhir untuk infowindows /////////////////////////////////
}
google.maps.event.addDomListener(window, 'load', initialize);
// document.getElementById('luas').value = luas;
</script>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
</div>
<div class="row small-spacing">
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="box-content bg-success text-white">
<div class="statistics-box with-icon">
<i class="ico small fa fa-diamond"></i>
<p class="text text-white">Produksi Sebelumnya</p>
<h2 class="counter">?? Kg</h2>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-3 col-md-6 col-xs-12 -->
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="box-content bg-info text-white">
<div class="statistics-box with-icon">
<i class="ico small fa fa-download"></i>
<p class="text text-white">Prediksi Produksi</p>
<h2 class="counter">?? Kg</h2>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-3 col-md-6 col-xs-12 -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,370 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content">
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">PILIH KECAMATAN :</label>
<div class="col-sm-6">
<select class="form-control" onchange="changeFuncKecamatan(value);" name="kecamatan">
<option value="" se>-Pilih Kecamatan</option>
<?php foreach ($kecamatan->result() as $key => $value) {
if ($this->uri->segment(3) == $value->id_kecamatan) {
$selected = "selected";
}else{
$selected = '';
}
?>
<option value="<?=$value->id_kecamatan?>" <?=$selected?>><?=$value->kecamatan?></option>
<?php } ?>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">PILIH KELURAHAN :</label>
<div class="col-sm-6">
<select class="form-control" onchange="changeFuncKelurahan(value);" name="kelurahan">
<option value="">-Pilih Kelurahan</option>
<?php foreach ($kelurahan->result() as $key => $value) {
if ($this->uri->segment(4) == $value->id_kelurahan) {
$selected = "selected";
}else{
$selected = '';
}
?>
<option value="<?=$value->id_kelurahan?>" <?=$selected?>><?=$value->kelurahan?></option>
<?php } ?>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">N I K :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="nik" placeholder="Masukkan N I K" name="nik" minlength="16" maxlength="16">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">Nama Lengkap :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Masukkan Nama Lengkap" name="nama">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
</div>
<!-- /.box-content -->
</div>
<div class="col-xs-12">
<div class="box-content">
<!-- <div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">ID LOKASI :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Otomatis">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div> -->
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">NO PBB :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="pbb" placeholder="Masukkan Nomor PBB" name="pbb" minlength="16" maxlength="16">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">Luas Lahan: :</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="luas_lahan" placeholder="Otomatis" disabled="">
<input type="hidden" name="luas_lahan" id="luas_lahan1">
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
<div class="card-content">
<form class="form-horizontal">
<div class="form-group">
<label for="inp-type-1" class="col-sm-3 control-label">Teknologi Tambak :</label>
<div class="col-sm-6">
<select class="form-control" name="tambak">
<option value="">-Pilih Teknologi Tambak</option>
<?php foreach ($tambak->result() as $key => $value) { ?>
<option value="<?=$value->id_tambak?>"><?=$value->tambak?></option>
<?php } ?>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</form>
</div>
</div>
<!-- /.box-content -->
</div>
<div class="col-xs-12">
<div class="box-content">
<input type="button" class="btn btn-info waves-effect waves-light" id="enablePolygon" value="Tanda Kordinat Tambak" name="enablePolygon" />
<input type="button" class="btn btn-danger waves-effect waves-light" id="resetPolygon" value="Reset Kembali Kordinat" style="display: none;" />
<input type="hidden" name ="point" id="coords">
<div id="showonPolygon" ><b>Area:</b> <span id="areaPolygon">&nbsp;</span>
</div> <br><br>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript" >
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var all_overlays = [];
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 16,
center: new google.maps.LatLng(-2.247762, 119.373063),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
<?php foreach ($kelurahan_terpilih->result() as $key => $value) { ?>
var polygon_<?=$value->id_kelurahan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "#B85612",
fillOpacity: 0.4,
});
<?php } ?>
var polyOptions = {
strokeWeight: 0,
fillOpacity: 0.45,
editable: true,
fillColor: '#FF1493'
};
var selectedShape;
var drawingManager = new google.maps.drawing.DrawingManager({
drawingMode: google.maps.drawing.OverlayType.POLYGON,
drawingControl: false,
markerOptions: {
draggable: true
},
polygonOptions: polyOptions
});
$('#enablePolygon').click(function() {
drawingManager.setMap(map);
drawingManager.setDrawingMode(google.maps.drawing.OverlayType.POLYGON);
$('#enablePolygon').hide();
});
$('#resetPolygon').click(function() {
if (selectedShape) {
selectedShape.setMap(null);
}
drawingManager.setMap(null);
$('#showonPolygon').hide();
$('#resetPolygon').hide();
$('#enablePolygon').show();
});
google.maps.event.addListener(drawingManager, 'polygoncomplete', function(polygon) {
var area = google.maps.geometry.spherical.computeArea(selectedShape.getPath());
var area1 = google.maps.geometry.spherical.computeArea(selectedShape.getPath());
$('#areaPolygon').html(area.toFixed(2)+' Sq meters');
area = area/10000;
area1 = area1/10000;
area = numberWithCommas(area.toFixed(2))+" Ha";
area1 = area1.toFixed(3);
document.getElementById("luas_lahan").value = area;
document.getElementById("luas_lahan1").value = area1;
var coordStr = "";
for (var i = 0; i < polygon.getPath().getLength(); i++) {
coordStr +="{lat: "+ polygon.getPath().getAt(i).lat() + ", lng: "+
polygon.getPath().getAt(i).lng()+"},\n"
;
}
document.getElementById("coords").value = coordStr;
// console.log(coordStr);
$('#resetPolygon').show();
});
function clearSelection() {
if (selectedShape) {
selectedShape.setEditable(false);
selectedShape = null;
}
}
function setSelection(shape) {
clearSelection();
selectedShape = shape;
shape.setEditable(true);
}
google.maps.event.addListener(drawingManager, 'overlaycomplete', function(e) {
all_overlays.push(e);
if (e.type != google.maps.drawing.OverlayType.MARKER) {
// Switch back to non-drawing mode after drawing a shape.
drawingManager.setDrawingMode(null);
// Add an event listener that selects the newly-drawn shape when the user
// mouses down on it.
var newShape = e.overlay;
newShape.type = e.type;
google.maps.event.addListener(newShape, 'click', function() {
setSelection(newShape);
});
setSelection(newShape);
}
});
<?php foreach ($kelurahan_terpilih->result() as $key => $value) {
$cek_nama_kecamatan = $this->mhome->tampil_data_where('tb_kecamatan',array());
foreach ($cek_nama_kecamatan->result() as $key1 => $value1) ;
$nama_kecamatan = $value1->kecamatan;
?>
google.maps.event.addListener(polygon_<?=$value->id_kelurahan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kelurahan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$nama_kecamatan?></h5>"+
"<h5>Kelurahan : <?=$value->kelurahan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < polygon_<?=$value->id_kelurahan?>.getPath().getLength(); i++) {
bounds.extend(polygon_<?=$value->id_kelurahan?>.getPath().getAt(i));
}
<?php } ?>
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div id="vertices"></div>
<div id="map_canvas"></div><br><br>
<center><button type="button" class="btn btn-lg waves-effect waves-light" onclick="heheh()">Lakukkan Pendaftaran</button></center>
</div>
<div class="row small-spacing">
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="box-content bg-success text-white">
<div class="statistics-box with-icon">
<i class="ico small fa fa-diamond"></i>
<p class="text text-white">Produksi Sebelumnya</p>
<h2 class="counter">?? Kg</h2>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-3 col-md-6 col-xs-12 -->
<div class="col-lg-6 col-md-6 col-xs-12">
<div class="box-content bg-info text-white">
<div class="statistics-box with-icon">
<i class="ico small fa fa-download"></i>
<p class="text text-white">Prediksi Produksi</p>
<h2 class="counter">?? Kg</h2>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-3 col-md-6 col-xs-12 -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,373 @@
<script src="<?=base_url()?>assets/scripts/jquery.min.js"></script>
<script src="<?=base_url()?>assets/scripts/modernizr.min.js"></script>
<script src="<?=base_url()?>assets/plugin/bootstrap/js/bootstrap.min.js"></script>
<script src="<?=base_url()?>assets/plugin/nprogress/nprogress.js"></script>
<script src="<?=base_url()?>assets/plugin/sweet-alert/sweetalert.min.js"></script>
<script src="<?=base_url()?>assets/plugin/waves/waves.min.js"></script>
<script src="<?=base_url()?>assets/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="<?=base_url()?>assets/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script>
<!-- <script src="<?=base_url()?>assets/toastr/toastr.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>assets/toastr/toastr.min.css"> -->
<script src="<?=base_url()?>assets/plugin/toastr/toastr.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>assets/plugin/toastr/toastr.css">
<script >
$(document).ready(function() {
$('#example').DataTable();
$('#example1').DataTable();
} );
</script>
<?php if ($this->session->flashdata('my404')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<?php echo $this->session->flashdata('my404')?>");
</script>
<?php endif ?>
<?php if ($this->session->flashdata('success')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.success("<?php echo $this->session->flashdata('success')?>");
</script>
<?php endif ?>
<?php if ($this->session->flashdata('error')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<?php echo $this->session->flashdata('error')?>");
</script>
<?php endif ?>
<?php if ($this->uri->segment(2) == '' or $this->uri->segment(2) == null): ?>
<script type="text/javascript">
$.ajax({
type: "post",
url: "<?=base_url()?>home/json_hasil",
// data: {inputannya: data}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
// console.log(data1);
var data = JSON.parse(data1);
console.log(data);
// window.location.replace("<?=base_url()?>admin/data_produksi/");
new Morris.Line({
// ID of the element in which to draw the chart.
element: 'myfirstchart',
// Chart data records -- each entry in this array corresponds to a point on
// the chart.
data: data['ket'],
// The name of the data record attribute that contains x-values.
xkey: data['tahun'],
parseTime: false,
// A list of names of data record attributes that contain y-values.
ykeys: ['produksi','prediksi'],
// Labels for the ykeys -- will be displayed when you hover over the
// chart.
labels: ['Produksi','Prediksi'],
lineColors:['Green','Red']
});
}
});
</script>
<?php endif ?>
<?php if ($this->uri->segment(2) == 'data_petambak'): ?>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable();
});
</script>
<?php endif ?>
<?php if ($this->uri->segment(2) == 'pendaftaran'): ?>
<script type="text/javascript">
function changeFuncKecamatan($i) {
var value = $i;
if (value == '' || value == null) {
window.location.replace("<?=base_url()?>home/pendaftaran/");
}else{
window.location.replace("<?=base_url()?>home/pendaftaran/"+value);
}
}
<?php if ($this->uri->segment(3) != null or $this->uri->segment(3) != '') { ?>
function changeFuncKelurahan($i) {
var value = $i;
if (value == '' || value == null) {
window.location.replace("<?=base_url()?>home/pendaftaran/<?=$this->uri->segment(3)?>");
}else{
window.location.replace("<?=base_url()?>home/pendaftaran/<?=$this->uri->segment(3)?>/"+value);
}
}
<?php } ?>
</script>
<script type="text/javascript">
function heheh(){
var kecamatan = $('select[name="kecamatan"]').val();
var kelurahan = $('select[name="kelurahan"]').val();
var nik = $('input[name="nik"]').val();
var nama = $('input[name="nama"]').val();
var pbb = $('input[name="pbb"]').val();
var point = $('input[name="point"]').val();
var tambak = $('select[name="tambak"]').val();
var luas_lahan = $('input[name="luas_lahan"]').val();
// console.log(point);
if(nik.length < 16 || nik == '' || nik == null){
$('input[name="nik"]').focus();
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>NIK harus Panjang 16 Karakter");
}else if(nama == '' || nama == null){
$('input[name="nama"]').focus();
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Nama Harus Terisi");
}else if(pbb.length < 16 || pbb == '' || pbb == null){
$('input[name="pbb"]').focus();
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>No PBB harus Panjang 16 Karakter");
} else if(tambak == '' || tambak == null){
$('select[name="tambak"]').focus();
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Teknologi Tambak Harus Dipilih");
} else if(point == '' || point == null){
$('input[name="enablePolygon"]').focus();
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Kordinat Tambak Harus Ditanda");
} else {
// console.log(kecamatan);
// console.log(kelurahan);
// console.log(nik);
// console.log(nama);
// console.log(pbb);
// console.log(tambak);
// console.log(point);
$.ajax({
type: "post",
url: "<?=base_url()?>home/pendaftaran_tambak/",
data: {kecamatan: kecamatan,kelurahan: kelurahan, nik: nik, nama : nama , pbb : pbb, tambak :tambak, point : point, luas_lahan: luas_lahan}, // appears as $_GET['id'] @ your backend side
// dataType: "json",
success: function(data1) {
// console.log(data1);
// window.location.href ="<?=base_url()?>";
if (data1 == 'true1') {
$('input[name="nik"]').focus();
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.warning("<b>Error</b><br>NIK Yang Dimasukkan Telah Terdaftar Dalam Sistem<br>Silakan Login Untuk Menambah Lahan");
}else if (data1 == 'true2') {
$('input[name="pbb"]').focus();
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.warning("<b>Error</b><br>No PBB Yang Dimasukkan Telah Terdaftar Dalam Sistem<br>Silakan Cek Kembali No PBB Yang Dimasukkan");
}else if (data1 == 'false') {
window.location.href ="<?=base_url()?>";
}
}
});
}
}
</script>
<script type="text/javascript">
function setInputFilter(textbox, inputFilter) {
["input", "keydown", "keyup", "mousedown", "mouseup", "select", "contextmenu", "drop"].forEach(function(event) {
textbox.addEventListener(event, function() {
if (inputFilter(this.value)) {
this.oldValue = this.value;
this.oldSelectionStart = this.selectionStart;
this.oldSelectionEnd = this.selectionEnd;
} else if (this.hasOwnProperty("oldValue")) {
this.value = this.oldValue;
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
} else {
this.value = "";
}
});
});
}
// Install input filters.
setInputFilter(document.getElementById("nik"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("pbb"), function(value) {
return /^-?\d*$/.test(value); });
</script>
<?php endif ?>
<?php if ($this->uri->segment(2) == 'kecamatan'): ?>
<script >
$(document).ready(function() {
$('#tabel-data').DataTable();
} );
</script>
<?php endif ?>
<script src="<?=base_url()?>assets/scripts/main.min.js"></script>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,14 @@
<div class="fixed-navbar">
<div class="pull-left">
<button type="button" class="menu-mobile-button glyphicon glyphicon-menu-hamburger js__menu_mobile"></button>
<h1 class="page-title">Sistem Analisa Produksi Perikanan Tambak</h1>
<!-- /.page-title -->
</div>
<!-- /.pull-left -->
<div class="pull-right">
<!-- /.ico-item -->
<!-- <a href="#" class="ico-item mdi mdi-logout js__logout"></a> -->
</div>
<!-- /.pull-right -->
</div>

View File

@ -0,0 +1,8 @@
<footer class="footer">
<ul class="list-inline">
<li>2020 © SAPITA.</li>
<li><a href="#">Privacy</a></li>
<li><a href="#">Terms</a></li>
<li><a href="#">Help</a></li>
</ul>
</footer>

View File

@ -0,0 +1,38 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<title>SAPITA - <?=$header?></title>
<!-- Main Styles -->
<link rel="stylesheet" href="<?=base_url()?>assets/styles/style.min.css">
<!-- Material Design Icon -->
<link rel="stylesheet" href="<?=base_url()?>assets/fonts/material-design/css/materialdesignicons.css">
<!-- mCustomScrollbar -->
<link rel="stylesheet" href="<?=base_url()?>assets/plugin/datatables/media/css/dataTables.bootstrap.min.css">
<link rel="stylesheet" href="<?=base_url()?>assets/plugin/datatables/extensions/Responsive/css/responsive.bootstrap.min.css">
<!-- Sweet Alert -->
<!-- <link rel="stylesheet" href="<?=base_url()?>assets/plugin/sweet-alert/sweetalert.css"> -->
<script src="<?php echo base_url() ?>sweet-alert/sweetalert.js"></script>
<style>
#map_canvas {
height: 600px;
width: 100%;
margin: 0px;
padding: 0px
}
.nowrap {
white-space: nowrap ;
}
</style>
</head>

View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:47:34 GMT -->
<?php $this->load->view("penyuluh/head"); ?>
<body>
<?php $this->load->view('penyuluh/main_menu'); ?>
<!-- /.main-menu -->
<?php $this->load->view("penyuluh/fixed_navbar") ; ?>
<!-- /.fixed-navbar -->
<!-- /#notification-popup -->
<!-- /#message-popup -->
<div id="wrapper">
<div class="main-content">
<?php $this->load->view($main); ?>
<!-- /.row -->
<?php $this->load->view("penyuluh/footer"); ?>
</div>
<!-- /.main-content -->
</div><!--/#wrapper -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/script/html5shiv.min.js"></script>
<script src="assets/script/respond.min.js"></script>
<![endif]-->
<!--
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<?php $this->load->view("penyuluh/script"); ?>
</body>
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:09 GMT -->
</html>

View File

@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<title><?=$header?></title>
<link rel="stylesheet" href="<?=base_url()?>assets/styles/style.min.css">
<!-- Waves Effect -->
<link rel="stylesheet" href="<?=base_url()?>assets/plugin/waves/waves.min.css">
</head>
<body>
<div id="single-wrapper">
<form method="post" class="frm-single">
<div class="inside">
<div class="title"><strong>SAPITA</strong></div>
<!-- /.title -->
<div class="frm-title">Login</div>
<!-- /.frm-title -->
<div class="frm-input"><input type="text" placeholder="Username" class="frm-inp" name="username"><i class="fa fa-user frm-ico"></i></div>
<!-- /.frm-input -->
<div class="frm-input"><input type="password" placeholder="Password" class="frm-inp" name="password"><i class="fa fa-lock frm-ico"></i></div>
<input type="submit" class="frm-submit" name="login" value="Login">
<!-- /.row -->
<a href="<?=base_url()?>home/pendaftaran" class="a-link"><i class="fa fa-archive"></i>Silakan Daftar Lahan Anda.</a>
<div class="frm-footer">Dinas Pertanian Kelautan Dan Perikanan <br> Kota Parepare © 2020.</div>
<!-- /.footer -->
</div>
<!-- .inside -->
</form>
<!-- /.frm-single -->
</div><!--/#single-wrapper -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/script/html5shiv.min.js"></script>
<script src="assets/script/respond.min.js"></script>
<![endif]-->
<!--
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="<?=base_url()?>assets/scripts/jquery.min.js"></script>
<script src="<?=base_url()?>assets/scripts/modernizr.min.js"></script>
<script src="<?=base_url()?>assets/plugin/bootstrap/js/bootstrap.min.js"></script>
<script src="<?=base_url()?>assets/plugin/nprogress/nprogress.js"></script>
<script src="<?=base_url()?>assets/plugin/waves/waves.min.js"></script>
<script src="<?=base_url()?>assets/plugin/toastr/toastr.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>assets/plugin/toastr/toastr.css">
<?php if ($this->session->flashdata('warning')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.warning("<?php echo $this->session->flashdata('warning')?>");
</script>
<?php endif ?>
<script src="<?=base_url()?>assets/scripts/main.min.js"></script>
</body>
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
</html>

View File

@ -0,0 +1,256 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">List Lahan Kabupaten <?=$nama_kecamatan?></h4>
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<?php
$cek_jumlah_petambak = $this->mpenyuluh->tampil_data_group_by('tb_lahan',array('kecamatan' => $no_kecamatan),'nik_petambak');
?>
<label class="col-sm-4 control-label">Jumlah Petambak</label>
<div class="col-sm-5">
<input type="text" disabled="" class="form-control" value="<?=count($cek_jumlah_petambak->result())?>">
</div>
<div class="col-sm-3"></div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Jumlah Lahan</label>
<div class="col-sm-5">
<input type="text" disabled="" class="form-control" value="<?=count($cek_lahan_kecamatan->result())?>">
</div>
<div class="col-sm-3"></div>
</div>
</div>
<div class="form-group" style="overflow-x: auto">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>No</th>
<th>Kode Lahan</th>
<th>Petambak</th>
<th>No PBB</th>
<th>Jenis Tambak</th>
<th>Luas</th>
<th>Kelurahan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php $i =1; foreach ($cek_lahan_kecamatan->result() as $key => $value):
$cek_petambak = $this->mpenyuluh->tampil_data_where('tb_petambak',array('nik' => $value->nik_petambak));
foreach ($cek_petambak->result() as $key1 => $value1) ;
$cek_tek_tambak = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->mpenyuluh->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
?>
<tr>
<td><?=$i?></td>
<td><?=$value->id_lahan?></td>
<td><?=$value1->nama?></td>
<td><?=$value->no_pbb?></td>
<td><?=$value2->tambak?></td>
<td><?=$value->luas_lahan?></td>
<td><?=$value3->kelurahan?></td>
<td>
<a href="<?=base_url()?>penyuluh/analisa/<?=$value->id_lahan?>"><button type="button" title="Analisa Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a>
<a href="<?=base_url()?>penyuluh/perkiraan_produksi/<?=$value->id_lahan?>"><button type="button" title="Perkiraan Produksi" class="btn btn-warning btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-file-text"></i></button></a>
<a href="<?=base_url()?>penyuluh/transaksi/<?=$value->id_lahan?>"><button type="button" title="Transaksi Produksi" class="btn btn-success btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-wpforms"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Luas Lahan Petambak : <span class="nowrap" id="luas1"></span> Ha </h4>
<h4 class="box-title">Jumlah Lahan : <?=count($cek_lahan_kecamatan->result())?> </h4>
<div class="card-content">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript">
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 12,
center: new google.maps.LatLng(-4.0741291, 119.63409424),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
<?php foreach ($kecamatan->result() as $key => $value) { ?>
var polygon_<?=$value->id_kecamatan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "#B85612",
fillOpacity: 0.4,
});
<?php } ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { ?>
<?php
if ($value->tek_tambak == 1) {
$color = "#FE2D00";
}elseif ($value->tek_tambak == 2) {
$color = "#77FE00";
}elseif ($value->tek_tambak == 3) {
$color = "#1F00FE";
}
?>
var lahan_<?=$value->id_lahan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->point?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
google.maps.event.addListener(polygon_<?=$value->id_kecamatan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$value->kecamatan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
// for (var i = 0; i < polygon_<?=$value->id_kecamatan?>.getPath().getLength(); i++) {
// bounds.extend(polygon_<?=$value->id_kecamatan?>.getPath().getAt(i));
// }
<?php } ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) {
$cek_tek_tambak = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->mpenyuluh->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
?>
google.maps.event.addListener(lahan_<?=$value->id_lahan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>ID Lahan: <?=$value->id_lahan?></h5>"+
"<h5>Teknologi Tambak : <?=$value2->tambak?></h5>"+
"<h5>Kecamatan : <?=$nama_kecamatan?></h5>"+
"<h5>Kelurahan : <?=$value3->kelurahan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
'<a href="<?=base_url()?>penyuluh/analisa/<?=$value->id_lahan?>"><button type="button" title="Analisa Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a> &nbsp &nbsp'+
'<a href="<?=base_url()?>penyuluh/perkiraan_produksi/<?=$value->id_lahan?>"><button type="button" title="Perkiraan Produksi" class="btn btn-warning btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-file-text"></i></button></a> &nbsp &nbsp'+ '<a href=""<?=base_url()?>penyuluh/transaksi/<?=$value->id_lahan?>"><button type="button" title="Transaksi Produksi" class="btn btn-success btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-wpforms"></i></button></a>'+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < lahan_<?=$value->id_lahan?>.getPath().getLength(); i++) {
bounds.extend(lahan_<?=$value->id_lahan?>.getPath().getAt(i));
}
<?php } ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { ?>
var luasl<?=$value->id_lahan?> =google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath());
<?php } ?>
var luaslahan = <?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { echo "luasl".$value->id_lahan."+";} ?>0;
luaslahan = luaslahan / 10000;
document.getElementById("luas1").innerHTML = numberWithCommas(luaslahan.toFixed(2));
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
// document.getElementById('luas').value = luas;
</script>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,75 @@
<div class="main-menu">
<header class="header">
<a href="index-2.html" class="logo"><img src="<?=base_url()?>logo.png" width="25" height="25"> SAPITA</a>
<!-- <button type="button" class="button-close fa fa-times js__menu_close"></button> -->
<div class="user">
<a href="#" class="avatar"><img src="<?=base_url()?>logo.png" alt="" width="50" height="50"></a>
<h4><a href="profile.html"><?=$this->session->userdata('nama')?></a></h4>
<h5 class="position"><?=$this->session->userdata('level')?></h5>
<!-- /.name -->
<div class="control-wrap js__drop_down">
<i class="fa fa-caret-down js__drop_down_button"></i>
<div class="control-list">
<div class="control-item"><a href="profile.html"><i class="fa fa-user"></i> Profile</a></div>
<div class="control-item"><a href="#"><i class="fa fa-sign-out"></i> Log out</a></div>
</div>
<!-- /.control-list -->
</div>
<!-- /.control-wrap -->
</div>
<!-- /.user -->
</header>
<!-- /.header -->
<div class="content">
<div class="navigation">
<h5 class="title">Menu</h5>
<!-- /.title -->
<ul class="menu js__accordion">
<li <?php if ($this->uri->segment(2) == '') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>penyuluh"><i class="menu-icon mdi mdi-view-dashboard"></i><span>Halaman Utama</span></a>
</li>
<!-- <li>
<a class="waves-effect" href="index-2.html"><i class="menu-icon mdi mdi-desktop-mac"></i><span>ADMIN</span></a>
</li> -->
<li <?php if ($this->uri->segment(2) == 'analisa') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>penyuluh/analisa"><i class="menu-icon mdi mdi-desktop-mac"></i><span>Analisa Produksi</span></a>
</li>
<li <?php if ($this->uri->segment(2) == 'perkiraan_produksi') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>penyuluh/perkiraan_produksi"><i class="menu-icon mdi mdi-calendar"></i><span>Perkiraan Produksi</span></a>
</li>
<li <?php if ($this->uri->segment(2) == 'transaksi') { echo 'class="current"'; } ?>>
<a class="waves-effect" href="<?=base_url()?>penyuluh/transaksi"><i class="menu-icon mdi mdi-desktop-mac"></i><span>Transaksi Produksi</span></a>
</li>
<li>
<a class="waves-effect" href="<?=base_url()?>penyuluh/logout"><i class="menu-icon mdi mdi-calendar"></i><span>Logout</span></a>
</li>
<li>
&nbsp<br>&nbsp
</li>
</ul>
<!-- /.menu js__accordion -->
</div>
<!-- /.navigation -->
</div>
<!-- /.content -->
</div>

View File

@ -0,0 +1,270 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">List Lahan Kabupaten <?=$nama_kecamatan?></h4>
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<?php
$cek_jumlah_petambak = $this->mpenyuluh->tampil_data_group_by('tb_lahan',array('kecamatan' => $no_kecamatan),'nik_petambak');
?>
<label class="col-sm-4 control-label">Jumlah Petambak</label>
<div class="col-sm-5">
<input type="text" disabled="" class="form-control" value="<?=count($cek_jumlah_petambak->result())?>">
</div>
<div class="col-sm-3"></div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Jumlah Lahan</label>
<div class="col-sm-5">
<input type="text" disabled="" class="form-control" value="<?=count($cek_lahan_kecamatan->result())?>">
</div>
<div class="col-sm-3"></div>
</div>
</div>
<div class="form-group" style="overflow-x: auto">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>No</th>
<th>Kode Lahan</th>
<th>Petambak</th>
<th>No PBB</th>
<th>Jenis Tambak</th>
<th>Luas</th>
<th>Kelurahan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php $i =1; foreach ($cek_lahan_kecamatan->result() as $key => $value):
$cek_petambak = $this->mpenyuluh->tampil_data_where('tb_petambak',array('nik' => $value->nik_petambak));
foreach ($cek_petambak->result() as $key1 => $value1) ;
$cek_tek_tambak = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->mpenyuluh->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
?>
<tr>
<td><?=$i?></td>
<td><?=$value->id_lahan?></td>
<td><?=$value1->nama?></td>
<td><?=$value->no_pbb?></td>
<td><?=$value2->tambak?></td>
<td><?=$value->luas_lahan?></td>
<td><?=$value3->kelurahan?></td>
<td>
<a href="<?=base_url()?>penyuluh/analisa/<?=$value->id_lahan?>"><button type="button" title="Analisa Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Luas Lahan Petambak : <span class="nowrap" id="luas1"></span> Ha </h4>
<h4 class="box-title">Jumlah Lahan : <?=count($cek_lahan_kecamatan->result())?> </h4>
<div class="card-content">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript">
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 12,
center: new google.maps.LatLng(-4.0741291, 119.63409424),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
<?php ////////////// sini awal tampil kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
var polygon_<?=$value->id_kecamatan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "#B85612",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil kecamatan ////////////////////////// ?>
<?php ////////////// sini awal tampil lahan ////////////////////////// ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { ?>
<?php
if ($value->tek_tambak == 1) {
$color = "#FE2D00";
}elseif ($value->tek_tambak == 2) {
$color = "#77FE00";
}elseif ($value->tek_tambak == 3) {
$color = "#1F00FE";
}
?>
var lahan_<?=$value->id_lahan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->point?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil lahan ////////////////////////// ?>
<?php ////////////// sini awal infowindows kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
google.maps.event.addListener(polygon_<?=$value->id_kecamatan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$value->kecamatan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
// for (var i = 0; i < polygon_<?=$value->id_kecamatan?>.getPath().getLength(); i++) {
// bounds.extend(polygon_<?=$value->id_kecamatan?>.getPath().getAt(i));
// }
<?php } ?>
<?php ////////////// sini akhir infowindows kecamatan ////////////////////////// ?>
<?php ////////////// sini awal infowindows lahan ////////////////////////// ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) {
$cek_tek_tambak = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->mpenyuluh->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
?>
google.maps.event.addListener(lahan_<?=$value->id_lahan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>ID Lahan: <?=$value->id_lahan?></h5>"+
"<h5>Teknologi Tambak : <?=$value2->tambak?></h5>"+
"<h5>Kecamatan : <?=$nama_kecamatan?></h5>"+
"<h5>Kelurahan : <?=$value3->kelurahan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
'<center><a href="<?=base_url()?>penyuluh/analisa/<?=$value->id_lahan?>"><button type="button" title="Analisa Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a></center> '+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < lahan_<?=$value->id_lahan?>.getPath().getLength(); i++) {
bounds.extend(lahan_<?=$value->id_lahan?>.getPath().getAt(i));
}
<?php } ?>
<?php ////////////// sini akhir infowindows lahan ////////////////////////// ?>
<?php ////////////// sini awal kira luas lahan petambak ////////////////////////// ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { ?>
var luasl<?=$value->id_lahan?> =google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath());
<?php } ?>
var luaslahan = <?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { echo "luasl".$value->id_lahan."+";} ?>0;
luaslahan = luaslahan / 10000;
document.getElementById("luas1").innerHTML = numberWithCommas(luaslahan.toFixed(2));
<?php ////////////// sini akhir kira luas lahan petambak ////////////////////////// ?>
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
// document.getElementById('luas').value = luas;
</script>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,172 @@
<div class="row small-spacing">
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<h4 class="box-title">Informasi Analisa Lahan</h4>
<!-- /.box-title -->
<?php foreach ($lahan->result() as $key => $value); ?>
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">Kode Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->id_lahan?>" title="ID Lahan" disabled="">
</div>
<div class="col-sm-4">
</div>
</div>
<?php
$cek_tambak = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak'=>$value->tek_tambak));
foreach ($cek_tambak->result() as $key1 => $value1) ;
$nama_tambak = $value1->tambak;
?>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">Luas Tambak</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->luas_lahan?>Ha" title="Luas Tambak" disabled="">
</div>
<div class="col-sm-4">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">Teknologi Tambak</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$nama_tambak?>" title="Teknologi Tambak" disabled="">
</div>
<div class="col-sm-4">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">Periode</label>
<?php
$tahun = date("Y");
if (date("m") < 7) {
$musim = "1";
}else{
$musim = "2";
}
?>
<div class="col-sm-2">
<input type="text" class="form-control" value="<?=$musim?>" title="Musim" disabled="">
</div>
<div class="col-sm-2">
<input type="text" class="form-control" value="<?=$tahun?>" title="Tahun" disabled="">
</div>
<div class="col-sm-4">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">Masa Tumbuh</label>
<div class="col-sm-4">
<select class="form-control" onchange="changeFuncLahan(value);" name="lokasi_lahan">
<option value="" disabled="" selected="">-Sila Pilih Masa Tumbuh</option>
<option value="60" >60 Hari</option>
<option value="90" >90 Hari</option>
<option value="150" >150 Hari</option>
</select>
</div>
<div class="col-sm-4">
</div>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<h4 class="box-title">Hasil Analisa Lahan</h4>
<!-- /.box-title -->
<div class="card-content" id="tabel">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>Bahan</th>
<th>Harga</th>
<th>Satuan</th>
<th width="20%">Jumlah</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$ket = json_decode($value1->ket);
$satuan = json_decode($value1->satuan);
$r = 1;
// print_r($satuan->$r);
foreach ($elemen_produksi->result() as $key2 => $value2):
$no = $value2->id_elemen;
$satu = $satuan->$no;
$harga = $ket->$no;
if ($harga == '' and $harga == null) {
$harga = '';
}else{
$harga = number_format($harga);
}
if ($satu == '' and $satu == null) {
$satu = '';
}else{
$satu = $satu * $value->luas_lahan;
$satu = number_format(ceil($satu));
}
?>
<tr>
<td><?=$value2->nama_elemen?></td>
<td>Rp. <?=$harga?></td>
<td><?=$satu?> <?=$value2->satuan?></td>
<td>Rp. ??</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
<!-- /.card-content -->
<div class="form-horizontal" id="sini_ganti">
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">Biaya Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="Rp. ??" title="Biaya Produksi" disabled="" name="biaya">
</div>
<div class="col-sm-4">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">Biaya Persiapan Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="Rp. ??" title="Biaya Produksi" disabled="" name="biaya">
</div>
<div class="col-sm-4">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label">Jumlah Hasil Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="?? Kg" title="Jumlah Hasil Produksi" disabled="">
</div>
<div class="col-sm-4">
</div>
</div>
</div>
</div>
<!-- /.box-content -->
<!-- /.box-content card white -->
</div>
</div>

View File

@ -0,0 +1,269 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">List Lahan Kabupaten <?=$nama_kecamatan?></h4>
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<?php
$cek_jumlah_petambak = $this->mpenyuluh->tampil_data_group_by('tb_lahan',array('kecamatan' => $no_kecamatan),'nik_petambak');
?>
<label class="col-sm-4 control-label">Jumlah Petambak</label>
<div class="col-sm-5">
<input type="text" disabled="" class="form-control" value="<?=count($cek_jumlah_petambak->result())?>">
</div>
<div class="col-sm-3"></div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Jumlah Lahan</label>
<div class="col-sm-5">
<input type="text" disabled="" class="form-control" value="<?=count($cek_lahan_kecamatan->result())?>">
</div>
<div class="col-sm-3"></div>
</div>
</div>
<div class="form-group" style="overflow-x: auto">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>No</th>
<th>Kode Lahan</th>
<th>Petambak</th>
<th>No PBB</th>
<th>Jenis Tambak</th>
<th>Luas</th>
<th>Kelurahan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php $i =1; foreach ($cek_lahan_kecamatan->result() as $key => $value):
$cek_petambak = $this->mpenyuluh->tampil_data_where('tb_petambak',array('nik' => $value->nik_petambak));
foreach ($cek_petambak->result() as $key1 => $value1) ;
$cek_tek_tambak = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->mpenyuluh->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
?>
<tr>
<td><?=$i?></td>
<td><?=$value->id_lahan?></td>
<td><?=$value1->nama?></td>
<td><?=$value->no_pbb?></td>
<td><?=$value2->tambak?></td>
<td><?=$value->luas_lahan?></td>
<td><?=$value3->kelurahan?></td>
<td>
<a href="<?=base_url()?>penyuluh/perkiraan_produksi/<?=$value->id_lahan?>"><button type="button" title="Perkiraan Produksi" class="btn btn-warning btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-file-text"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Luas Lahan Petambak : <span class="nowrap" id="luas1"></span> Ha </h4>
<h4 class="box-title">Jumlah Lahan : <?=count($cek_lahan_kecamatan->result())?> </h4>
<div class="card-content">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript">
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 12,
center: new google.maps.LatLng(-4.0741291, 119.63409424),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
<?php ////////////// sini awal tampil kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
var polygon_<?=$value->id_kecamatan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "#B85612",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil kecamatan ////////////////////////// ?>
<?php ////////////// sini awal tampil lahan ////////////////////////// ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { ?>
<?php
if ($value->tek_tambak == 1) {
$color = "#FE2D00";
}elseif ($value->tek_tambak == 2) {
$color = "#77FE00";
}elseif ($value->tek_tambak == 3) {
$color = "#1F00FE";
}
?>
var lahan_<?=$value->id_lahan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->point?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil lahan ////////////////////////// ?>
<?php ////////////// sini awal infowindows kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
google.maps.event.addListener(polygon_<?=$value->id_kecamatan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$value->kecamatan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
// for (var i = 0; i < polygon_<?=$value->id_kecamatan?>.getPath().getLength(); i++) {
// bounds.extend(polygon_<?=$value->id_kecamatan?>.getPath().getAt(i));
// }
<?php } ?>
<?php ////////////// sini akhir infowindows kecamatan ////////////////////////// ?>
<?php ////////////// sini awal infowindows lahan ////////////////////////// ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) {
$cek_tek_tambak = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->mpenyuluh->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
?>
google.maps.event.addListener(lahan_<?=$value->id_lahan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>ID Lahan: <?=$value->id_lahan?></h5>"+
"<h5>Teknologi Tambak : <?=$value2->tambak?></h5>"+
"<h5>Kecamatan : <?=$nama_kecamatan?></h5>"+
"<h5>Kelurahan : <?=$value3->kelurahan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
'<center><a href="<?=base_url()?>penyuluh/perkiraan_produksi/<?=$value->id_lahan?>"><button type="button" title="Perkiraan Produksi" class="btn btn-warning btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-file-text"></i></button></a></center> '+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < lahan_<?=$value->id_lahan?>.getPath().getLength(); i++) {
bounds.extend(lahan_<?=$value->id_lahan?>.getPath().getAt(i));
}
<?php } ?>
<?php ////////////// sini akhir infowindows lahan ////////////////////////// ?>
<?php ////////////// sini awal kira luas lahan petambak ////////////////////////// ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { ?>
var luasl<?=$value->id_lahan?> =google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath());
<?php } ?>
var luaslahan = <?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { echo "luasl".$value->id_lahan."+";} ?>0;
luaslahan = luaslahan / 10000;
document.getElementById("luas1").innerHTML = numberWithCommas(luaslahan.toFixed(2));
<?php ////////////// sini akhir kira luas lahan petambak ////////////////////////// ?>
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
// document.getElementById('luas').value = luas;
</script>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,235 @@
<div class="row small-spacing">
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<h4 class="box-title">Form Perkiraan Produksi</h4>
<!-- /.box-title -->
<div class="card-content">
<?php foreach ($lahan->result() as $key => $value) ;
$cari_data_harga = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' =>$value->tek_tambak));
foreach ($cari_data_harga->result() as $key3 => $value3);
$ket = json_decode($value3->ket);
?>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Kode Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->id_lahan?>" title="ID Lahan" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Luas Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->luas_lahan?> Ha" title="Luas Lahan" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jenis Tambak</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value3->tambak?>" title="Jenis Tambak" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Waktu Tebar</label>
<div class="col-sm-4">
<input type="date" class="form-control" id="tanggal" title="Waktu Tebar" min="2020-01-01">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inp-type-1" class="col-sm-5 control-label">Masa Tumbuh :</label>
<div class="col-sm-4">
<select class="form-control" onchange="changeFuncLahan(value);" name="lokasi_lahan">
<option value="" disabled="" selected="">-Sila Pilih Masa Pertumbuhan</option>
<option value="60" >60</option>
<option value="90" >90</option>
<option value="150" >150</option>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</div>
<div id="sinitabel">
<div class="form-horizontal" style="overflow-x: auto">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>Bahan</th>
<th>Harga</th>
<th>Satuan</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$ket = json_decode($value3->ket);
$satuan = json_decode($value3->satuan);
$r = 1;
// print_r($satuan->$r);
foreach ($elemen_produksi->result() as $key2 => $value2):
$no = $value2->id_elemen;
$satu = $satuan->$no;
$harga = $ket->$no;
if ($harga == '' and $harga == null) {
$harga = '';
}else{
$harga = number_format($harga);
}
if ($satu == '' and $satu == null) {
$satu = '';
}else{
$satu = $satu * $value->luas_lahan;
$satu = number_format(ceil($satu));
}
?>
<tr>
<td><?=$value2->nama_elemen?></td>
<td>Rp. <?=$harga?> </td>
<td>?? <?=$value2->satuan?></td>
<td>??</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jumlah Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="?? kg" title="Jumlah Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
<!-- /.box-content card white -->
</div>
<div id="detailsini">
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<!-- /.box-title -->
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Panen</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Panen" value="tanggal??" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Saiz</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Saiz" value="+- 7/kg" disabled="">
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-3 control-label">Jumlah</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Jumlah" value="?? kg" disabled="">
</div>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<!-- /.box-title -->
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Harga Jual</label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="Enter your email" title="Harga Jual" value="Rp. ??" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Nilai</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Nilai" value="Rp. ??" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Keuntungan</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Keuntungan" value="Rp. ??" disabled="">
</div>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
</div>
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<!-- /.box-title -->
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Status Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="Berhasil/Tidak Berhasil" title="Status Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
<!-- /.box-content card white -->
</div>
</div>
</div>

View File

@ -0,0 +1,269 @@
<div class="row small-spacing">
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">List Lahan Kabupaten <?=$nama_kecamatan?></h4>
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<?php
$cek_jumlah_petambak = $this->mpenyuluh->tampil_data_group_by('tb_lahan',array('kecamatan' => $no_kecamatan),'nik_petambak');
?>
<label class="col-sm-4 control-label">Jumlah Petambak</label>
<div class="col-sm-5">
<input type="text" disabled="" class="form-control" value="<?=count($cek_jumlah_petambak->result())?>">
</div>
<div class="col-sm-3"></div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Jumlah Lahan</label>
<div class="col-sm-5">
<input type="text" disabled="" class="form-control" value="<?=count($cek_lahan_kecamatan->result())?>">
</div>
<div class="col-sm-3"></div>
</div>
</div>
<div class="form-group" style="overflow-x: auto">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>No</th>
<th>Kode Lahan</th>
<th>Petambak</th>
<th>No PBB</th>
<th>Jenis Tambak</th>
<th>Luas</th>
<th>Kelurahan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php $i =1; foreach ($cek_lahan_kecamatan->result() as $key => $value):
$cek_petambak = $this->mpenyuluh->tampil_data_where('tb_petambak',array('nik' => $value->nik_petambak));
foreach ($cek_petambak->result() as $key1 => $value1) ;
$cek_tek_tambak = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->mpenyuluh->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
?>
<tr>
<td><?=$i?></td>
<td><?=$value->id_lahan?></td>
<td><?=$value1->nama?></td>
<td><?=$value->no_pbb?></td>
<td><?=$value2->tambak?></td>
<td><?=$value->luas_lahan?></td>
<td><?=$value3->kelurahan?></td>
<td>
<a href="<?=base_url()?>penyuluh/transaksi/<?=$value->id_lahan?>"><button type="button" title="Transaksi Produksi" class="btn btn-success btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-wpforms"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="box-content card">
<h4 class="box-title">Luas Lahan Petambak : <span class="nowrap" id="luas1"></span> Ha </h4>
<h4 class="box-title">Jumlah Lahan : <?=count($cek_lahan_kecamatan->result())?> </h4>
<div class="card-content">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBw6bnAk0C2jIDDbz_dVRso9gUEnHLTH68&libraries=drawing,places,geometry"></script>
<script type="text/javascript">
var infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150, 50)
});
var geocoder;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function initialize() {
var geolib = google.maps.geometry.spherical;
var myOptions = {
zoom: 12,
center: new google.maps.LatLng(-4.0741291, 119.63409424),
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
bounds = new google.maps.LatLngBounds();
<?php ////////////// sini awal tampil kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
var polygon_<?=$value->id_kecamatan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->kordinat?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "#B85612",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil kecamatan ////////////////////////// ?>
<?php ////////////// sini awal tampil lahan ////////////////////////// ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { ?>
<?php
if ($value->tek_tambak == 1) {
$color = "#FE2D00";
}elseif ($value->tek_tambak == 2) {
$color = "#77FE00";
}elseif ($value->tek_tambak == 3) {
$color = "#1F00FE";
}
?>
var lahan_<?=$value->id_lahan?> = new google.maps.Polygon({
map: map,
path: [<?=$value->point?>],
strokeColor: "#000000",
strokeOpacity: 2,
strokeWeight: 1,
fillColor: "<?=$color?>",
fillOpacity: 0.4,
});
<?php } ?>
<?php ////////////// sini akhir tampil lahan ////////////////////////// ?>
<?php ////////////// sini awal infowindows kecamatan ////////////////////////// ?>
<?php foreach ($kecamatan->result() as $key => $value) { ?>
google.maps.event.addListener(polygon_<?=$value->id_kecamatan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(polygon_<?=$value->id_kecamatan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>Kecamatan : <?=$value->kecamatan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
// for (var i = 0; i < polygon_<?=$value->id_kecamatan?>.getPath().getLength(); i++) {
// bounds.extend(polygon_<?=$value->id_kecamatan?>.getPath().getAt(i));
// }
<?php } ?>
<?php ////////////// sini akhir infowindows kecamatan ////////////////////////// ?>
<?php ////////////// sini awal infowindows lahan ////////////////////////// ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) {
$cek_tek_tambak = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' => $value->tek_tambak));
foreach ($cek_tek_tambak->result() as $key2 => $value2) ;
$cek_kelurahan = $this->mpenyuluh->tampil_data_where('tb_kelurahan',array('id_kelurahan' => $value->kelurahan));
foreach ($cek_kelurahan->result() as $key3 => $value3) ;
?>
google.maps.event.addListener(lahan_<?=$value->id_lahan?>, 'click', function(event) {
var vertices = this.getPath();
var luas = google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath()) / 10000;
luas = numberWithCommas(luas.toFixed(2));
var contentString ="<div class='form-group' >"+
"<h5>ID Lahan: <?=$value->id_lahan?></h5>"+
"<h5>Teknologi Tambak : <?=$value2->tambak?></h5>"+
"<h5>Kecamatan : <?=$nama_kecamatan?></h5>"+
"<h5>Kelurahan : <?=$value3->kelurahan?></h5>"+
"<h5>Luas : "+luas + " Ha"+"</h5>"+
'<center><a href="<?=base_url()?>penyuluh/transaksi/<?=$value->id_lahan?>"><button type="button" title="Transaksi Produksi" class="btn btn-success btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-wpforms"></i></button></a></center>'+
"</div>";
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
for (var i = 0; i < lahan_<?=$value->id_lahan?>.getPath().getLength(); i++) {
bounds.extend(lahan_<?=$value->id_lahan?>.getPath().getAt(i));
}
<?php } ?>
<?php ////////////// sini akhir infowindows lahan ////////////////////////// ?>
<?php ////////////// sini awal kira luas lahan petambak ////////////////////////// ?>
<?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { ?>
var luasl<?=$value->id_lahan?> =google.maps.geometry.spherical.computeArea(lahan_<?=$value->id_lahan?>.getPath());
<?php } ?>
var luaslahan = <?php foreach ($cek_lahan_kecamatan->result() as $key => $value) { echo "luasl".$value->id_lahan."+";} ?>0;
luaslahan = luaslahan / 10000;
document.getElementById("luas1").innerHTML = numberWithCommas(luaslahan.toFixed(2));
<?php ////////////// sini akhir kira luas lahan petambak ////////////////////////// ?>
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
// document.getElementById('luas').value = luas;
</script>
<div id="vertices"></div>
<div id="map_canvas"></div>
</div>
</div>
<!-- /.box-content -->
</div>
<!-- /.col-xs-12 -->
<!-- /.col-lg-6 col-xs-12 -->
</div>

View File

@ -0,0 +1,327 @@
<div class="row small-spacing">
<?php
$tahunnya = explode('-',$this->uri->segment(5));
?>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-xs-12 col-lg-12">
<div class="box-content card">
<h4 class="box-title">Daftar Transaksi Produksi</h4>
<div class="card-content">
<div class="form-group" style="overflow-x: auto" id="tabel_transaksi">
<table id="tabel-data1" class="table table-bordered">
<thead>
<tr>
<th>No</th>
<th>Tahun</th>
<th>Musim</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php if (count($data_transaksi_produksi->result())>0): ?>
<?php foreach ($data_transaksi_produksi->result() as $key => $value):
$ket = json_decode($value->ket);
?>
<?php $i=1; foreach ($ket as $key1 => $value1): ?>
<tr>
<td><?=$i?></td>
<td><?=$value1->tahun?></td>
<td><?=$value1->musim?></td>
<td align="center">
<a href="<?=base_url()?>penyuluh/transaksi/lihat/<?=$kode_lahan?>/<?=$value1->tahun?>-<?=$value1->musim?>"><button type="button" title="Lihat Transaksi Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
<?php endforeach ?>
<?php endif ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-xs-12">
<div class="box-content card ">
<h4 class="box-title">Form Transaksi Produksi Tahun <?=$tahunnya[0]?> Musim <?=$tahunnya[1]?> </h4>
<!-- /.box-title -->
<div class="card-content">
<?php foreach ($lahan->result() as $key => $value) ;
$cari_data_harga = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' =>$value->tek_tambak));
foreach ($cari_data_harga->result() as $key3 => $value3);
$ket = json_decode($value3->ket);
?>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Kode Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->id_lahan?>" title="ID Lahan" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Luas Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->luas_lahan?> Ha" title="Luas Lahan" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jenis Tambak</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value3->tambak?>" title="Jenis Tambak" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Waktu Tebar</label>
<div class="col-sm-4">
<?php
$min_date = date('Y-m-d');
$min_date = new DateTime($min_date);
$min_date->modify('-30 day');
$min_date =date('Y-m-d', strtotime($min_date->format('Y-m-d')));
$max_date = date('Y-m-d');
$max_date = new DateTime($max_date);
$max_date->modify('+30 day');
$max_date =date('Y-m-d', strtotime($max_date->format('Y-m-d')));
// print_r($ket_nya);
$produksi_pya = $ket_nya['ket_elemen_produksi'];
// print_r($produksi_pya);
$jumlah_produksi = round(($produksi_pya[1]*0.02)+$ket_nya['masa_tumbuh']-150);
$ekor = $produksi_pya[1];
$saiz = ceil(($ekor / $jumlah_produksi) - (($ket_nya['masa_tumbuh']/($ekor / $jumlah_produksi))*13));
foreach ($produksi_pya as $key4 => $value4) {
if ($key4 != 4) {
$jumlah_ini[$key4] = $value4;
}else{
$jumlah_ini[$key4] = $value4 * $ket_nya['masa_tumbuh'];
}
}
if ($saiz >= 45) {
$hargajual = 35000;
}elseif ($saiz >= 30) {
$hargajual = 60000;
}elseif ($saiz >= 25) {
$hargajual = 80000;
}elseif ($saiz >= 20) {
$hargajual = 110000;
}elseif ($saiz >= 17) {
$hargajual = 120000;
}elseif ($saiz >= 8) {
$hargajual = 180000;
}elseif ($saiz >= 1) {
$hargajual = 185000;
}
// print_r($jumlah_ini);
$nilaiproduksi = $hargajual * $jumlah_produksi;
?>
<input type="date" class="form-control" id="tanggal" title="Waktu Tebar" min="<?=$min_date?>" max="<?=$max_date?>" value="<?=$ket_nya['waktu_tebar']?>" disabled>
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inp-type-1" class="col-sm-5 control-label">Masa Tumbuh :</label>
<div class="col-sm-4">
<select class="form-control" id="masa_tumbuh" disabled="">
<option value="" disabled="">-Sila Pilih Masa Pertumbuhan</option>
<option value="60" <?php if ($ket_nya['masa_tumbuh'] == 60): ?>selected <?php endif ?>>60</option>
<option value="90" <?php if ($ket_nya['masa_tumbuh'] == 90): ?>selected <?php endif ?>>90</option>
<option value="150" <?php if ($ket_nya['masa_tumbuh'] == 150): ?>selected <?php endif ?> >150</option>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</div>
<div id="sinitabel">
<form class="form-horizontal" style="overflow-x: auto" id="elemen_produksi">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>Bahan</th>
<th>Harga</th>
<th width="20%">Satuan</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$ket = json_decode($value3->ket);
$satuan = json_decode($value3->satuan);
$r = 1;
$biaya = 0;
// print_r($satuan->$r);
foreach ($elemen_produksi->result() as $key2 => $value2):
$no = $value2->id_elemen;
$satu = $satuan->$no;
$harga = $ket->$no;
if ($harga == '' and $harga == null) {
$harga = '';
}else{
$harga = number_format($harga);
}
$jumlah = $jumlah_ini[$value2->id_elemen] * $ket->$no;
// if ($produksi_pya['Tenaga']) {
// $satu = $satu * $harga;
// }else{
// $satu = $satu * $harga * $hari;
// }
$biaya = $biaya + $jumlah;
?>
<tr>
<td><?=$value2->nama_elemen?></td>
<td>Rp. <?=$harga?> </td>
<td>
<input type="text" style="width: 200px;" class="form-control" id="inputan<?=$no?>" placeholder="Jumlah <?=$value2->nama_elemen?>" name="<?=$value2->id_elemen?>" minlegth='5' maxlength='10' value='<?=number_format($produksi_pya[$value2->id_elemen])?>' disabled>
</td>
<td>Rp. <?=number_format($jumlah)?></td>
</tr>
<?php endforeach ;
$persiapan_lahan = $biaya * 10 / 100;
$totalbiaya = $biaya + $persiapan_lahan;
$keuntungan = $nilaiproduksi - $biaya - $persiapan_lahan;
if ($keuntungan <= 0 ) {
$status = 'Tidak Berhasil';
}else{
$status = 'Berhasil';
}
?>
</tbody>
</table>
</form>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jumlah Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=number_format($jumlah_produksi)?> kg" title="Jumlah Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
<div class="form-horizontal">
<div class="form-group">
<center><button type="button" class="btn btn-primary btn-sm waves-effect waves-light" onclick="submitdata()" id="button_submit" style="display: none">Proses Transaksi Produksi</button> &nbsp &nbsp <a href="<?=base_url()?>penyuluh/transaksi/lihat/<?=$this->uri->segment(4).'/'.$this->uri->segment(5)?>"><button type="button" class="btn btn-danger btn-sm waves-effect waves-light" id="button_batal" style="display: none">Batal Edit</button></a><button type="button" class="btn btn-warning btn-sm waves-effect waves-light" onclick="editdata()" id="button_edit" >Edit Transaksi Produksi ?</button></center>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
<!-- /.box-content card white -->
</div>
<div id="detailsini">
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<!-- /.box-title -->
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Panen</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Panen" value="<?=$ket_nya['masa_panen']?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Saiz</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Saiz" value="+- <?=$saiz?> ekor/kg" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Total Biaya</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Jumlah" value="Rp . <?=number_format($totalbiaya)?>" disabled="">
</div>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Harga Jual</label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="Enter your email" title="Harga Jual" value="Rp. <?=number_format($hargajual)?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Nilai Produksi</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Nilai" value="Rp. <?=number_format($nilaiproduksi)?>" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Keuntungan</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Keuntungan" value="Rp. <?=number_format($keuntungan)?>" disabled="">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Status Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$status?>" title="Status Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,270 @@
<div class="row small-spacing">
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-xs-12 col-lg-12">
<div class="box-content card">
<h4 class="box-title">Daftar Transaksi Produksi</h4>
<div class="card-content">
<div class="form-group" style="overflow-x: auto" id="tabel_transaksi">
<table id="tabel-data1" class="table table-bordered">
<thead>
<tr>
<th>No</th>
<th>Tahun</th>
<th>Musim</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php if (count($data_transaksi_produksi->result())>0): ?>
<?php foreach ($data_transaksi_produksi->result() as $key => $value):
$ket = json_decode($value->ket);
?>
<?php $i=1; foreach ($ket as $key1 => $value1): ?>
<tr>
<td><?=$i?></td>
<td><?=$value1->tahun?></td>
<td><?=$value1->musim?></td>
<td align="center">
<a href="<?=base_url()?>penyuluh/transaksi/lihat/<?=$kode_lahan?>/<?=$value1->tahun?>-<?=$value1->musim?>"><button type="button" title="Lihat Transaksi Produksi" class="btn btn-info btn-circle btn-sm waves-effect waves-light"><i class="ico fa fa-list-alt"></i></button></a>
</td>
</tr>
<?php $i++; endforeach ?>
<?php endforeach ?>
<?php endif ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-xs-12">
<div class="box-content card ">
<h4 class="box-title">Form Transaksi Produksi</h4>
<!-- /.box-title -->
<div class="card-content">
<?php foreach ($lahan->result() as $key => $value) ;
$cari_data_harga = $this->mpenyuluh->tampil_data_where('tb_tambak',array('id_tambak' =>$value->tek_tambak));
foreach ($cari_data_harga->result() as $key3 => $value3);
$ket = json_decode($value3->ket);
?>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Kode Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->id_lahan?>" title="ID Lahan" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Luas Lahan</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value->luas_lahan?> Ha" title="Luas Lahan" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jenis Tambak</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="<?=$value3->tambak?>" title="Jenis Tambak" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Waktu Tebar</label>
<div class="col-sm-4">
<?php
$min_date = date('Y-m-d');
$min_date = new DateTime($min_date);
$min_date->modify('-30 day');
$min_date =date('Y-m-d', strtotime($min_date->format('Y-m-d')));
$max_date = date('Y-m-d');
$max_date = new DateTime($max_date);
$max_date->modify('+30 day');
$max_date =date('Y-m-d', strtotime($max_date->format('Y-m-d')));
?>
<input type="date" class="form-control" id="tanggal" title="Waktu Tebar" min="<?=$min_date?>" max="<?=$max_date?>">
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="inp-type-1" class="col-sm-5 control-label">Masa Tumbuh :</label>
<div class="col-sm-4">
<select class="form-control" id="masa_tumbuh">
<option value="" disabled="" selected="">-Sila Pilih Masa Pertumbuhan</option>
<option value="60" >60</option>
<option value="90" >90</option>
<option value="150" >150</option>
</select>
</div>
<div class="col-sm-3"></div>
</div>
</div>
<div id="sinitabel">
<form class="form-horizontal" style="overflow-x: auto" id="elemen_produksi">
<table id="tabel-data" class="table table-striped table-bordered display" style="width:100%">
<thead>
<tr>
<th>Bahan</th>
<th>Harga</th>
<th width="20%">Satuan</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$ket = json_decode($value3->ket);
$satuan = json_decode($value3->satuan);
$r = 1;
// print_r($satuan->$r);
foreach ($elemen_produksi->result() as $key2 => $value2):
$no = $value2->id_elemen;
$satu = $satuan->$no;
$harga = $ket->$no;
if ($harga == '' and $harga == null) {
$harga = '';
}else{
$harga = number_format($harga);
}
?>
<tr>
<td><?=$value2->nama_elemen?></td>
<td>Rp. <?=$harga?> </td>
<td>
<input type="text" style="width: 200px;" class="form-control" id="inputan<?=$no?>" placeholder="Jumlah <?=$value2->nama_elemen?>" name="<?=$value2->id_elemen?>" minlegth='5' maxlength='10'>
</td>
<td>??</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</form>
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Jumlah Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="?? kg" title="Jumlah Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
<div class="form-horizontal">
<div class="form-group">
<center><button type="button" class="btn btn-primary btn-sm waves-effect waves-light" onclick="submitdata()">Proses Transaksi Produksi</button></center>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
<!-- /.box-content card white -->
</div>
<div id="detailsini">
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<!-- /.box-title -->
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Panen</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Panen" value="tanggal ??" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Saiz</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Saiz" value="+- ?? ekor/kg" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Total Biaya</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Jumlah" value="Rp . ??" disabled="">
</div>
</div>
</div>
</div>
<!-- /.card-content -->
</div>
<!-- /.box-content -->
</div>
<!-- /.col-lg-6 col-xs-12 -->
<div class="col-lg-6 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">Harga Jual</label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="Enter your email" title="Harga Jual" value="Rp. ??" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Nilai Produksi</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Nilai" value="Rp. ??" disabled="">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-3 control-label">Keuntungan</label>
<div class="col-sm-9">
<input type="text" class="form-control" title="Keuntungan" value="Rp. ??" disabled="">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-xs-12">
<div class="box-content card white">
<div class="card-content">
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-5 control-label">Status Produksi</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="??" title="Status Produksi" disabled="">
</div>
<div class="col-sm-3">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,636 @@
<script src="<?=base_url()?>assets/scripts/jquery.min.js"></script>
<script src="<?=base_url()?>assets/scripts/modernizr.min.js"></script>
<script src="<?=base_url()?>assets/plugin/bootstrap/js/bootstrap.min.js"></script>
<script src="<?=base_url()?>assets/plugin/nprogress/nprogress.js"></script>
<!-- <script src="<?=base_url()?>assets/plugin/sweet-alert/sweetalert.min.js"></script> -->
<script src="<?php echo base_url() ?>sweet-alert/sweetalert.js"></script>
<script src="<?=base_url()?>assets/plugin/waves/waves.min.js"></script>
<script src="<?=base_url()?>assets/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="<?=base_url()?>assets/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script>
<!-- <script src="<?=base_url()?>assets/toastr/toastr.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>assets/toastr/toastr.min.css"> -->
<script src="<?=base_url()?>assets/plugin/toastr/toastr.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>assets/plugin/toastr/toastr.css">
<?php if ($this->session->flashdata('my404')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<?php echo $this->session->flashdata('my404')?>");
</script>
<?php endif ?>
<?php if ($this->session->flashdata('success')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.success("<?php echo $this->session->flashdata('success')?>");
</script>
<?php endif ?>
<?php if ($this->session->flashdata('error')): ?>
<script type="text/javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<?php echo $this->session->flashdata('error')?>");
</script>
<?php endif ?>
<?php if ($this->uri->segment(2) == '' or $this->uri->segment(2) == null): ?>
<!-- <script type="text/javascript">
function changeFuncLahan()
{
var value = $('select[name="lokasi_lahan"]').val();
window.location.replace("<?=base_url()?>petambak/analisa/"+value);
}
</script> -->
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"aLengthMenu": [[10, 20, 30, ,40, -1], [10, 20, 30, 40 ,"All"]],
"iDisplayLength": 10,
// "pageLength": 5,
"searching": true,
"paging": true,
"ordering": true,
"info": true,
});
});
</script>
<?php endif ?>
<?php if ($this->uri->segment(2) == 'analisa' ): ?>
<?php if ($this->uri->segment(3) == '' and $this->uri->segment(3) == null): ?>
<!-- <script type="text/javascript">
function changeFuncLahan()
{
var value = $('select[name="lokasi_lahan"]').val();
window.location.replace("<?=base_url()?>petambak/analisa/"+value);
}
</script> -->
<?php endif ?>
<?php if ($this->uri->segment(3) != '' or $this->uri->segment(3) != null): ?>
<script type="text/javascript">
function changeFuncLahan()
{
var value = $('select[name="lokasi_lahan"]').val();
if (value != '') {
$.ajax({
type: "post",
url: "<?=base_url()?>penyuluh/analisa",
data: {hari: value, kode: <?=$this->uri->segment(3)?>,id:1}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
$('#tabel').html(data1);
}
});
$.ajax({
type: "post",
url: "<?=base_url()?>penyuluh/analisa",
data: {hari: value, kode: <?=$this->uri->segment(3)?>,id:2}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
$('#sini_ganti').html(data1);
}
});
}
}
</script>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"pageLength": 10,
"searching": false,
"paging": false,
"ordering": false,
"info": false,
});
});
</script>
<?php endif ?>
<?php endif ?>
<!-- <?php if ($this->uri->segment(2) == 'pengujian'): ?>
<script type="text/javascript">
function changeFuncLahan()
{
var value = $('select[name="lokasi_lahan"]').val();
window.location.replace("<?=base_url()?>petambak/pengujian/"+value);
}
</script>
<?php endif ?> -->
<?php if ($this->uri->segment(2) == 'perkiraan_produksi'): ?>
<?php if ($this->uri->segment(3) == '' and $this->uri->segment(3) == null): ?>
<!-- <script type="text/javascript">
function changeFuncLahan()
{
var value = $('select[name="lokasi_lahan"]').val();
window.location.replace("<?=base_url()?>petambak/perkiraan_produksi/"+value);
}
</script> -->
<?php endif ?>
<?php if ($this->uri->segment(3) != '' and $this->uri->segment(3) != 'null'): ?>
<script type="text/javascript">
function changeFuncLahan(a)
{
// console.log(a);
var reString = /^\d{4}-\d\d-\d\d$/;
var tanggal = $("#tanggal").val();
if (reString.test(tanggal)) {
// console.log(tanggal);
$.ajax({
type: "post",
url: "<?=base_url()?>penyuluh/perkiraan_produksi",
data: {hari: a, kode: <?=$this->uri->segment(3)?>, no:'tabel'}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
// console.log(data1);
$("#sinitabel").html(data1);
}
});
$.ajax({
type: "post",
url: "<?=base_url()?>penyuluh/perkiraan_produksi",
data: {hari: a, kode: <?=$this->uri->segment(3)?>, tanggal: tanggal}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
// console.log(data1);
$("#detailsini").html(data1);
}
});
}else{
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.warning("<b>Gagal</b><br>Tanggal Harus Dipilih Terlebih Dulu");
}
// var value = $('select[name="lokasi_lahan"]').val();
// window.location.replace("<?=base_url()?>petambak/perkiraan_produksi/"+value);
}
</script>
<?php endif ?>
<?php endif ?>
<?php if ($this->uri->segment(2) == 'transaksi'): ?>
<?php if ($this->uri->segment(3) == '' or $this->uri->segment(3) == null): ?>
<script type="text/javascript">
function changeFuncLahan()
{
var value = $('select[name="lokasi_lahan"]').val();
window.location.replace("<?=base_url()?>penyuluh/transaksi/"+value);
}
</script>
<?php endif ?>
<?php if (is_numeric($this->uri->segment(3))): ?>
<script type="text/javascript">
<?php foreach ($elemen_produksi->result() as $key => $value): ?>
var elem = document.getElementById("inputan<?=$value->id_elemen?>");
elem.addEventListener("keydown",function(event){
var key = event.which;
if((key<48 || key>57) && key != 8) event.preventDefault();
});
elem.addEventListener("keyup",function(event){
var value = this.value.replace(/,/g,"");
this.dataset.currentValue=parseInt(value);
var caret = value.length-1;
while((caret-3)>-1)
{
caret -= 3;
value = value.split('');
value.splice(caret+1,0,",");
value = value.join('');
}
this.value = value;
});
<?php endforeach ?>
</script>
<script type="text/javascript">
function submitdata()
{
// console.log(a);
var reString = /^\d{4}-\d\d-\d\d$/;
var tanggal = $("#tanggal").val();
var masa_tumbuh = $("#masa_tumbuh").val();
// console.log(tanggal);
// if (reString.test(tanggal)) {
// // console.log(tanggal);
// }
var data = $('#elemen_produksi').serializeArray();
var $emptyFields = $('#elemen_produksi :input').filter(function() {
return $.trim(this.value) === "";
// return this.name;
});
if (!$emptyFields.length) {
if (reString.test(tanggal)) {
if (masa_tumbuh == '' || masa_tumbuh == null) {
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Masa Tumbuh Harus Dipilih");
}else{
$.ajax({
type: "post",
url: "<?=base_url()?>penyuluh/transaksi",
data: {hari: masa_tumbuh, data : data, kode: <?=$this->uri->segment(3)?>, tanggal: tanggal,no:'tabel'}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
// console.log(data1);
$("#sinitabel").html(data1);
}
});
$.ajax({
type: "post",
url: "<?=base_url()?>penyuluh/transaksi",
data: {hari: masa_tumbuh, data : data, kode: <?=$this->uri->segment(3)?>, tanggal: tanggal, no : 'detail'}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
// console.log(data1);
$("#detailsini").html(data1);
}
});
$.ajax({
type: "post",
url: "<?=base_url()?>penyuluh/transaksi",
data: {hari: masa_tumbuh, data : data, kode: <?=$this->uri->segment(3)?>, tanggal: tanggal, no : 'tabel_transaksi'}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
console.log(data1);
$("#tabel_transaksi").html(data1);
}
});
}
}else{
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Tanggal Harus Terisi");
}
}else{
// console.log('tiada');
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Semua Input Form Pada Field Satuan Harus Terisi");
}
}
</script>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"pageLength": 10,
"searching": false,
"paging": false,
"ordering": false,
"info": false,
});
});
$(document).ready(function(){
$('#tabel-data1').DataTable({
"pageLength": 10,
"searching": true,
"paging": true,
"ordering": true,
"info": true,
});
});
</script>
<?php endif ?>
<?php if ($this->uri->segment(3) == 'lihat'): ?>
<script type="text/javascript">
function editdata()
{
$('#button_submit').show();
$('#button_batal').show();
$('#button_edit').hide();
$("#tanggal").prop('disabled', false);
$("#tanggal").focus();
$("#masa_tumbuh").prop('disabled', false);
<?php foreach ($elemen_produksi->result() as $key => $value): ?>
$("#inputan<?= $value->id_elemen?>").prop('disabled', false);
<?php endforeach ?>
}
</script>
<script type="text/javascript">
<?php foreach ($elemen_produksi->result() as $key => $value): ?>
var elem = document.getElementById("inputan<?=$value->id_elemen?>");
elem.addEventListener("keydown",function(event){
var key = event.which;
if((key<48 || key>57) && key != 8) event.preventDefault();
});
elem.addEventListener("keyup",function(event){
var value = this.value.replace(/,/g,"");
this.dataset.currentValue=parseInt(value);
var caret = value.length-1;
while((caret-3)>-1)
{
caret -= 3;
value = value.split('');
value.splice(caret+1,0,",");
value = value.join('');
}
this.value = value;
});
<?php endforeach ?>
</script>
<script type="text/javascript">
function submitdata()
{
// console.log(a);
var reString = /^\d{4}-\d\d-\d\d$/;
var tanggal = $("#tanggal").val();
var masa_tumbuh = $("#masa_tumbuh").val();
// console.log(tanggal);
// if (reString.test(tanggal)) {
// // console.log(tanggal);
// }
var data = $('#elemen_produksi').serializeArray();
var $emptyFields = $('#elemen_produksi :input').filter(function() {
return $.trim(this.value) === "";
// return this.name;
});
if (!$emptyFields.length) {
if (reString.test(tanggal)) {
if (masa_tumbuh == '' || masa_tumbuh == null) {
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Masa Tumbuh Harus Dipilih");
}else{
$.ajax({
type: "post",
url: "<?=base_url()?>penyuluh/transaksi",
data: {hari: masa_tumbuh, data : data, kode: <?=$this->uri->segment(4)?>, tanggal: tanggal,no:'tabel'}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
// console.log(data1);
$("#sinitabel").html(data1);
}
});
$.ajax({
type: "post",
url: "<?=base_url()?>penyuluh/transaksi",
data: {hari: masa_tumbuh, data : data, kode: <?=$this->uri->segment(4)?>, tanggal: tanggal, no : 'detail'}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
// console.log(data1);
$("#detailsini").html(data1);
}
});
$.ajax({
type: "post",
url: "<?=base_url()?>penyuluh/transaksi",
data: {hari: masa_tumbuh, data : data, kode: <?=$this->uri->segment(4)?>, tanggal: tanggal, no : 'tabel_transaksi'}, // appears as $_GET['id'] @ your backend side
// dataType: "html",
success: function(data1) {
console.log(data1);
$("#tabel_transaksi").html(data1);
}
});
}
}else{
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Tanggal Harus Terisi");
}
}else{
// console.log('tiada');
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"positionClass": "toast-top-right",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.error("<b>Error</b><br>Semua Input Form Pada Field Satuan Harus Terisi");
}
}
</script>
<script>
$(document).ready(function(){
$('#tabel-data').DataTable({
"pageLength": 10,
"searching": false,
"paging": false,
"ordering": false,
"info": false,
});
});
$(document).ready(function(){
$('#tabel-data1').DataTable({
"pageLength": 10,
"searching": true,
"paging": true,
"ordering": true,
"info": true,
});
});
</script>
<?php endif ?>
<?php endif ?>
<script src="<?=base_url()?>assets/scripts/main.min.js"></script>

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