From b72f329154c17250955fa97ce82e1ed660e9375b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”> Date: Tue, 10 Dec 2024 11:49:04 +0100 Subject: [PATCH] CM91 - RMA update --- .gitignore | 1 + api/v1/get/equipments.php | 8 +- api/v2/get/billing.php | 2 +- api/v2/get/equipments.php | 8 +- api/v2/get/history.php | 4 + api/v2/post/rma.php | 11 +- assets/images/tss-green.png | Bin 0 -> 16575 bytes assets/mail/email_template_new.php | 107 +++++-- rma.php | 323 ++++++++++++-------- rma_manage.php | 458 ++++++++++++++++++++++++++++ rmas.php | 43 ++- settings/settingsmenu.php | 4 +- settings/settingsprofiles.php | 4 +- settings/settingsviews.php | 1 + settings/systemrma.php | 30 ++ settings/systemservicetool_init.php | 178 ----------- 16 files changed, 839 insertions(+), 343 deletions(-) create mode 100644 assets/images/tss-green.png create mode 100644 rma_manage.php create mode 100644 settings/systemrma.php 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.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UUWfV8q;70(PbM_8Tsu3cju^ zBsoVZhw1ro$Z*qH6A^}!eo<~^4E|i(n73`mssZ5){m2SWnV)TzGv1bi!_r0eH8F4Z z`np>n4VNwXf{6wOcgEuH-xSc*v=|XR0fyrXkm0r`nJF_nZHO4(pf{>b;0O;jz0$tA zEuf>qCu`kiMVcof$>Ud{@x^HBu&_z9eCP0|8sn& zZ{Q;3bakjJp+|4!`cryFa{uuj6L_~bJikTHtVJ&~fcPIlazI908?PD*xI&5Nx*(JH)>=_Hpi)?uXVAIOs+pK<%HUSct`t<;zsM~E*a zsz;;LZa+MV%1{p?H>qDQBQ4(|BDz4pMLi@SQVg{U_CjYBNam;?N zLK-{G1bEWKLn)KHw)Is{!}IOCKQG|-o0#x4q0^%2M2@XihOMtT-TceF%G`C0Q#EwS zX+-9$@@@$W#eVTcu+Q?eV;z+A^GPbkZp+q(saN*TJ%lYJ2F^Sh9?X(b~cNi2dgYB+?+3{*O(b_KB_>MvcH4FLCDZ+5sWR+TMpF literal 0 HcmV?d00001 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 = ' - - + + + + + ' . $subject . ' - - - ' . $newuser_header . ', -
-
- ' . $newuser_text . ' -

' . $newuser_credential_label . '

-
-
- ' . $newuser_closure . ' -
-
- Kind regards,
-
-
- logo -
- - -'; + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ CustomerPortal +
+ ' . $newuser_header . ', +
+
+ '.$newuser_text.' '.$newuser_credential_text_1.''.$post_content['username'].' +
+
+ '.$newuser_credential_text_2.' +
+ + + + + +
+ Reset Password +
+
+ ' . $newuser_closure . ' +
+
+ + +'; \ No newline at end of file diff --git a/rma.php b/rma.php index 6875f6d..554fe99 100644 --- a/rma.php +++ b/rma.php @@ -6,10 +6,68 @@ if (debug && debug_id == $_SESSION['id']){ ini_set('display_startup_errors', '1'); error_reporting(E_ALL); } +//__________________________________________ +//MOVE TO TRANSLATION FILES: +//__________________________________________ +$button_create_rma = 'Create RMA'; + +//RMA +$rmas_h2 = 'Return Material'; +$rmas_p = 'View, manage, and search RMA details.'; +$rma_h2 = 'Return Material Request'; + +$message_rma_1 = 'RMA created successfully!'; +$message_rma_2 = 'RMA updated successfully!'; +$message_rma_3 = 'RMA deleted successfully!'; +$message_no_rma = 'There is no RMA'; + +$rma_search = 'Search RMA...'; + +$rma_rowID = 'Request number'; +$rma_status = 'Status'; + +$rma_status0_text = '1'; +$rma_status1_text = '2'; +$rma_status2_text = '3'; +$rma_status3_text = '4'; +$rma_status4_text = '5'; + +$rma_sw_version_latest = 'Latest software version'; +$rma_servicereport_latest = 'Servicereport created last 7days'; + +$rma_information = 'RMA information'; +$rma_return_reason = 'Return reason'; +$rma_return_reason0_text = ''; +$rma_return_reason1_text = ''; +$rma_return_reason2_text = ''; +$rma_return_reason3_text = ''; +$rma_return_reason4_text = ''; +$rma_return_reason5_text = ''; + +$rma_return_reasons_notes = 'Return reason notes'; + +$rma_return_tab1 = 'Return reason'; +$rma_return_tab2 = 'Questions'; + +$rma_question_allowed_label1 = 'Yes'; +$rma_question_allowed_label2 = 'No'; + +$rma_question_header_1 = ''; +$rma_question_1 = 'Batteries working?'; +$rma_question_2 = 'Button correctly working'; +$rma_question_3 = ''; +$rma_question_4 = ''; +$rma_question_5 = ''; +$rma_question_6 = ''; +$rma_question_7 = ''; +//__________________________________________ +//__________________________________________ +//__________________________________________ include_once './assets/functions.php'; include_once './settings/settings.php'; +include_once './settings/systemrma.php'; -$page = 'rmas'; +$page = 'rma'; //Check if allowed if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){ header('location: index.php'); @@ -20,154 +78,179 @@ $update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'], $delete_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'D'); $create_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'C'); +$view_product = isAllowed('product' ,$_SESSION['profile'],$_SESSION['permission'],'R'); +$view_history = isAllowed('history' ,$_SESSION['profile'],$_SESSION['permission'],'C'); -//GET PARAMETERS -$pagination_page = isset($_GET['p']) ? $_GET['p'] : 1; -$search = isset($_GET['search']) ? '&search='.$_GET['search'] : ''; +$rowID = $_GET['rowID'] ?? ''; -// Determine the URL -$url = 'index.php?page='.$page.$search; -//GET Details from URL -$GET_VALUES = urlGETdetails($_GET) ?? ''; +if ($rowID !=''){ + $url = 'index.php?page=rma&rowID='.$rowID.''; +} else { + $url = 'index.php?page=rmas'; +} + +// ID param exists, edit an existing product //CALL TO API -$api_url = '/v2/rma/'.$GET_VALUES; +$api_url = '/v2/rma/rowID='.$_GET['rowID']; $responses = ioServer($api_url,''); //Decode Payload if (!empty($responses)){$responses = json_decode($responses,true);}else{$responses = null;} +$rma = json_decode(json_encode($responses[0]), true); + +//GET DETAILS +$rma_header = json_decode($rma['header'],true) ?? ''; +$rma_questions = json_decode($rma['questions'],true) ?? ''; + +//------------------------------ +//Variables +//------------------------------ +$status_text = 'rma_status'.$rma['status'].'_text'; -//Return QueryTotal from API -$api_url = '/v2/rma/'.$GET_VALUES.'&totals='; -$query_total = ioServer($api_url,''); -//Decode Payload -if (!empty($query_total)){$query_total = json_decode($query_total,true);}else{$query_total = null;} // Handle success messages if (isset($_GET['success_msg'])) { if ($_GET['success_msg'] == 1) { - $success_msg = $message_ct_1; + $success_msg = $message_rma_1; } if ($_GET['success_msg'] == 2) { - $success_msg = $message_ct_2; + $success_msg = $message_rma_2; } if ($_GET['success_msg'] == 3) { - $success_msg = $message_ct_3; + $success_msg = $message_rma_3; } -} +} -if (isset($_GET['download'])){ - downloadToExcel('rma',$responses); -} +template_header('RMA', 'rma','manage'); -template_header('rma', 'rma' ,'view'); $view = ' -
-
- -
-

'.$rma_h2.' ('.$query_total.')

-

'.$rma_p.'

-
-
-
'; +
+

'.($rma_h2 ?? 'Return Material Request').' - '.$_GET['rowID'].'

+ '.$button_cancel.' +'; + +if ($update_allowed === 1){ + $view .= 'Edit'; +} + +$view .= '
'; if (isset($success_msg)){ -$view .= '
- -

'.$success_msg.'

- -
'; + $view .= '
+ +

'.$success_msg.'

+ +
'; } -$view .= ' -
'; -if ($create_allowed ===1){ - $view .= ''.$button_create_rma.''; -} -$view .= ' -
- -
- '.$general_filters.' -
- - + +$view .= '
'; +$view .= '
+
+ '.($rma_information ?? 'RMA details').' +
+
+

'.$equipment_label3.'

+

'.$$status_text.'

+
+
+

'.$equipment_label2.'

+

'.$rma_header['serialnumber'].'

+
+ +
+

'.$product_code.'

+

'.(($view_product == 1)? ''.$rma_header['productcode'].'':'').'

+
+
+

'.$product_name.'

+

'.(($view_product == 1)? ''.$rma_header['productname'].'':'').'

+
+
+

'.$equipment_label10.'

+

+
+
+

'.($rma_sw_version_latest ?? 'Latest software version').'

+

+

+
+
+

'.($rma_servicereport_latest ?? 'Servicereport created last 7days').'

+

+

+
+ '; + +$view .=' +
+'; + +$view .='
+
+ '.$view_asset_partners.' +
+
+

'.$general_soldto.'

+

+
+
+

'.$general_shipto.'

+

+
+
+

'.$general_location.'

+

'; -//SHOW DOWNLOAD TO EXCELL OPTION ONLY TO ADMIN USERS -if ($_SESSION['permission'] == 3 || $_SESSION['permission'] == 4){ - $view .='
- -
'; -} -$view .= ''; +// ------------------------------- +//BUILD TO INPUT FORM BASED ON ARRAY +// ------------------------------ +// +$view .='
+ '.($rma_return_tab1 ?? 'Return reason').''; + +if($rma_header['servicereport_available'] == 0 ){ + $view .=''.($rma_return_tab2 ?? 'Questions').''; +} + +$view .= '
'; + +$view .= '
+
+
+

'.($rma_return_reason ?? 'Return reason').'

+

+

+
+
+

'.($rma_return_reason_note ?? 'Return reason note').'

+

+

+
+
+
'; + +$view .= '
+
'; + +$view .= '
- -
-'; + '; $view .= ' -
-
- - - - - - - - - - - - '; - - if (empty($responses)){ - - $view .= ' - - - '; - } - else { - foreach ($responses as $response){ - $view .= ' - - - - - - - - '; - } - } -$view .= ' - -
'.$rma_rowID.''.$rma_carbrand.''.$rma_cartype.''.$general_createdby.''.$general_actions.'
'.$message_no_ct.'
'.$response->rowID.''.$response->carbrand.''.$response->cartype.''.$response->createdby.''.$general_view.'
-
+
+ '; -$view.=''; //OUTPUT echo $view; diff --git a/rma_manage.php b/rma_manage.php new file mode 100644 index 0000000..8a943e8 --- /dev/null +++ b/rma_manage.php @@ -0,0 +1,458 @@ + '', + 'status' => 0, + 'header' => [ + 'rowID'=> '', + 'accounthierarchy'=> '', + 'serialnumber'=>'', + 'hw_version'=>'', + 'sw_version'=>'', + 'service_date'=>'', + 'warranty_date'=> '', + 'order_ref'=>'', + 'sw_version_latest'=>'', + 'servicereport_available' => '', + 'productrowid' => '', + 'productcode'=> '', + 'productname'=> '', + 'return_reason' => '', + 'return_reason_note' => '' + ], + 'questions' => [], + 'created' => '', + 'createdby' => '', + 'updated' => '', + 'updatedby' => '', + 'accounthierarchy' => '' +]; + +if (isset($_GET['rowID'])) { + // ID param exists, edit an existing product + //CALL TO API + $api_url = '/v2/rma/rowID='.$_GET['rowID']; + $responses = ioServer($api_url,''); + //Decode Payload + if (!empty($responses)){$responses = json_decode($responses,true);}else{$responses = null;} + $rma = json_decode(json_encode($responses[0]), true); + + //GET DETAILS + $rma['header'] = json_decode($rma['header'],true) ?? ''; + $rma['questions'] = json_decode($rma['questions'],true) ?? ''; + $serial_input = ''; + + if ($update_allowed === 1){ + if (isset($_POST['save'])) { + //UPLOAD ALL PICTURES + foreach ($_FILES["fileToUpload"]["name"] as $key => $value){ + //ONLY UPDATE PICTURES IF SOMETHING IS RETURNED + if($value !='' || !empty($value)){ + uploadrequest($key); + } + } + + //GET ALL POST DATA + $payload = json_encode($_POST, JSON_UNESCAPED_UNICODE); + + //API call + $responses = ioServer('/v2/rma', $payload); + if ($responses === 'NOK'){ + + } else { + header('Location: index.php?page=rma&rowID='.$_GET['rowID'].'&success_msg=2'); + exit; + } + } + } + + if ($delete_allowed === 1){ + if (isset($_POST['delete'])) { + //GET ALL POST DATA + $payload = json_encode($_POST , JSON_UNESCAPED_UNICODE); + + //API call + $responses = ioServer('/v2/rma', $payload); + // Redirect and delete equipment + if ($responses === 'NOK'){ + + } else { + header('Location: index.php?page=rmas&success_msg=3'); + exit; + } + } + } + +} else { + + if (isset($_POST['assetID'])){ + //GET RELATED DATA + $api_url = '/v2/equipments/serialnumber='.$_POST['assetID']; + $equipment = ioServer($api_url,''); + //Decode Payload + if (!empty($equipment)){$equipment = json_decode( $equipment,true);}else{$equipment = null;} + + if (isset($equipment[0]['rowID'])){ + //CHECK FOR LATEST SERVICEREPORT + $servicereport_date = date("Y-m-d", strtotime("-7 days")); + + $api_url = '/v2/history/equipmentid='.$equipment[0]['rowID'].'&type=servicereport&created='.$servicereport_date.'&totals='; + $servicereport = ioServer($api_url,''); + //Decode Payload + if (!empty($servicereport)){$servicereport = json_decode( $servicereport,true);}else{$servicereport = null;} + + //GetPartnerDetails + $partner_data = json_decode($equipment[0]['accounthierarchy'],true) ?? ''; + if (is_array($partner_data)){ + $soldto = getPartnerName($partner_data['soldto']) ?? '-'; + $shipto = getPartnerName($partner_data['shipto']) ?? '-'; + $location = getPartnerName($partner_data['location']) ?? '-'; + } + + $rma = [ + 'rowID' => '', + 'status' => 0, + 'header' => [ + 'rowID'=> $equipment[0]['rowID'], + 'serialnumber'=> $equipment[0]['serialnumber'], + 'hw_version'=> $equipment[0]['hw_version'], + 'sw_version'=>$equipment[0]['sw_version'], + 'service_date'=> date('Y-m-d', strtotime($equipment[0]['service_date']. ' + 365 days')), + 'warranty_date'=> date('Y-m-d', strtotime($equipment[0]['warranty_date']. ' + 365 days')), + 'order_ref'=>$equipment[0]['order_ref'], + 'sw_version_latest'=>$equipment[0]['sw_version_latest'], + 'servicereport_available' => (($servicereport !=0) ? 1 : 0), + 'productrowid'=> $equipment[0]['productrowid'], + 'productcode'=> $equipment[0]['productcode'], + 'productname'=> $equipment[0]['productname'], + 'return_reason' => '', + 'return_reason_note' => '', + 'soldto'=> $soldto, + 'shipto'=> $shipto, + 'location'=> $location + ], + 'questions' => [], + 'created' => '', + 'createdby' => '', + 'updated' => '', + 'updatedby' => '', + 'accounthierarchy' => '' + ]; + + $serial_input = ''; + + } else { + $serial_input = ''; + } + } else { + //GET RELATED SERIALNUMBERS + //CALL TO API + $api_url = '/v2/equipments/list='; + $assets_keys = ioServer($api_url,''); + + //Decode Payload + if (!empty($assets_keys)){$assets_keys = json_decode($assets_keys,true);}else{$assets_keys = null;} + //CREATE SERIALNUMBER DROPDOWN + $serial_input =' + '; + foreach ($assets_keys as $assets_key) { + $serial_input .= ''; + } + $serial_input .= ''; + //END DROPDOWN + } + + // Create a new equipment + if (isset($_POST['save'])) { + + //UPLOAD ALL PICTURES + foreach ($_FILES["fileToUpload"]["name"] as $key => $value){ + //ONLY UPDATE PICTURES IF SOMETHING IS RETURNED + if($value !='' || !empty($value)){ + uploadrequest($key); + } + } + + //GET ALL POST DATA + $payload = json_encode($_POST, JSON_UNESCAPED_UNICODE); + var_dump($payload); + //API call + $responses = ioServer('/v2/rma', $payload); + if ($responses === 'NOK'){ + + } else { + header('Location: index.php?page=rmas&success_msg=1'); + exit; + } + } +} + +template_header('RMA', 'rma','manage'); + +$view =' +
+
+

'.($rma_h2 ?? 'Return Material Request').'

+ '.$button_cancel.' + '; + +if ($delete_allowed === 1){ + $view .= ''; +} +if ($update_allowed === 1){ + $view .= ''; +} + +$view .= '
'; +$view .= '
'; +$view .= '
+
+ '.($rma_information ?? 'RMA details').' +
+
+

'.$equipment_label3.'

+

+
+
+

'.$equipment_label2.'

+

'.$serial_input.'

+
+ +
+

'.$product_code.'

+

'.(($view_product == 1)? ''.$rma['header']['productcode'].'':'').'

+
+
+

'.$product_name.'

+

'.(($view_product == 1)? ''.$rma['header']['productname'].'':'').'

+
+
+

'.$equipment_label10.'

+

+
+
+

'.($rma_sw_version_latest ?? 'Latest software version').'

+

+

+
+
+

'.($rma_servicereport_latest ?? 'Servicereport created last 7days').'

+

+

+
+ + + + + + + '; + +$view .=' +
+'; + +$view .='
+
+ '.$view_asset_partners.' +
+
+

'.$general_soldto.'

+

+
+
+

'.$general_shipto.'

+

+
+
+

'.$general_location.'

+

+
+
'; + +$view .= '
'; +// ------------------------------- +//BUILD TO INPUT FORM BASED ON ARRAY +// ------------------------------ +// +$view .='
+ '.($rma_return_tab1 ?? 'Return reason').''; + +if($rma['header']['servicereport_available'] == 0 ){ + $view .=''.($rma_return_tab2 ?? 'Questions').''; +} + +$view .= '
'; + +$view .= '
+
+
+

'.($rma_return_reason ?? 'Return reason').'

+

+

+
+
+

'.($rma_return_reason_note ?? 'Return reason note').'

+

+

+
+
+
'; + +$view .= '
+
'; +if($rma['header']['servicereport_available'] == 0 ){ + foreach($arrayQuestions_rma as $group){ + foreach($group['Questions_in_group'] as $question){ + + switch ($question['Type']) { + case 'dropdown': + $view .= ''; + $view .= ''; + break; + + case 'textarea': + $view .= ''; + $view .= ''; + break; + + case 'file'; + $view .= ''; + + if ($question['QuestionID'] !=''){ + $view .= ' + '; + } else { + $view .= ''; + } + + break; + } + } + } +} + +$view .= '
+
+
'; + +$view .= ' +
+
+ +'; + +//OUTPUT +echo $view; + +template_footer(); +?> \ No newline at end of file diff --git a/rmas.php b/rmas.php index 4659c99..d0ff180 100644 --- a/rmas.php +++ b/rmas.php @@ -4,12 +4,13 @@ defined(page_security_key) or exit; //__________________________________________ //MOVE TO TRANSLATION FILES: //__________________________________________ + $button_create_rma = 'Create RMA'; //RMA $rmas_h2 = 'Return Material'; $rmas_p = 'View, manage, and search RMA details.'; -$rma_h2 = 'RMA'; +$rma_h2 = 'Return Material Request'; $message_rma_1 = 'RMA created successfully!'; $message_rma_2 = 'RMA updated successfully!'; @@ -20,8 +21,40 @@ $rma_search = 'Search RMA...'; $rma_rowID = 'Request number'; $rma_status = 'Status'; +$rma_sw_version_latest = 'Latest software version'; +$rma_servicereport_latest = 'Servicereport created last 7days'; + +$rma_status0_text = '1'; +$rma_status1_text = '2'; +$rma_status2_text = '3'; +$rma_status3_text = '4'; +$rma_status4_text = '5'; $rma_information = 'RMA information'; +$rma_return_reason = 'Return reason'; +$rma_return_reason0_text = ''; +$rma_return_reason1_text = ''; +$rma_return_reason2_text = ''; +$rma_return_reason3_text = ''; +$rma_return_reason4_text = ''; +$rma_return_reason5_text = ''; + +$rma_return_reasons_notes = 'Return reason notes'; + +$rma_return_tab1 = 'Return reason'; +$rma_return_tab2 = 'Questions'; + +$rma_question_allowed_label1 = 'Yes'; +$rma_question_allowed_label2 = 'No'; + +$rma_question_header_1 = ''; +$rma_question_1 = 'Batteries working?'; +$rma_question_2 = 'Button correctly working'; +$rma_question_3 = ''; +$rma_question_4 = ''; +$rma_question_5 = ''; +$rma_question_6 = ''; +$rma_question_7 = ''; //__________________________________________ //__________________________________________ //__________________________________________ @@ -58,6 +91,7 @@ $GET_VALUES = urlGETdetails($_GET) ?? ''; //CALL TO API $api_url = '/v2/rma/'.$GET_VALUES; $responses = ioServer($api_url,''); + //Decode Payload if (!empty($responses)){$responses = json_decode($responses,true);}else{$responses = null;} @@ -163,10 +197,15 @@ $view .= ' } else { foreach ($responses as $response){ + //------------------------------ + //Variables + //------------------------------ + $status_text = 'rma_status'.$response['status'].'_text'; + $view .= ' '.$response['rowID'].' - '.$response['status'].' + '.$$status_text.' '.$response['created'].' '.$response['createdby'].' '.$response['updated'].' diff --git a/settings/settingsmenu.php b/settings/settingsmenu.php index 3d818b4..a61ad29 100644 --- a/settings/settingsmenu.php +++ b/settings/settingsmenu.php @@ -8,7 +8,7 @@ // into translation files and corresponding profile //------------------------------------------ //Menu Setup -$main_menu = array ('dashboard','sales','build','cartests','marketing','equipments','products','reporting','admin','settings'); +$main_menu = array ('dashboard','sales','buildtool','cartests','marketing','equipments','products','reporting','admin','settings'); //Sub menus $equipments_sub = array('equipments','servicereports','rmas','histories','firmwaretool','equipments_mass_update'); @@ -152,7 +152,7 @@ $urls = array( "icon" => "fas fa-tachometer-alt", "name" => "menu_marketing" ), - "build" => array( + "buildtool" => array( "url" => "buildtool", "selected" => "buildtool", "icon" => "fas fa-tachometer-alt", diff --git a/settings/settingsprofiles.php b/settings/settingsprofiles.php index b7f4a3f..358fd51 100644 --- a/settings/settingsprofiles.php +++ b/settings/settingsprofiles.php @@ -6,9 +6,9 @@ define('superuser_profile','dashboard,profile,assets,equipments,equipment,equipm /*Admin*/ define('admin_profile','dashboard,profile,buildtool,sales,accounts,account,contracts,contract,contract_manage,cartests,cartest,cartest_manage,assets,equipments,equipment,equipment_healthindex,equipment_data,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,buildtool,products,products_versions,products_software,product,product_manage,servicereports,servicereport,admin,partners,partner,users,user,user_manage,communications,communication,communication_send,marketing,reporting,report_build,report_contracts_billing,report_healthindex,changelog,application'); /*AdminPlus*/ -define('adminplus_profile','dashboard,profile,buildtool,sales,accounts,account,contracts,contract,contract_manage,cartests,cartest,cartest_manage,assets,equipments,equipment,equipment_healthindex,equipment_data,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,buildtool,products,products_versions,products_software,product,product_manage,servicereports,servicereport,admin,partners,partner,users,user,user_manage,communications,communication,communication_send,marketing,reporting,report_build,report_contracts_billing,report_healthindex,report_usage,config,settings,logfile,changelog,language,application,maintenance,profiles,vin'); +define('adminplus_profile','dashboard,profile,buildtool,sales,accounts,account,contracts,contract,contract_manage,cartests,cartest,cartest_manage,assets,equipments,equipment,equipment_healthindex,equipment_data,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,rmas,rma,rma_manage,rma_history,rma_history_manage,buildtool,products,products_versions,products_software,product,product_manage,servicereports,servicereport,admin,partners,partner,users,user,user_manage,communications,communication,communication_send,marketing,reporting,report_build,report_contracts_billing,report_healthindex,report_usage,config,settings,logfile,changelog,language,application,maintenance,profiles,vin'); /*Build*/ -define('build','buildtool,firmwaretool,buildtool,products_software,application'); +define('build','dashboard,profile,buildtool,firmwaretool,buildtool,products_software,application'); /*Distribution*/ define('distribution','dashboard,profile,assets,equipments,equipment,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,products,products_versions,products_software,product,product_manage,servicereports,servicereport,admin,partners,partner,users,user,user_manage,marketing,application'); /*Firmware*/ diff --git a/settings/settingsviews.php b/settings/settingsviews.php index b451f7e..fce6093 100644 --- a/settings/settingsviews.php +++ b/settings/settingsviews.php @@ -13,6 +13,7 @@ $all_views = [ "contracts", "contract", "contract_manage", + "billing", "cartests", "cartest", "cartest_manage", diff --git a/settings/systemrma.php b/settings/systemrma.php new file mode 100644 index 0000000..29b9186 --- /dev/null +++ b/settings/systemrma.php @@ -0,0 +1,30 @@ + "1", "Response" => $rma_question_allowed_label1), + array("responseID" => "2", "Response" => $rma_question_allowed_label2) +); + +//================================================================= +// RMA Tool questions =================================== +//================================================================= + +$arrayQuestions_rma = array( + array("Group" => $rma_question_header_1, + "Group_sequence" => '1', + "Questions_in_group" => array( + array("Question_sequence" => '1',"QuestionID" => "rma_1","Question" => $rma_question_1, "Type" => 'dropdown', "Response" => $allowedResponse_1), + array("Question_sequence" => '2',"QuestionID" => "rma_2","Question" => $rma_question_2, "Type" => 'dropdown', "Response" => $allowedResponse_1), + array("Question_sequence" => '3',"QuestionID" => "rma_3","Question" => $rma_question_3, "Type" => 'dropdown', "Response" => $allowedResponse_1), + array("Question_sequence" => '4',"QuestionID" => "rma_4","Question" => $rma_question_4, "Type" => 'dropdown', "Response" => $allowedResponse_1) + ) + ) +); + +//================================================================= +// =================================== +//================================================================= diff --git a/settings/systemservicetool_init.php b/settings/systemservicetool_init.php index 2c9e867..c1bfe88 100644 --- a/settings/systemservicetool_init.php +++ b/settings/systemservicetool_init.php @@ -96,182 +96,4 @@ $init = array( ) ); -//================================================================= -//SERVICE Tool allowed responses=================================== -//================================================================= - -$allowedResponseRadio = array( - array("responseID" => "1", "Response" => $service_allowed_label1), - array("responseID" => "2", "Response" => $service_allowed_label2) -); - -$allowedResponseDropdownDamage = array( - array("responseID" => "5", "Response" => $service_allowed_label5), - array("responseID" => "4", "Response" => $service_allowed_label4), - array("responseID" => "3", "Response" => $service_allowed_label3), - array("responseID" => "9", "Response" => $service_allowed_label9) -); - -$allowedResponseDropdownCorrosion = array( - array("responseID" => "6", "Response" => $service_allowed_label1), - array("responseID" => "7", "Response" => $service_allowed_label2) -); - -// Negative answers -$negative_results = array("2","3","6"); -//================================================================= -//SERVICE Tool Visual Inspection=================================== -//================================================================= - - -$arrayQuestions_visual = array( - array("Group" => $group_header_1, - "Group_sequence" => '1', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "service_visual_1","Question" => $service_visual_1, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '2',"QuestionID" => "service_visual_2","Question" => $service_visual_2, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '3',"QuestionID" => "service_visual_3","Question" => $service_visual_3, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '4',"QuestionID" => "service_visual_4","Question" => $service_visual_4, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio) - ) - ), - array("Group" => $group_header_2, - "Group_sequence" => '2', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "service_visual_5", "Question" => $service_visual_5, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '2',"QuestionID" => "service_visual_6", "Question" => $service_visual_6, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '3',"QuestionID" => "service_visual_7", "Question" => $service_visual_7, "Type" => 'Radiobutton', "Response" => $allowedResponseDropdownCorrosion), - array("Question_sequence" => '4',"QuestionID" => "service_visual_8", "Question" => $service_visual_8, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage) - ) - ), - array("Group" => $group_header_3, - "Group_sequence" => '3', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "service_visual_9", "Question" => $service_visual_9, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '2',"QuestionID" => "service_visual_10", "Question" => $service_visual_10, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '3',"QuestionID" => "service_visual_11", "Question" => $service_visual_11, "Type" => 'Radiobutton', "Response" => $allowedResponseDropdownCorrosion), - array("Question_sequence" => '4',"QuestionID" => "service_visual_12", "Question" => $service_visual_12, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage) - ) - ), - array("Group" => $group_header_4, - "Group_sequence" => '4', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "service_visual_13", "Question" => $service_visual_13, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '2',"QuestionID" => "service_visual_14", "Question" => $service_visual_14, "Type" => 'Radiobutton', "Response" => $allowedResponseDropdownCorrosion), - array("Question_sequence" => '2',"QuestionID" => "service_visual_15", "Question" => $service_visual_15, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '2',"QuestionID" => "service_visual_16", "Question" => $service_visual_16, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '2',"QuestionID" => "service_visual_17", "Question" => $service_visual_17, "Type" => 'Radiobutton', "Response" => $allowedResponseDropdownCorrosion), - array("Question_sequence" => '2',"QuestionID" => "service_visual_18", "Question" => $service_visual_18, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio) - ) - ), - array("Group" => $group_header_5, - "Group_sequence" => '5', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "service_visual_19", "Question" => $service_visual_19, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '2',"QuestionID" => "service_visual_20", "Question" => $service_visual_20, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage), - array("Question_sequence" => '3',"QuestionID" => "service_visual_21", "Question" => $service_visual_21, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage), - array("Question_sequence" => '4',"QuestionID" => "service_visual_22", "Question" => $service_visual_22, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage) - ) - ) - ); - -//================================================================= -//SERVICE Tool Finalize =================================== -//================================================================= -$arrayQuestions_finalize = array( - array("Group" => $group_header_6, - "Group_sequence" => '1', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "service_action_clean", "Question" => $service_action_clean, "Type" => 'Checkbox', "Response" => ""), - array("Question_sequence" => '2',"QuestionID" => "service_action_battery", "Question" => $service_action_battery, "Type" => 'Checkbox', "Response" => "") - ) - ), - array("Group" => $group_header_7, - "Group_sequence" => '1', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "service_notes", "Question" => $service_notes, "Type" => 'Textarea', "Response" => "") - ) - ), - array("Group" => $group_header_8, - "Group_sequence" => '3', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "service_action_serial", "Question" => $service_action_serial, "Type" => 'Checkbox', "Response" => ""), - array("Question_sequence" => '2',"QuestionID" => "service_action_cover", "Question" => $service_action_cover, "Type" => 'Checkbox', "Response" => ""), - array("Question_sequence" => '3',"QuestionID" => "service_action_spudger", "Question" => $service_action_spudger, "Type" => 'Checkbox', "Response" => ""), - array("Question_sequence" => '4',"QuestionID" => "service_action_case", "Question" => $service_action_case, "Type" => 'Checkbox', "Response" => ""), - array("Question_sequence" => '5',"QuestionID" => "service_action_instructions", "Question" => $service_action_instructions, "Type" => 'Checkbox', "Response" => "") - ) - ), - array("Group" => $group_header_9, - "Group_sequence" => '4', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "service_mandatory_question", "Question" => $service_mandatory_question, "Type" => 'Checkbox', "Response" => "") - ) - ) - ); - -$arrayQuestions_legacy = array( - array("Group" => $group_header_legacy_1, - "Group_sequence" => '1', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "question1","Question" => $question1, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '2',"QuestionID" => "question2","Question" => $question2, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '3',"QuestionID" => "question3","Question" => $question3, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '4',"QuestionID" => "question4","Question" => $question4, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio) - ) - ), - array("Group" => $group_header_legacy_2, - "Group_sequence" => '2', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "question5", "Question" => $question5, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio) - ) - ), - array("Group" => $group_header_legacy_3, - "Group_sequence" => '3', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "question6", "Question" => $question6, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '2',"QuestionID" => "question7", "Question" => $question7, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '3',"QuestionID" => "question8", "Question" => $question8, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '4',"QuestionID" => "question9", "Question" => $question9, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio) - ) - ), - array("Group" => $group_header_legacy_4, - "Group_sequence" => '4', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "question11a", "Question" => $question11, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownCorrosion), - array("Question_sequence" => '2',"QuestionID" => "question12a", "Question" => $question12, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownCorrosion), - array("Question_sequence" => '3',"QuestionID" => "question13a", "Question" => $question13, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownCorrosion), - array("Question_sequence" => '4',"QuestionID" => "question14a", "Question" => $question14, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownCorrosion), - array("Question_sequence" => '5',"QuestionID" => "question18a", "Question" => $question18, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownCorrosion) - ) - ), - array("Group" => $group_header_legacy_5, - "Group_sequence" => '5', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "question10", "Question" => $question10, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage), - array("Question_sequence" => '2',"QuestionID" => "question11", "Question" => $question11, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage), - array("Question_sequence" => '3',"QuestionID" => "question12", "Question" => $question12, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage), - array("Question_sequence" => '4',"QuestionID" => "question13", "Question" => $question13, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage), - array("Question_sequence" => '5',"QuestionID" => "question14", "Question" => $question14, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage), - array("Question_sequence" => '6',"QuestionID" => "question15", "Question" => $question15, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage), - array("Question_sequence" => '7',"QuestionID" => "question16", "Question" => $question16, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage), - array("Question_sequence" => '8',"QuestionID" => "question17", "Question" => $question17, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage), - array("Question_sequence" => '9',"QuestionID" => "question18", "Question" => $question18, "Type" => 'Dropdown', "Response" => $allowedResponseDropdownDamage) - ) - ), - array("Group" => $group_header_legacy_6, - "Group_sequence" => '6', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "question20", "Question" => $question20, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '2',"QuestionID" => "question22", "Question" => $question22, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio) - ) - ), - array("Group" => $group_header_legacy_7, - "Group_sequence" => '7', - "Questions_in_group" => array( - array("Question_sequence" => '1',"QuestionID" => "question21", "Question" => $question21, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '2',"QuestionID" => "question23", "Question" => $question23, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio), - array("Question_sequence" => '3',"QuestionID" => "question24", "Question" => $question24, "Type" => 'Radiobutton', "Response" => $allowedResponseRadio) - ) - ), - ); ?> \ No newline at end of file