Esempio n. 1
0
function set_venue_data_from_POST()
{
    F3::set('name', F3::scrub($_POST['name']));
    F3::set('address', F3::scrub($_POST['address']));
    F3::set('postcode', F3::scrub($_POST['postcode']));
    F3::set('info', F3::scrub($_POST['info']));
}
Esempio n. 2
0
File: user.php Progetto: pshreez/PHP
 function login()
 {
     $user = new Axon('tbl_user');
     $id = F3::get('POST.id');
     if ($user->found(array("id=:id", array(":id" => $id))) == 0) {
         // Register user
         $user->id = $id;
         $user->username = F3::get('POST.username');
         $user->email = F3::get('POST.email');
         $user->fullname = F3::get('POST.fullname');
         $user->image = F3::get('POST.image');
         $user->save();
     } else {
         $user->load(array("id=:id", array(":id" => $id)));
         if ($user->active == 'n') {
             die(json_encode(array("message" => "hello world", "type" => "error")));
         } else {
             $user->username = F3::get('POST.username');
             $user->email = F3::get('POST.email');
             $user->fullname = F3::get('POST.fullname');
             $user->image = F3::get('POST.image');
             $user->save();
         }
         F3::set('SESSION.user', $user);
         F3::set('SESSION.sid', Snippets::_getRN());
     }
 }
Esempio n. 3
0
function yukle($hedef = NULL, $alan = 'file')
{
    $yuklenen = F3::get("FILES.{$alan}.tmp_name");
    // hedef ve yüklenen dosyanın boş olmasına izin veriyoruz
    // herhangi biri boşsa mesele yok, çağırana dön
    if (empty($hedef) || empty($yuklenen)) {
        return true;
    }
    // bu bir uploaded dosya olmalı, fake dosyalara izin yok
    if (is_uploaded_file($yuklenen)) {
        // boyutu sınırla, değeri öylesine seçtim
        if (filesize($yuklenen) > 600000) {
            F3::set('error', 'Resim çok büyük');
        } else {
            if (exif_imagetype($yuklenen) != IMAGETYPE_JPEG) {
                F3::set('error', 'Resim JPEG değil');
            } else {
                if (file_exists($hedef)) {
                    F3::set('error', 'Resim zaten kaydedilmiş');
                } else {
                    if (!move_uploaded_file($yuklenen, $hedef)) {
                        F3::set('error', 'Dosya yükleme hatası');
                    }
                }
            }
        }
        // yok başka bir ihtimal!
    } else {
        // bu aslında bir atak işareti
        F3::set('error', 'Dosya geçerli bir yükleme değil');
    }
    return false;
}
Esempio n. 4
0
 public function list_saved_form()
 {
     F3::set('data', 'daved data on the  row');
     $user = F3::get("SESSION.onlineUser");
     $datas = DB::sql("select v.id,v.form_type,v.date,u.username from vehicle v, user_form u where u.vehicle_id=v.id and v.status ='saved' and u.username='******'");
     F3::set('data', $datas);
 }
Esempio n. 5
0
 public function get()
 {
     if ($this->flag['search']) {
         if (isset($_GET['q']) && $_GET['q'] != '') {
             // Fetch Search Query
             $query = F3::scrub($_GET['q']);
             $search = new SearchModel();
             // Fetch Search Results
             if ($this->results = $search->items($query)) {
                 // Reroute if one match
                 if (count($this->results) == 1 && $this->redirect) {
                     F3::reroute('/loot/' . $this->results[0]['urlname']);
                 }
                 $this->title = "Search: \"" . $query . "\" - Diablo 2 Database";
                 $this->heading = "Search: \"" . $query . "\"";
                 F3::set('NOTIFY.success', "Rejoice! " . count($this->results) . " matches found!");
                 $this->render('search.php');
             } else {
                 $this->heading = "Search: \"" . $query . "\"";
                 F3::set('NOTIFY.warning', "Nothing found in the database. Try the <a href=/loot/>Loot Directory</a>.");
                 $this->render('blank.php');
             }
         } else {
             F3::reroute('/');
         }
     } else {
         F3::set('NOTIFY.warning', "Search is temporarily disabled. Please try again later.");
         $this->render('blank.php');
     }
 }
