Added Resources Starter
This commit is contained in:
@@ -16,8 +16,14 @@ class myfitHx extends Model
|
||||
|
||||
public function readLoginHx($in)
|
||||
{
|
||||
// $in['member_id'] = 16;
|
||||
$member_id =
|
||||
( isset($in['member_id']) && $in['member_id'] > 0 && is_int($in['member_id']) )
|
||||
? $in['member_id']
|
||||
: 0;
|
||||
$sqlQ =
|
||||
'SELECT * FROM members_login_hx WHERE member_id='.$in['member_id'];
|
||||
'SELECT * FROM members_login_hx WHERE member_id=' .
|
||||
$member_id;
|
||||
$query = $this->db->query($sqlQ);
|
||||
$data['loginhx_data'] = $query->getResultArray();
|
||||
return $inx = [
|
||||
@@ -25,7 +31,5 @@ class myfitHx extends Model
|
||||
'status' => 1,
|
||||
'raw_data' => $in,
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+47
-32
@@ -5,44 +5,59 @@ use CodeIgniter\Model;
|
||||
|
||||
class myfitPricing extends Model
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
public function getSitePricing($in)
|
||||
{
|
||||
|
||||
return array
|
||||
(
|
||||
[
|
||||
'icon' => '/static/media/standard.png',
|
||||
'title' => 'Standard',
|
||||
'text' => 'For the basics.',
|
||||
'price' => 'Free',
|
||||
'price_anual' => 'Free',
|
||||
'features' =>['Reminders', 'Health Tracking', 'Feature 3', 'Feature 4','Feature 5']
|
||||
return [
|
||||
'pricing_text_02' => 'This will be the test header test 001',
|
||||
'pricing' => [
|
||||
[
|
||||
'icon' => '/static/media/standard.png',
|
||||
'title' => 'Standard',
|
||||
'text' => 'For the basics.',
|
||||
'price' => 'Free',
|
||||
'price_anual' => 'Free',
|
||||
'features' => [
|
||||
'Reminders',
|
||||
'Health Tracking',
|
||||
'Analytics',
|
||||
'Notifications',
|
||||
'Health Resources',
|
||||
],
|
||||
],
|
||||
[
|
||||
'icon' => '/static/media/unlimited.png',
|
||||
'title' => 'Unlimited',
|
||||
'text' => 'Professionals here.',
|
||||
'price' => '$7.99/m',
|
||||
'price_anual' => '$55/y',
|
||||
'features' => [
|
||||
'Everyting Premium',
|
||||
'Feature 22',
|
||||
'Feature 33',
|
||||
'Integrations',
|
||||
'Custom Page',
|
||||
],
|
||||
],
|
||||
[
|
||||
'icon' => '/static/media/premium.png',
|
||||
'title' => 'Premium',
|
||||
'text' => 'For small team.',
|
||||
'price' => '$5/m',
|
||||
'price_anual' => '$45/y',
|
||||
'features' => [
|
||||
'Everything Standard',
|
||||
'Group/Family Tracking',
|
||||
'Custom Dashboard',
|
||||
'Recomendations',
|
||||
'Storage',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'icon' => '/static/media/unlimited.png',
|
||||
'title' => 'Unlimited',
|
||||
'text' => 'Professionals here.',
|
||||
'price' => '$7.99/m',
|
||||
'price_anual' => '$55/y',
|
||||
'features' =>['Everyting Premium', 'Feature 22', 'Feature 33', 'Feature 44','Custom Page']
|
||||
],
|
||||
[
|
||||
'icon' => '/static/media/premium.png',
|
||||
'title' => 'Premium',
|
||||
'text' => 'For small team.',
|
||||
'price' => '$5/m',
|
||||
'price_anual' => '$45/y',
|
||||
'features' =>['Everything Standard', 'Group/Family Tracking', 'Feature 88', 'Feature 99','Feature 100']
|
||||
]
|
||||
);
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class myfitResources extends Model
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getSiteResources($in)
|
||||
{
|
||||
return [
|
||||
'pricing_text_02' => 'This will be the test header test 001',
|
||||
'pricing' => [
|
||||
[
|
||||
'icon' => '/static/media/standard.png',
|
||||
'title' => 'Standard',
|
||||
'text' => 'For the basics.',
|
||||
'price' => 'Free',
|
||||
'price_anual' => 'Free',
|
||||
'features' => [
|
||||
'Reminders',
|
||||
'Health Tracking',
|
||||
'Analytics',
|
||||
'Notifications',
|
||||
'Health Resources',
|
||||
],
|
||||
],
|
||||
[
|
||||
'icon' => '/static/media/unlimited.png',
|
||||
'title' => 'Unlimited',
|
||||
'text' => 'Professionals here.',
|
||||
'price' => '$7.99/m',
|
||||
'price_anual' => '$55/y',
|
||||
'features' => [
|
||||
'Everyting Premium',
|
||||
'Feature 22',
|
||||
'Feature 33',
|
||||
'Integrations',
|
||||
'Custom Page',
|
||||
],
|
||||
],
|
||||
[
|
||||
'icon' => '/static/media/premium.png',
|
||||
'title' => 'Premium',
|
||||
'text' => 'For small team.',
|
||||
'price' => '$5/m',
|
||||
'price_anual' => '$45/y',
|
||||
'features' => [
|
||||
'Everything Standard',
|
||||
'Group/Family Tracking',
|
||||
'Custom Dashboard',
|
||||
'Recomendations',
|
||||
'Storage',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -11,17 +11,17 @@ class myfitUserReminders extends Model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
//$db = \Config\Database::connect('mermsemr');
|
||||
$this->db = \Config\Database::connect($this->con_name);
|
||||
}
|
||||
|
||||
public function readReminders($in)
|
||||
{
|
||||
$member_id =
|
||||
isset($in['member_id']) && $in['member_id'] > 0
|
||||
? $in['member_id']
|
||||
: 0;
|
||||
$reminder_category = $this->reminderCategory(); // [];
|
||||
$sqlQ =
|
||||
'SELECT * FROM members_reminders';
|
||||
|
||||
|
||||
$sqlQ = "SELECT * FROM members_reminders WHERE member_id = $member_id";
|
||||
$query = $this->db->query($sqlQ);
|
||||
$data['reminders_data'] = $query->getResultArray();
|
||||
return $inx = [
|
||||
@@ -30,16 +30,107 @@ class myfitUserReminders extends Model
|
||||
'status' => 1,
|
||||
'raw_data' => $in,
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function reminderCategory(){
|
||||
|
||||
$sqlQ ="SELECT uuid,category,code FROM reminder_category ORDER BY category";
|
||||
public function reminderCategory()
|
||||
{
|
||||
$sqlQ =
|
||||
'SELECT uuid,category,code FROM reminder_category ORDER BY category';
|
||||
$query = $this->db->query($sqlQ);
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
public function reminderMode()
|
||||
{
|
||||
$sqlQ = 'SELECT uuid,mode,code FROM reminder_modes';
|
||||
$query = $this->db->query($sqlQ);
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
public function reminderAddEdit($in)
|
||||
{
|
||||
/*
|
||||
{
|
||||
'member_id': 1,
|
||||
'description': 'This is a test',
|
||||
'category': 'APPT',
|
||||
'mode' : 'SMS',
|
||||
'start_date':'2022-01-01',
|
||||
'end_date': '2022-01-01',
|
||||
'notes':'This is te notes for the page '
|
||||
}
|
||||
|
||||
*/
|
||||
$in_test = [
|
||||
'member_id' => 1,
|
||||
'description' => 'This is a test',
|
||||
'category' => 'APPT',
|
||||
'mode' => 'SMS',
|
||||
'start_date' => '2022-01-01',
|
||||
'end_date' => '2022-01-01',
|
||||
'notes' => 'This is te notes for the page ',
|
||||
];
|
||||
|
||||
if (isset($in['member_id']) && $in['member_id'] > 0) {
|
||||
if (isset($in['uuid']) && trim($in['uuid']) != '') {
|
||||
return $this->editReminder($in);
|
||||
} else {
|
||||
return $this->addReminder($in);
|
||||
}
|
||||
}
|
||||
return [
|
||||
'error' => 'Invalid call to reminder',
|
||||
'reason' => 'details commin in version 3',
|
||||
];
|
||||
}
|
||||
|
||||
private function addReminder($in)
|
||||
{
|
||||
$member_id = $in['member_id'];
|
||||
$description = $in['description'];
|
||||
$category = $in['category'];
|
||||
$mode = $in['mode'];
|
||||
$start_date = $in['start_date'];
|
||||
$end_date = $in['end_date'];
|
||||
$notes = $in['notes'];
|
||||
|
||||
// Create Rem
|
||||
$sqlQ = "INSERT INTO members_reminders ( member_id,
|
||||
description, category, mode, start_date, end_date,notes )
|
||||
VALUES ($member_id,'$description','$category', '$mode','$start_date', '$end_date','$notes')";
|
||||
if ($this->db->query($sqlQ)) {
|
||||
$insert_id = $this->db->insertID();
|
||||
|
||||
$sqlQ = "SELECT * FROM members_reminders WHERE id = $insert_id ";
|
||||
$query = $this->db->query($sqlQ);
|
||||
$rem_data = $query->getResultArray();
|
||||
} else {
|
||||
$insert_id = 0;
|
||||
$rem_data = [];
|
||||
}
|
||||
|
||||
return ['insert_id' => $insert_id, 'new_data' => $rem_data];
|
||||
}
|
||||
|
||||
private function editReminder($in)
|
||||
{
|
||||
$uuid = trim($in['uuid']);
|
||||
$member_id = $in['member_id'];
|
||||
$description = $in['description'];
|
||||
$category = $in['category'];
|
||||
$mode = $in['mode'];
|
||||
$start_date = $in['start_date'];
|
||||
$end_date = $in['end_date'];
|
||||
$notes = $in['notes'];
|
||||
|
||||
$sqlQ = "SELECT * FROM members_reminders WHERE member_id = $member_id AND uuid ='$uuid' ";
|
||||
$query = $this->db->query($sqlQ);
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$sql = "INSERT INTO table (title) VALUES('" . $db->escapeString($title) . "')";
|
||||
|
||||
*/
|
||||
|
||||
@@ -17,12 +17,12 @@ class userAccess extends Model
|
||||
|
||||
public function startLogin($in)
|
||||
{
|
||||
$sqlQ =
|
||||
'SELECT m.id as member_id, m.*,mp.* FROM members m LEFT JOIN members_profile mp ON m.id=mp.member_id WHERE m.id =12';
|
||||
// $sqlQ =
|
||||
// 'SELECT m.id as member_id, m.*,mp.* FROM members m LEFT JOIN members_profile mp ON m.id=mp.member_id WHERE m.id =12';
|
||||
|
||||
$username = $in['username'];
|
||||
$password = $in['password'];
|
||||
$sqlQ = "SELECT m.id as member_id, m.*,mp.*
|
||||
$username = trim($in['username']);
|
||||
$password = trim($in['password']);
|
||||
$sqlQ = "SELECT m.id as mid, m.*,mp.*
|
||||
FROM members m LEFT
|
||||
JOIN members_profile mp ON m.id=mp.member_id
|
||||
WHERE LOWER(m.username) = LOWER('$username')
|
||||
@@ -33,8 +33,10 @@ class userAccess extends Model
|
||||
|
||||
if (count($data['profile_data']) == 1) {
|
||||
$data['profile_data'][0]['password'] = '**REMOVED**';
|
||||
$member_id = $data['profile_data'][0]['member_id'];
|
||||
$member_id = $data['profile_data'][0]['mid'];
|
||||
$member_uid = $data['profile_data'][0]['uuid'];
|
||||
$data['profile_data'][0]['member_id'] = $member_id; // fixing issue of member id used in profile
|
||||
|
||||
return $inx = [
|
||||
'session_token' => $this->generateSession($member_id),
|
||||
'member_id' => $member_id,
|
||||
|
||||
Reference in New Issue
Block a user