Beispiel #1
0
 protected function getTextFromData($data)
 {
     if (!is_array($data)) {
         throw new \RuntimeException('Wrong type of data to markdownify: ' . get_type($data));
     }
     return Yaml::dump($data, 3);
 }
Beispiel #2
0
 /**
  * @param $callable
  *
  * @throws InvalidResolverException
  */
 public function setResolver($callable)
 {
     if (!is_callable($callable)) {
         throw new InvalidResolverException(s('Routing resolver must be a callable, received "%s".', get_type($callable)));
     }
     $this->resolver = $callable;
 }
 protected function getTextFromData($data)
 {
     if (!is_string($data)) {
         throw new \RuntimeException('Wrong type of data to markdownify: ' . get_type($data));
     }
     return (new MarkdownifyExtra())->parseString($data);
 }
 public function run(ApplicationInterface $app)
 {
     $connector = Connector::getInstance();
     $connector->setSourcesBasePath(getcwd());
     $matcher = new Matcher();
     // redirect errors to PhpConsole
     \PhpConsole\Handler::getInstance()->start();
     $app->getEventsHandler()->bind('*', function (EventInterface $event) use($app, $connector, $matcher) {
         /**
          * @var $connector \PhpConsole\Connector
          */
         if ($connector->isActiveClient()) {
             $console = \PhpConsole\Handler::getInstance();
             $context = $event->getContext();
             $origin = $event->getOrigin();
             switch (true) {
                 case $event->getName() == 'application.workflow.step.run':
                     $console->debug(sprintf('Starting running step %s', $origin->getName()), 'workflow.step');
                     break;
                 case $event->getName() == 'application.workflow.hook.run':
                     $middleware = $origin->getMiddleware();
                     $console->debug(sprintf('Running Middleware %s (%s)', $middleware->getReference(), $middleware->getDescription()), 'workflow.hook');
                     $this->dumpNotifications($console, $middleware->getNotifications());
                     break;
                 case $matcher->match(ServicesFactory::EVENT_INSTANCE_BUILT . '.*', $event->getName()):
                     $console->debug(sprintf('Built service %s (%s)', $context['serviceSpecs']->getId(), is_object($context['instance']) ? get_class($context['instance']) : get_type($context['instance'])), 'services');
                     break;
                 case $matcher->match($event->getName(), '*.notify.*'):
                     $this->dumpNotifications($console, $event->getContext('notifications'));
                     break;
             }
         }
     });
 }
 /**
  * Transforms an array to a csv set of strings
  *
  * @param  array|null $array
  * @return string
  */
 public function transform($array)
 {
     if (!is_array($array)) {
         throw new TransformationFailedException(sprintf('%s is not an array', get_type($array)));
     }
     return implode(',', $array);
 }
Beispiel #6
0
 public function test_load_file()
 {
     $path = path(__DIR__, '/../configs/array.php');
     $driver = new ArrayConfigDriver();
     $config = $driver->loadFile($path);
     $this->assertTrue(get_type($config) == 'array');
     $this->assertEquals(require $path, $config);
 }
Beispiel #7
0
 /**
  *	Creates a new record and adds it to the DB based on the stuff given in $info
  *	@param	info	Array|Zend_Config		The stuff to put in the DB
  *	@return			$this
  */
 protected function _create($info)
 {
     $info instanceof Zend_Config && ($info = $info->toArray());
     if (!is_array($info)) {
         throw new Kizano_Exception(sprintf('%s::%s(): Argument $info expected type (string), received `%s\'', __CLASS__, __FUNCTION__, get_type($info)));
     }
     foreach ($info as $name => $value) {
         $this[$name] = $value;
     }
     return $this->save();
 }
 /**
  * @param IDefinition $definition
  * @param $command
  *
  * @return mixed
  * @throws InvalidCommandHandlerException
  */
 public function invoke(IDefinition $definition, $command)
 {
     $handler = $definition->getHandler();
     if ($this->isValidHandlerClass($handler)) {
         $handler = $this->createHandler($handler);
     }
     if ($this->isValidHandler($handler)) {
         return $this->invokeHandler($handler, $command);
     }
     throw new InvalidCommandHandlerException(s('Handler "%s" must implement method "handle($command)".', is_string($handler) ? $handler : get_type($handler)));
 }