Esempio n. 6
0
function myldap_bind()
{
    $r = ldap_bind(F3::get('LDAP.conn'), F3::get('LDAP.admin'), F3::get('LDAP.passw'));
    if (!$r) {
        trigger_error("LDAP bind failed...", E_WARNING);
    }
    F3::set('LDAP.bind', $r);
    return $r;
}
Esempio n. 7
0
function main()
{
    F3::set('name', 'world');
    F3::set('buddy', array('Tom', 'Dick', 'Harry'));
    F3::set('gender', 'M');
    F3::set('loggedin', 'true');
    F3::set('div', array('coffee' => array('arabica', 'barako', 'liberica', 'kopiluwak'), 'tea' => array('darjeeling', 'pekoe', 'samovar')));
    F3::set('rows', array(1, 2, 3, 4, 5));
    echo F3::serve('5template.htm');
}
Esempio n. 8
0
 public function relations()
 {
     // Select magic + class + division
     $division = "\n                SELECT class, division\n                FROM relate_loot_normal\n            ";
     foreach (F3::sql($division) as $row) {
         F3::set('class', F3::get('DB.pdo')->quote($row['class']));
         F3::set('division', F3::get('DB.pdo')->quote($row['division']));
         $query = "\n                    UPDATE loot\n                    SET division = {@division}\n                    WHERE class = {@class}\n                ";
         F3::sql($query);
     }
 }
Esempio n. 9
0
 /**
 		Generate CAPTCHA image
 			@param $dimx integer
 			@param $dimy integer
 			@param $len integer
 			@param $ttfs string
 			@param $var string
 			@param $die boolean
 			@public
 	**/
 static function captcha($dimx = 150, $dimy = 50, $len = 5, $ttfs = 'cube', $var = 'captcha', $die = TRUE)
 {
     $base = self::rgb(self::$vars['BGCOLOR']);
     $trans = self::$vars['FGTRANS'];
     // Specify Captcha seed
     $seed = substr(md5(uniqid()), 0, $len);
     F3::set('SESSION.' . $var, $seed);
     // Font size
     $size = 0.9 * min($dimx / $len, $dimy);
     // Load TrueType fonts
     $fonts = self::split($ttfs);
     $file = self::$vars['FONTS'] . self::fixslashes($fonts[array_rand($fonts)]) . '.ttf';
     $stats =& self::ref('STATS');
     if (!isset($stats['FILES'])) {
         $stats['FILES'] = array('fonts' => array());
     }
     $stats['FILES']['fonts'][basename($file)] = filesize($file);
     $maxdeg = 12;
     // Create blank image
     $captcha = imagecreatetruecolor($dimx, $dimy);
     list($r, $g, $b) = $base;
     $bg = imagecolorallocate($captcha, $r, $g, $b);
     imagefill($captcha, 0, 0, $bg);
     $width = 0;
     // Insert each Captcha character
     for ($i = 0; $i < $len; $i++) {
         // Random angle
         $angle = $maxdeg - mt_rand(0, $maxdeg * 2);
         // Get CAPTCHA character from session cookie
         $char = $seed[$i];
         $fg = imagecolorallocatealpha($captcha, mt_rand(0, 255 - $trans), mt_rand(0, 255 - $trans), mt_rand(0, 255 - $trans), $trans);
         // Compute bounding box metrics
         $bbox = imagettfbbox($size, 0, $file, $char);
         $w = max($bbox[2], $bbox[4]) - max($bbox[0], $bbox[6]);
         $h = max($bbox[1], $bbox[3]) - max($bbox[5], $bbox[7]);
         $sin = sin(deg2rad($angle));
         imagettftext($captcha, $size, $angle, 0.9 * $width + abs($h * $sin), $dimy - $h / 2 + abs($w * $sin), $fg, $file, $char);
         $width += $w + abs($h * $sin);
         imagecolordeallocate($captcha, $fg);
     }
     // Make the background transparent
     imagecolortransparent($captcha, $bg);
     // Send output as PNG image
     if (PHP_SAPI != 'cli' && !headers_sent()) {
         header(self::HTTP_Content . ': image/png');
         header(self::HTTP_Powered . ': ' . self::TEXT_AppName . ' ' . '(' . self::TEXT_AppURL . ')');
     }
     imagepng($captcha, NULL, self::PNG_Compress, PNG_NO_FILTER);
     if ($die) {
         die;
     }
 }
