コード例 #1
0
ファイル: Face.php プロジェクト: Crocodile26/php-1
 public function _face($uid, $data)
 {
     $uid = intval($uid);
     $info = Face::findFirst("uid={$uid}");
     if (!$info) {
         $info = new Face();
         $info->addtime = time();
     }
     $info->uptime = time();
     $info->uid = $uid;
     foreach ($data as $field => $value) {
         $info->{$field} = $value;
     }
     $result = $info->save();
     if (!$result) {
         $this->outputErrors($info);
     }
     return true;
 }
コード例 #2
0
ファイル: Face.php プロジェクト: 3116246/haolinju
 public static function getFaceEmoteImg_GIF($repacestr)
 {
     if (count(Face::$FaceEmoteImg) == 0 || Face::$FaceEmoteImgReplaceStr != $repacestr) {
         Face::$FaceEmoteImgReplaceStr = $repacestr;
         Face::$FaceEmoteImg = array_map(function ($item) {
             return preg_replace("/\\[IMGSRC\\]/", $item, Face::$FaceEmoteImgReplaceStr);
         }, array_values(Face::$FaceEmotes_GIF));
     }
     return Face::$FaceEmoteImg;
 }
コード例 #3
0
ファイル: Wechat.php プロジェクト: devsnippet/MyWechat
    sae_log("用户取消关注: " . $event->openid);
    $mysql = new SaeMysql();
    $signup = "update  wechat_user set isFollow = 0, unfollowTime = '" . date("Y/m/d-H:i:s") . "'WHERE\n    openid='{$event->FromUserName}'";
    $mysql->runSql($signup);
    sae_log($mysql->errno() . "-" . $mysql->errmsg());
    $mysql->closeDb();
});
//文字消息处理,调用图灵机器人
$server->on('message', 'text', function ($message) use($welcome) {
    //四六级查分-备份考号
    return handleText($message->Content, $message->FromUserName, $welcome);
});
//图片处理,调用微软API
$server->on('message', 'image', function ($image) {
    $picUrl = $image->PicUrl;
    $face = new Face($picUrl);
    $info = $face->info;
    if ($info !== false) {
        $amount = count($info);
        $description = "";
        $title = "";
        if ($info === array()) {
            $title .= "照片中木有人脸/:fade";
        } else {
            $savedUrl = $face->save();
            $title .= "照片中共检测到{$amount}张脸 点击查看大图";
            for ($i = 0; $i < $amount; $i++) {
                if ($amount > 1) {
                    $description .= sprintf("\n第%s张脸\n", $i + 1);
                }
                $attr = $info[$i]['attributes'];
コード例 #4
0
ファイル: Loan.php プロジェクト: Crocodile26/php-1
 public static function advise($uid, $foid, $adviseType, $reason, $loan = false)
 {
     $isLoanSketch = false;
     switch ($adviseType) {
         case 'loansketch':
             $status = \App\LoanStatus::getStatusSketch();
             $oid = User::findFirst("uid={$uid}")->oid;
             $isLoanSketch = true;
             break;
         case 'visit':
             $status = \App\LoanStatus::getStatusCarAssess();
             $oid = Visit::findFirst("uid={$uid}")->oid;
             $isLoanSketch = true;
             break;
         case 'car':
             $status = \App\LoanStatus::getStatusVisit();
             $oid = Car::findFirst("uid={$uid}")->oid;
             $isLoanSketch = true;
             break;
         case 'face':
             $status = \App\LoanStatus::getStatusChecked();
             $oid = Face::findFirst("uid={$uid}")->oid;
             $isLoanSketch = true;
             break;
     }
     if (empty($oid)) {
         return false;
     }
     if ($isLoanSketch) {
         $model = LoanSketch::findFirst("uid={$uid}");
         $model->status = $status;
         $model->update();
     }
     Advise::add($uid, $oid, $foid, $adviseType, $reason);
     return true;
 }
コード例 #5
0
ファイル: lib.visual.php プロジェクト: r3c130n/scriptacid
    public static function GetPageParametersForm($pageUrl, $arParams)
    {
        $html = "";
        $parser = new Parser($pageUrl);
        if ($parser) {
            $html = "";
            //'<script type="text/javascript" src="/scriptacid/lib/gpl/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>';
            $html .= '<script type="text/javascript">
tinyMCE.init({
		// General options
		mode : "textareas",
		language : "ru",
		editor_selector: "editor_' . $arParams['editorName'] . '",
		theme : "advanced",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",
		valid_elements: "*[*]",
		invalid_elements: "object,applet,iframe",

		// Replace values for the template plugin
		template_replace_values : {
			username : "******",
			staffid : "991234"
		}
	});</script>';
            $html .= '<form onSubmit="SavePage($(\'#' . $arParams['editorName'] . '\').val());return false;">';
            $html .= '<textarea id="' . $arParams['editorName'] . '" name="' . $arParams['editorName'] . '" class="editor_' . $arParams['editorName'] . '" rows="20" cols="30" style="width: 100%">' . $parser->pageContent . '</textarea>';
            $html .= '</form>';
            return $html;
        } else {
            return "No content";
        }
        $arPageParameters = array();
        $form = '<form class="dialog-window-form-form">';
        $form .= '<table class="dialog-window-form-table styled">';
        foreach ($arPageParameters['PARAMETERS'] as $name => $parameter) {
            $form .= Face::GetParameterHTML($name, $parameter, $arParams[$name]);
        }
        $form .= '</table>';
        $form .= '</form>';
        return $form;
    }
コード例 #6
0
ファイル: User.php プロジェクト: Crocodile26/php-1
 /**
  * 获取贷款所有信息、全国风控提交之前的数据
  */
 public static function infos($uid, $level = '*')
 {
     $uid = intval($uid);
     $infos = [];
     $infos['user'] = self::findFirst("uid={$uid}")->toArray();
     $isArray = is_array($level);
     $all = $level == '*';
     if ($all || ($isArray and in_array('loansketch', $level))) {
         $infos['loansketch'] = LoanSketch::findByUid($uid);
         $infos['loansketch_advises'] = Advise::getAdvisesByUid($uid, Advise::STATUS_UNDO, 'loansketch');
     }
     //面审
     if ($all || ($isArray and in_array('face', $level))) {
         $infos['face'] = Face::findByUid($uid);
         $infos['face_advises'] = Advise::getAdvisesByUid($uid, Advise::STATUS_UNDO, 'face');
     }
     //外访
     if ($all || ($isArray and in_array('visit', $level))) {
         $infos['visit'] = Visit::findByUid($uid);
         $infos['visit_advises'] = Advise::getAdvisesByUid($uid, Advise::STATUS_UNDO, 'visit');
     }
     //车评
     if ($all || ($isArray and in_array('car', $level))) {
         $infos['car'] = Car::findByUid($uid);
         $infos['car_advises'] = Advise::getAdvisesByUid($uid, Advise::STATUS_UNDO, 'car');
     }
     if ($all || ($isArray and in_array('car_files', $level))) {
         $infos['car_files'] = Files::getFilesByUid($uid, \App\Config\Loan::uploadTypes('car'));
     }
     //贷款
     if ($all || ($isArray and in_array('loan', $level))) {
         $infos['loan'] = Loan::findByUid($uid);
     }
     return $infos;
 }
コード例 #7
0
ファイル: index.php プロジェクト: r3c130n/scriptacid
<?php

namespace ScriptAcid;

/**
 * @name Показывает форму редактирования параметров компонент
 * @example Запрашивается с помощью AJAX запроса
 * @author r3c130n
 * @deprecated не трогать
 */
if (!empty($_GET['show'])) {
    require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
    switch ($_GET['show']) {
        case 'params':
            if (!empty($_GET['arParams']['componentUrl']) && is_dir($_SERVER["DOCUMENT_ROOT"] . $_GET['arParams']['componentUrl']) && !empty($_GET['arParams']['templateUrl']) && is_dir($_SERVER["DOCUMENT_ROOT"] . $_GET['arParams']['templateUrl'])) {
                echo Component::GetParametersForm($_GET['arParams']['componentUrl'], $_GET['arParams']['templateUrl'], $_GET['arParams']);
            }
            break;
        case 'page-params':
            echo Face::GetPageParametersForm($_GET['arParams']['pageUrl'], $_GET['arParams']);
            break;
        default:
            break;
    }
}
コード例 #8
0
 /**
  * Показать системную панель
  * @return html
  */
 function showPanel()
 {
     return Face::EditorPanel($_SERVER['PHP_SELF']);
 }