diff --git a/.gitignore b/.gitignore index d5a43b8..413b735 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ dev.php test.php +migration.php log_21.txt log_22.txt marketing/ diff --git a/api/v1/get/equipments.php b/api/v1/get/equipments.php index 61b7e18..27915d1 100644 --- a/api/v1/get/equipments.php +++ b/api/v1/get/equipments.php @@ -61,7 +61,7 @@ if(isset($get_content) && $get_content!=''){ $v = explode("=", $y); //INCLUDE VARIABLES IN ARRAY $criterias[$v[0]] = $v[1]; - if ($v[0] == 'page' || $v[0] =='p' || $v[0] =='products' || $v[0] =='totals' || $v[0] =='history' || $v[0] =='success_msg' || $v[0] =='download' || $v[0] =='sort'){ + if ($v[0] == 'page' || $v[0] =='p' || $v[0] =='products' || $v[0] =='list' || $v[0] =='totals' || $v[0] =='history' || $v[0] =='success_msg' || $v[0] =='download' || $v[0] =='sort'){ //do nothing } elseif ($v[0] == 'equipmentid') { @@ -188,6 +188,10 @@ elseif (isset($criterias['products']) && $criterias['products'] ==''){ //Request for all products in equipment view $sql = 'SELECT distinct(p.productcode), p.productname from equipment e LEFT JOIN products p ON e.productrowid = p.rowID '.$whereclause.' ORDER BY p.productcode'; } +elseif (isset($criterias['list']) && $criterias['list'] =='') { + //SQL for Paging + $sql = 'SELECT e.rowID, e.serialnumber FROM equipment e '.$whereclause.''; +} elseif (isset($criterias['totals']) && $criterias['totals'] =='' && isset($criterias['type'])){ //Request for total rows for history reports $sql ='SELECT count(*) as count FROM equipment_history h LEFT JOIN equipment e ON h.equipmentid = e.rowID '.$whereclause.''; @@ -320,7 +324,7 @@ if(isset($criterias['totals']) && $criterias['totals']==''){ $messages = $stmt->fetch(); $messages = $messages[0]; } -elseif ((isset($criterias['history']) && $criterias['history'] !='') || (isset($criterias['products']) && $criterias['products'] =='') || (isset($criterias['download']) && $criterias['download'] =='')){ +elseif ((isset($criterias['history']) && $criterias['history'] !='') || (isset($criterias['list']) && $criterias['list']=='') || (isset($criterias['products']) && $criterias['products'] =='') || (isset($criterias['download']) && $criterias['download'] =='')){ //Excute Query $stmt->execute(); //Get results diff --git a/api/v2/get/billing.php b/api/v2/get/billing.php index a53d3ed..e8832a7 100644 --- a/api/v2/get/billing.php +++ b/api/v2/get/billing.php @@ -34,7 +34,7 @@ if(isset($get_content) && $get_content!=''){ $ye = ((isset($criterias['year']) && $criterias['year'] !='' )? $criterias['year'] : $curYear); $mo = ((isset($criterias['month']) && $criterias['month'] !='')? $criterias['month'] : $curMonth); $qu = ((isset($criterias['month']) ? (int)ceil($mo / 3): $curQuarter)); -$da = $ye.'-'.$mo.'-01'; +$da = $ye.'-'.$mo.'-'.date("d"); //CALL TO API TO GET ALL ACTIVE CONTRACTS $api_url = '/v2/contracts/'.$GET_VALUES; diff --git a/api/v2/get/equipments.php b/api/v2/get/equipments.php index 5c82922..a31b9de 100644 --- a/api/v2/get/equipments.php +++ b/api/v2/get/equipments.php @@ -60,7 +60,7 @@ if(isset($get_content) && $get_content!=''){ $v = explode("=", $y); //INCLUDE VARIABLES IN ARRAY $criterias[$v[0]] = $v[1]; - if ($v[0] == 'page' || $v[0] =='p' || $v[0] =='products' || $v[0] =='totals' || $v[0] =='history' || $v[0] =='success_msg' || $v[0] =='download' || $v[0] =='sort'){ + if ($v[0] == 'page' || $v[0] =='p' || $v[0] =='products' || $v[0] =='list' || $v[0] =='totals' || $v[0] =='history' || $v[0] =='success_msg' || $v[0] =='download' || $v[0] =='sort'){ //do nothing } elseif ($v[0] == 'equipmentid') { @@ -179,6 +179,10 @@ elseif (isset($criterias['totals']) && $criterias['totals'] =='' && !isset($crit //Request for total rows $sql = 'SELECT count(*) as count from equipment e LEFT JOIN products p ON e.productrowid = p.rowID '.$whereclause.''; } +elseif (isset($criterias['list']) && $criterias['list'] =='') { + //SQL for Paging + $sql = 'SELECT e.rowID, e.serialnumber FROM equipment e '.$whereclause.''; +} elseif (isset($criterias['products']) && $criterias['products'] ==''){ //Request for all products in equipment view $sql = 'SELECT distinct(p.productcode), p.productname from equipment e LEFT JOIN products p ON e.productrowid = p.rowID '.$whereclause.' ORDER BY p.productcode'; @@ -315,7 +319,7 @@ if(isset($criterias['totals']) && $criterias['totals']==''){ $messages = $stmt->fetch(); $messages = $messages[0]; } -elseif ((isset($criterias['history']) && $criterias['history'] !='') || (isset($criterias['products']) && $criterias['products'] =='') || (isset($criterias['download']) && $criterias['download'] =='')){ +elseif ((isset($criterias['history']) && $criterias['history'] !='') || (isset($criterias['list']) && $criterias['list']=='') || (isset($criterias['products']) && $criterias['products'] =='') || (isset($criterias['download']) && $criterias['download'] =='')){ //Excute Query $stmt->execute(); //Get results diff --git a/api/v2/get/history.php b/api/v2/get/history.php index 152f939..205fb7b 100644 --- a/api/v2/get/history.php +++ b/api/v2/get/history.php @@ -69,6 +69,10 @@ if(isset($get_content) && $get_content!=''){ $filter_key_2 = '"ServiceReport"'; $clause .= ' AND h.type = '.$filter_key_2.' AND h.description like '.$filter_key_1; } + elseif ($v[0] == 'created') { + //build up search + $clause .= ' AND h.created > :'.$v[0]; + } else {//create clause $clause .= ' AND '.$v[0].' = :'.$v[0]; } diff --git a/api/v2/post/rma.php b/api/v2/post/rma.php index 3172784..496751d 100644 --- a/api/v2/post/rma.php +++ b/api/v2/post/rma.php @@ -15,7 +15,6 @@ $whereclause = ''; //SET PARAMETERS FOR QUERY $id = $post_content['rowID'] ?? ''; //check for rowID -$rma_id = $post_content['rmaID'] ?? 0; //check for rmaID $command = ($id == '')? 'insert' : 'update'; //IF rowID = empty then INSERT if (isset($post_content['delete'])){$command = 'delete';} //change command to delete @@ -44,10 +43,14 @@ if ($command == 'insert'){ $post_content['createdby'] = $username; } +//ENCODE HEADER AND QUESTIONS +if (isset($post_content['header'])){$post_content['header'] = json_encode($post_content['header'], JSON_UNESCAPED_UNICODE);} +if (isset($post_content['questions'])){$post_content['questions'] = json_encode($post_content['questions'], JSON_UNESCAPED_UNICODE);} + //CREAT NEW ARRAY AND MAP TO CLAUSE if(isset($post_content) && $post_content!=''){ foreach ($post_content as $key => $var){ - if ($key == 'submit' || $key == 'delete' || $key == 'rowID'){ + if ($key == 'save' ||$key == 'submit' || $key == 'delete' || $key == 'rowID'){ //do nothing } else { @@ -66,13 +69,13 @@ $clause_insert = substr($clause_insert, 2); //Clean clause - remove first comma $input_insert = substr($input_insert, 1); //Clean clause - remove first comma //QUERY AND VERIFY ALLOWED -if ($command == 'update' && $rma_id !=0 && isAllowed('rma',$profile,$permission,'U') === 1){ +if ($command == 'update' && isAllowed('rma',$profile,$permission,'U') === 1){ $sql = 'UPDATE rma SET '.$clause.' WHERE rowID = ? '.$whereclause.''; $execute_input[] = $id; $stmt = $pdo->prepare($sql); $stmt->execute($execute_input); } -elseif ($command == 'insert' && $rma_id !=0 && isAllowed('rma',$profile,$permission,'C') === 1){ +elseif ($command == 'insert' && isAllowed('rma',$profile,$permission,'C') === 1){ $sql = 'INSERT INTO rma ('.$clause_insert.') VALUES ('.$input_insert.')'; $stmt = $pdo->prepare($sql); $stmt->execute($execute_input); diff --git a/assets/images/tss-green.png b/assets/images/tss-green.png new file mode 100644 index 0000000..43dcec9 Binary files /dev/null and b/assets/images/tss-green.png differ diff --git a/assets/mail/email_template_new.php b/assets/mail/email_template_new.php index faabe91..54f32e0 100644 --- a/assets/mail/email_template_new.php +++ b/assets/mail/email_template_new.php @@ -5,8 +5,11 @@ defined($security_key) or exit; //------------------------------------------ $newuser_subject = 'CustomerPortal user created'; $newuser_header = 'Dear CustomerPortal user'; -$newuser_text = 'Your CustomerPortal administrator has provided access to the CustomerPortal. To complete your account you need to update your password via the link below.'; -$newuser_credential_label = 'Link to portal:'; + +$newuser_text = 'Your administrator has provided access to the CustomerPortal.'; +$newuser_credential_text_1 = 'Your account has been created with username '; +$newuser_credential_text_2 = 'Please click the button below to complete your registration.'; + $newuser_closure = 'For security reasons this link is only active for 10 minutes.'; //------------------------------------------ @@ -15,33 +18,77 @@ $newuser_closure = 'For security reasons this link is only active for 10 minutes $subject = $newuser_subject; $message = ' - -
+ + + + +
+
|
+
'.$rma_p.'
-'.$success_msg.'
- -'.$success_msg.'
+ +