Beispiel #1
0
</span>
			</td>

			<td class="text-right">
				<span class="label label-<?php 
        echo $row->price ? 'default' : 'warning';
        ?>
"><?php 
        echo price($row->price);
        ?>
</span>
			</td>

			<td nowrap="nowrap">
				<?php 
        echo AdminUI::actions(array_except($row->rowActions(), 'remove'));
        ?>
			</td>
		</tr>
	<?php 
    }
    ?>
	</tbody>
	</table>

	<?php 
    echo $data->links();
} else {
    ?>

	<div class="alert alert-info text-center"><i class="icon-gears icon-3x"></i><br>Нет записей</div>
Beispiel #2
0
 protected function loginOrDie()
 {
     $admin = new AdminUI();
     $admin->dataStrat();
 }
Beispiel #3
0
<?php

# manage site
/*
this page handles both gets and sets.
ideally we could check for post vars, process set request, then location change to a get
however we also need to show invalid post requests? maybe we could just do that client side.
*/
require_once '../../flot-admin/core/base.php';
require_once '../../flot-admin/core/flot.php';
$flot = new Flot();
$admin_ui = new AdminUI();
if (!$flot->b_is_user_admin()) {
    # forward them to login page
    $flot->_page_change("/flot-admin/admin/login.php");
}
$html_main_admin_content = "";
$html_main_admin_content_menu = "";
$s_body_class = "";
$s_section = "";
$ufUf = new UtilityFunctions();
if ($ufUf->b_post_vars()) {
    #
    # handle post request
    #
    $s_action = $ufUf->s_post_var_from_allowed("action", array("edit"), "edit");
    $s_section = $ufUf->s_post_var_from_allowed("section", array("items", "elements", "pictures", "menus", "settings", "oncologies"), "items");
    switch ($s_section) {
        case "items":
            switch ($s_action) {
                case 'edit':
Beispiel #4
0
<?php

# log in and forward user to route admin section
require '../core/flot.php';
$flot = new Flot();
$AdminUI = new AdminUI();
# are we handling the log in form submission ?
$flot->_handle_auth_attempt();
if ($flot->b_is_user_admin()) {
    # they're logged in so forward them to the admin page to manage the site
    $flot->_page_change("index.php");
}
# serve them the log in form
?>
<!DOCTYPE html>
<html>
	<head>
		<?php 
echo $AdminUI->s_admin_header();
?>
	</head>
	<body>
		<div class="container" style="max-width:300px;margin-top:150px;">
			<!-- instruction, email, password, login/submit button -->
			<form role="form" method="post" name="login" action="login.php">
				<div class="form-group">
					<h1>login</h1>
				</div>
				<div class="form-group">
					<input type="email" name="email" class="form-control" id="login_email" placeholder="email">
				</div>
Beispiel #5
0
<!DOCTYPE html>
<html>
<head>
	<title>Bootstrap 101 Template</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<!-- Bootstrap -->
	<link href="/packages/devhook/devhook/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
	<link href="/packages/devhook/devhook/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" media="screen">

	<script src="/packages/devhook/devhook/js/jquery.js"></script>
</head>
<body>

<?php 
echo AdminUI::navbar();
?>

<div class="navbar navbar-static-top navbar-inverse size-sm">
	<div class="container">
		<ul class="nav navbar-nav pull-left">
			<li><a href="#">Доставка и оплата</a></li>
			<li><a href="#">Отзывы</a></li>
			<li><a href="#">Условия и гарантия</a></li>
			<li><a href="#">Помощь</a></li>
			<li><a href="#">Контакты</a></li>
		</ul>

	<?php 
if ($user->id) {
    ?>
			<div class="navbar-form pull-right">
 public function handleRequest()
 {
     /* Check if it is time to insert more terms into DB */
     if (Term::isTimeToUpdate()) {
         Term::doTermUpdate();
     }
     // Fetch the action from the REQUEST.
     if (!isset($_REQUEST['action'])) {
         $req = "";
     } else {
         $req = $_REQUEST['action'];
     }
     // Show requested page.
     switch ($req) {
         case 'example_form':
             header('Content-type: application/pdf');
             readfile(PHPWS_SOURCE_DIR . 'mod/intern/pdf/Internship_Example.pdf');
             exit;
             break;
         case 'edit_internship':
             PHPWS_Core::initModClass('intern', 'UI/InternshipUI.php');
             $view = new InternshipUI();
             $this->content = $view->display();
             break;
         case 'add_internship':
             PHPWS_Core::initModClass('intern', 'command/SaveInternship.php');
             $ctrl = new SaveInternship();
             $ctrl->execute();
             test('finished execute', 1);
             break;
         case 'search':
             PHPWS_Core::initModClass('intern', 'UI/SearchUI.php');
             $view = new SearchUI();
             $this->content = $view->display();
             break;
         case 'results':
             PHPWS_Core::initModClass('intern', 'UI/ResultsUI.php');
             $view = new ResultsUI();
             $this->content = $view->display();
             break;
         case DEPT_EDIT:
             PHPWS_Core::initModClass('intern', 'UI/DepartmentUI.php');
             PHPWS_Core::initModClass('intern', 'Department.php');
             if (isset($_REQUEST['add'])) {
                 /* Add department with the name in REQUEST */
                 if (isset($_REQUEST['name'])) {
                     Department::add($_REQUEST['name']);
                 } else {
                     NQ::simple('intern', INTERN_ERROR, "Department must have name.");
                 }
             } else {
                 if (isset($_REQUEST['rename'])) {
                     /* Rename dept with ID to new name that was passed in REQUEST */
                     if (isset($_REQUEST['id'])) {
                         $d = new Department($_REQUEST['id']);
                         $d->rename($_REQUEST['rename']);
                     } else {
                         NQ::simple('intern', INTERN_ERROR, "No ID given. Cannot rename department.");
                     }
                 } else {
                     if (isset($_REQUEST['hide'])) {
                         /* Hide/Show department with ID passed in REQUEST. */
                         if (isset($_REQUEST['id'])) {
                             $d = new Department($_REQUEST['id']);
                             $d->hide($_REQUEST['hide'] == 1);
                         } else {
                             NQ::simple('intern', INTERN_ERROR, "No ID given. Cannot hide department.");
                         }
                     } else {
                         if (isset($_REQUEST['del'])) {
                             /* Delete department with same ID passed in REQUEST. */
                             if (isset($_REQUEST['id'])) {
                                 $d = new Department($_REQUEST['id']);
                                 $d->del();
                             } else {
                                 NQ::simple('intern', INTERN_ERROR, "No ID given. Cannot delete department.");
                             }
                         } else {
                             if (isset($_REQUEST['fDel'])) {
                                 /** for now... */
                                 NQ::simple('intern', INTERN_WARNING, 'Sorry, cannot forcefully delete a department.');
                             }
                         }
                     }
                 }
             }
             $view = new DepartmentUI();
             $this->content = $view->display();
             break;
         case GRAD_PROG_EDIT:
             PHPWS_Core::initModClass('intern', 'GradProgram.php');
             PHPWS_Core::initModClass('intern', 'UI/GradProgramUI.php');
             if (isset($_REQUEST['add'])) {
                 /* Add grad program with the name in REQUEST */
                 if (isset($_REQUEST['name'])) {
                     GradProgram::add($_REQUEST['name']);
                 } else {
                     NQ::simple('intern', INTERN_ERROR, "Grad Program must have name.");
                 }
             } else {
                 if (isset($_REQUEST['rename'])) {
                     /* Rename program with ID to new name that was passed in REQUEST */
                     if (isset($_REQUEST['id'])) {
                         $g = new GradProgram($_REQUEST['id']);
                         $g->rename($_REQUEST['rename']);
                     } else {
                         NQ::simple('intern', INTERN_ERROR, "No ID given. Cannot rename graduate program.");
                     }
                 } else {
                     if (isset($_REQUEST['hide'])) {
                         /* Hide/Show program with ID passed in REQUEST. */
                         if (isset($_REQUEST['id'])) {
                             $g = new GradProgram($_REQUEST['id']);
                             $g->hide($_REQUEST['hide'] == 1);
                         } else {
                             NQ::simple('intern', INTERN_ERROR, "No ID given. Cannot hide graduate program.");
                         }
                     } else {
                         if (isset($_REQUEST['del'])) {
                             /* Delete program with same ID passed in REQUEST. */
                             if (isset($_REQUEST['id'])) {
                                 $g = new GradProgram($_REQUEST['id']);
                                 $g->del();
                             } else {
                                 NQ::simple('intern', INTERN_ERROR, "No ID given. Cannot delete graduate program.");
                             }
                         }
                     }
                 }
             }
             $view = new GradProgramUI();
             $this->content = $view->display();
             break;
         case MAJOR_EDIT:
             PHPWS_Core::initModClass('intern', 'UI/MajorUI.php');
             if (isset($_REQUEST['add'])) {
                 /* Add major with the name passed in REQUEST. */
                 if (isset($_REQUEST['name'])) {
                     Major::add($_REQUEST['name']);
                 } else {
                     NQ::simple('intern', INTERN_ERROR, "Major must have name.");
                 }
             } else {
                 if (isset($_REQUEST['rename'])) {
                     /* Rename major with ID to new name that was passed in REQUEST */
                     if (isset($_REQUEST['id'])) {
                         $m = new Major($_REQUEST['id']);
                         $m->rename($_REQUEST['rename']);
                     } else {
                         NQ::simple('intern', INTERN_ERROR, "No ID given. Cannot rename major.");
                     }
                 } else {
                     if (isset($_REQUEST['hide'])) {
                         /* Hide major with ID passed in REQUEST. */
                         if (isset($_REQUEST['id'])) {
                             $m = new Major($_REQUEST['id']);
                             $m->hide($_REQUEST['hide'] == 1);
                         } else {
                             NQ::simple('intern', INTERN_ERROR, "No ID given. Cannot hide major.");
                         }
                     } else {
                         if (isset($_REQUEST['del'])) {
                             /* Delete major with same ID passed in REQUEST. */
                             if (isset($_REQUEST['id'])) {
                                 $m = new Major($_REQUEST['id']);
                                 $m->del();
                             } else {
                                 NQ::simple('intern', INTERN_ERROR, "No ID given. Cannot delete major.");
                             }
                         }
                     }
                 }
             }
             $view = new MajorUI();
             $this->content = $view->display();
             break;
             /**
              * Matt additions!
              */
         /**
          * Matt additions!
          */
         case 'add_state':
             if (!Current_User::allow('intern', 'edit_state')) {
                 disallow();
             }
             PHPWS_Core::initModClass('intern', 'State.php');
             $state = new State($_GET['abbr']);
             $state->setActive(true);
             $state->save();
             exit;
             break;
         case 'remove_state':
             if (!Current_User::allow('intern', 'edit_state')) {
                 disallow();
             }
             PHPWS_Core::initModClass('intern', 'State.php');
             $state = new State($_GET['abbr']);
             $state->setActive(false);
             $state->save();
             exit;
             break;
         case STATE_EDIT:
             if (!Current_User::allow('intern', 'edit_state')) {
                 disallow();
             }
             PHPWS_Core::initModClass('intern', 'UI/StateUI.php');
             $view = new StateUI();
             $this->content = $view->display();
             break;
         case 'edit_admins':
             PHPWS_Core::initModClass('intern', 'UI/AdminUI.php');
             PHPWS_Core::initModClass('intern', 'Admin.php');
             PHPWS_Core::initModClass('intern', 'Department.php');
             if (isset($_REQUEST['add'])) {
                 // Add user in REQUEST to administrator list for the department in REQUEST.
                 Admin::add($_REQUEST['username'], $_REQUEST['department_id']);
             } else {
                 if (isset($_REQUEST['del'])) {
                     // Delete the user in REQUEST from department in REQUEST.
                     Admin::del($_REQUEST['username'], $_REQUEST['department_id']);
                 } else {
                     if (isset($_REQUEST['user_complete'])) {
                         $users = Admin::searchUsers($_REQUEST['term']);
                         echo json_encode($users);
                         exit;
                     }
                 }
             }
             $view = new AdminUI();
             $this->content = $view->display();
             break;
         case 'pdf':
             PHPWS_Core::initModClass('intern', 'InternshipFactory.php');
             PHPWS_Core::initModClass('intern', 'InternshipContractPdfView.php');
             PHPWS_Core::initModClass('intern', 'EmergencyContactFactory.php');
             $i = InternshipFactory::getInternshipById($_REQUEST['id']);
             $emgContacts = EmergencyContactFactory::getContactsForInternship($i);
             $pdfView = new InternshipContractPdfView($i, $emgContacts);
             $pdf = $pdfView->getPdf();
             $pdf->output();
             exit;
         case 'upload_document_form':
             PHPWS_Core::initModClass('intern', 'Intern_Document_Manager.php');
             $docManager = new Intern_Document_Manager();
             echo $docManager->edit();
             exit;
             break;
         case 'post_document_upload':
             PHPWS_Core::initModClass('intern', 'Intern_Document_Manager.php');
             $docManager = new Intern_Document_Manager();
             $docManager->postDocumentUpload();
             break;
         case 'delete_document':
             PHPWS_Core::initModClass('intern', 'Intern_Document.php');
             $doc = new Intern_Document($_REQUEST['doc_id']);
             $doc->delete();
             NQ::simple('intern', INTERN_SUCCESS, 'Document deleted.');
             NQ::close();
             PHPWS_Core::goBack();
             break;
         case 'addEmergencyContact':
             PHPWS_Core::initModClass('intern', 'command/AddEmergencyContact.php');
             $ctrl = new AddEmergencyContact();
             $ctrl->execute();
             break;
         case 'removeEmergencyContact':
             PHPWS_Core::initModClass('intern', 'command/RemoveEmergencyContact.php');
             $ctrl = new RemoveEmergencyContact();
             $ctrl->execute();
             break;
         case 'edit_faculty':
             PHPWS_Core::initModClass('intern', 'FacultyUI.php');
             $facultyUI = new FacultyUI();
             $this->content = $facultyUI->display();
             break;
         case 'getFacultyListForDept':
             PHPWS_Core::initModClass('intern', 'command/GetFacultyListForDept.php');
             $ctrl = new GetFacultyListForDept();
             $ctrl->execute();
             break;
         case 'restFacultyById':
             PHPWS_Core::initModClass('intern', 'command/RestFacultyById.php');
             $ctrl = new RestFacultyById();
             $ctrl->execute();
             break;
         case 'facultyDeptRest':
             PHPWS_Core::initModClass('intern', 'command/FacultyDeptRest.php');
             $ctrl = new FacultyDeptRest();
             $ctrl->execute();
             break;
         default:
             PHPWS_Core::initModClass('intern', 'UI/InternMenu.php');
             $menu = new InternMenu();
             $this->content = $menu->display();
             break;
     }
 }
Beispiel #7
0
    ?>
				<div class="dh-tabs" style="margin-bottom:20px">
					<?php 
    echo $tabs->elem()->className('nav nav-tabs');
    ?>
				</div>
			<?php 
}
?>

		<?php 
echo AdminUI::breadcrumbs();
?>

		<?php 
echo AdminUI::alerts();
?>

		<div id="content">
			<?php 
echo $content;
?>
		</div><!--#content-->

	</div>
<hr>

<script src="/packages/devhook/devhook/bootstrap/js/bootstrap.min.js"></script>
<script>
	$('a[data-toggle=tooltip]').tooltip();
</script>
Beispiel #8
0
 protected function init()
 {
     parent::init();
     \AdminUI::menu('subnav')->active('shop/orders');
 }
 /**
  * Init results params from skin template params. It's used when Results table is filled from ajax result.
  *
  * @param string the template param which can have values( 'admin', 'front' )
  * @param string the name of the skin
  */
 function init_params_by_skin($skin_type, $skin_name)
 {
     switch ($skin_type) {
         case 'admin':
             // admin skin type
             global $adminskins_path;
             require_once $adminskins_path . $skin_name . '/_adminUI.class.php';
             $this->params = AdminUI::get_template('Results');
             break;
         case 'front':
             // front office skin type
             global $skins_path;
             require_once $skins_path . $skin_name . '/_skin.class.php';
             $this->params = Skin::get_template('Results');
             break;
         default:
             debug_die('Invalid results template param!');
     }
 }
Beispiel #10
0
			<td nowrap="nowrap">
				<div class="btn-group">
					<a href="" class="btn btn-xs btn-info"><i class="icon-dropbox icon-large"></i> Товары</a>
					<a href="" class="btn btn-xs btn-info disabled"><?php 
        echo $row->total_allowed;
        ?>
</a>
					<a href="" class="btn btn-xs btn-info disabled"><?php 
        echo $row->total;
        ?>
</a>
				</div>
			</td>
			<td nowrap="nowrap">
				<?php 
        echo AdminUI::actions($row->rowActions());
        ?>
			</td>
		</tr>
	<?php 
    }
    ?>
	</tbody>
	</table>

<?php 
} else {
    ?>

	<div class="alert alert-info text-center"><i class="icon-gears icon-3x"></i><br>Нет записей</div>
Beispiel #11
0
 protected function getTile(PinholePhoto $photo)
 {
     $ui = new AdminUI();
     $ui->loadFromXML($this->ui_xml);
     $store = new SwatTableStore();
     $ds = new SwatDetailsStore();
     $ds->photo = $photo;
     $ds->class_name = $this->getTileClasses($photo);
     $store->add($ds);
     $ui->getWidget('index_view')->model = $store;
     ob_start();
     $ui->getWidget('index_view')->display();
     $string = ob_get_clean();
     // only pass back the tile element, not the whole view
     $dom = new DomDocument();
     $dom->loadXML('<xml>' . $string . '</xml>');
     $divs = $dom->getElementsByTagName('div');
     foreach ($divs as $div) {
         $classes = explode(' ', $div->getAttribute('class'));
         if (in_array('swat-tile', $classes)) {
             return $dom->saveXML($div);
         }
     }
 }
Beispiel #12
0
 /**
  * Load template params from current skin
  */
 function load_template()
 {
     $params = array('toolbar_before' => '<div class="edit_toolbar $toolbar_class$">', 'toolbar_after' => '</div>', 'toolbar_title_before' => '', 'toolbar_title_after' => '', 'toolbar_group_before' => '', 'toolbar_group_after' => ' ', 'toolbar_button_class' => 'quicktags');
     if (is_admin_page()) {
         // Get plugin template from backoffice skin
         if (is_logged_in()) {
             global $current_User, $UserSettings, $adminskins_path;
             $admin_skin = $UserSettings->get('admin_skin', $current_User->ID);
             require_once $adminskins_path . $admin_skin . '/_adminUI.class.php';
             $AdminUI = new AdminUI();
             $skin_template = $AdminUI->get_template('plugin_template');
         }
     } else {
         // Get plugin template from frontoffice skin
         global $Blog;
         if (!empty($Blog)) {
             $skin_ID = $Blog->get_skin_ID();
             $SkinCache =& get_SkinCache();
             if ($Skin =& $SkinCache->get_by_ID($skin_ID, false, false)) {
                 $skin_template = $Skin->get_template('plugin_template');
             }
         }
     }
     if (empty($skin_template)) {
         // Use default template params when they are not set by skin
         $this->template = $params;
     } else {
         // Merge default params with current skin params
         $this->template = array_merge($params, $skin_template);
     }
 }