Esempio n. 10
0
function captcha()
{
    // Validate CAPTCHA verification code; if any
    F3::input('captcha', function ($value) {
        if (!F3::exists('message') && F3::exists('SESSION.captcha')) {
            $captcha = F3::get('SESSION.captcha');
            if (empty($value)) {
                F3::set('message', 'Verification code required');
            } elseif (strlen($value) > strlen($captcha)) {
                F3::set('message', 'Verification code is too long');
            } elseif (strtolower($value) != $captcha) {
                F3::set('message', 'Invalid verification code');
            }
        }
    });
}
Esempio n. 11
0
function soyad()
{
    // Validate blog soyad
    F3::input('soyad', function ($value) {
        if (!F3::exists('message')) {
            if (empty($value)) {
                F3::set('message', 'Soyad should not be blank');
            } elseif (strlen($value) > 127) {
                F3::set('message', 'Soyad is too long');
            } elseif (strlen($value) < 3) {
                F3::set('message', 'Soyad is too short');
            }
        }
        // Do post-processing of soyad here
        F3::set('REQUEST.soyad', ucfirst($value));
    });
}
Esempio n. 12
0
 public function get()
 {
     $loot = new LootModel();
     // Check for JSON
     if (isset($_GET['format'])) {
         if ($_GET['format'] == "json") {
             $this->json = true;
         }
     }
     // URL Item Token
     $urlname = F3::get('PARAMS.item');
     // Fetch Item
     $this->item = $this->json ? $loot->item($urlname) : json_decode($loot->item($urlname));
     // Fetch Similar
     if (!empty($this->item->similar)) {
         foreach ($this->item->similar as $similar) {
             $this->similar[] = json_decode($loot->item($similar->urlname, array("verbose" => false)));
         }
     }
     // Fetch Variants
     if (!empty($this->item->variants)) {
         foreach ($this->item->variants as $variant) {
             $this->variants[] = json_decode($loot->item($variant->urlname, array("verbose" => false)));
         }
     }
     // Fetch Siblings
     if (!empty($this->item->siblings)) {
         foreach ($this->item->siblings as $sibling) {
             $this->siblings[] = json_decode($loot->item($sibling->urlname, array("verbose" => false)));
         }
     }
     $this->navigation['/loot/']['selected'] = true;
     if ($this->item) {
         if ($this->json) {
             $this->title = $this->item['name'] . " - Diablo 2 Database";
             $this->render('lootjson.php', false);
         } else {
             $this->title = $this->item->name . " - Diablo 2 Database";
             $this->render('loot.php');
         }
     } else {
         F3::set('NOTIFY.error', "Mysterious... this item doesn't seem to be in our database.");
         $this->render('blank.php');
     }
 }
Esempio n. 13
0
 function recentActivity()
 {
     $poll = new Axon('tbl_poll');
     $polls = array();
     $poll->def('fullname', 'SELECT fullname FROM tbl_user WHERE tbl_poll.user_id=tbl_user.id');
     $poll->def('image', 'SELECT image FROM tbl_user WHERE tbl_poll.user_id=tbl_user.id');
     $poll->def('hits', 'SELECT COUNT(date) FROM tbl_vote WHERE tbl_poll.id=tbl_vote.poll_id');
     $poll->def('date', 'SELECT date FROM tbl_vote WHERE tbl_poll.id=tbl_vote.poll_id ORDER BY date DESC LIMIT 1');
     $q = $poll->find('published_date IS NOT NULL AND is_archive="n" AND expiry_date>now() AND private="n"', 'date DESC');
     foreach ($q as $pl) {
         $polls[$pl->id] = array(strtoupper($pl->keyword), $pl->question, '<img src="' . $pl->image . '" width="20px" height="20px" /> ' . $pl->fullname);
     }
     $this->set('pollList', $polls);
     $this->set('title', 'Recent Activity');
     F3::set('heading', 'Recent Activity');
     F3::set('template', 'polls');
     echo Template::serve("template/layout.htm");
 }
Esempio n. 14
0
 /**
 		Auto-detect default locale; Override parent class
 			@return boolean
 			@param $_lang string
 			@public
 	**/
 public static function setDefault($_lang = NULL)
 {
     if (!$_lang) {
         $_header = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
         if (F3::exists('LANGUAGE')) {
             // Framework variable defined
             $_lang = F3::get('LANGUAGE');
         } elseif (isset($_header)) {
             // Found in HTTP header
             $_lang = self::acceptFromHttp($_header);
         } else {
             // Use default_locale
             $_lang = self::getDefault();
         }
     }
     // Set default language
     $_ok = parent::setDefault($_lang);
     if ($_ok) {
         F3::set('LANGUAGE', $_lang);
         self::$dict = array();
     }
     return $_ok;
 }
Esempio n. 15
0
 function allPoll()
 {
     if (!F3::get('SESSION.asid')) {
         F3:
         reroute('/admin');
     }
     $poll = new Axon("tbl_poll");
     $poll->def('fullname', 'SELECT fullname FROM tbl_user WHERE tbl_poll.user_id=tbl_user.id');
     $poll->def('image', 'SELECT image FROM tbl_user WHERE tbl_poll.user_id=tbl_user.id');
     $poll->def('hits', 'SELECT COUNT(date) FROM tbl_vote WHERE tbl_poll.id=tbl_vote.poll_id');
     $q = $poll->find();
     $users = array();
     foreach ($q as $qu) {
         $polls[$qu->id] = array(strtoupper($qu->keyword), $qu->question, '<img src="' . $qu->image . '" width="20px" height="20px" />' . $qu->fullname, date_create("now") >= date_create($qu->expiry_date) ? "Yes" : "No", $qu->published_date ? "Yes" : "No", $qu->published_date && date_create("now") < date_create($qu->expiry_date) && $qu->is_archive == "n" ? "Yes" : "No", $qu->private == 'y' ? "Private" : "Public", $qu->hits);
         if (!in_array($qu->fullname, $users)) {
             $users[] = $qu->fullname;
         }
     }
     F3::set('pollList', $polls);
     F3::set('users', $users);
     F3::set('template', 'poll');
     echo Template::Serve('template/admin/layout.htm');
 }
