background-color: white; } </style> </head> <body> <table border="0px"> <?php include_once "csp_helper.php"; $u = "*****@*****.**"; $p = "****"; //NOTE: don't bother, the helper code based on Zend no longer works $ss = new Google_Spreadsheet($u, $p); $ss->useSpreadsheet("Collaboration Tracking"); $ss->useWorksheet("Sheet1"); //headers echo "<tr>"; $head = $ss->getColumnNames(); foreach ($head as $colname) { echo "<th>{$colname}</th>"; } echo "</tr>"; //GET admin set $view = $_GET["view"]; $rowset = ""; //means "show all; if ($view == "Ongoing" || $view == "Completed" || $view == "Canceled" || $view == "Unknown") { $rowset = "projectstatus={$view}"; } //retrieve data
This class is best used with a cronjob like this: 0,30 * * * * cd /home/yurukov1/public_html/vote; /usr/local/php5/bin/php proxy.php If an email is configured for the cronjob, then all addresses in error will be printed out only once. *********************************************************/ mb_internal_encoding("UTF-8"); $datafile = "data/.data.json.gz"; //the path yo your ZEND libs set_include_path("/home/yurukov1/libs/"); include_once "Google_Spreadsheet.php"; include "secret.php"; include_once "config.php"; //access settings should be defined in config.php $ss = new Google_Spreadsheet($u, $p); $ss->useSpreadsheet($spreadsh); $ss->useWorksheet($sheet); // get the data from the spreadsheet $rows = $ss->getRows(); if (!$rows) { exit; } $data = array(); for ($i = 0; $i < count($rows); $i++) { $type = $rows[$i]["искателидапомогнете"]; if ($type == "Ще разпостранявам информация сред познати") { $type = 1; } else { if ($type == "Бих се заел с организиране на секция извън консулствата") { $type = 2; } else { $type = 0;
// optional, comment out and test $mail->MsgHTML($body); $mails = explode(',', $_SETTINGS['email']['address']); foreach ($mails as $v) { $mail->AddAddress(trim($v)); } if (!$mail->Send()) { $ret['error'] = 1; } } /**************** GOOGLE.DOCS method ************************/ if ($_SETTINGS['store_to_gdocs']) { include_once "GoogleSpreadsheet/Google_Spreadsheet.php"; $ss = new Google_Spreadsheet($_SETTINGS['gdocs']['user'], $_SETTINGS['gdocs']['password']); $ss->useSpreadsheet($_SETTINGS['gdocs']['spreadsheet_name']); $ss->useWorksheet($_SETTINGS['gdocs']['worksheet_name']); $row = array("Date" => date("m/d/Y H:i")); foreach ($_POST['fields'] as $k => $v) { $row[$k] = $v; } if (!$ss->addRow($row)) { $ret['error'] = 1; } } /**************** MailChimp method ************************/ if ($_SETTINGS['store_to_mailchimp']) { if (@$_POST['fields'][$_SETTINGS['email_field_name']] && $_SETTINGS['mailchimp']['apikey'] && $_SETTINGS['mailchimp']['listId']) { include_once 'mailChimp/MCAPI.class.php'; $MCAPI = new MCAPI($_SETTINGS['mailchimp']['apikey']); $arr = array('EMAIL' => $_POST['fields'][$_SETTINGS['email_field_name']]); if ($_SETTINGS['first_name_field_name']) {