function other()
{
    $dept = new department();
    $admindept = $dept->getAll();
    $man = new manager();
    $dept_managers = $man->getAllDept();
    while ($element = each($dept_managers)) {
    }
    $smt = new SMT('manager/AddAdmin', '..');
    $smt->render(array('admindept' => $admindept, 'admindept_sel' => key($admindept), 'dept_managers' => $dept_managers));
}
 public function printArray($all)
 {
     if (is_array($all)) {
         // Kint::dump($all);
         echo "<table border=1px>";
         echo "\r\n\t\t\t\t<thead>\r\n\t\t\t\t\t<th></th>\r\n    \t\t\t\t<th>id</th>\r\n \t\t\t\t\t<th>Задание</th>\r\n \t\t\t\t\t<th>Описание</th>\r\n \t\t\t\t\t<th>Поручено</th>\r\n \t\t\t\t\t<th>Срок</th>\r\n \t\t\t\t\t<th>Окончено</th>\r\n \t\t\t\t\t<th>Кто поручил</th>\r\n \t\t\t\t\t<th>Кому поручено</th>\r\n \t\t\t\t\t<th>Приоритет</th>\r\n \t\t\t\t\t<th>Статус</th>\r\n \t\t\t\t\t<th>Сайт</th>\r\n\t\t\t\t</thead>";
         foreach ($all as $x) {
             $id = $x->id;
             $hostingName = hosting::GET($x->hostingID)->name;
             $managerName = manager::GET($x->managerID)->name;
             $registratorName = registrator::GET($x->registratorID)->name;
             $from = $_SERVER['REQUEST_URI'];
             echo "\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<a href=\"/task/edit/{$id}?return-url={$from}\">\r\n\t\t\t\t\t\t\t\tE\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<a href=\"/task/view/{$id}\">\r\n\t\t\t\t\t\t\t\t{$id}\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td><a href=\"/task/view/{$id}\">\r\n\t\t\t\t\t\t\t{$x->name}\r\n\t\t\t\t\t\t</td></a>\r\n\t\t\t\t\t\t<td>{$x->description}</td>\r\n\t\t\t\t\t\t<td>";
             if (!is_null($x->insert_datetime)) {
                 echo DateTime::createFromFormat("M d Y h:i:s:uA", $x->insert_datetime)->format("Y-m-d H:i");
             }
             echo "</td>\r\n\t\t\t\t\t\t<td>";
             if (!is_null($x->deadlineDate)) {
                 echo DateTime::createFromFormat("M d Y h:i:s:uA", $x->deadlineDate)->format("Y-m-d H:i");
             }
             echo "</td>\r\n\t\t\t\t\t\t<td>";
             if (!is_null($x->finishedDate)) {
                 echo DateTime::createFromFormat("M d Y h:i:s:uA", $x->finishedDate)->format("Y-m-d H:i");
             }
             echo "</td>\r\n\t\t\t\t\t\t<td><a href=\"/user/view/{$x->giver_userID}\">\r\n\t\t\t\t\t\t\t" . user::GET($x->giver_userID)->username . "\r\n\t\t\t\t\t\t</a></td>\r\n\t\t\t\t\t\t<td><a href=\"/user/view/{$x->doer_userID}\">\r\n\t\t\t\t\t\t\t" . user::GET($x->doer_userID)->username . "\r\n\t\t\t\t\t\t</a></td>\r\n\t\t\t\t\t\t<td>" . priority::GET($x->priorityID)->name . "</td>\r\n\t\t\t\t\t\t<td>" . status::GET($x->statusID)->name . "</td>\r\n\t\t\t\t\t\t<td><a href=\"/site/view/{$x->siteID}\">" . site::GET($x->siteID)->name . "</a></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t";
         }
         echo "</table>";
     }
 }
 public function GET($id)
 {
     if (!manager::IFDELETED($id)) {
         $getQuery = "SELECT id, name FROM [dbo].[manager] WHERE id={$id};";
         $row = mssql_fetch_array(mssql_query($getQuery));
         $result = new manager($row["id"], $row["name"]);
         return $result;
     }
 }
 public function newEntry()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         manager::INSERT($_POST['name']);
         header("Location: /manager/view/{$id}");
     } else {
         managerController::loadView('new', $args = array());
     }
 }