Esempio n. 16
0
 public static function _showError($message = "")
 {
     if (Snippets::_isAjax()) {
         if (Snippets::_isPost()) {
             $ret = array('error' => true);
             if ($message == "") {
                 $message = F3::get('ERROR.text');
             }
             $ret['message'] = $message;
             echo json_encode($ret);
         } else {
             $ret = 'error';
             if ($message == "") {
                 $message = F3::get('ERROR.text');
             }
             $ret .= " [{$message}]";
             echo $ret;
         }
     } else {
         F3::set('title', 'Page Not Found');
         F3::set('template', 'error');
         echo Template::serve("template/layout.htm");
     }
 }
Esempio n. 17
0
    $ne = "Tc No";
    if ($hata = denetle($value, array('dolu' => array(true, "{$ne} boş bırakılamaz"), 'esit' => array(11, "{$ne} 11 haneli olmalıdır"), 'tamsayi' => array(true, "{$ne} sadece rakam içermeli"), 'ozel' => array(function ($value) {
        return !is_tc($value);
    }, "Geçerli bir {$ne} değil")))) {
        F3::set('error', $hata);
        return;
    }
});
F3::input($alan = 'kizliksoyad', function ($value) use($alan) {
    $ne = "Kızlık Soyadı";
    if ($hata = denetle($value, array('dolu' => array(true, "{$ne} boş bırakılamaz")))) {
        F3::set('error', $hata);
        return;
    }
});
if (!F3::exists('error')) {
    $tc = F3::get('REQUEST.tc');
    $kizliksoyad = F3::get('REQUEST.kizliksoyad');
    $kul = new Axon('kul');
    $kul->load("tc={$tc}");
    if (!$kul->dry() && streq_turkish($kul->kizliksoyad, $kizliksoyad)) {
        // tc no'yu oturuma gömelim ve oradan alalım
        F3::set('SESSION.sorgutc', $tc);
        F3::set('SESSION.sorgukizliksoyad', $kizliksoyad);
        return F3::call(':sorguok');
    }
    F3::set('error', "Girdiğiniz bilgilere uygun bir kayıt bulunamadı.  Lütfen verdiğiniz bilgileri kontrol edin.");
}
// hata var, dön başa ve tekrar sorgu al.
// error alanı dolu ve layout.htm'de görüntülenecek
F3::call(':sorgual');
Esempio n. 18
0
        $basePath = 'https://api.groupdocs.com/v2.0';
    }
    $basePath = strip_tags(trim($basePath));
    //Set base path
    $storageApi->setBasePath($basePath);
    //###Make a request to Storage API using clientId and file id
    try {
        //Check entere path for propper slashes
        if (strpos($folder, '\\') == true) {
            $folder = str_replace('\\', '/', $folder);
        }
        //Create folder
        $createFodler = $storageApi->Create($clientId, $folder);
        //Check status of creating folder action
        if ($createFodler->status == "Ok") {
            //Generate message with successful result
            $message = '<span style="color:green">Folder was created ' . $createFodler->result->path . '</span>';
            F3::set('message', $message);
        } else {
            throw new Exception($docInfo->error_message);
        }
    } catch (Exception $e) {
        $error = 'ERROR: ' . $e->getMessage() . "\n";
        F3::set('error', $error);
    }
}
//Process template
F3::set('userId', $clientId);
F3::set('privateKey', $privateKey);
F3::set('folder', $folder);
echo Template::serve('sample34.htm');
Esempio n. 19
0
<?php

/**
Load the base file
**/
$main = (require_once __DIR__ . '/lib/base.php');
//Path to the app files
$main->set('AUTOLOAD', 'app/');
//Turn on the cache
F3::set('CACHE', TRUE);
/**
	DEBUG LEVEL
	0 = no errors shown
	3 = all errors shown
**/
$main->set('DEBUG', 3);
// Path to our templates
$main->set('GUI', 'gui/');
// Define application globals
$main->set('site', 'Pollenizer Flickr Application Test');
/**
	Define our routes (HTTP method and URI) and route handlers.
**/
// Our home page (No cache)
$main->route('GET /', 'Flickr->show');
//Run the test
$suite = new PHPUnit_TestSuite("Flickr_unittest");
$result = PHPUnit::run($suite);
echo $result->toString();
Esempio n. 20
0
<?php

