--- a/generateConvos.php
+++ b/generateConvos.php
@@ -1,25 +1,35 @@
prepare( 'select * from recordings limit 100;');
+$sth = $conn->prepare('select * from recordings limit 100;');
- $sth->execute( );
+$sth->execute();
$recordings = $sth->fetchAll();
$convos = Array();
$convo = Array();
foreach ($recordings as $i => $recording) {
- if (count($convo) > 0 && strcasecmp($convo[count($convos)]['tgid'], $recording['tgid']) != 0) {
- $convos[] = $convo;
- $convo = Array();
- } ;
- //print_r($recording);
- $convo[] = $recording;
- //print_r($convo);
- echo "
\n";
+ if (count($convo) > 0) {
+ echo "
" . strcasecmp($convos[count($convos) - 1][0]['call_timestamp'], $recording['call_timestamp']);
+ if (abs(strcasecmp($convos[count($convos) - 1][0]['call_timestamp'], $recording['call_timestamp'])) > 2) {
+ echo " " . $convos[count($convos) - 1][0]['call_timestamp'] . " " . $recording['call_timestamp'];
+ }
+ if (strcasecmp($convos[count($convos) - 1][0]['tgid'], $recording['tgid']) != 0) {
+ $convos[] = $convo;
+ $convo = Array();
+ }
+ }
+ ;
+ //print_r($recording);
+ $convo[] = $recording;
+ //print_r($convo);
+ //echo "
\n";
}
foreach ($convos as $i => $convo) {
- print_r($convo);
- echo "
\n";
+ foreach ($convo as $recording) {
+ echo $recording['filename'] . " , ";
+ }
+ echo "