Skip to content

Instantly share code, notes, and snippets.

View aorborc's full-sized avatar

A or B or C Technologies aorborc

View GitHub Profile
@aorborc
aorborc / FormatIndianCurrency.ds
Last active February 15, 2024 20:19
Convert Indian currency value to a readable comma separate value in Zoho Creator
string FormatIndianCurrency(float currency_val)
{
number = "";
frac_value = "";
if(currency_val != null)
{
if(currency_val > 0.0)
{
// whole_value = "12345678";
whole_value = currency_val.toString().getPrefix(".");
@aorborc
aorborc / UploadFiletoZohoDesk.js
Last active November 21, 2022 19:46
Upload a file from Zoho Creator or any Zoho Service to Zoho Desk ticket, via deluge
ticket_attachment_api_url = "https://desk.zoho.com/api/v1/tickets/" + Desk_Ticket_ID + "/attachments";
header_map = Map();
header_map.put("orgId","yourOrgID");
yourFile = invokeurl
[
url :"httpsdownloadURL"
type :GET
];
@aorborc
aorborc / gts.jsp
Last active November 4, 2022 01:52
Guess the Song HTML page code. Tutorial at https://youtu.be/ljD3y925zIg
<%{
%>
<link
href="https://aorborc.github.io/bootstrap5/css/main.min.css"
rel="stylesheet"
crossorigin="anonymous"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
@aorborc
aorborc / guage.js
Last active July 7, 2022 20:58
Process Custom JSON with Guage and table in Zoho Creator HTML -- https://help.zoho.com/portal/en/community/topic/dashboard-data-from-deluge-function
<%{
data_source = {"code":"0","description":"Success","subscriberQuota":{"qtavalue":"500.00","qtabalance":"419.30","qtaconsumption":"80.70","type":"2","refuelingTotal":"0.00","qtaconsumptionTotal":"263.22"},"historyQuota":{{"time":"20220707","qtaconsumption":"19.07","mcc":"714"},{"time":"20220707","qtaconsumption":"236.41","mcc":"710"},{"time":"20220707","qtaconsumption":"7.74","mcc":"708"},{"time":"20220706","qtaconsumption":"164.85","mcc":"714"}},"ext":null};
subscriberQuota = data_source.get("subscriberQuota");
qtaconsumption = subscriberQuota.get("qtaconsumption").toDecimal();
qtavalue = subscriberQuota.get("qtavalue").toDecimal();
percent = ((qtaconsumption / qtavalue).round(4) * 100).round(2);
deg_value = percent / 200;
%>
<div style="margin:10px;display:flex;flex-direction:column;">
<h1 style="text-align:center;">subscriberQuota</h1>
@aorborc
aorborc / Amount2Words.js
Last active November 12, 2024 06:20
Zoho Creator Functions to Convert Indian Rupees (with paise) Amount to Words
string String.Amount2Words(float amount)
{
//amount.frac() not working for long numbers
paise_str = amount.toString().getSuffix(".");
if(paise_str != "")
{
paise_amount = paise_str.toLong();
paise_str = " and "+ thisapp.String.TwoDigitWords(paise_amount) + " paise";
}
rupee_str = String.RupeeInWords(amount.toLong());
@aorborc
aorborc / ReadZohoBlogs.gs
Last active March 23, 2022 07:48
Get the latest posts from Zoho Blogs posted in the last hour and send an email via Google Apps Script
function readAndSend() {
let url = 'https://www.zoho.com/blog/feed';
let xml = UrlFetchApp.fetch(url).getContentText();
let document = XmlService.parse(xml.trim());
let root = document.getRootElement();
let channel = root.getChild('channel');
let items = channel.getChildren('item');
for(i =0; i< items.length; i++){
let item = items[i];
let pubDateStr = item.getChild('pubDate').getText();
@aorborc
aorborc / PushToZohoCreator.php
Last active October 18, 2023 12:09
Create Access Token using Zoho Creator API V2 and add record using PHP. Youtube Tutorial at https://www.youtube.com/watch?v=UqSsP-wz-mE
<?php
$client_id ='1000.GUPPSEH1013UZQA5SN8OAJV1DQU5FM';//Enter your Client ID here
$client_secret = '4932018fd429a4246e96d9186e77704d88d05b052a';//Enter your Client Secret here
$code = '1000.bf0e3723d718ac74660843a2128946b8.c6a7d9ce01ea879a22803f5f88bb0a6c';//Enter your Code here
$base_acc_url = 'https://accounts.zoho.com';
$service_url = 'https://creator.zoho.com';
$refresh_token = '1000.4f4b206a80c5e3e48c1cf3a55994a19c.c7c25dc7144da53c497b2d2ca834d1d0'; //Replce this with your Refresh token
$token_url = $base_acc_url . '/oauth/v2/token?grant_type=authorization_code&client_id='. $client_id . '&client_secret='. $client_secret . '&redirect_uri=http://localhost&code=' . $code;
@aorborc
aorborc / function.php
Created December 4, 2019 07:00 — forked from YugalXD/function.php
Send mail with mailgun api by PHP CURL.
<?php
define('MAILGUN_URL', 'https://api.mailgun.net/v3/DOMAIN_NAME');
define('MAILGUN_KEY', 'KEY');
function sendmailbymailgun($to,$toname,$mailfromnane,$mailfrom,$subject,$html,$text,$tag,$replyto){
$array_data = array(
'from'=> $mailfromname .'<'.$mailfrom.'>',
'to'=>$toname.'<'.$to.'>',
'subject'=>$subject,
'html'=>$html,
import sys
n = int(raw_input("Enter the Counter number : "))
for i in range(1,n):
if( i% 15 == 0):
print "fizzbuzz"
elif (i%3 == 0):
print "fizz"
elif (i%5 == 0):
print "buzz"
else:
#
# /etc/apache2/sites-available/openerp
#
# OpenERP Reverse Proxy Configuration for Apache 2.
#
# Authors: 2014 Mariano Ruiz <[email protected]>
#
# After copy this file execute:
#
# sudo a2ensite openerp