Beispiel #5
0
 function __construct($model, $session = "0", $clock = 0)
 {
     $this->clock = $clock;
     //0;
     wfDebugLog('p2p', $this->clock . ' - function logootEngine::__construct ');
     if (isset($model)) {
         $this->model = $model;
     } else {
         $this->model = manager::getNewBoModel();
     }
     $this->sessionid = $session;
 }
Beispiel #6
0
    /**
     *
     * @param <String> $rev_id Revision id
     * @return boModel
     */
    static function loadModel($rev_id)
    {
        try {
            if ($rev_id != 0) {
                $dao = new dao();
                return $dao->loadModel($rev_id);
            } else {
                return manager::getNewBoModel();
            }
        } catch (Exception $e) {
            throw new MWException(__METHOD__ . ' db access problems,
if this page existed before the DSMW installation,
maybe it has not been processed by DSMW');
        }
    }
 function Trigger()
 {
     global $Core;
     switch ($this->button) {
         case 'add':
         case 'edit':
         case 'addcontacts':
         case 'editcontacts':
             $this->AddButton('Save');
             $this->InitSkin();
             $this->InitEditor();
             $this->Edit();
             break;
         case 'save':
             if (DEMO_MODE) {
                 $Core->ExitDemoEvent($this->redirect);
             }
             $this->SaveItems();
             break;
         case 'delete':
         case 'deletecontacts':
             if (DEMO_MODE) {
                 $Core->ExitDemoEvent($this->redirect);
             }
             $this->DeleteItem();
             break;
         case 'cancel':
             $Core->ExitEvent(2, $this->redirect);
             break;
         case '':
             $this->AddButton('Add');
             $this->InitProps();
             $this->ViewItems();
             break;
         default:
             parent::Trigger();
             break;
     }
 }
Beispiel #8
0
<?php

include "php/user.php";
include "php/security.php";
include "php/manager.php";
$login = new user();
$sec = new security();
$manager = new manager();
$logincheck = $login->islogin();
if ($logincheck != 1) {
    header("location: index.php");
} else {
    if (isset($_GET['error'])) {
        $error = $_GET['error'];
    }
    if ($_SERVER['REQUEST_METHOD'] == "POST") {
        $managername = $sec->escape($_POST['managername']);
        $managerlength = $sec->checknullwithoutwhitespace($managername);
        $managerage = $sec->escape($_POST['managerage']);
        $managermail = $sec->escape($_POST['managermail']);
        $manageraddress = $sec->escape($_POST['manageraddress']);
        if ($managerlength != 0) {
            $ans = $manager->addmanager($managername, $managerage, $managermail, $manageraddress);
            if ($ans == 0) {
                $error = "نام مدیر نباید تکراری باشد";
            } else {
                $error = "مدیر با موفقیت ایجاد شد";
            }
        } else {
            $error = "لطفا ابتدا نام مدیر را وارد کنید";
        }
Beispiel #9
0
<?php

include "php/security.php";
include "php/school.php";
include "php/user.php";
include "php/manager.php";
$login = new user();
$logincheck = $login->islogin();
if ($logincheck != 1) {
    header("location: index.php");
    die;
}
$manager = new manager();
$sec = new security();
$name;
$age;
$email;
$address;
if ($_SERVER["REQUEST_METHOD"] == "GET") {
    if (isset($_GET['id'])) {
        $result = $manager->getmanagerbyid($_GET['id']);
        $row = $result->fetch_assoc();
        $name = $row['Name'];
        $age = $row['Age'];
        $email = $row['Email'];
        $address = $row['Address'];
    }
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $id = $sec->escape($_POST['managerid']);
    $managername = $sec->escape($_POST["managername"]);
Beispiel #10
0
<?php

include "php/user.php";
include "php/manager.php";
include "php/school.php";
include "php/security.php";
$login = new user();
$manager = new manager();
$school = new school();
$sec = new security();
$logincheck = $login->islogin();
if ($logincheck != 1) {
    header("location: index.php");
} else {
    if ($_SERVER['REQUEST_METHOD'] == "POST") {
        if (isset($_POST['schoolid'])) {
            $schoolid = $_POST['schoolid'];
            $managerid = $_POST['managerid'];
            $shift = $_POST['shift'];
            $school->addmanagertoschool($managerid, $schoolid, $shift);
            header("location: schools.php");
        }
    }
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        if (isset($_GET['schoolid']) & isset($_GET['shift'])) {
            $schoolid = $sec->escape($_GET['schoolid']);
            $shift = $sec->escape($_GET['shift']);
            $schoolresult = $school->getschoolbyid($schoolid);
            if ($schoolresult->num_rows == 1) {
                $schoolrow = $schoolresult->fetch_assoc();
                $managerresult = $manager->getmanagers();
Beispiel #11
0
<?php

include "php/user.php";
include "php/manager.php";
$manager = new manager();
$login = new user();
$logincheck = $login->islogin();
if ($logincheck != 1) {
    header("location: index.php");
}
if (isset($_GET['id'])) {
    $manager->removemanager($_GET['id']);
    header("location: managers.php");
}
?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>

</body>
</html>
<?php

/* For licensing terms, see /license.txt */
/**
 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
 * @link www.phpletter.com
 * @since 22/April/2007
 *
 */
require_once '../../../../../../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'fckeditor/editor/plugins/ajaxfilemanager/inc/config.php';
if (!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path'])) {
    include_once CLASS_MANAGER;
    $manager = new manager($_GET['path'], false);
    $fileTypes = $manager->getFileType(basename($_GET['path']));
    if ($fileTypes['preview']) {
        switch ($fileTypes['fileType']) {
            case "image":
                $imageInfo = @getimagesize($_GET['path']);
                if (!empty($imageInfo[0]) && !empty($imageInfo[1])) {
                    $thumInfo = getThumbWidthHeight($imageInfo[0], $imageInfo[1], 400, 135);
                    printf("<img src=\"%s\" width=\"%s\" height=\"%s\" />", getFileUrl($_GET['path']), $thumInfo['width'], $thumInfo['height']);
                } else {
                    echo PREVIEW_IMAGE_LOAD_FAILED;
                }
                break;
            case "txt":
                if ($fp = @fopen($_GET['path'], 'r')) {
                    echo @fread($fp, @filesize($_GET['path']));
                    @fclose($fp);
                } else {
Beispiel #13
0
 /**
  * Constructor
  *
  * @param manager $manager Trim tools manager object
  */
 public function __construct(manager $manager)
 {
     $this->tools = $manager->get_tools();
 }
Beispiel #14
0
 /**
  * get current or the specified dir information
  *
  * @param string $path
  * @return array
  */
 function getFolderInfo($path = null)
 {
     if (is_null($path)) {
         return $this->currentFolderInfo;
     } else {
         $obj = new manager($path, false);
         $obj->setSessionAction($this->sessionAction);
         $obj->getFileList();
         return $obj->getFolderInfo();
     }
 }
    $error = SYS_DISABLED;
} elseif (empty($_POST['new_folder'])) {
    $error = ERR_FOLDER_NAME_EMPTY;
} elseif (!preg_match("/^[a-zA-Z0-9_\\- ]+\$/", $_POST['new_folder'])) {
    $error = ERR_FOLDER_FORMAT;
} else {
    if (empty($_POST['currentFolderPath']) || !isUnderRoot($_POST['currentFolderPath'])) {
        $error = ERR_FOLDER_PATH_NOT_ALLOWED;
    } elseif (file_exists(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'])) {
        $error = ERR_FOLDER_EXISTS;
    } else {
        include_once CLASS_FILE;
        $file = new file();
        if ($file->mkdir(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], 0775)) {
            include_once CLASS_MANAGER;
            $manager = new manager(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], false);
            $pathInfo = $manager->getFolderInfo(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']);
            foreach ($pathInfo as $k => $v) {
                switch ($k) {
                    case "ctime":
                    case "mtime":
                    case "atime":
                        $v = date(DATE_TIME_FORMAT, $v);
                        break;
                    case 'name':
                        $info .= sprintf(", %s:'%s'", 'short_name', shortenFileName($v));
                        break;
                    case 'cssClass':
                        $v = 'folderEmpty';
                        break;
                }
					if(file_exists($doc) && isUnderRoot($doc) )
					{
						
						if( array_search(getRealPath($doc), $allDocs) === false || CONFIG_OVERWRITTEN)
						{
							if(CONFIG_OVERWRITTEN)
							{
								$file->delete($doc);
							}
							if($file->copyTo($doc, $_GET['current_folder_path']))
							{
								
								$finalPath = $destFolderPath . basename($doc);
								$objFile = new file($finalPath);
								$tem = $objFile->getFileInfo();
								$obj = new manager($finalPath, false);			
														
								$fileType = $obj->getFileType($finalPath);
								
								foreach($fileType as $k=>$v)
								{
									$tem[$k] = $v;
								}
								
								$tem['path'] = backslashToSlash($doc);		
								$tem['type'] = (is_dir($finalPath)?'folder':'file');
								$tem['size'] = @transformFileSize($tem['size']);
								$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
								$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
								$tem['flag'] = 'noFlag';
								$tem['url'] = getFileUrl($doc);
Beispiel #17
0
 function testManyInsDel()
 {
     $model = manager::loadModel(0);
     //$logoot = new logootEngine($model);
     $logoot = manager::getNewEngine($model);
     $oldContent = "";
     for ($i = 0; $i < 500; $i++) {
         //500 inserts / 499 deletion
         //insert X
         $newContent = "{$i}";
         $listOp1 = $logoot->generate($oldContent, $newContent);
         if ($i == 0) {
             //ins first line
             $this->assertEquals(1, $listOp1->size());
         } else {
             $this->assertEquals(2, $listOp1->size());
         }
         $oldContent = $newContent;
     }
     $modelAssert = $logoot->getModel();
     $this->assertEquals(3, count($modelAssert->getPositionlist()));
 }
 function Trigger()
 {
     global $Core;
     switch ($this->button) {
         case 'add':
         case 'edit':
         case 'editblock':
             $this->AddButton('Save');
             $this->InitSkin();
             $this->InitEditor();
             $this->Edit();
             break;
         case 'clearcache':
             $this->clearCache();
             break;
         case 'save':
             if (DEMO_MODE) {
                 $Core->ExitDemoEvent($this->redirect);
             }
             $this->PrepareForSave();
             $this->SaveItems();
             $Core->UpdateSitemap();
             break;
         case 'delete':
         case 'deleteblock':
             if (DEMO_MODE) {
                 $Core->ExitDemoEvent($this->redirect);
             }
             $this->DeleteItem();
             break;
         case 'publish':
         case 'unpublish':
         case 'publishblock':
         case 'unpublishblock':
             if (DEMO_MODE) {
                 $Core->ExitDemoEvent($this->redirect);
             }
             $this->publishPage();
             break;
         case 'cancel':
             $Core->ExitEvent(2, $this->redirect);
             break;
         case '':
             $this->filterObjs();
             $this->AddButton('Add');
             $this->AddButton('Clear Cache');
             $this->InitProps();
             $this->PublishedValueToString();
             $this->MenuIdToString();
             $this->ViewItems();
             break;
         default:
             parent::Trigger();
             break;
     }
 }
Beispiel #19
0
        function say_hello()
        {
            return "I'm a programmer, dude";
        }
    }
    $p = new programmer();
    echo "verifying method override in subclass<br>\n";
    echo "Result: " . ($p->say_hello() == "I'm a programmer, dude" ? 'pass' : 'fail') . "<br><br>\n\n";
}
function test2()
{
    class manager extends person
    {
        var $mytype = 'manager';
    }
    $p = new manager();
    echo "verifying variable override in subclass<br>\n";
    echo "Result: " . ($p->say_hello() == "I am a manager" ? 'pass' : 'fail') . "<br><br>\n\n";
}
function test3()
{
    class user extends person
    {
        function __construct()
        {
            $this->mytype = 'user';
        }
    }
    $p = new user();
    echo "verifying variable override in subclass constructor<br>\n";
    echo "Result: " . ($p->say_hello() == "I am a user" ? 'pass' : 'fail') . "<br><br>\n\n";
Beispiel #20
0
 function testConcDelOpIntegration()
 {
     $oldtext = "";
     $conctext = "line1\nline2\nline3\nline4";
     $model = manager::loadModel(0);
     //$logoot = new logootEngine($model);
     $logoot = manager::getNewEngine($model);
     $listOp = $logoot->generate($oldtext, $conctext);
     //$model has 4 lines created by 4 ins operations
     $tmpMod = $logoot->getModel();
     $this->assertEquals(6, count($tmpMod->getPositionlist()));
     $this->assertEquals(6, count($tmpMod->getLinelist()));
     $oldtext = "line1\nline2\nline3\nline4";
     $actualtext = "line1\nline2\nline4";
     $listOp1 = $logoot->generate($oldtext, $actualtext);
     $tmpMod = $logoot->getModel();
     $this->assertEquals(5, count($tmpMod->getPositionlist()));
     $this->assertEquals(5, count($tmpMod->getLinelist()));
     $logoot->integrate($listOp1);
     $modelAssert = $logoot->getModel();
     $this->assertEquals(5, count($modelAssert->getPositionlist()));
     $this->assertEquals(5, count($modelAssert->getLinelist()));
 }
Beispiel #21
0
		/**
		 * get the file according to the search keywords
		 *
		 */
		function doSearch($baseFolderPath = null)
		{
			
			$baseFolderPath = addTrailingSlash(backslashToSlash((is_null($baseFolderPath)?$this->rootFolder:$baseFolderPath)));
			
			$dirHandler = @opendir($baseFolderPath);
			if($dirHandler)
			{
				while(false !== ($file = readdir($dirHandler)))
				{
					if($file != '.' && $file != '..')
					{
						$path = $baseFolderPath . $file;
						if(is_file($path))
						{
							$isValid = true;

							$fileTime = @filemtime($path);
							$fileSize = @filesize($path);	
							if($this->searchkeywords['name'] !== ''  && @eregi($this->searchkeywords['name'], $file) === false)
							{
								$isValid = false;
							}
							if($this->searchkeywords['mtime_from'] != '' && $fileTime < @strtotime($this->searchkeywords['mtime_from']))
							{
								$isValid = false;
							}
							if($this->searchkeywords['mtime_to'] != '' && $fileTime > @strtotime($this->searchkeywords['mtime_to']))
							{
								$isValid = false;
							}							
							if($this->searchkeywords['size_from'] != '' && $fileSize < @strtotime($this->searchkeywords['size_from']))
							{
								$isValid = false;
							}
							if($this->searchkeywords['size_to'] != '' && $fileSize > @strtotime($this->searchkeywords['size_to']))
							{
								$isValid = false;
							}			
							if($isValid && isListingDocument($path))
							{
								$finalPath = $path;
								$objFile = new file($finalPath);
								$tem = $objFile->getFileInfo();
								$obj = new manager($finalPath, false);			
								$obj->setSessionAction($this->sessionAction);
								$selectedDocuments = $this->sessionAction->get();													
								$fileType = $obj->getFileType($finalPath);
								
								foreach($fileType as $k=>$v)
								{
									$tem[$k] = $v;
								}
								
								$tem['path'] = backslashToSlash($finalPath);		
								$tem['type'] = (is_dir($finalPath)?'folder':'file');
/*								$tem['size'] = transformFileSize($tem['size']);
								$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
								$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);*/
								$tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag');
								$tem['url'] = getFileUrl($tem['path']);
								$this->rootFolderInfo['file']++;
								$manager = null;
								$this->files[] = $tem;
								$tem = null;								
							}
						}elseif(is_dir($path) && $this->searchkeywords['recursive'])
						{
							$this->Search($baseFolderPath);
						}
					}
				}
			}
			 
		}
Beispiel #22
0
ini_set('display_errors', '1');
//*/
//includes
require '../config.php';
require 'manager.php';
// check if action is set (read/write/delete)
// return error if not.
if (!isset($_POST['action'])) {
    echo '{"error": 100, "message": "Action must be set."}';
    die;
} else {
    $arg_action = $_POST['action'];
}
// start the manager
// only one user for now. Use path prefix
$manager = new manager('admin', '../');
//## Write a note ##//
if ("write" == $arg_action) {
    // create new note if no id is given
    if (!isset($_POST['id']) || $_POST['id'] == '') {
        $arg_id = $manager->generate_id();
    } else {
        $arg_id = $_POST['id'];
    }
    // title must not be empty -> space
    if (!isset($_POST['title'])) {
        $title = ' ';
    } else {
        $title = $_POST['title'];
    }
    if (!isset($_POST['text'])) {
Beispiel #23
0
     }
 }
 include_once CLASS_FILE;
 $file = new file();
 //check if all files are allowed to cut or copy
 foreach ($selectedDocuments as $doc) {
     if (file_exists($doc) && isUnderRoot($doc)) {
         if (array_search(getRealPath($doc), $allDocs) === false || CONFIG_OVERWRITTEN) {
             if (CONFIG_OVERWRITTEN) {
                 $file->delete($doc);
             }
             if ($file->copyTo($doc, $_GET['current_folder_path'])) {
                 $finalPath = $destFolderPath . basename($doc);
                 $objFile = new file($finalPath);
                 $tem = $objFile->getFileInfo();
                 $obj = new manager($finalPath, false);
                 $fileType = $obj->getFileType($finalPath, is_dir($finalPath) ? true : false);
                 foreach ($fileType as $k => $v) {
                     $tem[$k] = $v;
                 }
                 /*								foreach ($folderInfo as $k=>$v)
                 								{
                 									$tem['i_' . $k] = $v;
                 								}
                 								if($folderInfo['type'] == 'folder' && empty($folderInfo['subdir']) &&  empty($folderInfo['file']))
                 								{
                 									$tem['cssClass'] = 'folderEmpty';
                 								}*/
                 $tem['final_path'] = $finalPath;
                 $tem['path'] = backslashToSlash($finalPath);
                 $tem['type'] = is_dir($finalPath) ? 'folder' : 'file';
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request, $id)
 {
     $manager = manager::find($id);
     $manager->update($request->all());
     return redirect('managers/' . $manager->id);
 }
Beispiel #25
0
	{		
		$error = ERR_FILE_TYPE_NOT_ALLOWED;
	}elseif(defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
	{		
		 $error = sprintf(ERROR_FILE_TOO_BID, transformFileSize(CONFIG_UPLOAD_MAXSIZE));
	}else
	{
							include_once(CLASS_FILE);
							$path = $upload->getFilePath();
							$obj = new file($path);
							$tem = $obj->getFileInfo();							
							if(sizeof($tem))
							{	
								include_once(CLASS_MANAGER);
							
								$manager = new manager($upload->getFilePath(), false);			
															
								$fileType = $manager->getFileType($upload->getFileName());

								foreach($fileType as $k=>$v)
								{
									$tem[$k] = $v;
								}
								
								$tem['path'] = backslashToSlash($path);		
								$tem['type'] = "file";
								$tem['size'] = transformFileSize($tem['size']);
								$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
								$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
								$tem['short_name'] = shortenFileName($tem['name']);						
								$tem['flag'] = 'noFlag';
Beispiel #26
0
<?php

/*
/  WebNote - see readme.md for details
/  Copyright (C) 2012 David Glenck - <*****@*****.**>
/  Published under GNU GPLv3 
/  - see licences/gpl-3.0.txt or <http://www.gnu.org/licenses/>
*/
/*//Debug
error_reporting(E_ALL);
ini_set('display_errors', '1');
//*/
// includes
require 'manager.php';
require 'dep/php/markdown.php';
// The Initializer:
// loads notes and saves them into an array
$load = new manager('admin');
// only one user (for now)
$load->read_note();
// load all notes
$WN_notes = $load->get();
// get loaded notes
Beispiel #27
0
 /**
  * Process an inbound address to obtain the data stored within it.
  *
  * @param string $address The fully formed e-mail address to process.
  */
 protected function process($address)
 {
     global $DB;
     if (!self::is_correct_format($address)) {
         // This address does not contain a subaddress to parse.
         return;
     }
     // Ensure that the instance record is empty.
     $this->record = null;
     $record = new \stdClass();
     $record->address = $address;
     list($localpart) = explode('@', $address, 2);
     list($record->mailbox, $encodeddata) = explode('+', $localpart, 2);
     $data = base64_decode($encodeddata, true);
     if (!$data) {
         // This address has no valid data.
         return;
     }
     $content = @unpack('N2handlerid/N2userid/N2datavalue/H*datakey', $data);
     if (!$content) {
         // This address has no data.
         return;
     }
     if (PHP_INT_SIZE === 8) {
         // 64-bit machine.
         $content['handlerid'] = $content['handlerid1'] << 32 | $content['handlerid2'];
         $content['userid'] = $content['userid1'] << 32 | $content['userid2'];
         $content['datavalue'] = $content['datavalue1'] << 32 | $content['datavalue2'];
     } else {
         if ($content['handlerid1'] > 0 || $content['userid1'] > 0 || $content['datavalue1'] > 0) {
             // Any 64-bit integer which is greater than the 32-bit integer size will have a non-zero value in the first
             // half of the integer.
             throw new \moodle_exception('Mixed environment.' . ' Key generated with a 64-bit machine but received into a 32-bit machine.');
         }
         $content['handlerid'] = $content['handlerid2'];
         $content['userid'] = $content['userid2'];
         $content['datavalue'] = $content['datavalue2'];
     }
     // Clear the 32-bit to 64-bit variables away.
     unset($content['handlerid1']);
     unset($content['handlerid2']);
     unset($content['userid1']);
     unset($content['userid2']);
     unset($content['datavalue1']);
     unset($content['datavalue2']);
     $record = (object) array_merge((array) $record, $content);
     // Fetch the user record.
     $record->user = $DB->get_record('user', array('id' => $record->userid));
     // Fetch and set the handler.
     if ($handler = manager::get_handler_from_id($record->handlerid)) {
         $this->handler = $handler;
         // Retrieve the record for the data key.
         $record->data = $DB->get_record('messageinbound_datakeys', array('handler' => $handler->id, 'datavalue' => $record->datavalue));
     }
     $this->record = $record;
 }
    $sessionAction = new SessionAction();
    $selectedDocuments = $sessionAction->get();
    if (removeTrailingSlash($sessionAction->getFolder()) == getParentPath($_POST['original_path']) && sizeof($selectedDocuments)) {
        if (($key = array_search(basename($_POST['original_path']), $selectedDocuments)) !== false) {
            $selectedDocuments[$key] = $_POST['name'];
            $sessionAction->set($selectedDocuments);
        }
    } elseif (removeTrailingSlash($sessionAction->getFolder()) == removeTrailingSlash($_POST['original_path'])) {
        $sessionAction->setFolder($_POST['original_path']);
    }
    $path = addTrailingSlash(getParentPath($_POST['original_path'])) . $_POST['name'];
    if (is_file($path)) {
        include_once CLASS_FILE;
        $file = new file($path);
        $fileInfo = $file->getFileInfo();
        $fileInfo['mtime'] = date(DATE_TIME_FORMAT, $fileInfo['mtime']);
    } else {
        include_once CLASS_MANAGER;
        $manager = new manager($path, false);
        $fileInfo = $manager->getFolderInfo();
        $fileInfo['mtime'] = date(DATE_TIME_FORMAT, $fileInfo['mtime']);
    }
    event_system(LOG_MY_FOLDER_CHANGE, LOG_MY_FOLDER_PATH, $_POST['original_path']);
    event_system(LOG_MY_FOLDER_CHANGE, LOG_MY_FOLDER_NEW_PATH, $path);
}
echo "{";
echo "error:'" . $error . "' ";
foreach ($fileInfo as $k => $v) {
    echo "," . $k . ":'" . $v . "' ";
}
echo "}";
        $search->addSearchKeyword('recursive', @$_GET['search_recursively']);
        $search->addSearchKeyword('mtime_from', @$_GET['search_mtime_from']);
        $search->addSearchKeyword('mtime_to', @$_GET['search_mtime_to']);
        $search->addSearchKeyword('size_from', @$_GET['search_size_from']);
        $search->addSearchKeyword('size_to', @$_GET['search_size_to']);
        $search->addSearchKeyword('recursive', @$_GET['search_recursively']);
        $search->addSearchKeyword('name', @$_GET['search_name']);
        $search->doSearch();
        $fileList = $search->getFoundFiles();
        $folderInfo = $search->getRootFolderInfo();
    } else {
        include_once CLASS_MANAGER;
        include_once CLASS_SESSION_ACTION;
        $sessionAction = new SessionAction();
        include_once DIR_AJAX_INC . "class.manager.php";
        $manager = new manager();
        $manager->setSessionAction($sessionAction);
        $fileList = $manager->getFileList();
        $folderInfo = $manager->getFolderInfo();
    }
    $pagination->setUrl(CONFIG_URL_FILEnIMAGE_MANAGER);
} else {
    include_once CLASS_PAGINATION;
    $pagination = new pagination(false);
}
$pagination->setTotal(sizeof($fileList));
$pagination->setFirstText(PAGINATION_FIRST);
$pagination->setPreviousText(PAGINATION_PREVIOUS);
$pagination->setNextText(PAGINATION_NEXT);
$pagination->setLastText(PAGINATION_LAST);
$pagination->setLimit(!empty($_GET['limit']) ? (int) $_GET['limit'] : CONFIG_DEFAULT_PAGINATION_LIMIT);
<?php

$eid = $_REQUEST['id'];
$ename = $_REQUEST['name'];
$ebsal = $_REQUEST['bsal'];
$edes = $_REQUEST['desig'];
if ($edes == 'Select') {
    echo "Please enter the designation<br/>";
    echo "<a href='index.html'>Back</a>";
} else {
    if ($edes == "Developer") {
        include 'developer.php';
        $d = new developer($eid, $ename, $ebsal, $edes);
        $d->calsal();
        $d->display();
    } else {
        if ($edes == "Manager") {
            include 'manager.php';
            $d = new manager($eid, $ename, $ebsal, $edes);
            $d->calsal();
            $d->display();
        }
    }
}