Want to Hire Dev to code display of data in PHP

Mehr
6 Monate 2 Wochen her - 6 Monate 2 Wochen her #189103 von h0rr0rOrg
Hello!
I am the webmaster for the HWA, and I need help getting my Limesurvey data to display on my PHP/Wordpress website. I've done some of the coding and managed to get it set up, but it's not showing the data the way I want it to.

I know JSON only a little, having learned a bit since moving to the Online LimeSurvey.

I doubt it's difficult, but I cannot make it work. At this point, I'm willing to pay someone to code me a script and PHP page to make it happen. You probably don't need to start from scratch, if you don't want to, but could just fix the code I have.

We are the Horror Writers Association, and we're a non-profit org run by volunteers, so please know that we can't pay as much as a corporation.

If you're interested, email me at Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!, let me know your experience and how much you would need to charge us to do this.

It may be a bit more complicated than the standard. I need it to sort on X, then take those results, sort them on Y, Z, A, B, then display only a portion of the data.

Thanks for your time.
Angel Leigh McCoy, HWA Webmaster
Letzte Änderung: 6 Monate 2 Wochen her von h0rr0rOrg.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

LimeSurvey Partners
Mehr
6 Monate 2 Wochen her #189114 von tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Folgende Benutzer bedankten sich: DenisChenu, gabrieljenik

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 2 Wochen her - 6 Monate 2 Wochen her #189122 von h0rr0rOrg
Thanks, Tpartner, but that page is where I started. It isn't helping me beyond a certain point. I have another post where I go into detail.

I finally tried hiring someone else to fix it, but they borked it. So now I'm here, hoping someone here has the expertise I need to fix it.

Old post: www.limesurvey.org/community/forums/can-...html?start=15#185143

I'm FRANKLY at my wits end.
Letzte Änderung: 6 Monate 2 Wochen her von h0rr0rOrg.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 2 Wochen her #189127 von DenisChenu
Didn't understand : you want some dev contact, @tparner give you the official partner page. Then you have the contact ?
No ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .
Folgende Benutzer bedankten sich: gabrieljenik

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 2 Wochen her - 6 Monate 2 Wochen her #189142 von Joffm
Regarding your old post.

There is this line
// THE FOLLOWING LINE IS WHERE I NEED TO ECHO ONLY SPECIFIED $item DATA
echo '<td style="border: 1px solid #CCC; padding: 2px 7px;">A: ' . $item . '</td>';

Why don't you define your desired items
$categories = array("title", "author", "publisher");

and then
if (in_array($category, $categories)) {
echo '<td style="border: 1px solid #CCC; padding: 2px 7px;">A: ' . $item . '</td>';
}

And somewhere you mentioned some sorting.
Well, you have your array.
Here some examples how to sort:
https://www.virendrachandak.com/techtalk/how-to-sort-a-multi-dimension-array-by-value-in-php/


Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Anhänge:
Letzte Änderung: 6 Monate 2 Wochen her von Joffm.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 1 Woche her #189171 von h0rr0rOrg
Oh! You're right. That's not the page I thought it was. Sorry!

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 1 Woche her #189172 von h0rr0rOrg
Thanks, Joffm! I'll take another look and see if I can sort it out.

Much appreciated.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 1 Woche her #189173 von h0rr0rOrg
Sorry, tpartner. I thought that was a different link. Much appreciated!

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 1 Woche her - 6 Monate 1 Woche her #189212 von Joffm
Hi,
I played around a bit with your php file and got the following:

Styling is up to you.
As far as I understood your explanation this is near to your ideas.
If not you ought to show us (screenshot, drawing, etc)

Here the script:
<html>
<head>
<title>HWA Bram Stoker Award Recommendations</title>
<script language="JavaScript" type="text/JavaScript">
// THE FOLLOWING IS LIMESURVEY CODE
 function get_session_key(USERNAME $username, PASSWORD $password)
</script>
</head>
 
<body>
<!-- START OF CONTENT -->
<table border=1><tr bgcolor="#bbbbbb"><td colspan=8><br><center><h1>HWA Bram Stoker Award&reg; Member Recommendations for Works Published in 2018</h1></td></tr>
 
<?php
require_once 'jsonrpcphp/JsonRPCClient.php';
 
define( 'LS_BASEURL', 'https://www.myServer.de/survey');  // adjust this one to your actual LimeSurvey URL
define( 'LS_USER', 'user' );
define( 'LS_PASSWORD', 'password' );
 