function getImgPath($galleryFolder, $destination_folder, $imgName)
{
    $imgPath = '';
    if ($handle = opendir($destination_folder)) {
        while (false !== ($file = readdir($handle))) {
            if (strpos($file, $imgName) !== false && strpos($file, '_sm') === false) {
                $img = $destination_folder . $file;
                $imgData = base64_encode(file_get_contents($img));
                $imgPath = 'data: ' . get_type($img) . ';base64,' . $imgData;
            }
        }
        closedir($handle);
    }
    return $imgPath;
}
 /**
  * Retrieves the attachments of the specified object
  *
  * @param mixed $object
  * @return WebDev\AttachmentBundle\Attachement\File[]
  */
 public function files($object)
 {
     if (!is_object($object)) {
         throw new Exception("Can't retrieve the attachments of a " . get_type($object));
     }
     $class = new ReflectionClass($object);
     $files = array();
     foreach ($this->reader->getClassAnnotations($class) as $annotation) {
         if (!$annotation instanceof FileAttachment) {
             continue;
         }
         $file = new File($annotation, $object, $this);
         $files[$file->getName()] = $file;
     }
     return $files;
 }
Beispiel #11
0
 public static function nameConstant(SpritePackageInterface $package, SpriteImage $sprite)
 {
     $converter = $package->getConstantsConverter();
     if (!empty($converter)) {
         if (!is_callable($converter, true)) {
             throw new RuntimeException('Variable of type `%s` is not callable', get_type($converter));
         }
         $params = [$package, $sprite];
         $name = call_user_func_array($converter, $params);
     } else {
         $name = $sprite->name;
     }
     // Last resort replacements
     $name = preg_replace('~^[0-9]+~', '', $name);
     return str_replace('-', '_', $name);
 }
 /**
  * @param IRoute $route
  *
  * @return IHttpResponse
  * @throws InvalidRouteValue
  */
 public function invokeRoute(IRoute $route)
 {
     $invoker = $this->findInvoker($route);
     if ($invoker) {
         $response = $invoker->invoke($route, $this->container);
         if ($response instanceof IHttpResponseHolder) {
             $response = $response->getHttpResponse();
         } else {
             if ($response instanceof IHttpResponseable) {
                 $response = $response->toHttpResponse();
             }
         }
         if (!$response instanceof IHttpResponse) {
             $response = new HttpResponse(HttpStatusCode::OK, $response);
         }
         return $response;
     }
     throw new InvalidRouteValue(s('Could not resolve route value of type %s.', get_type($route->getAction())));
 }
 public static function newSubtitle()
 {
     if (!isset($_FILES['newsub_file'])) {
         return null;
     }
     $newsub_amt = count($_FILES['newsub_file']['name']);
     $folder = 'subtitle/';
     $return = array();
     for ($i = 0; $i < $newsub_amt; $i++) {
         $extension = get_type($_FILES['newsub_file']['name'][$i]);
         $name = 'sub_' . strtotime('now') . rand(10000000, 99999999);
         if ($_FILES['newsub_file']['tmp_name'][$i] && $extension == 'srt') {
             $extension = 'srt';
             move_uploaded_file($_FILES['newsub_file']['tmp_name'][$i], UPLOAD_PATH . "{$folder}{$name}.{$extension}");
             $return[$i] = UPLOAD_URL . "{$folder}{$name}.{$extension}";
         } else {
             $return[$i] = null;
         }
     }
     return $return;
 }
Beispiel #14
0
function render_value($dbc, $db_name, $name, $with_def = false)
{
    if (strpos($name, $db_name . ':o') === 0) {
        $id = str_replace($db_name . ':o', "", $name);
        $query = "select * from def where id ='{$id}'";
        $result = mysqli_query($dbc, $query) or die('Error querying database:' . $query);
        if ($row = mysqli_fetch_array($result)) {
            $pre_label = $row[name];
            $def = $row[def];
            $result = get_entity_link($id, get_type($dbc, $name) . ':&nbsp;' . $pre_label, $db_name);
            if ($with_def && $def != '') {
                $result .= '&nbsp;<em><small>(' . tcmks_substr($def) . ')' . '</small></em>';
            }
        } else {
            $result = $name;
        }
    } else {
        $result = $name;
    }
    return $result;
}
Beispiel #15
0
 /**
  * @param $data
  * @param int $options
  *
  * @return string
  * @throws InvalidDataTypeException
  * @throws JsonEncodeException
  */
 public function encode($data, $options = 0)
 {
     $json = null;
     if ($data instanceof IArrayable) {
         $json = @json_encode($data->toArray(), $options);
     } else {
         if ($data instanceof IJsonable) {
             $json = $data->toJson($options);
         } else {
             if (is_array($data) || is_object($data)) {
                 $json = @json_encode($data, $options);
             } else {
                 throw new InvalidDataTypeException(s('Can not convert data of type "%s" to json.', get_type($data)));
             }
         }
     }
     if ($json === false) {
         throw new JsonEncodeException(json_last_error_msg(), $data);
     }
     return $json;
 }