// Retrieve blog entries
$kul = new Axon('kul');
F3::set('entries', $kul->find());
// Use the home.htm template
F3::set('pagetitle', 'ana sayfa');
F3::set('template', 'home');
F3::call('render');
Esempio n. 21
0
    }
    //If request was successfull - set url variable for template
    F3::set('sourceFileId', $sourceFileId);
    F3::set('targetFileId', $targetFileId);
    F3::set('iframe', $iframe);
}
//### Delete downloads folder and all files in this folder
function delFolder($path)
{
    $next = null;
    $item = array();
    //Get all items fron folder
    $item = scandir($path);
    //Remove from array "." and ".."
    $item = array_slice($item, 2);
    //Check is there was files
    if (count($item) > 0) {
        //Delete files from folder
        for ($i = 0; $i < count($item); $i++) {
            $next = $path . "/" . $item[$i];
            if (file_exists($next)) {
                unlink($next);
            }
        }
    }
    //Delete folder
    rmdir($path);
}
//Process template
F3::set('callbackURL', $callbackUrl);
echo Template::serve('sample19.htm');
Esempio n. 22
0
                        //iframe to dev server
                    } elseif ($basePath == "https://dev-api.groupdocs.com/v2.0") {
                        $iframe = 'http://dev-apps.groupdocs.com/document-viewer/embed/' . $guid;
                        //iframe to test server
                    } elseif ($basePath == "https://stage-api-groupdocs.dynabic.com/v2.0") {
                        $iframe = 'https://stage-apps-groupdocs.dynabic.com/document-viewer/Embed/' . $guid;
                        //Iframe to realtime server
                    } elseif ($basePath == "http://realtime-api.groupdocs.com") {
                        $iframe = 'http://realtime-apps.groupdocs.com/document-viewer/embed/' . $guid;
                    }
                    $iframe = $signature->signUrl($iframe);
                    F3::set('iframe', $iframe);
                } else {
                    throw new Exception($getDocumentStatus->error_message);
                }
            } catch (Exception $e) {
                $error = 'ERROR: ' . $e->getMessage() . "\n";
                F3::set('error', $error);
            }
        } else {
            throw new Exception($response->error_message);
        }
    } catch (Exception $e) {
        $error = 'ERROR: ' . $e->getMessage() . "\n";
        F3::set('error', $error);
    }
}
//Process template
F3::set('userId', $clientId);
F3::set('privateKey', $privateKey);
echo Template::serve('sample06.htm');
Esempio n. 23
0
F3::call(':ldap_login');
$cn = "*";
$data = myldap_search("cn={$cn}");
unset($data["count"]);
F3::set('entries', $data);
/*
print_r(F3::get('entries'));

Array ( 
	[0] => Array ( [cn] => creators [sn] => m [telephonenumber] => 12356 [postalcode] => 55050 [userpassword] => {MD5}ofDWJ4N+OTCFftj5hhitMA== ) 
	
	[1] => Array ( [cn] => moodle [sn] => User [telephonenumber] =>
[postalcode] => [userpassword] => {MD5}laBi5pYA91KuyVLgyoCiIA== ) 

	[2] => Array ( [cn] => test [sn] => test [telephonenumber] =>[postalcode] => [userpassword] => {MD5}ofDWJ4N+OTCFftj5hhitMA== ) 

	[3] => Array ( [cn] => ldap [sn] => test [telephonenumber] => [postalcode] => [userpassword]=> {MD5}ofDWJ4N+OTCFftj5hhitMA== ) 

	[4] => Array ( [cn] => harun [sn] => dama [telephonenumber] => 12345 [postalcode] => 21112 [userpassword] => ) 

	[5] => Array ( [cn] => mahruki [sn] => dama [telephonenumber] => 12345 [postalcode] =>21112 [userpassword] => {MD5}Xr4ilOzQ4PCOq3aQ0qbuaQ== ) 

	[6] => Array ( [cn] => murat [sn] => ggg [telephonenumber] => 1235 [postalcode] => 33321 [userpassword] => {SSHA}pb1w8iNvfR0aT7uhXvGn25cH0lIPbzwQ ) 

	[7] => Array ( [cn]=> mustafa [sn] => kuru [telephonenumber] => 1235 [postalcode] => 33321 [userpassword] => {SSHA}/6FnViYzjvUoP52AOhHoM9fV7x4OPsO2 ) )
*/
// Use the home.htm template
F3::set('pagetitle', 'sorgu sonuçları');
F3::set('template', 'sorgu');
F3::call('render');
Esempio n. 24
0
                }
            }
            # Delete file from Api Storage
            try {
                if ($fileGuid == "") {
                    $message = '<span style="color: red">This file is no longer available</span>';
                } else {
                    $delFile = $storageApi->Delete($clientId, $fileGuid);
                    // Check the result of the request
                    if ($delFile->status == "Ok") {
                        // If status "ok" - show Mesege
                        $message = '<span style="color: green">Done, file deleted from your GroupDocs Storage</span>';
                    } else {
                        $message = '<span style="color: red">' . $delFile->error_message . '</span>';
                    }
                }
            } catch (Exception $e) {
                $error = 'ERROR: ' . $e->getMessage() . "\n";
                F3::set('error', $error);
            }
        } else {
            $message = '<span style="color: red">' . $allFiles->error_message . '</span>';
        }
    } catch (Exception $e) {
        $error = 'ERROR: ' . $e->getMessage() . "\n";
        F3::set('error', $error);
    }
    F3::set('message', $message);
}
// Process template
echo Template::serve('sample30.htm');
Esempio n. 25
0
 /**
 		Rotate a two-dimensional framework array variable; Replace contents
 		of framework variable if flag is TRUE (default), otherwise, return
 		transposed result
 			@return array
 			@param $_name string
 			@param $_flag boolean
 			@public
 	**/
 public static function transpose($_name, $_flag = TRUE)
 {
     $_rows = F3::get($_name);
     if (!is_array($_rows)) {
         F3::$global['CONTEXT'] = $_name;
         trigger_error(self::TEXT_NotArray);
         return FALSE;
     }
     foreach ($_rows as $_keyx => $_cols) {
         foreach ($_cols as $_keyy => $_valy) {
             $_result[$_keyy][$_keyx] = $_valy;
         }
     }
     if (!$_flag) {
         return $_result;
     }
     F3::set($_name, $_result);
 }
Esempio n. 26
0
File: user.php Progetto: pshreez/PHP
 function transfer()
 {
     if (!F3::get('SESSION.onlineUser')) {
         F3::reroute("/");
     }
     $dateNep = new Form_elements();
     //transfer information of the vehicle
     $id = date('siGjnty') . rand(1, 100);
     $ip_address = $_SERVER['REMOTE_ADDR'];
     $wheeler = F3::get("POST.wheeler");
     $zone_id = F3::get("POST.zone_id");
     $lot_number = F3::get("POST.lot_number");
     $vehicle_symbol_type = $wheeler == 21 ? F3::get("POST.vehicle_symbol_type_two") : F3::get("POST.vehicle_symbol_type_four");
     $number = F3::get("POST.number");
     $vehicleid = $this->vehicleid($wheeler, $zone_id, $lot_number, $vehicle_symbol_type, $number);
     $reason = F3::get("POST.reason");
     $dates = F3::get("POST.date");
     $date = $dateNep->dateConvertEn($dates);
     $remarks = F3::get("POST.remarks");
     $witness_name = F3::get("POST.witness_name");
     $witness_address = F3::get("POST.witness_address");
     $citizenship_no = F3::get("POST.citizenship_no");
     //owner information
     $owner_type = F3::get("POST.owner_type");
     $first_name = F3::get("POST.first_name");
     $last_name = F3::get("POST.last_name");
     $father_name = F3::get("POST.father_name");
     $grandfather_name = F3::get("POST.grandfather_name");
     $dob = F3::get("POST.dob");
     $reg_num = F3::get("POST.reg_num");
     $email = F3::get("POST.email");
     $mobile = F3::get("POST.mobileno");
     $p_zone_id = F3::get("POST.p_zone_id");
     $p_district_id = F3::get("POST.p_district_id");
     $p_metropolitan = F3::get("POST.p_metropolitan");
     $p_ward_no = F3::get("POST.p_ward_no");
     $p_address = F3::get("POST.p_address");
     $p_house_no = F3::get("POST.p_house_no");
     $p_phone = F3::get("POST.p_phone");
     $temp_zone_id = F3::get("POST.temp_zone_id");
     $temp_district_id = F3::get("POST.temp_district_id");
     $temp_metropolitan = F3::get("POST.temp_metropolitan");
     $temp_ward_no = F3::get("POST.temp_ward_no");
     $temp_address = F3::get("POST.temp_address");
     $temp_house_no = F3::get("POST.temp_house_no");
     $temp_phone = F3::get("POST.temp_phone");
     $nabalik_guardian_name = F3::get("POST.nabalik_guardian_name");
     $nabalik_relation = F3::get("POST.nabalik_relation");
     $nabalik_identity_no = F3::get("POST.nabalik_identity_no");
     $nabalik_district = F3::get("POST.nabalik_district");
     $nabalik_year = F3::get("POST.nabalik_year");
     $nabalik_address = F3::get("POST.nabalik_address");
     $bank_name = F3::get("POST.bank_name");
     $creditor_name = F3::get("POST.creditor_name");
     $creditor_district = F3::get("POST.creditor_district");
     $creditor_year = F3::get("POST.creditor_year");
     $creditor_address = F3::get("POST.creditor_address");
     $per_nagarikta = F3::get("POST.per_nagarikta");
     $per_identificationno = F3::get("POST.per_identificationno");
     $per_district = F3::get("POST.per_district");
     $per_year = F3::get("POST.per_year");
     $indian_identificationno = F3::get("POST.indian_identificationno");
     $other_identificationno = F3::get("POST.other_identificationno");
     $captcha = F3::get("POST.code");
     if ($captcha == F3::get("SESSION.captcha")) {
         $this->pictureFolder($id);
         $sqls[] = "INSERT INTO vehicle (id,wheeler,vehicleid,zone_id,lot_number,vehicle_symbol_type,number,ip_address,form_type) VALUES('{$id}','{$wheeler}','{$vehicleid}','{$zone_id}',' {$lot_number}','{$vehicle_symbol_type} ','{$number}','{$ip_address}','namsari')";
         $sqls[] = "INSERT INTO owner (vehicleid,owner_type,first_name,last_name, father_name,grandfather_name,\n        dob,reg_num,email,mobileno,p_zone_id,p_district_id, p_metropolitan,p_ward_no,\n        p_address, p_house_no, p_phone, temp_zone_id,temp_district_id, temp_metropolitan,\n        temp_ward_no, temp_address,temp_house_no, temp_phone, nabalik_guardian_name,nabalik_relation,\n        nabalik_identity_no, nabalik_district, nabalik_year, nabalik_address, bank_name, creditor_name,\n        creditor_district, creditor_year, creditor_address,per_nagarikta,per_identificationno,per_district,per_year,indian_identificationno,other_identificationno)\n        VALUES( '{$id}','{$owner_type}','{$first_name}','{$last_name}','{$father_name}','{$grandfather_name}',\n       '{$dob}','{$reg_num}','{$email}','{$mobile}','{$p_zone_id}','{$p_district_id}','{$p_metropolitan}','{$p_ward_no}','{$p_address}',\n        '{$p_house_no}', '{$p_phone}','{$temp_zone_id}','{$temp_district_id}','{$temp_metropolitan}','{$temp_ward_no}',\n        '{$temp_address}',' {$temp_house_no}',' {$temp_phone}', '{$nabalik_guardian_name}',' {$nabalik_relation}',\n        '{$nabalik_identity_no}','{$nabalik_district}','{$nabalik_year}','{$nabalik_address}','{$bank_name}',\n        '{$creditor_name}','{$creditor_district}','{$creditor_year}','{$creditor_address}','{$per_nagarikta}',\n        '{$per_identificationno}','{$per_district}','{$per_year}','{$indian_identificationno}' ,'{$other_identificationno}')";
         $sqls[] = "INSERT INTO namsari (vehicle_id,reason,date,remarks,witness_name,witness_address,citizenship_no) VALUES('{$id}','{$reason}','{$date}','{$remarks}','{$witness_name}','{$witness_address}','{$citizenship_no}')";
         DB::sql($sqls);
         F3::reroute("/feedbackt/{$id}");
     } else {
         F3::set('error', 'The captcha you have entered is wrong');
         $this->transfer_ownership();
     }
 }