// the survey to process
$survey_id=977824;
// instantiate a new client
$myJSONRPCClient = new \org\jsonrpcphp\JsonRPCClient( LS_BASEURL.'/index.php/admin/remotecontrol' );
// receive session key
$sessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );
 
if(is_array($sessionKey))
{
    header("Content-type: application/json");
    echo json_encode($sessionKey);
    echo '<br />This is another test with sesssion key.<br />';
    die();
}
else if($sessionKey) // Is a valid session
{
/* Get the responses */
  $rawResponses = $myJSONRPCClient->export_responses( $sessionKey, $survey_id,
    'json', // Document type : pdf,csv,xls,doc,json
    null, // Language code : null : default from survey
    'complete', // Stautus complete|incomplete|all
    'code', // Heading : code|full|abbreviated : question text, default code
    'short', // answer : short|long , default : long
    null,
    null
  );
  $category= array ("","Novel","First Novel","Graphic Novel","Young adult novel","Long Fiction","Short Fiction","Screenplay","Anthology","Fiction Collection");
  $columns = array("title", "author", "publisher", "venue", "month");
 
  if(is_array($rawResponses))
  {
    print_r($rawResponses);
  }
  else {
    $decodedString = base64_decode($rawResponses); // The decodedString variable turns the data into an array and contains the entire array of data for the survey in English
    $responseArr = json_decode($decodedString, True); // Creates the json-decoded array of data for use in PHP.
 
    for ($i=1;$i<9;$i++) {
      echo '<tr bgcolor="#bbbbbb"><td colspan="8" style="font-size:14pt;font-weight:bold;text-align:center">'.$category[$i].'</td></tr>';
      foreach($responseArr['responses'] as $rownumber => $row) {
        foreach($row as $column => $item) {
 
          if ($item["category"]=="A".$i) {
            echo '<tr bgcolor="#bbbbbb">';
            foreach($columns as $col) {
              echo '<td style="border: 1px solid #CCC; padding: 2px 7px;">' . $item[$col] . '</td>';
            }
          }
          echo '</tr>';
        }
      }
    }
    echo '</table>';
  }
}
 
  // Release the session key
  $myJSONRPCClient->release_session_key( $sSessionKey );
 
 
 
?>
</table>
<!-- END OF CONTENT -->
</body>
</html>

1. You should have the same structure in the codes of the categories (Why did you change after "A9"?)
Therefore the script only works up to category "A9"; as you see I check for "A".$i in the loop.
2. The same in "month". Why the change? Here I used the short name of the month as code


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Anhänge:
Letzte Änderung: 6 Monate 1 Woche her von Joffm.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 1 Woche her #189239 von jelo
Nice effort.

What external library did you use for JSON-RPC?
The one linked in the LimeSurvey manual?
github.com/weberhofer/jsonrpcphp

Since there many php libs around JSON-RPC, it's worth pointing out what external dependence we have.

Since PHP 7 is more and more the norm, this JSON PHP lib is worth a look.
github.com/datto/php-json-rpc

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 1 Woche her #189240 von Joffm
Yes, it is weberhofer.

I never used the API, here just a try to help.


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 1 Woche her #189241 von DenisChenu

jelo schrieb: Nice effort.

What external library did you use for JSON-RPC?
The one linked in the LimeSurvey manual?
github.com/weberhofer/jsonrpcphp

Since there many php libs around JSON-RPC, it's worth pointing out what external dependence we have.

Since PHP 7 is more and more the norm, this JSON PHP lib is worth a look.
github.com/datto/php-json-rpc

datto lib seems for jsonRPC spec 2, we are on spec 1 : manual.limesurvey.org/RemoteControl_2_API#How_to_use_LSRC2

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 1 Woche her #189249 von jelo

DenisChenu schrieb: datto lib seems for jsonRPC spec 2, we are on spec 1 : manual.limesurvey.org/RemoteControl_2_API#How_to_use_LSRC2

Thanks for the hint. Sad but true. Datto is JSON-RPC 2.0 only.

Is there a maintained php lib for both JSON-RPC 1.0 and 2.0?
JSON-RPC 2.0 only is quite common these days (available since 2010)

On GITHUB many libs are 4-5 years without any activity. Might be fine, cause the libs are without a glitch.
github.com/AlexBinno/php-json-rpc

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 1 Woche her #189272 von gabrieljenik
Hi,

Let me know if you are still interested in hiring.
My contact is Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!.

Thanks

Cheers,
Gabriel - www.Encuesta.Biz - Authorized Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?)....[img]

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 3 Stunden her #189685 von h0rr0rOrg
You all are the best, thank you so much. I've got it working now. I couldn't have done it without you!

Angel...

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha