public function add($s)
 {
     // Adding new skills to the database
     foreach ($s as $skill) {
         $elem = $this->find(array("meetup_skill_id" => $skill["meetup_skill_id"]));
         if (!$elem) {
             if ($id = $this->db->insert('skills', $skill)) {
                 //echo $db->count . ' skills were added';
             } else {
                 prettyprint($skill);
                 die('skill insetion failed: ' . $this->db->getLastError());
             }
         }
     }
 }
示例#2
0
 /**
  * main method for getting report results.  This method can be called as an
  * ajax callback and return the raw data in json format, or it can display
  * a table or graph directly.  All other methods that get report results use this
  * either directly or as an ajax call.
  */
 public function api()
 {
     // special case for optional pivot on hostname
     // mainly used to graph each host as a series
     $hostname_field = $this->data_model->get_field_name('hostname');
     if (get_var('dimension-pivot-' . $hostname_field) != null) {
         $dimension_table = $this->report_obj->get_table_by_alias('dimension');
         $hosts = $this->report_obj->get_distinct_values($dimension_table, $hostname_field);
         $this->report_obj->set_pivot_values('dimension-pivot-' . $hostname_field, $hosts);
     }
     // process the form data, and get the query result
     $data = array();
     $data['datasource'] = get_var('datasource');
     try {
         $data['sql'] = $this->report_obj->query();
         $data['result'] = $this->report_obj->execute();
     } catch (Exception $e) {
         $this->alert($e->getMessage(), 'alert-error');
         prettyprint($data['sql']);
     }
     $data['columns'] = $this->report_obj->get_column_names();
     $data['permalink'] = site_url() . '?action=report&datasource=' . $data['datasource'] . '&' . $this->report_obj->get_search_uri();
     $data['jsonlink'] = site_url() . '?action=api&output=json&datasource=' . $data['datasource'] . '&' . $this->report_obj->get_search_uri();
     // output data in the requested format
     // never display header and footer
     $output_types = array('json' => "report_json", 'json2' => "report_json2", 'print_r' => "report_printr", 'table' => "report_result");
     $output = get_var('output');
     if (!key_exists($output, $output_types)) {
         $output = 'table';
     }
     $source_type = $this->data_model->get_source_type();
     if (key_exists('callbacks', $this->conf['reports'][$source_type]) && key_exists($output, $this->conf['reports'][$source_type]['callbacks'])) {
         $data['callbacks'] = $this->conf['reports'][$source_type]['callbacks'][$output];
     }
     $this->load->view($output_types[$output], $data);
 }
prettyprint('<?php
$options = array("Option #1", "Option #2", "Option #3");

include("PFBC/Form.php");
$form = new Form("form-elements");
$form->configure(array(
	"prevent" => array("bootstrap", "jQuery")
));
$form->addElement(new Element_Hidden("form", "form-elements"));
$form->addElement(new Element_HTML(\'<legend>Standard</legend>\'));
$form->addElement(new Element_Textbox("Textbox:", "Textbox"));
$form->addElement(new Element_Password("Password:"******"Password"));
$form->addElement(new Element_File("File:", "File"));
$form->addElement(new Element_Textarea("Textarea:", "Textarea"));
$form->addElement(new Element_Select("Select:", "Select", $options));
$form->addElement(new Element_Radio("Radio Buttons:", "RadioButtons", $options));
$form->addElement(new Element_Checkbox("Checkboxes:", "Checkboxes", $options));
$form->addElement(new Element_HTML(\'<legend>HTML5</legend>\'));
$form->addElement(new Element_Phone("Phone:", "Phone"));
$form->addElement(new Element_Search("Search:", "Search"));
$form->addElement(new Element_Url("Url:", "Url"));
$form->addElement(new Element_Email("Email:", "Email"));
$form->addElement(new Element_Date("Date:", "Date"));
$form->addElement(new Element_DateTime("DateTime:", "DateTime"));
$form->addElement(new Element_DateTimeLocal("DateTime-Local:", "DateTimeLocal"));
$form->addElement(new Element_Month("Month:", "Month"));
$form->addElement(new Element_Week("Week:", "Week"));
$form->addElement(new Element_Time("Time:", "Time"));
$form->addElement(new Element_Number("Number:", "Number"));
$form->addElement(new Element_Range("Range:", "Range"));
$form->addElement(new Element_Color("Color:", "Color"));
$form->addElement(new Element_HTML(\'<legend>jQuery UI</legend>\'));
$form->addElement(new Element_jQueryUIDate("Date:", "jQueryUIDate"));
$form->addElement(new Element_Checksort("Checksort:", "Checksort", $options));
$form->addElement(new Element_Sort("Sort:", "Sort", $options));
$form->addElement(new Element_HTML(\'<legend>WYSIWYG Editor</legend>\'));
$form->addElement(new Element_TinyMCE("TinyMCE:", "TinyMCE"));
$form->addElement(new Element_CKEditor("CKEditor:", "CKEditor"));
$form->addElement(new Element_HTML(\'<legend>Custom/Other</legend>\'));
$form->addElement(new Element_State("State:", "State"));
$form->addElement(new Element_Country("Country:", "Country"));
$form->addElement(new Element_YesNo("Yes/No:", "YesNo"));
$form->addElement(new Element_Captcha("Captcha:"));
$form->addElement(new Element_Button);
$form->addElement(new Element_Button("Cancel", "button", array(
	"onclick" => "history.go(-1);"
)));
$form->render();');
<?php

require_once '../modules/prettyprint.php';
require_once '../vendor/autoload.php';
require_once '../config.php';
require_once 'init.php';
$videos = $db->get("videos");
$logFile = fopen("updateVideos_log.txt", "a+") or die("Unable to open file!");
$date = getdate();
$date = $date["year"] . "-" . $date["mon"] . "-" . $date["mday"];
$txt = "Date = {$date}\n";
fwrite($logFile, $txt);
foreach ($videos as $v) {
    $youtubeId = $v["youtubeId"];
    $statistiscs = file_get_contents("https://www.googleapis.com/youtube/v3/videos?id={$youtubeId}&part=statistics&key={$youtubeApiKey}");
    $statistiscs = json_decode($statistiscs);
    $data = array("viewCount" => $statistiscs->items[0]->statistics->viewCount, "likeCount" => $statistiscs->items[0]->statistics->likeCount);
    $db->where("youtubeId", $youtubeId);
    $db->update("videos", $data);
    $txt = "{$youtubeId}, {$data['viewCount']}, {$data['likeCount']}\n";
    fwrite($logFile, $txt);
}
fclose($logFile);
prettyprint($data);
/*
$contentDetails = file_get_contents("https://www.googleapis.com/youtube/v3/videos?id=$youtubeId&part=contentDetails&key=$apikey");
$snippet = file_get_contents("https://www.googleapis.com/youtube/v3/videos?id=$youtubeId&part=snippet&key=$apikey");
$contentDetails = json_decode($contentDetails);
$snippet = json_decode($snippet);
*/
exit();');
?>

	</div>
	<div id="php5-3" class="tab-pane">

<?php 
prettyprint('
<?php
//----------AFTER THE FORM HAS BEEN SUBMITTED----------
include("PFBC/Form.php");
if(Form::isValid("login", false)) {
	if(isValidUser($_POST["Email"], $_POST["Password"])) {
		Form::clearValues("login");
		header("Location: profile.php");
	}
	else {
		Form::setError("login", "Error: Invalid Email Address / Password");
		header("Location: login.php");
	}
}
else
	header("Location: login.php");
exit();');
?>

	</div>
</div>	

<p>The isValid method has a second, optional parameter that controls whether or not the form's submitted data is cleared from the PHP session
if the form validates without errors.  In the example above, false is passed allowing us to authenticate the potential user with
示例#6
0
 public function submit_approve_script()
 {
     if (!$this->has_credentials()) {
         return $this->redirect("input_credentials");
     }
     $propagate_script_id = get_var('propagate_script_id');
     $deploy_action = get_var('deploy_action');
     $submitter = $this->user_is_dba() ? '' : $this->get_auth_user();
     $instances = get_var("instance");
     if ($deploy_action == 'approve') {
         $event_name = "approve_script";
     } else {
         $event_name = "disapprove_script";
     }
     try {
         $this->data_model->approve_propagate_script($propagate_script_id, $submitter, $instances, $deploy_action == 'approve');
         $this->notify_listeners($event_name, array('script_id' => $propagate_script_id, 'user' => $this->get_auth_user()));
         return $this->redirect("view_script", "propagate_script_id=" . $propagate_script_id . "#instance_deployments");
     } catch (Exception $e) {
         $data['database_roles'] = $this->data_model->get_database_roles();
         $this->alert($e->getMessage(), 'alert-error');
         prettyprint($data['script_sql_code']);
         echo $data['script_sql_code'];
         $this->load->view("input_script", $data);
         $this->footer();
         return;
     }
 }
示例#7
0
prettyprint('<?php
include("PFBC/Form.php");
$form = new Form("ajax");
$form->configure(array(
    "prevent" => array("bootstrap", "jQuery"),
    "ajax" => 1,
    "ajaxCallback" => "parseJSONResponse"
));
$form->addElement(new Element_Hidden("form", "ajax"));
$form->addElement(new Element_HTML(\'<legend>Using the Google Geocoding API</legend>\'));
$form->addElement(new Element_Textbox("Address:", "Address", array(
	"required" => 1
)));
$form->addElement(new Element_HTML(\'<div id="GoogleGeocodeAPIReaponse" style="display: none;">\'));
$form->addElement(new Element_Textbox("Latitude/Longitude:", "LatitudeLongitude", array(
	"readonly" => ""
)));
$form->addElement(new Element_HTML(\'</div>\'));
$form->addElement(new Element_Button("Geocode", "submit", array(
	"icon" => "search"
)));
$form->render();
?>

<script type="text/javascript">
    function parseJSONResponse(latlng) {
        var form = document.getElementById("ajax");
        if(latlng.status == "OK") {
            var result = latlng.results[0];
            form.LatitudeLongitude.value = result.geometry.location.lat + \', \' + result.geometry.location.lng;
        }
        else
            form.LatitudeLongitude.value = "N/A";

        document.getElementById("GoogleGeocodeAPIReaponse").style.display = "block";
    }
</script>

<?php
//----------AFTER THE FORM HAS BEEN SUBMITTED----------
include("PFBC/Form.php");
if(isset($_POST["form"])) {
    if(Form::isValid($_POST["form"])) {
        header("Content-type: application/json");
        echo file_get_contents("http://maps.google.com/maps/api/geocode/json?address=" . urlencode($_POST["Address"]) . "&sensor=false");
    }
    else
        Form::renderAjaxErrorResponse($_POST["form"]);
    exit();
}');
示例#8
0
prettyprint('<?php
include("PFBC/Form.php");
$form = new Form("html5");
$form->configure(array(
    "prevent" => array("bootstrap", "jQuery")
));
$form->addElement(new Element_Hidden("form", "html5"));
$form->addElement(new Element_HTML(\'<legend>Attributes</legend>\'));
$form->addElement(new Element_Textbox("Required Attribute:", "Required", array(
    "required" => 1, 
    "shortDesc" => "Highlights field in red when focussed"
)));
$form->addElement(new Element_Textbox("Placeholder Attribute:", "Placeholder", array(
    "placeholder" => "my placeholder",
    "shortDesc" => "Provides example or hint",
	"longDesc" => "The form\'s labelToPlaceholder property can be used to convert each element\'s label to its placeholder.  This strategy keeps your php source cleaner when building forms.  Check out the <a href=\\"views.php\\">Vertical View</a> example to see the labelToPlaceholder property in action."
)));
$form->addElement(new Element_Textbox("Pattern Attributes:", "Pattern", array(
    "pattern" => "^pfbc.*",
    "title" => "Must start with \\"pfbc\\"",
    "shortDesc" => "Provides native, client-side validation",
    "longDesc" => "This input\'s pattern attribute is set to the following regular expression: ^pfbc.*"
)));
$form->addElement(new Element_HTML(\'<legend>Elements</legend>\'));
$form->addElement(new Element_Phone("Phone:", "Phone"));
$form->addElement(new Element_Search("Search:", "Search"));
$form->addElement(new Element_Url("Url:", "Url"));
$form->addElement(new Element_Email("Email:", "Email"));
$form->addElement(new Element_DateTime("DateTime:", "DateTime"));
$form->addElement(new Element_Date("Date:", "Date"));
$form->addElement(new Element_Month("Month:", "Month"));
$form->addElement(new Element_Week("Week:", "Week"));
$form->addElement(new Element_Time("Time:", "Time"));
$form->addElement(new Element_DateTimeLocal("DateTime-Local:", "DateTimeLocal"));
$form->addElement(new Element_Number("Number:", "Number"));
$form->addElement(new Element_Range("Range:", "Range"));
$form->addElement(new Element_Color("Color:", "Color"));
$form->addElement(new Element_Button);
$form->addElement(new Element_Button("Cancel", "button", array(
    "onclick" => "history.go(-1);"
)));
$form->render();');
示例#9
0
 /**
  * main method for getting report results.  This method can be called as an
  * ajax callback and return the raw data in json format, or it can display
  * a table or graph directly.  All other methods that get report results use this
  * either directly or as an ajax call.
  */
 public function api()
 {
     $checksum_field_name = $this->data_model->get_field_name('checksum');
     $hostname_field = $this->data_model->get_field_name('hostname');
     $dimension_table = $this->report_obj->get_table_by_alias('dimension');
     // special case for optional pivot on hostname
     // mainly used to graph each host as a series
     if (get_var('dimension-pivot-' . $hostname_field) != null) {
         $hosts = $this->report_obj->get_distinct_values($dimension_table, $hostname_field);
         $this->report_obj->set_pivot_values('dimension-pivot-' . $hostname_field, $hosts);
     } else {
         if (get_var('dimension-pivot-' . $checksum_field_name) != null and get_var("dimension-pivot-{$checksum_field_name}-use-values") != null) {
             $values = explode('|', get_var("dimension-pivot-{$checksum_field_name}-use-values"));
             for ($i = 0; $i < count($values); $i++) {
                 $values[$i] = $this->translate_checksum($values[$i]);
             }
             $this->report_obj->set_pivot_values("dimension-pivot-{$checksum_field_name}", $values);
             //$_GET["dimension-pivot-{$checksum_field_name}"] = get_var('plot_field');
         }
     }
     // translate the checksum field from possible hex value
     $checksum = $this->translate_checksum(get_var("fact-{$checksum_field_name}"));
     if (isset($checksum)) {
         //            print "setting checksum [$checksum]";
         $_GET["fact-{$checksum_field_name}"] = $checksum;
     }
     // process the form data, and get the query result
     $data = array();
     $data['datasource'] = get_var('datasource');
     try {
         $data['sql'] = $this->report_obj->query();
         $data['result'] = $this->report_obj->execute();
     } catch (Exception $e) {
         $this->alert($e->getMessage(), 'alert-error');
         prettyprint($data['sql']);
     }
     $data['columns'] = $this->report_obj->get_column_names();
     $data['permalink'] = site_url() . '?action=report&datasource=' . $data['datasource'] . '&' . $this->report_obj->get_search_uri();
     $data['jsonlink'] = site_url() . '?action=api&output=json&datasource=' . $data['datasource'] . '&' . $this->report_obj->get_search_uri();
     // output data in the requested format
     // never display header and footer
     $output_types = array('json' => "report_json", 'json2' => "report_json2", 'print_r' => "report_printr", 'table' => "report_result");
     $output = get_var('output');
     if (!key_exists($output, $output_types)) {
         $output = 'table';
     }
     $source_type = $this->data_model->get_source_type();
     if (key_exists('callbacks', $this->conf['reports'][$source_type]) && key_exists($output, $this->conf['reports'][$source_type]['callbacks'])) {
         $data['callbacks'] = $this->conf['reports'][$source_type]['callbacks'][$output];
     }
     $this->load->view($output_types[$output], $data);
 }
define("TOP", 30);
require_once '/usr/local/apache/ProxyFramework/DatabaseImpl.php';
$db = new DatabaseImpl('/usr/local/apache/htdocs/proxy_framework/ports.db');
$db->loadEntries($ent);
usort($ent, create_function('$a,$b', 'return $a[1] < $b[1] ? 1 : -1;'));
$sum = 0;
foreach ($ent as $e) {
    $sum += (int) $e[1];
}
function prettyprint($a, $sum)
{
    printf("%7s %7s %8s\n", "Port", "Count", "Pct.");
    print "-----------------------------\n";
    $i = 0;
    $total_pct = 0;
    $total = 0;
    foreach ($a as $e) {
        $pct = (double) $e[1] / (double) $sum * 100;
        $total_pct += $pct;
        $total += $e[1];
        printf("%7s %7s %8.3f%%\n", $e[0], $e[1], $pct);
        if (++$i >= TOP) {
            break;
        }
    }
    print "-----------------------------\n";
    printf("%7s %7s %8.3f%%\n", "Total", $total, $total_pct);
}
prettyprint($ent, $sum);
 public function save()
 {
     // First, suscribe to mailchimp
     $this->suscribeToMailchimp();
     // Add user to the database
     $data = $this->getUser();
     $this->db->where("meetup_id", $this->meetup_id);
     $user = $this->db->getOne("users");
     //echo "User:"******"<hr>");
     if ($user) {
         $this->db->where("meetup_id", $this->meetup_id);
         if ($this->db->update('users', $data)) {
             //echo  $db->count . ' records were updated';
         } else {
             prettyprint($data);
             die('User (' . $this->id . ') update failed: ' . $this->db->getLastError());
         }
     } else {
         $result = $this->db->insert('users', $data);
         if (!$result) {
             prettyprint($data);
             die("The user ('.{$this->meetup_id}.') could not be added, please contact to the webmaster at root@geodevelopers.org: " . $this->db->getLastError());
         }
     }
     // Add profile to the database
     $data = $this->getProfile();
     //prettyprint($this);
     //cho "Profile:";
     //prettyprint($data);
     //die("<hr>");
     $this->db->where("meetup_id", $this->meetup_id);
     $profile = $this->db->getOne("profiles");
     if ($profile) {
         $this->db->where("meetup_id", $this->meetup_id);
         if ($this->db->update('profiles', $data)) {
             //echo $db->count . ' records were updated';
         } else {
             prettyprint($data);
             die('User profile (' . $this->id . ') update failed: ' . $this->db->getLastError());
         }
     } else {
         $result = $this->db->insert('profiles', $data);
         if (!$result) {
             prettyprint($data);
             die("User profile ('.{$this->meetup_id}.') could not be added, please contact to the webmaster at root@geodevelopers.org:" . $this->db->getLastError());
         }
     }
     $skills = $this->getSkills();
     //echo "Skills:";
     //prettyprint($skills);
     //die("<hr>");
     foreach ($skills as $key => $s) {
         if (!isset($s["id"])) {
             $s["id"] = $this->db->insert("skills", $s);
             if (!$s["id"]) {
                 prettyprint($s);
                 die("Skill " . $s["name"] . " for user ('.{$this->meetup_id}.') could not be added ");
             } else {
                 $this->skills[$s["id"]] = $s;
                 unset($this->skills["new_" . $s["meetup_skill_id"]]);
             }
         }
     }
     // Insert new user_skills
     $skills = $this->getUserSkills();
     /*echo "UserSkills:";
       prettyprint($skills);
       die("<hr>");*/
     foreach ($skills as $s) {
         $this->db->where("skill_id", $s["skill_id"])->where("meetup_id", $this->meetup_id);
         $elem = $this->db->getOne("user_skills");
         if (!$elem) {
             if ($id = $this->db->insert('user_skills', $s)) {
                 //echo $db->count . ' user_skills were added';
             } else {
                 prettyprint($s);
                 die('user_skills for user (' . $this->meetup_id . ') insetion failed: ' . $this->db->getLastError());
             }
         } else {
             //prettyprint($s);
             $this->db->where("skill_id", $s["skill_id"])->where("meetup_id", $this->meetup_id);
             if (!$this->db->update('user_skills', $s)) {
                 prettyprint($s);
                 die("User ('.{$this->meetup_id}.') skills could not be updated");
             }
         }
     }
     //$member = new Member(array("meetup_id" =>$this->meetup_id));
     $this->updateProgress();
     return true;
 }
示例#12
0
$store = mapi_openmsgstore($session, $storeentryid);
if (!$store) {
    print "Unable to open store\n";
    exit(1);
}
$root = mapi_msgstore_openentry($store);
if (!$root) {
    print "Unable to open root folder\n";
    exit(1);
}
$folders = mapi_folder_gethierarchytable($root, CONVENIENT_DEPTH);
$total = 0;
while (1) {
    $rows = mapi_table_queryrows($folders, array(PR_DISPLAY_NAME, PR_FOLDER_TYPE, PR_ENTRYID), 0, 100);
    if (count($rows) == 0) {
        break;
    }
    foreach ($rows as $row) {
        // Skip searchfolders
        if (isset($row[PR_FOLDER_TYPE]) && $row[PR_FOLDER_TYPE] == FOLDER_SEARCH) {
            continue;
        }
        print isset($row[PR_DISPLAY_NAME]) ? $row[PR_DISPLAY_NAME] : "<Unknown>";
        print ": ";
        $size = foldersize($store, $row[PR_ENTRYID]);
        print prettyprint($size) . "\n";
        $total += $size;
    }
}
print "Total: " . prettyprint($total) . "\n";
示例#13
0
	"placeholder" => "Search", 
	"append" => \'<button class="btn btn-primary">Go</button>\'
)));
$form->render();');
?>

	</div>
	<div id="php5-4" class="tab-pane">

<?php 
prettyprint('<?php
include("PFBC/Form.php");
$form = new Form("search");
$form->configure(array(
    "prevent" => array("bootstrap", "jQuery", "focus"),
    "view" => new View_Search
));
$form->addElement(new Element_Hidden("form", "search"));
$form->addElement(new Element_HTML(\'<legend>Search</legend>\'));
$form->addElement(new Element_Search("", "Search", array(
	"placeholder" => "Search", 
	"append" => \'<button class="btn btn-primary">Go</button>\'
)));
$form->render();');
?>

	</div>
</div>

<?php 
include "../footer.php";
示例#14
0
         */
        if (!(ctype_alnum($_GET['code']) && strlen($_GET['code']) == 32)) {
            echo template('master', ['content' => template('error', ['error' => "The code parameter provided doesn't look right.", 'details' => ''])]);
            exit;
        }
        $response = \Httpful\Request::post('https://api.instagram.com/oauth/access_token', 'client_id=' . $config['client_id'] . '&client_secret=' . $config['client_secret'] . '&grant_type=authorization_code' . '&redirect_uri=' . $config['redirect_uri'] . '&code=' . $_GET['code'])->send();
        if ($response->code == 200) {
            $_SESSION['token'] = $response->body->access_token;
        } else {
            echo template('master', ['content' => template('error', ['error' => 'An error occured while trying to get an access token.', 'details' => debugging($response)])]);
            exit;
        }
    }
}
$token = $_SESSION['token'];
$numberOfPosts = get('tags/capitalone')->data->media_count;
$posts = get('tags/capitalone/media/recent?count=20')->data;
$positive = $negative = $neutral = 0;
foreach ($posts as $post) {
    $user = get('users/' . $post->user->id)->data->counts;
    $positivity = positivity($post->caption->text);
    if ($positivity === 0) {
        $neutral++;
    } elseif ($positivity > 0) {
        $positive++;
    } elseif ($positivity < 0) {
        $negative++;
    }
    $postTable .= template('post', ['url' => $post->link, 'likes' => $post->likes->count, 'user_name' => prettyprint($post->user->full_name, $post->user->username), 'user_url' => 'https://instagram.com/' . $post->user->username, 'user_posts' => $user->media, 'user_followed_by' => $user->followed_by, 'user_follows' => $user->follows, 'caption' => linkify(truncate($post->caption->text)), 'positivity' => $positivity, 'major' => $user->followed_by / $user->follows > 2 ? 'major' : '']);
}
echo template('master', ['content' => template('main', ['num' => number_format($numberOfPosts), 'positive' => $positive, 'negative' => $negative, 'neutral' => $neutral, 'posts' => $postTable])]);
示例#15
0
        ?>
</h2>
  <?php 
        prettyprint($table->getColumns());
        ?>
  <button type='button' class='btn-link expandable collapsed' data-toggle='collapse' data-target='#expandable_<?php 
        echo $table->getName();
        ?>
'>
  Tietokantataulussa on yhteensä <?php 
        echo $table->getRowCount();
        ?>
 riviä:
  </button>
  <div id='expandable_<?php 
        echo $table->getName();
        ?>
' class='collapse'>
  <?php 
        prettyprint($table->getRows());
        ?>
  </div>
<?php 
    }
    ?>
</div>
</body>
</html><?php 
} catch (Exception $e) {
    echo '<pre>', $e->getMessage();
}
示例#16
0
	</div>
    <div id="php5" class="tab-pane">

<?php 
prettyprint('<?php
session_start();

include("PFBC/Form.php");
$form = new Form("login");
$form->addElement(new Element_HTML(\'<legend>Login</legend>\'));
$form->addElement(new Element_Hidden("form", "login"));
$form->addElement(new Element_Email("Email Address:", "Email", array(
	"required" => 1
)));
$form->addElement(new Element_Password("Password:"******"Password", array(
	"required" => 1
)));
$form->addElement(new Element_Checkbox("", "Remember", array(
	"1" => "Remember me"
)));
$form->addElement(new Element_Button("Login"));
$form->addElement(new Element_Button("Cancel", "button", array(
    "onclick" => "history.go(-1);"
)));
$form->render();');
?>

	</div>
</div>
        }
        $userprofile = $user->getUserProfile();
        $_SESSION['user'] = $userprofile;
    } else {
        $userprofile = $GeodevDB->getUser(array("type" => "userprofile"));
    }
    $smarty->assign('PROFILE', $userprofile);
    $smarty->assign('OTHERSKILLS', $GeodevDB->getSkills(array("type" => "other")));
    $smarty->assign('GEOSKILLS', $GeodevDB->getSkills(array("type" => "geo")));
    $smarty->assign('SKILLSGIS', $GeodevDB->getUserSkills(array("type" => "gis")));
    $smarty->assign('SKILLS', $GeodevDB->getUserSkills(array("type" => "other")));
    $smarty->assign('REFERRERS', $GeodevDB->getReferrers());
    $smarty->assign('ACTION', 'edit');
    $smarty->display('profile.tpl');
} else {
    prettyprint($_SESSION);
    echo "Estás intentando editar el perfil de otro usuario, si crees que esto es un error por favor contacta con root@geodevelopers.org";
    echo $_SESSION["user"]["meetup_id"] . "," . $_GET["meetup_id"];
}
function uploadFile($name)
{
    global $ROOT;
    $target_dir = "../images/photos/";
    $tmp_name = $target_dir . basename($_FILES["photo"]["name"]);
    $imageFileType = pathinfo($tmp_name, PATHINFO_EXTENSION);
    $target_file = $target_dir . basename($_SESSION["user"]["meetup_id"] . "." . $imageFileType);
    // Check if image file is a actual image or fake image
    if (isset($_POST["submit"])) {
        $check = getimagesize($_FILES["photo"]["tmp_name"]);
        if ($check === false) {
            return array("status" => "error", "response" => "File is not an image.");