From: Steve Sutton Date: Wed, 24 Sep 2014 21:00:18 +0000 (-0400) Subject: initial copy X-Git-Tag: v1.0.1~37 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=8ed7bd3658e93fcbe1f25f3d79c67afdbbbdee61;p=WP-Plugins%2Fglm-employment.git initial copy --- 8ed7bd3658e93fcbe1f25f3d79c67afdbbbdee61 diff --git a/controllers/admin.php b/controllers/admin.php new file mode 100644 index 0000000..308b142 --- /dev/null +++ b/controllers/admin.php @@ -0,0 +1,91 @@ +prefix . SELF::TABLE_NAME; + + $charset_collate = ''; + + if (!empty($wpdb->charset)) { + $charset_collate .= "DEFAULT CHARACTER SET {$wpdb->charset}"; + } + + if (!empty($wpdb->collate)) { + $charset_collate .= " COLLATE {$wpdb->collate}"; + } + + $sql = "CREATE TABLE {$tableName} ( + id mediumint (9) NOT NULL AUTO_INCREMENT, + time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + name text NOT NULL, + description text, + qualifications text, + benefits text, + primary_shift text, + comments text, + expire_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + pay_grade text, + job_code text, + status text, + active bool DEFAULT 0, + hr_contact text, + hr_phone text, + hr_email text, + UNIQUE KEY id (id) + ) $charset_collate;"; + + require_once ABSPATH . 'wp-admin/includes/upgrade.php'; + \dbDelta($sql); + + \add_option(SELF::DB_OPTION, SELF::DB_VERSION); + } + + public function initializeData() + { + global $wpdb; + + $tableName = $wpdb->prefix . SELF::TABLE_NAME; + + $testData = array( + 'time' => \current_time('mysql'), + 'name' => 'Test 1', + 'expire_date' => '2015-02-12 00:00:00' + ); + $wpdb->insert( + $tableName, + $testData + ); + } + + public function pluginUpdateDbCheck() + { + if (\get_option(SELF::DB_OPTION) != SELF::DB_VERSION) { + $this->installApplication(); + } + \update_option(SELF::DB_OPTION, SELF::DB_VERSION); + } + +} diff --git a/glm-employment.php b/glm-employment.php new file mode 100644 index 0000000..d0ce475 --- /dev/null +++ b/glm-employment.php @@ -0,0 +1,27 @@ +initalizeActivationHooks(); + } +} + +$employmentApp = new Emp\Setup(); diff --git a/models/job.php b/models/job.php new file mode 100644 index 0000000..90a3e52 --- /dev/null +++ b/models/job.php @@ -0,0 +1,10 @@ +