Esempio n. 27
0
        if ($createAnnotation->status == "Ok") {
            if ($createAnnotation->result) {
                //Generation of iframe URL using fileGuId
                if ($basePath == "https://api.groupdocs.com/v2.0") {
                    $iframe = 'http://apps.groupdocs.com/document-annotation2/embed/' . $createAnnotation->result->documentGuid . '?frameborder="0" width="720" height="600"';
                    //iframe to dev server
                } elseif ($basePath == "https://dev-api.groupdocs.com/v2.0") {
                    $iframe = 'http://dev-apps.groupdocs.com/document-annotation2/embed/' . $createAnnotation->result->documentGuid . '?frameborder="0" width="720" height="600"';
                    //iframe to test server
                } elseif ($basePath == "https://stage-api-groupdocs.dynabic.com/v2.0") {
                    $iframe = 'https://stage-apps-groupdocs.dynabic.com/document-annotation2/Embed/' . $createAnnotation->result->documentGuid . '?frameborder="0" width="720" height="600"';
                    //Iframe to realtime server
                } elseif ($basePath == "http://realtime-api.groupdocs.com") {
                    $iframe = 'http://realtime-apps.groupdocs.com/document-annotation2/embed/' . $createAnnotation->result->documentGuid . '?frameborder="0" width="720" height="600"';
                }
                $iframe = $signer->signUrl($iframe);
                F3::set('annotationId', $createAnnotation->result->annotationGuid);
                F3::set('annotationType', $annotationType);
                F3::set('annotationText', $replyText);
                F3::set('url', $iframe);
            }
        } else {
            throw new Exception($createAnnotation->error_message);
        }
    } catch (Exception $e) {
        $error = 'ERROR: ' . $e->getMessage() . "\n";
        F3::set('error', $error);
    }
}
// Process template
echo Template::serve('sample11.htm');
Esempio n. 28
0
                        if (gettype($content) == "StyleChangeInfo") {
                            continue;
                        }
                        //If object make cycle for the curent object
                        foreach ($content as $subName => $subContent) {
                            $table .= "<tr><td>" . $subName . "</td><td>" . $subContent . "</td></tr>";
                        }
                    } elseif (!is_object($content) && !is_array($content)) {
                        //Get curent element data
                        $table .= "<td>" . $name . "</td><td>" . $content . "</td>";
                        $table .= "</tr>";
                    }
                }
                $table .= "<tr bgcolor='#808080'><td></td><td></td></tr>";
            }
            $table .= "</table>";
            F3::set('change', $table);
        } else {
            throw new Exception($info->error_message);
        }
    } catch (Exception $e) {
        $error = 'ERROR: ' . $e->getMessage() . "\n";
        F3::set('error', $error);
    }
    //If request was successfull - set url variable for template
    //            return F3::set('change', $table);
}
//Process template
F3::set('resultFileId', $resultFileId);
//    F3::set('result', $result);
echo Template::serve('sample20.htm');
Esempio n. 29
0
            $iframe = 'https://stage-apps-groupdocs.dynabic.com/document-viewer/Embed/' . $fileGuId;
            //Iframe to realtime server
        } elseif ($basePath == "http://realtime-api.groupdocs.com") {
            $iframe = 'http://realtime-apps.groupdocs.com/document-viewer/embed/' . $fileGuId;
        }
    }
    if ($iframeType == "annotation") {
        if ($basePath == "https://api.groupdocs.com/v2.0") {
            $iframe = 'http://apps.groupdocs.com/document-annotation2/embed/' . $fileGuId;
            //iframe to dev server
        } elseif ($basePath == "https://dev-api.groupdocs.com/v2.0") {
            $iframe = 'http://dev-apps.groupdocs.com/document-annotation2/embed/' . $fileGuId;
            //iframe to test server
        } elseif ($basePath == "https://stage-api-groupdocs.dynabic.com/v2.0") {
            $iframe = 'https://stage-apps-groupdocs.dynabic.com/document-annotation2/Embed/' . $fileGuId;
            //Iframe to realtime server
        } elseif ($basePath == "http://realtime-api.groupdocs.com") {
            $iframe = 'http://realtime-apps.groupdocs.com/document-annotation2/embed/' . $fileGuId;
        }
    }
    $iframe = $signer->signUrl($iframe);
    //If request was successfull - set url variable for template
    F3::set('fileId', $fileGuId);
    F3::set('url', $iframe);
}
//Process template
F3::set('userId', $clientId);
F3::set('privateKey', $privateKey);
F3::set('width', $width);
F3::set('height', $height);
echo Template::serve('sample09.htm');
Esempio n. 30
0
    }
    $user = new Axon('user');
    $user->load(array('fb_id=:fb_id', array(':fb_id' => $uid)));
    if ($user->dry()) {
        _force_logout();
    }
    // Make user a var for template use
    F3::set('user', array('fb_id' => $user->fb_id, 'name' => $user->name, 'email_opt' => $user->email_opt));
    if (isset($_SESSION['message'])) {
        F3::set('message', $_SESSION['message']);
        F3::set('extra_js', array('bootstrap-alert.js'));
        unset($_SESSION['message']);
    }
    F3::set('extra_css', array('settings.css'));
    echo Template::serve('templates/header.html');
    F3::set('page', 'general_settings');
    echo Template::serve('templates/settings.html');
    echo Template::serve('templates/footer.html');
    die;
});
F3::route('POST /settings/save', function () {
    $facebook = F3::get('Facebook');
    $uid = $facebook->getUser();
    if (!$uid) {
        _force_logout();
    }
    $user = new Axon('user');
    $user->load(array('fb_id=:fb_id', array(':fb_id' => $uid)));
    if ($user->dry()) {
        _force_logout();
    }