as well as the Zind GData libraries

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;
<?php

include_once "csp_helper.php";
$u = "*****@*****.**";
$p = "pi314159265";
$ss = new Google_Spreadsheet($u, $p);
$ss->useSpreadsheet("Collaboration Tracking");
$ss->useWorksheet("Sheet1");
$ss2 = new Google_Spreadsheet($u, $p);
$ss2->useSpreadsheet("NRNB Subproject Stages");
$ss2->useWorksheet("Sheet1");
$rowset = 'projectstage!=""';
# only rows with stage info
$rows = $ss->getRows($rowset);
if ($rows) {
    foreach ($rows as $row) {
        $stage = $row['projectstage'];
        $stage2 = array();
        ## skip if no digits
        $stage = str_replace(",", "", $stage);
        $len = strlen($stage);
        if ($len < 1) {
            continue;
        } elseif ($len == 1) {
            array_push($stage2, $stage . "1");
        } elseif ($len > 1) {
            array_push($stage2, substr($stage, 0, 1) . "2");
            for ($i = 1; $i < $len - 1; $i++) {
                array_push($stage2, substr($stage, $i, 1) . "1");
                array_push($stage2, substr($stage, $i, 1) . "2");
            }
tr:nth-child(odd) {
  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}";
Example #4
0
	{
            border: solid 1px #fff;
            background-repeat: repeat-x;
            background-position: top;
        }
    </style>
</head>

<body>
<div id="inputArea" style="float:left;background-color:#fff;">

<?php 
include_once "csp_helper.php";
$u = "*****@*****.**";
$p = "pi314159265";
$ss = new Google_Spreadsheet($u, $p);
$ss->useSpreadsheet("Collaboration Tracking");
$ss->useWorksheet("Sheet1");
//GET sub id
if (empty($_GET)) {
    echo "This page requires a Subproject ID in order to display data. Please try again. </div></body></html>";
} else {
    $subid = $_GET["id"];
    $msg = "Please update the following information:";
    if ('POST' == $_SERVER['REQUEST_METHOD']) {
        $update2 = check_input($_POST['update']);
        $feedback2 = check_input($_POST['feedback']);
        $pubmed2 = check_input($_POST['pubmed']);
        $grant2 = check_input($_POST['grant']);
        $status2 = check_input($_POST['status']);
        $st1 = check_input($_POST['stage1']);
<?php

// Zend library include path
set_include_path(get_include_path() . PATH_SEPARATOR . "{$_SERVER['DOCUMENT_ROOT']}/ZendGdata-1.8.1/library");
include_once "Google_Spreadsheet.php";
include_once "../../../config/post_spreadsheet_config.php";
$ss = new Google_Spreadsheet($u, $p);
$ss->useSpreadsheet("Mailing List 2015");
$name = Trim(stripslashes($_GET['name']));
$email = Trim(stripslashes($_GET['email']));
$year = Trim(stripslashes($_GET['year']));
$campus = Trim(stripslashes($_GET['campus']));
$interest = Trim(stripslashes($_GET['interest']));
$involvement = Trim(stripslashes($_GET['involvement']));
// if not setting worksheet, "Sheet1" is assumed
// $ss->useWorksheet("worksheetName");
$row = array("Name" => $name, "Email" => $email, "Year of Study" => $year, "College/Campus" => $campus, "Area of interest" => $interest, "Involvement in TEDxUofT" => $involvement);
if ($ss->addRow($row)) {
    echo "Form data successfully stored using Google Spreadsheet";
} else {
    echo "Error, unable to store spreadsheet data";
}
<?php

// Zend library include path
set_include_path(get_include_path() . PATH_SEPARATOR . "{$_SERVER['DOCUMENT_ROOT']}/ZendGdata-1.8.1/library");
include_once "Google_Spreadsheet.php";
include_once "../../../config/post_spreadsheet_config.php";
$ss = new Google_Spreadsheet($u, $p);
$ss->useSpreadsheet("2015 Delegate Application");
$Name = Trim(stripslashes($_GET['Name']));
$Email = Trim(stripslashes($_GET['Email']));
$Year = Trim(stripslashes($_GET['Year']));
$Phone = Trim(stripslashes($_GET['Phone']));
$Status = Trim(stripslashes($_GET['Status']));
$Occupation = Trim(stripslashes($_GET['Occupation']));
$Program = Trim(stripslashes($_GET['Program']));
$Campus = Trim(stripslashes($_GET['Campus']));
$Dietary = Trim(stripslashes($_GET['Dietary']));
$FinalQ = Trim(stripslashes($_GET['FinalQ']));
// if not setting worksheet, "Sheet1" is assumed
// $ss->useWorksheet("worksheetName");
$row = array("Name" => $Name, "E-mail" => $Email, "Year" => $Year, "Phone" => $Phone, "I am a(an)" => $Status, "Occupation" => $Occupation, "Program" => $Program, "Campus" => $Campus, "Dietary" => $Dietary, "Final Question" => $FinalQ);
if ($ss->addRow($row)) {
    echo "Form data successfully stored using Google Spreadsheet";
} else {
    echo "Error, unable to store spreadsheet data";
}
<?php

// Zend library include path
set_include_path(get_include_path() . PATH_SEPARATOR . "{$_SERVER['DOCUMENT_ROOT']}/ZendGdata-1.8.1/library");
include_once "Google_Spreadsheet.php";
include_once "../../../config/post_spreadsheet_config.php";
$ss = new Google_Spreadsheet($u, $p);
$ss->useSpreadsheet("Hiring Application Submissions 2014");
$Name = Trim(stripslashes($_GET['Name']));
$Campus = Trim(stripslashes($_GET['Campus']));
$Position = Trim(stripslashes($_GET['Position']));
$Email = Trim(stripslashes($_GET['Email']));
$Phone = Trim(stripslashes($_GET['Phone']));
$Occupation = Trim(stripslashes($_GET['Occupation']));
$Title = Trim(stripslashes($_GET['Title']));
$Year = Trim(stripslashes($_GET['Year']));
// if not setting worksheet, "Sheet1" is assumed
// $ss->useWorksheet("worksheetName");
$row = array("Name" => $Name, "Campus" => $Campus, "Application Position" => $Position, "E-mail" => $Email, "Phone" => $Phone, "Program" => $Occupation, "Year of Study" => $Year);
if ($ss->addRow($row)) {
    echo "Form data successfully stored using Google Spreadsheet";
} else {
    echo "Error, unable to store spreadsheet data";
}
Example #8
0
    $mail->Subject = $_SETTINGS['email']['subject'];
    $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
    // 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']);
<?php

// Zend library include path
set_include_path(get_include_path() . PATH_SEPARATOR . "{$_SERVER['DOCUMENT_ROOT']}/ZendGdata-1.8.1/library");
include_once "Google_Spreadsheet.php";
include_once "../../../config/post_spreadsheet_config.php";
$ss = new Google_Spreadsheet($u, $p);
$ss->useSpreadsheet("Nomination Submissions 2014");
$Nominator_Name = Trim(stripslashes($_GET['Nominator_Name']));
$Nominator_Email = Trim(stripslashes($_GET['Nominator_Email']));
$Nominator_Phone = Trim(stripslashes($_GET['Nominator_Phone']));
$Nominee_Name = Trim(stripslashes($_GET['Nominee_Name']));
$Nominee_Email = Trim(stripslashes($_GET['Nominee_Email']));
$Nominee_Phone = Trim(stripslashes($_GET['Nominee_Phone']));
$Overview = Trim(stripslashes($_GET['Overview']));
$Websites_Articles = Trim(stripslashes($_GET['Websites_Articles']));
$Audios_Videos = Trim(stripslashes($_GET['Audios_Videos']));
$Speaking_Style = Trim(stripslashes($_GET['Speaking_Style']));
$Why_fits_the_theme = Trim(stripslashes($_GET['Why_fits_the_theme']));
// if not setting worksheet, "Sheet1" is assumed
// $ss->useWorksheet("worksheetName");
$row = array("Nominator Name" => $Nominator_Name, "Nominator E-mail" => $Nominator_Email, "Nominator Phone" => $Nominator_Phone, "Nominee Name" => $Nominee_Name, "Nominee E-mail" => $Nominee_Email, "Nominee Phone" => $Nominee_Phone, "Overview" => $Overview, "Websites or Articles" => $Websites_Articles, "Audios or Videos" => $Audios_Videos, "Speaking Style" => $Speaking_Style, "Why fits the theme" => $Why_fits_the_theme);
if ($ss->addRow($row)) {
    echo "Form data successfully stored using Google Spreadsheet";
} else {
    echo "Error, unable to store spreadsheet data";
}
 function __construct()
 {
     new Model();
     $teamSpreadsheet = new Google_Spreadsheet('Team Contacts & Roles');
     // d($teamSpreadsheet);
     // $columnNames = $teamSpreadsheet->getColumnNames();
     // dd($columnNames);
     $this->rows = $teamSpreadsheet->getRows();
     // $rows = $teamSpreadsheet->getRows();
     // dd($rows);
     // foreach ($rows as $row) {
     // 	$teamName;
     // 	if (is_string($row)) {
     // 		$teamName = $row;
     // 	}
     // 	$data = array();
     // 	// $data = array_merge($row, $teamName);
     // 	$teamMember = new TeamMember($row);
     // 	$teamMember->setTeam($teamName);
     // 	// $teamMember = new TeamMember($teamName);
     // 	// foreach ($row as $key => $value) {
     // 	// 	$teamMember->set()
     // 	// 	$teamMember[] = $teamMember[$key] = $value;
     // 	// }
     // 	$this->teamMembers[] = $teamMember;
     // }
     // dd($teamMembers);
     // foreach ($rows as $row) {
     // 	// if row begins with '*' then trim it off and create a class with the name
     // 	// dd($row);
     // 	$count = 0;
     // 	$this->teamMembers[$count] = new TeamMember($row[0]);
     // 	// d($this->teamMembers);
     // 	foreach ($row as $k => $v) {
     // 		$this->teamMembers[$count]->setAll($v[0], $v[1], $v[2], $v[5], $v[6], $v[7], $v[8], $v[9]);
     // 		// d($row);
     // 		// sd($k);
     // 		// if ($k[0] == 'Position' && $k[9] == 'Picture') {
     // 		// }
     // 	}
     // 	$count++;
     // }
     // dd($teamMembers);
     // LOOP THROUGH AND CREATE TEAM MEMBERS
     // $teamMember = new TeamMember();
     // foreach ($rows as $colName => $colValue) {
     // for ($i = 0; $i < count($rows); $i++) {
     // 	$columnValues = array();
     // 	$columns = $rows[$i];
     // 	// for ($colPosition = 0; $colPosition < ; $colPosition++) {
     // 		// $columns[] = $rows[$i][$colPosition]
     // 	// }
     // 	foreach ($columns as $column) {
     // 		// dd($column);
     // 		// $columnValues[] =
     // 	}
     // }
     // $teams[] = new Team($currentFirstColumn);
     // - instantiate the Team Class
     // -
 }