first commit

This commit is contained in:
2019-05-25 23:11:05 -04:00
commit 16f48376bc
6139 changed files with 990356 additions and 0 deletions
@@ -0,0 +1,23 @@
<?php
class Admindash_model extends CI_Model {
function __construct() {
}
public function getAdminDashData($data) {
$out = array();
$y = $this->getDashRecentSignup(10);
$out['recent_signup'] = $y['recent_signup'];
return $out;
}
public function getDashRecentSignup($limit) {
$out = array();
$mysql = "SELECT id,firstname,lastname,email,added::date AS added,phone FROM members ORDER BY id DESC LIMIT $limit ";
$q = $this->db->query($mysql);
$out['recent_signup'] = $q->result();
return $out;
}
}
+259
View File
@@ -0,0 +1,259 @@
<?php
class Combo_model extends CI_Model {
var $optCons = '';
var $currentStyle = 'form-control select';
var $readOnlyMode = false;
var $defaultComboMessage = 'Select...';
var $showDefaultSelect = true;
function __construct() {
}
public function getProvidersListTypeCombo($option_name, $curVal) {
$sql = "SELECT id,firstname||' '||lastname||'-'||email AS driver_name FROM providers WHERE status=1 ORDER BY ID ASC ";
$q = $this->db->query($sql);
$option_value = $this->optionValueObject($q->result(), "id", "driver_name", $curVal);
return $this->comboFrame($option_name, $option_value);
}
public function getJobPostDuration($option_name, $duration) {
$this->defaultComboMessage = 'Select duration of post';
$cmbstr = "";
for ($ii = 2; $ii <= 10; $ii++) {
$cmbstr .= "<option value='$ii'>$ii day(s)</option>";
}
return $this->comboFrame($option_name, $cmbstr);
}
public function getUserAccountTypeCombo($option_name, $curVal) {
$sql = "SELECT id,type_name FROM members_acc_types WHERE status=1 ORDER BY ID ASC ";
$q = $this->db->query($sql);
$option_value = $this->optionValueObject($q->result(), "id", "type_name", $curVal);
return $this->comboFrame($option_name, $option_value);
}
public function getUserJobGroupCombo($option_name, $member_id, $curVal) {
// $sql = "SELECT id,group_name FROM members_job_group WHERE member_id = $member_id AND status = 1 ORDER BY group_name ASC ";
$sql = "SELECT m.id,m.group_name, m.group_name||' ['||count(g.group_id)||' members]' AS member_group_count "
. "FROM members_job_group m "
. "LEFT JOIN members_job_groupmember g ON g.group_id = m.id "
. "WHERE m.member_id = $member_id "
. "AND m.status = 1 GROUP BY m.id,m.group_name ORDER BY m.group_name ASC";
$q = $this->db->query($sql);
$option_value = $this->optionValueObject($q->result(), "id", "member_group_count", $curVal);
return $this->comboFrame($option_name, $option_value);
}
public function getUserRecipientCombo($option_name, $member_id, $curVal) {
$sql = "SELECT b.id,b.firstname||' '||b.lastname||' '||b.account_no||' '||k.name AS recipient "
. "FROM sendmoney_recipient b "
. "LEFT JOIN bank_entity_codes k ON k.code=b.bank_code "
. "WHERE b.member_id = $member_id AND b.status=1";
$q = $this->db->query($sql);
$option_value = $this->optionValueObject($q->result(), "id", "recipient", $curVal);
return $this->comboFrame($option_name, $option_value);
}
public function getAccountTypeCombo($option_name, $curVal) {
$q = $this
->db
->where('status', 1)
->order_by('type_name', 'ASC')
->get('account_types');
$option_value = $this->optionValueObject($q->result(), "type_value", "type_name", $curVal);
return $this->comboFrame($option_name, $option_value);
}
public function getGeneralSkillCombo($option_name, $curVal) {
$this->showDefaultSelect = false;
$q = $this
->db
->where('status', 1)
->order_by('lorder', 'DESC')
->get('skill_category');
$option_value = $this->optionValueObject($q->result(), "id", "category", $curVal);
return $this->comboFrame($option_name, $option_value);
}
public function getUserNewSkillCombo($option_name, $curVal, $category_id, $member_id) {
$q = $this
->db
->where('status', 1)
->where('category_id', $category_id)
->order_by('lorder', 'DESC')
->get('skill_types');
$option_value = $this->optionValueObject($q->result(), "id", "skill", $curVal);
return $this->comboFrame($option_name, $option_value);
}
public function setReadOnly($bl) {
$this->readOnlyMode = $bl;
}
public function getCountryCombo($option_name, $curVal) {
$q = $this
->db
->where('status', 1)
->order_by('country', 'ASC')
->get('country');
$option_value = $this->optionValueObject($q->result(), "code", "country", $curVal);
return $this->comboFrame($option_name, $option_value);
}
public function getBankCombo($option_name, $curVal) {
/*
wrenchboard=> Select code,name from bank_entity_codes WHERE country ='NG' ORDER BY name ASC;
code | name
------+------------------------------------------------
044 | Access Bank
014 | Afri Bank
023 | Citi Bank
063 | Diamond Bank
050 | Ecobank
040 | Equitorial Trust Bank
*/
$q = $this
->db
->where('status', 1)
->order_by('name', 'ASC')
->get('bank_entity_codes');
$option_value = $this->optionValueObject($q->result(), "code", "name", $curVal);
return $this->comboFrame($option_name, $option_value);
}
public function geReasonCombo($rkey, $option_name, $curVal) {
/*
utransport=> SELECT * FROM reason_items WHERE rkey='AREASON';
id | rkey | lkey| name | weight | lorder | created
----+------+------+--------+--------+---------
*/
$q = $this
->db
->where('rkey', $rkey)
->order_by('name', 'ASC')
->get('reason_items');
$option_value = $this->optionValueObject($q->result(), "lkey", "name", $curVal);
return $this->comboFrame($option_name, $option_value);
}
private function optionValueObject($sdStd, $val, $valname, $curVal) {
$this->optCons = '';
if ($this->showDefaultSelect == true) {
$this->optCons .= "<option value=''>" . $this->defaultComboMessage . "</option>";
}
foreach ($sdStd as $row) {
$selV = '';
if ($curVal == $row->$val) {
$selV = " selected ";
}
$this->optCons .= "<option value='" . $row->$val . "' " . $selV . ">" . $row->$valname . "</option>";
}
return $this->optCons;
}
private function comboFrame($option_name, $option_value) {
$addReaOnly = "";
if ($this->readOnlyMode == true) {
$addReaOnly = " disabled ";
}
return $cmb = "<select data-placeholder='" . $this->defaultComboMessage . "' class='" . $this->currentStyle . "' name='$option_name' $addReaOnly >$option_value</select>";
}
public function getStatesCombo($option_name, $curVal) {
// global $stateCodes;
$option_value = "";
// print_r($stateCodes);
foreach ($this->stateCodes as $i => $srow) {
$sel = "";
if ($i == $curVal) {
$sel = " selected ";
}
$option_value.="<option value='" . $i . "' " . $sel . ">" . $srow . "</option>";
}
return $this->comboFrame($option_name, $option_value);
}
var $stateCodes = array(
"AK" => "Alaska",
"AL" => "Alabama",
"AZ" => "Arizona",
"AR" => "Arkansas",
"CA" => "California",
"CO" => "Colorado",
"CT" => "Connecticut",
"DC" => "District of Columbia",
"DE" => "Delaware",
"FL" => "Florida",
"GA" => "Georgia",
"HI" => "Hawaii",
"IA" => "Iowa",
"ID" => "Idaho",
"IL" => "Illinois",
"IN" => "Indiana",
"KS" => "Kansas",
"KY" => "Kentucky",
"LA" => "Louisiana",
"ME" => "Maine",
"MD" => "Maryland",
"MA" => "Massachusetts",
"MI" => "Michigan",
"MN" => "Minnesota",
"MO" => "Missouri",
"MS" => "Mississippi",
"MT" => "Montana",
"NC" => "North Carolina",
"ND" => "North Dakota",
"NE" => "Nebraska",
"NH" => "New Hampshire",
"NJ" => "New Jersey",
"NM" => "New Mexico",
"NV" => "Nevada",
"NY" => "New York",
"OH" => "Ohio",
"OK" => "Oklahoma",
"OR" => "Oregon",
"PA" => "Pennsylvania",
"PR" => "Puerto Rico",
"RI" => "Rhode Island",
"SC" => "South Carolina",
"SD" => "South Dakota",
"TN" => "Tennessee",
"TX" => "Texas",
"UT" => "Utah",
"VA" => "Virginia",
"VI" => "Virgin Islands",
"VT" => "Vermont",
"WA" => "Washington",
"WI" => "Wisconsin",
"WV" => "West Virginia",
"WY" => "Wyoming"
);
}
@@ -0,0 +1,88 @@
<?php
class Service_model extends CI_Model {
function __construct() {
}
public function getAdminDashData($data) {
$out = array();
$y = $this->getDashRecentSignup(10);
$out['recent_signup'] = $y['recent_signup'];
return $out;
}
public function getServiceRequestListStatus($serviceType,$statusList, $limit) {
$out = array();
$mysql = "SELECT r.id AS service_request_id,DATE_PART('day', r.service_date - now() ) AS day_gap, r.*,a.agent_name,m.firstname,m.lastname,m.email,m.phone,"
. " s.service AS service_type_text "
. " FROM members_service_request r "
. " LEFT JOIN members m ON m.id = r.member_id LEFT JOIN agents a ON a.id=r.agent_id LEFT JOIN service_types s ON s.id = r.service_type "
. " WHERE r.service_type=".$serviceType." AND r.flags IN(".$statusList.") ORDER BY r.id DESC LIMIT $limit ";
$q = $this->db->query($mysql);
$out['service_request_list'] = $q->result();
return $out;
}
public function getServiceRequestList($limit) {
$out = array();
$mysql = "SELECT r.id AS service_request_id,DATE_PART('day', r.service_date - now() ) AS day_gap, r.*,a.agent_name,m.firstname,m.lastname,m.email,m.phone,"
. " s.service AS service_type_text "
. " FROM members_service_request r "
. " LEFT JOIN members m ON m.id = r.member_id LEFT JOIN agents a ON a.id=r.agent_id LEFT JOIN service_types s ON s.id = r.service_type "
. " ORDER BY r.id DESC LIMIT $limit ";
$q = $this->db->query($mysql);
$out['service_request_list'] = $q->result();
return $out;
}
public function getMemberServiceRequestList($member_id, $limit) {
$out = array();
$mysql = "SELECT r.id AS service_request_id,DATE_PART('day', r.service_date - now() ) AS day_gap, r.*,a.agent_name,m.firstname,m.lastname,m.email,m.phone,"
. " s.service AS service_type_text "
. " FROM members_service_request r "
. " LEFT JOIN members m ON m.id = r.member_id LEFT JOIN agents a ON a.id=r.agent_id LEFT JOIN service_types s ON s.id = r.service_type WHERE r.member_id= " . $member_id
. " ORDER BY r.id DESC LIMIT $limit ";
$q = $this->db->query($mysql);
$out['service_request_list'] = $q->result();
return $out;
}
/*
*
* id | pid | member_id | agent_id | service_type | service_date | added | status | flags | loc | dist_mode | miles | minutes | agent_name | firstname | lastname | email | phone
----+-----+-----------+----------+--------------+---------------------+----------------------------+--------+-------+-----------------+-----------+-------+---------+----------------------------+-----------+----------+-------------------------+------------
1 | 100 | 11 | 3 | 3 | 2018-04-10 16:30:00 | 2018-04-23 17:12:33.642712 | 1 | 1 | 104.238.127.115 | | 0 | 0 | Agenr Name with name 10003 | Thompson | david | ses66181+5726@gmail.com | 7702223282
2 | 100 | 3 | 4 | 3 | 2018-04-10 18:30:00 | 2018-04-23 17:13:13.310014 | 1 | 1 | 104.238.127.115 | | 0 | 0 | Agenr Name with name 10004 | nidia | Kate | ses66181+5514@gmail.com | 7702222657
3 | 100 | 10 | 6 | 5 | 2018-04-10 07:30:00 | 2018-04-23 17:13:50.357451 | 1 | 1 | 104.238.127.115 | | 0 | 0 | Agenr Name with name 10006 | mayowa | Idowu | ses66181+4862@gmail.com | 7702224559
4 | 100 | 13 | 6 | 2 | 2018-04-10 18:30:00 | 2018-04-23 17:14:03.610904 | 1 | 1 | 104.238.127.115 | | 0 | 0 | Agenr Name with name 10006 | Oyewumi | Olalekan | ses66181+6839@gmail.com | 7702225690
5 | 100 | 13 | 7 | 2 | 2018-04-10 15:30:00 | 2018-04-23 17:14:07.596965 | 1 | 1 | 104.238.127.115 | | 0 | 0 | Agenr Name with name 86517 | Oyewumi | Olalekan | ses66181+6839@gmail.com | 7702225690
6 | 100 | 2 | 9 | 2 | 2018-04-10 17:30:00 | 2018-04-23 17:14:28.341037 | 1 | 1 | 104.238.127.115 | | 0 | 0 | Agenr Name with name 3297 | Caroline | travis | ses66181+5527@gmail.com | 7702226881
kleen=> select * from service_types;
id | service | description | status | added
----+-----------------------+-----------------------+--------+----------------------------
1 | Laundry Drop Off | Laundry Drop Off | 1 | 2018-04-17 11:36:42.94168
2 | Dryclean Pick & Deliv | Dryclean Pick & Deliv | 1 | 2018-04-17 11:36:42.953587
3 | Home Cleaning | Home Cleaning | 1 | 2018-04-17 11:36:42.984192
4 | Home Laundry | Home Laundry | 1 | 2018-04-17 11:36:42.990875
5 | Wash/Fold | Wash/Fold | 1 | 2018-04-17 11:36:43.003582
(5 rows)
*/
}
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>