function findBoundingKeys($needle, $haystack)
{
    // Make sure we have an array
    if (!is_array($haystack)) {
        throw new Exception('findBoundingKeys expects $haystack to be an Array, got ' . get_type($haystack));
    }
    // Make sure we have an array of numbers we can compare
    if (max(array_map('is_numeric', $haystack))) {
        throw new Exception('findBoundingKeys expects $haystack to be an Array of numeric values');
    }
    // Sort the array in order from lowest value to highest
    asort($haystack);
    // Rewind the array so we start from the start
    reset($haystack);
    // If the needle is lower than the smallest element in $haystack, return the smallest element
    if ($needle < min($haystack)) {
        return array(key($haystack));
    }
    // If the needle is higher than the largest value in $haystack, return the last element
    if ($needle > max($haystack)) {
        end($haystack);
        return array(key($haystack));
    }
    do {
        // Get the key/value for the current array index
        $current = current($haystack);
        $currentkey = key($haystack);
        // Advance to the next index and get the key/value for that index
        $next = next($haystack);
        $nextkey = key($haystack);
        // Check if the needle is between the current and next elements
        if ($current < $needle && $needle < $next) {
            // If it is, return the current & next elements
            return array($currentkey, $nextkey);
        }
    } while (key($haystack) !== FALSE);
    // Something went utterly wrong, return FALSE
    return FALSE;
}
    print "POST<BR/>\n";
    if (!empty($_POST)) {
        dump($_POST);
    }
}
//	$remotes = get_current();							// set auto-refresh if any mobile units
//	$interval = intval(get_variable('auto_poll'));
//	$refresh = ((($remotes['aprs']) || ($remotes['instam']) || ($remotes['locatea']) || ($remotes['gtrack']) || ($remotes['glat'])) && ($interval>0))? "\t<META HTTP-EQUIV='REFRESH' CONTENT='" . intval($interval*60) . "'>\n": "";
$temp = get_variable('auto_poll');
$poll_val = $temp == 0 ? "none" : $temp;
$id = array_key_exists('id', $_GET) ? $_GET['id'] : NULL;
$result = mysql_query("SELECT * FROM `{$GLOBALS['mysql_prefix']}ticket` WHERE id='{$id}'");
$row = mysql_fetch_assoc($result);
$title = $row['scope'];
$ticket_severity = get_severity($row['severity']);
$ticket_type = get_type($row['in_types_id']);
$ticket_status = get_status($row['status']);
$ticket_updated = format_date_time($row['updated']);
$ticket_addr = "{$row['street']}, {$row['city']} {$row['state']} ";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<HEAD><TITLE>Incident Popup - Incident <?php 
print $title;
?>
 <?php 
print $ticket_updated;
?>
</TITLE>
	<LINK REL=StyleSheet HREF="stylesheet.php?version=<?php 
