]> ruin.nu Git - ndwebbie.git/commitdiff
Show avilable credits
authorMichael Andreen <harv@ruin.nu>
Tue, 17 Jan 2017 22:33:32 +0000 (23:33 +0100)
committerMichael Andreen <harv@ruin.nu>
Tue, 17 Jan 2017 22:33:32 +0000 (23:33 +0100)
lib/NDWeb/Controller/Users.pm
root/src/users/sms.tt2

index efb48d3fd155e0e718c83f860a93a6dfd048662a..40e9aaa51f2b2c162d03fa38b0aa9f0de3ea1623 100644 (file)
@@ -216,6 +216,8 @@ ORDER BY time desc
                });
        $query->execute;
        $c->stash(sms => $query->fetchall_arrayref({}));
+
+       $c->stash(credits => $dbh->selectrow_array(q{SELECT credits FROM clickatell}));
 }
 
 sub postsms : Local {
index 21a611bbb5413adb8aad1d4c4f5b841763a5859a..0a5e12757e2a747bafdbbc879d0cf670942e6aff 100644 (file)
@@ -2,6 +2,7 @@
 
 <form action="postsms" method="post" id="sms"><fieldset class="forum-post">
 <legend>New SMS</legend>
+       <p>Available credits: [% credits %]</p>
        <p><span id="recadd">Receiver(s): </span><select name="uid" multiple size="5">
 [% FOR u IN users %]
                <option value="[% u.uid %]" [% IF uid == u.uid %]selected[% END %]>[% u.username %]</option>