print time();
Beispiel #18
0
         $name = $domain;
     }
 } else {
     $name = $_REQUEST['name'];
 }
 // verify record to be added
 $result = verify_record($name, $_REQUEST['type'], $_REQUEST['address'], $_REQUEST['distance'], $_REQUEST['weight'], $_REQUEST['port'], $_REQUEST['ttl']);
 if ($result != 'OK') {
     // Set values
     $q = "select * from records where record_id='" . $_REQUEST['record_id'] . "' and domain_id='" . get_dom_id($domain) . "' and type!='S' limit 1";
     $stmt = $pdo->query($q) or die(print_r($pdo->errorInfo()));
     $row = $stmt->fetch();
     $smarty->assign('record_id', $_REQUEST['record_id']);
     $smarty->assign('name', $row['host']);
     $smarty->assign('address', $row['val']);
     $smarty->assign('type', get_type($row['type']));
     $smarty->assign('distance', $row['distance']);
     $smarty->assign('weight', $row['weight']);
     $smarty->assign('port', $row['port']);
     $smarty->assign('ttl', $row['ttl']);
     set_msg_err(htmlentities($result, ENT_QUOTES));
     $smarty->display('header.tpl');
     $smarty->display('edit_record.tpl');
     $smarty->display('footer.tpl');
     exit;
 } else {
     // Update record
     if ($_REQUEST['type'] == 'AAAA' || $_REQUEST['type'] == 'AAAA+PTR') {
         $address = uncompress_ipv6($_REQUEST['address']);
     } else {
         $address = $_REQUEST['address'];
{
    global $argv;
    return strtolower(trim($argv['1']));
}
function get_type()
{
    global $argv;
    return strtolower(trim($argv['2']));
}
###################################################################
# Main code
###################################################################
$agi = new AGI();
$exten = agi_get_variable("USER");
$action = get_action();
$type = get_type();
# VM exists?
if (check_for_voicemail_box($exten)) {
    # Retrieve Spooler directory
    $spool_dir = agi_get_variable('ASTSPOOLDIR');
    # Depending on message type
    switch ($type) {
        case 'temp':
            $play = 'vm-rec-temp';
            $file = $spool_dir . '/voicemail/default/' . $exten . '/temp';
            break;
        case 'name':
            $play = 'vm-rec-name';
            $file = $spool_dir . '/voicemail/default/' . $exten . '/greet';
            break;
        case 'busy':
Beispiel #20
0
<?php

defined('DT_ADMIN') or exit('Access Denied');
$TYPE = get_type('mail', 1);
$menus = array(array('添加邮件', '?moduleid=' . $moduleid . '&file=' . $file . '&action=add'), array('邮件管理', '?moduleid=' . $moduleid . '&file=' . $file), array('订阅列表', '?moduleid=' . $moduleid . '&file=' . $file . '&action=list'), array('订阅分类', 'javascript:Dwidget(\'?file=type&item=' . $file . '\', \'订阅分类\');'));
switch ($action) {
    case 'add':
        if ($submit) {
            $typeid or msg('请选择邮件分类');
            $title or msg('请填写邮件标题');
            $content or msg('请填写邮件内容');
            $content = addslashes(save_remote(save_local(stripslashes($content))));
            $db->query("INSERT INTO {$DT_PRE}mail (title,typeid,content,addtime,editor,edittime) VALUES ('{$title}','{$typeid}','{$content}','{$DT_TIME}','{$_username}','{$DT_TIME}')");
            dmsg('添加成功', $forward);
        } else {
            include tpl('mail_add', $module);
        }
        break;
    case 'edit':
        $itemid or msg();
        if ($submit) {
            $typeid or msg('请选择邮件分类');
            $title or msg('请填写邮件标题');
            $content or msg('请填写邮件内容');
            $content = addslashes(save_remote(save_local(stripslashes($content))));
            $db->query("UPDATE {$DT_PRE}mail SET title='{$title}',typeid='{$typeid}',content='{$content}',editor='{$_username}',edittime='{$DT_TIME}' WHERE itemid={$itemid}");
            dmsg('修改成功', $forward);
        } else {
            $r = $db->get_one("SELECT * FROM {$DT_PRE}mail WHERE itemid={$itemid}");
            $r or msg();
            extract($r);
Beispiel #21
0
    $img_name = $img;
} else {
    if (file_exists('image/' . $img)) {
        unlink('image/' . $img);
    }
    $img_name = $_FILES['file']['name'];
    //function used to be sure this is image
    require '../helpers/filevalidate.php';
    if (!validation($img_name, array('jpg', 'png', 'jpeg'))) {
        // function return false
        header("location: edit_menu.php?id={$id}&msg=error_data");
        die;
    }
    //function used to know file type
    require '../helpers/filetype.php';
    $type = get_type($img_name);
    //class used to resize images
    require_once '../helpers/ImageManipulator.php';
    //to make random name
    $randomstring = substr(str_shuffle("1234567890abcdefghijklmnopqrstuvwxyz"), 0, 15);
    $img_name = $randomstring . ".{$type}";
    $newName = time() . '_';
    $img = new ImageManipulator($_FILES['file']['tmp_name']);
    //resize image
    $newimg = $img->resample(950, 400);
    //put image in file "image"
    $img->save('image/' . $img_name);
}
/*
update in database
*/
Beispiel #22
0
    $update = '';
    include DT_ROOT . '/include/update.inc.php';
    $head_canonical = $linkurl;
    $head_title = $title . $DT['seo_delimiter'] . $head_title;
    $head_keywords = $keyword;
    $head_description = $introduce ? $introduce : $title;
    if ($EXT['mobile_enable']) {
        $head_mobile = $EXT['mobile_url'] . mobileurl($moduleid, 0, $itemid, $page);
    }
} else {
    $typeid = isset($typeid) ? intval($typeid) : 0;
    $view = isset($view) ? 1 : 0;
    $url = "file={$file}";
    $condition = "username='******' AND status=3";
    if ($typeid) {
        $MTYPE = get_type('mall-' . $userid);
        $condition .= " AND mycatid='{$typeid}'";
        $url .= "&typeid={$typeid}";
        $head_title = $MTYPE[$typeid]['typename'] . $DT['seo_delimiter'] . $head_title;
    }
    if ($kw) {
        $condition .= " AND keyword LIKE '%{$keyword}%'";
        $url .= "&kw={$kw}";
        $head_title = $kw . $DT['seo_delimiter'] . $head_title;
    }
    if ($view) {
        $url .= "&view={$view}";
    }
    $demo_url = userurl($username, $url . '&page={destoon_page}', $domain);
    $pagesize = intval($menu_num[$menuid]);
    if (!$pagesize || $pagesize > 100) {
Beispiel #23
0
$user_comment = new user_commentBean($db, 'user_comment');
switch ($act) {
    case 'list':
        //商家列表
        $result = get_list($db, $user_comment, $user_order, $shop_info);
        break;
    case 'info':
        //商家信息
        $result = detail($db, $shop_info, $user_comment, $user_order);
        break;
    case 'order_list':
        //获取商家订单列表
        $result = get_order_list($sid, $user_order, $sys_user, $sys_dict, $user_order_goods);
        break;
    case 'type':
        $result = get_type($db, $sys_dict);
        break;
    case 'trading_mode':
        $result = trading_mode($sid, $shop_info);
        //获取商家交易模式
        break;
    case 'search_shop':
        $result = search_shop($db, $user_comment, $user_order, $shop_info);
        //模糊查询店铺
        break;
    default:
        $result = array('success' => false, 'result' => -1, 'error_msg' => "传入参数有误!");
        break;
}
/*
 * 功能:商家列表
Beispiel #24
0
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" style="text-align:center">
                                    <thead style="text-align:center">
                                        <tr>
                                            <th style="width: 10% ; text-align:center">ID</th>
							    			<th style="width: 20% ; text-align:center">Categories</th>
							    			<th style="width: 40% ; text-align:center">Type Name</th>
                                        </tr>
                                    </thead>

                                    <tbody>
									<?php 
// get TYPE in DB
$result = get_type();
if (mysqli_num_rows($result) > 0) {
    while ($list = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
        ?>
						 				<tr>
							                <td style='text-align:center' ><?php 
        echo $list['type_id'];
        ?>
</td>
							                <td style='text-align:left'><?php 
        echo $list['cat_name'];
        ?>
</td>
							                <td style='text-align:left'><?php 
        echo $list['type_name'];
        ?>
function build_row()
{
    $args = func_get_args();
    $array[0] = $args[1][8];
    if ($args[1][2] != "" && $args[0]["owner"]) {
        $array[1] = $args[1][2] . ":" . $args[1][3];
    } else {
        $array[1] = "&nbsp;";
    }
    if ($args[1][5] != "" && $args[0]["date"]) {
        $array[2] = $args[1][5] . " " . $args[1][6];
    } else {
        $array[2] = "&nbsp;";
    }
    if ($args[1][7] != "" && $args[0]["date"]) {
        $array[3] = $args[1][7];
    } else {
        $array[3] = "&nbsp;";
    }
    if ($args[1][4] != "" && $args[0]["size"]) {
        $array[4] = convert_size($args[1][4]);
    } else {
        $array[4] = "&nbsp;";
    }
    if ($args[1][0] != "" && $args[0]["perm"]) {
        $array[5] = build_perm($args[1][8], $args[1][0]);
    } else {
        $array[5] = "&nbsp;";
    }
    $array[6] = $args[2];
    $array[7] = get_type($args[2], $args[1][8]);
    if (func_num_args() == "4") {
        $array[8] = $args[3];
    } else {
        $array[8] = $args[1][8];
    }
    return $array;
}
function do_ticket($theRow, $theWidth, $search = FALSE, $dist = TRUE)
{
    // returns table - 6/26/10
    global $iw_width, $nature, $disposition, $patient, $incident, $incidents;
    // 12/3/10
    $tickno = get_variable('serial_no_ap') == 0 ? "&nbsp;&nbsp;<I>(#" . $theRow['id'] . ")</I>" : "";
    // 1/25/09
    switch ($theRow['severity']) {
        //color tickets by severity
        case $GLOBALS['SEVERITY_MEDIUM']:
            $severityclass = 'severity_medium';
            break;
        case $GLOBALS['SEVERITY_HIGH']:
            $severityclass = 'severity_high';
            break;
        default:
            $severityclass = 'severity_normal';
            break;
    }
    $print = "<TABLE BORDER='0' ID='left' width='" . $theWidth . "'>\n";
    //
    $print .= "<TR CLASS='even'><TD ALIGN='left' CLASS='td_data' COLSPAN=2 ALIGN='center'><B>{$incident}: <I>" . highlight($search, $theRow['scope']) . "</B>" . $tickno . "</TD></TR>\n";
    $print .= "<TR CLASS='odd' ><TD ALIGN='left'>" . get_text("Addr") . ":</TD>\t\t<TD ALIGN='left'>" . highlight($search, $theRow['tick_street']) . "</TD></TR>\n";
    $print .= "<TR CLASS='even' ><TD ALIGN='left'>" . get_text("City") . ":</TD>\t\t\t<TD ALIGN='left'>" . highlight($search, $theRow['tick_city']);
    $print .= "&nbsp;&nbsp;" . highlight($search, $theRow['tick_state']) . "</TD></TR>\n";
    $print .= "<TR CLASS='odd' ><TD ALIGN='left'>" . get_text("Priority") . ":</TD> <TD ALIGN='left' CLASS='" . $severityclass . "'>" . get_severity($theRow['severity']);
    $print .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$nature}:&nbsp;&nbsp;" . get_type($theRow['in_types_id']);
    $print .= "</TD></TR>\n";
    $print .= "<TR CLASS='even'  VALIGN='top'><TD ALIGN='left'>" . get_text("Synopsis") . ":</TD>\t<TD ALIGN='left'>" . replace_quotes(highlight($search, nl2br($theRow['tick_descr']))) . "</TD></TR>\n";
    //	8/12/09
    $print .= "<TR CLASS='odd' ><TD ALIGN='left'>" . get_text("Protocol") . ":</TD> <TD ALIGN='left' CLASS='{$severityclass}'>{$theRow['protocol']}</TD></TR>\n";
    // 7/16/09
    $print .= "<TR CLASS='even'  VALIGN='top'><TD ALIGN='left'>" . get_text("911 Contacted") . ":</TD>\t<TD ALIGN='left'>" . highlight($search, nl2br($theRow['nine_one_one'])) . "</TD></TR>\n";
    //	6/26/10
    $print .= "<TR CLASS='odd'><TD ALIGN='left'>" . get_text("Reported by") . ":</TD>\t<TD ALIGN='left'>" . highlight($search, $theRow['contact']) . "</TD></TR>\n";
    $print .= "<TR CLASS='even' ><TD ALIGN='left'>" . get_text("Phone") . ":</TD>\t\t\t<TD ALIGN='left'>" . format_phone($theRow['phone']) . "</TD></TR>\n";
    $end_date = intval($theRow['problemend']) > 1 ? $theRow['problemend'] : time() - intval(get_variable('delta_mins')) * 60;
    $elapsed = my_date_diff($theRow['problemstart'], $end_date);
    $elaped_str = intval($theRow['problemend']) > 1 ? "" : "&nbsp;&nbsp;&nbsp;&nbsp;({$elapsed})";
    $print .= "<TR CLASS='odd'><TD ALIGN='left'>" . get_text("Status") . ":</TD>\t\t<TD ALIGN='left'>" . get_status($theRow['status']) . "{$elaped_str}</TD></TR>\n";
    $by_str = $theRow['call_taker'] == 0 ? "" : "&nbsp;&nbsp;by " . get_owner($theRow['call_taker']) . "&nbsp;&nbsp;";
    // 1/7/10
    $print .= "<TR CLASS='even'><TD ALIGN='left'>" . get_text("Written") . ":</TD>\t\t<TD ALIGN='left'>" . format_date($theRow['date']) . $by_str;
    $print .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Updated:&nbsp;&nbsp;" . format_date($theRow['updated']) . "</TD></TR>\n";
    $print .= empty($theRow['booked_date']) ? "" : "<TR CLASS='odd'><TD ALIGN='left'>Scheduled date:</TD>\t\t<TD ALIGN='left'>" . format_date($theRow['booked_date']) . "</TD></TR>\n";
    // 10/6/09
    $print .= "<TR CLASS='even' ><TD ALIGN='left' COLSPAN='2'>&nbsp;\t<TD ALIGN='left'></TR>\n";
    // separator
    $print .= empty($theRow['fac_name']) ? "" : "<TR CLASS='odd' ><TD ALIGN='left'>{$incident} at Facility:</TD>\t\t<TD ALIGN='left'>" . highlight($search, $theRow['fac_name']) . "</TD></TR>\n";
    // 8/1/09
    $print .= empty($theRow['rec_fac_name']) ? "" : "<TR CLASS='even' ><TD ALIGN='left'>Receiving Facility:</TD>\t\t<TD ALIGN='left'>" . highlight($search, $theRow['rec_fac_name']) . "</TD></TR>\n";
    // 10/6/09
    $print .= empty($theRow['comments']) ? "" : "<TR CLASS='odd'  VALIGN='top'><TD ALIGN='left'>{$disposition}:</TD>\t<TD ALIGN='left'>" . replace_quotes(highlight($search, nl2br($theRow['comments']))) . "</TD></TR>\n";
    $print .= "<TR CLASS='even' ><TD ALIGN='left'>" . get_text("Run Start") . ":</TD>\t\t\t\t\t<TD ALIGN='left'>" . format_date($theRow['problemstart']);
    $elaped_str = intval($theRow['problemend']) > 1 ? $elapsed : "";
    $print .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End:&nbsp;&nbsp;" . format_date($theRow['problemend']) . "&nbsp;&nbsp;({$elaped_str})</TD></TR>\n";
    $locale = get_variable('locale');
    // 08/03/09
    switch ($locale) {
        case "0":
            $grid_type = "&nbsp;&nbsp;&nbsp;&nbsp;USNG&nbsp;&nbsp;" . LLtoUSNG($theRow['lat'], $theRow['lng']);
            break;
        case "1":
            $grid_type = "&nbsp;&nbsp;&nbsp;&nbsp;OSGB&nbsp;&nbsp;" . LLtoOSGB($theRow['lat'], $theRow['lng']);
            // 8/23/08, 10/15/08, 8/3/09
            break;
        case "2":
            $coords = $theRow['lat'] . "," . $theRow['lng'];
            // 8/12/09
            $grid_type = "&nbsp;&nbsp;&nbsp;&nbsp;UTM&nbsp;&nbsp;" . toUTM($coords);
            // 8/23/08, 10/15/08, 8/3/09
            break;
        default:
            print "ERROR in " . basename(__FILE__) . " " . __LINE__ . "<BR />";
    }
    $print .= "<TR CLASS='odd'><TD ALIGN='left' onClick = 'javascript: do_coords(" . $theRow['lat'] . "," . $theRow['lng'] . ")'><U>" . get_text("Position") . "</U>: </TD>\n\t\t<TD ALIGN='left'>" . get_lat($theRow['lat']) . "&nbsp;&nbsp;&nbsp;" . get_lng($theRow['lng']) . $grid_type . "</TD></TR>\n";
    // 9/13/08
    $print .= "<TR><TD colspan=2 ALIGN='left'>";
    $print .= show_log($theRow[0]);
    // log
    $print .= "</TD></TR>";
    $print .= "<TR STYLE = 'display:none;'><TD colspan=2><SPAN ID='oldlat'>" . $theRow['lat'] . "</SPAN><SPAN ID='oldlng'>" . $theRow['lng'] . "</SPAN></TD></TR>";
    $print .= "</TABLE>\n";
    $print .= show_assigns(0, $theRow[0]);
    // 'id' ambiguity - 7/27/09
    $print .= show_actions($theRow[0], "date", FALSE, FALSE);
    return $print;
}
Beispiel #27
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
$TYPE = get_type('ask', 1);
$menus = array(array('客服中心', '?moduleid=' . $moduleid . '&file=' . $file), array('问题分类', 'javascript:Dwidget(\'?file=type&item=' . $file . '\', \'问题分类\');'));
$stars = array('', '<span style="color:red;">不满意</span>', '基本满意', '<span style="color:green;">非常满意</span>');
switch ($action) {
    case 'edit':
        $itemid or msg();
        if ($submit) {
            if ($status == 2 && !$reply) {
                msg('回复内容不能为空');
            }
            $reply = addslashes(save_remote(save_local(stripslashes($reply))));
            $db->query("UPDATE {$DT_PRE}ask SET status={$status},admin='{$_username}',admintime='{$DT_TIME}',reply='{$reply}' WHERE itemid={$itemid}");
            dmsg('受理成功', $forward);
        } else {
            $r = $db->get_one("SELECT * FROM {$DT_PRE}ask WHERE itemid={$itemid}");
            $r or msg();
            extract($r);
            $addtime = timetodate($addtime, 5);
            $admintime = timetodate($admintime, 5);
            include tpl('ask_edit', $module);
        }
        break;
    case 'delete':
        $itemid or msg();
        $db->query("DELETE FROM {$DT_PRE}ask WHERE itemid={$itemid} ");
        dmsg('删除成功', '?moduleid=' . $moduleid . '&file=' . $file);
        break;
    default:
Beispiel #28
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
login();
require DT_ROOT . '/module/' . $module . '/common.inc.php';
if ($_groupid > 5 && !$_edittime && $action == 'add') {
    dheader($MODULE[2]['linkurl'] . 'edit.php?tab=2');
}
$MG['homepage'] && $MG['news_limit'] > -1 or dalert(lang('message->without_permission_and_upgrade'), 'goback');
require DT_ROOT . '/include/post.func.php';
$TYPE = get_type('news-' . $_userid);
require MD_ROOT . '/news.class.php';
$do = new news();
switch ($action) {
    case 'add':
        if ($MG['news_limit']) {
            $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}news WHERE username='******' AND status>0");
            if ($r['num'] >= $MG['news_limit']) {
                dalert(lang($L['limit_add'], array($MG['news_limit'], $r['num'])), 'goback');
            }
        }
        if ($submit) {
            if ($do->pass($post)) {
                $post['username'] = $_username;
                $post['level'] = $post['addtime'] = 0;
                $need_check = $MOD['news_check'] == 2 ? $MG['check'] : $MOD['news_check'];
                $post['status'] = get_status(3, $need_check);
                $do->add($post);
                dmsg($L['op_add_success'], '?status=' . $post['status']);
            } else {
                message($do->errmsg);
Beispiel #29
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
$TYPE = get_type('link', 1);
require MD_ROOT . '/link.class.php';
$do = new dlink();
$menus = array(array('添加链接', '?moduleid=' . $moduleid . '&file=' . $file . '&action=add'), array('链接列表', '?moduleid=' . $moduleid . '&file=' . $file), array('审核链接', '?moduleid=' . $moduleid . '&file=' . $file . '&action=check'), array('链接分类', 'javascript:Dwidget(\'?file=type&item=' . $file . '\', \'链接分类\');'), array('模块设置', '?moduleid=' . $moduleid . '&file=setting#' . $file));
if ($_catids || $_areaids) {
    require DT_ROOT . '/admin/admin_check.inc.php';
}
$this_forward = '?moduleid=' . $moduleid . '&file=' . $file;
if (in_array($action, array('', 'check'))) {
    $sorder = array('结果排序方式', '更新时间降序', '更新时间升序', '是否文字降序', '是否文字升序', '是否推荐降序', '是否推荐升序');
    $dorder = array('listorder DESC,itemid DESC', 'edittime DESC', 'eidttime ASC', 'type DESC', 'type ASC', 'elite DESC', 'elite ASC');
    $stype = array('类型', '文字', 'LOGO');
    $dtype = array('0', '1', '2');
    $level = isset($level) ? intval($level) : 0;
    $typeid = isset($typeid) ? intval($typeid) : 0;
    $type = isset($type) ? intval($type) : 0;
    isset($order) && isset($dorder[$order]) or $order = 0;
    $type_select = type_select('link', 1, 'typeid', '请选择分类', $typeid);
    $order_select = dselect($sorder, 'order', '', $order);
    $level_select = level_select('level', '级别', $level);
    $_type_select = dselect($stype, 'type', '', $type);
    $condition = '';
    if ($_areaids) {
        $condition .= " AND areaid IN (" . $_areaids . ")";
    }
    //CITY
    if ($keyword) {
        $condition .= " AND title LIKE '%{$keyword}%'";
Beispiel #30
0
 /**
  * @param $class
  * @param $instance
  *
  * @throws TypeMismatchException
  */
 protected function matchClassType($class, $instance)
 {
     if (!$this->isInStrictMode()) {
         return;
     }
     if (!$instance instanceof $class) {
         throw new TypeMismatchException(s('Container expects an implementation of type %s, %s given.', $class, get_type($instance)));
     }
 }