Exemple #1
0
function recommendCreate($survey_code, $rule, $number)
{
    // 先删除旧推荐规则
    M(TB_BAS_SURVEY_RECOMMEND)->where("survey_code = '{$survey_code}'")->delete();
    M(TB_BAS_SURVEY_RECOMMEND_RULE)->where("survey_code = '{$survey_code}'")->delete();
    // 根据调查状态确定推荐规则初状态
    $recommend['recommend_state'] = M(TB_BAS_SURVEY_INFO)->where("survey_code = '{$survey_code}'")->getField('survey_state');
    // 生成推荐信息
    $recommend['survey_code'] = $survey_code;
    // 调查编码
    $recommend['recommend_grade'] = 1;
    // 推荐优先级
    $recommend['recommend_number'] = $number;
    // 推荐数量
    $recommend['state_time'] = date('Y-m-d H:i:s');
    // 状态时间
    // 生成推荐规则信息
    // 插入推荐规则表
    if (insertTable(TB_BAS_SURVEY_RECOMMEND, $recommend)) {
        for ($i = 0; $i < sizeof($rule); $i++) {
            $data['survey_code'] = $survey_code;
            // 调查编码
            $data['rule_key'] = $rule[$i]['rule_key'];
            // 推荐规则字段
            $data['rule_logic'] = $rule[$i]['rule_logic'];
            // 推荐规则逻辑
            $data['rule_value'] = $rule[$i]['rule_value'];
            // 推荐规则对应值
            $data['rule_sql'] = $rule[$i]['rule_sql'];
            // 推荐规则对应SQL语句
            $data['state_time'] = $recommend['state_time'];
            // 状态时间
            // 插入推荐规则表
            if (!insertTable(TB_BAS_SURVEY_RECOMMEND_RULE, $data)) {
                return false;
            }
        }
        return true;
    } else {
        return false;
    }
}
Exemple #2
0
function uploadFileForServer($name, $file)
{
    $arr = array_keys($file);
    $nameArr = implode($arr);
    $types = array('image/gif', 'image/png', 'image/jpeg');
    $size = 1024000;
    $nameGen = substr(md5(rand()), 0, 7);
    $typeFile = $_FILES[$nameArr]['type'];
    $newName = renameFile($nameGen, $typeFile);
    $upload = DIR . '/' . $newName;
    $name = empty($name) ? 'no name' : $name;
    $tupefile = $_FILES[$nameArr]['type'];
    if (in_array($_FILES[$nameArr]['type'], $types) && $_FILES[$nameArr]['size'] < $size) {
        if (is_uploaded_file($_FILES[$nameArr]['tmp_name'])) {
            connectDB();
            insertTable($newName, $name);
            return move_uploaded_file($_FILES[$nameArr]['tmp_name'], $upload);
        }
    }
}
Exemple #3
0
}
if (isset($_POST['hashtag'])) {
    $keyword = $_POST['hashtag'];
    //$output = shell_exec("E:\PROGRA~1\R\R-3.2.2\bin\\rscript.exe WordCloud.R $keyword");//supply path to your Rscript.exe file
    $output = shell_exec("C:\\PROGRA~1\\R\\R-3.2.2\\bin\\rscript.exe WordCloud.R {$keyword}");
    //supply path to your Rscript.exe file
    //echo "Result contains ";
    // echo "<pre>$output</pre>";
    $table = get_string_between($output, "table-start", "table-end");
    $filename = get_string_between($output, "filename-start", "filename-end");
    $filename = substr($filename, 5, -2);
    //echo "<pre>$table</pre>";
    //$values = explode("\n",$table);
    //echo "X axis = ".$values[1]." \n Y axis = ".$values[2]."";
    //echo $filename;
    insertTable($filename, $keyword);
}
?>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Home</title>

    <!-- Bootstrap core CSS -->

    <link href="css/bootstrap.min.css" rel="stylesheet">
Exemple #4
0
    $cp = $_REQUEST['zip'];
    $pais = $_REQUEST['user_pais'];
    $tel = $_REQUEST['phone'];
    $movil = $_REQUEST['mobile'];
    $city = $_REQUEST['city'];
    $id_user = $_GET['i'];
    $user_data = updateTable("user", "name = '{$name}',lastname= '{$lastname}',dob='{$dob}',act='{$user_act}',gender='{$gender}'", "id = '{$_GET['i']}'");
    updateTable("user_det", "description = '{$desc}'", "id_user = '******' AND id_data = '2'");
    updateTable("user_det", "description = '{$direccion}'", "id_user = '******' AND id_data = '3'");
    updateTable("user_det", "description = '{$cp}'", "id_user = '******' AND id_data = '4'");
    updateTable("user_det", "description = '{$pais}'", "id_user = '******' AND id_data = '5'");
    updateTable("user_det", "description = '{$tel}'", "id_user = '******' AND id_data = '6'");
    updateTable("user_det", "description = '{$city}'", "id_user = '******' AND id_data = '10'");
    $md = getUserData($id_user, "7");
    if (empty($md)) {
        insertTable("user_det", "'',{$id_user},'7','{$movil}'");
    } else {
        updateTable("user_det", "description = '{$movil}'", "id_user = '******' AND id_data = '7'");
    }
    if ($user_data != false) {
        ?>
<script>
	alert("Se ha modificado el usuario correctamente.");
	window.location="usuarios.php";
	</script>
    <?php 
    } else {
        ?>
    <script>
	alert("No se ha  podido modificar el usuario correctamente.");
	window.history.back();
Exemple #5
0
<!DOCTYPE html>
    <html>
        <head>
            <title>Setting up Fun Quiz database</title>
        </head>
        <body>

            <h3>Setting up...</h3>

    <?php 
require_once 'functions.php';
//Haomin liu,12109377,assignment 2,quizfun
createTable("question", "question_id INT(10) unsigned NOT NULL AUTO_INCREMENT,\n                        question_text VARCHAR(256) DEFAULT NULL,\n                        question_category VARCHAR(16) DEFAULT NULL,\n                        INDEX(question_text(20)),\n                        INDEX(question_category(4)),\n                        PRIMARY KEY(question_id)");
createTable("question_option", "option_id INT(10) unsigned NOT NULL AUTO_INCREMENT,\n                        question_id INT(10) unsigned DEFAULT NULL,\n                        option_text VARCHAR(128) DEFAULT NULL,\n                        is_right_option enum('0','1') DEFAULT '0',\n                        INDEX(option_text(20)),\n                        PRIMARY KEY(option_id),\n                        FOREIGN KEY (question_id) \n                            REFERENCES question(question_id)\n                            ON DELETE CASCADE");
createTable("members", "username VARCHAR(16) NOT NULL,\n                      password VARCHAR(32) NOT NULL,\n                      score INT(10) DEFAULT NULL,\n                      INDEX(username(6)),\n                      PRIMARY KEY(username)");
createTable("profiles", "username VARCHAR(16)NOT NULL,\n                      profile_text VARCHAR(4096) NOT NULL,\n                      INDEX(username(6)),\n                      PRIMARY KEY(username)");
insertTable("question", "(1, 'What does PHP stand for?','PHP'),\n                        (2, 'Which of the following is NOT a magic predefined constant?','PHP'),\n                        (3, 'Which of the following is NOT a valid PHP comparison operator?','PHP'),\n                        (4, 'A value that has no defined value is expressed in PHP with the following keyword:','PHP'),\n                        (5, 'Which of the following is used to declare a constant?','PHP'),\n                        (6, 'You can add names to each frame window using which setting in HTML?','HTML'),\n                        (7, 'Use what to prevent confusion on numbers higher than 9 with hexadecimal colors ?','HTML'),\n                        (8, 'What type of file do you have to use when you are saving a new page?','HTML'),\n                        (9, 'All normal webpages consist of what two parts ?','HTML'),\n                        (10, 'What character is used to indicate an end tag?','HTML'),\n                        (11, 'To remove duplicate rows from the result set of a SELECT use the following keyword:','Mysql'),\n                        (12, 'Which of the following can add a row to a table?','Mysql'),\n                        (13, 'Which SQL statement is used to insert a new data in a database?','Mysql'),\n                        (14, 'A SELECT command without a WHERE clause returns?','Mysql'),\n                        (15, 'What SQL clause is used to restrict the rows returned by a query?','Mysql'),\n                        (16, 'Which built-in method returns the length of the string?','JAVASCRIPT'),\n                        (17, 'Which of the following function of String object combines the text of two strings and returns a new string?','JAVASCRIPT'),\n                        (18, 'Which of the following is true?','JAVASCRIPT'),\n                        (19, 'What is mean by \"this\" keyword in javascript?','JAVASCRIPT'),\n                        (20, 'If x=103 & y=9 then x%=y , what is the value of x after executing x%=y?','JAVASCRIPT');");
insertTable("question_option", "(1, 1, 'Preprocessed Hypertext Page','0'),\n                        (2, 1, 'Hypertext Markup Language','0'),\n                        (3, 1, 'PHP: Hypertext Preprocessor', '1'),\n                        (4, 1, 'PHypertext Transfer Protocol','0'),\n                        (5, 1, 'Hypertext Make Language','0'),\n                        (6, 2, '__LINE__','0'),\n                        (7, 2, '__FILE__','0'),\n                        (8, 2, '__CLASS__', '0'),\n                        (9, 2, '__DIR__','0'),\n                        (10, 2, '__DATE__','1'),\n                        (11, 3, '!=','0'),\n                        (12, 3, '>=','0'),\n                        (13, 3, '<=>','1'),\n                        (14, 3, '<>','0'),\n                        (15, 3, '===','0'),\n                        (16, 4, 'undef','1'),\n                        (17, 4, 'null','0'),\n                        (18, 4, 'none','0'),\n                        (19, 4, 'There is no such concept in PHP','0'),\n                        (20, 4, 'None of the above is true','0'),\n                        (21, 5, 'const','0'),\n                        (22, 5, 'constant','0'),\n                        (23, 5, 'define','1'),\n                        (24, 5, '#pragma','0'),\n                        (25, 5, 'def','0'),\n                        (26, 6, 'name','1'),\n                        (27, 6, 'src','1'),\n                        (28, 6, 'ur','0'),\n                        (29, 6, 'url','0'),\n                        (30, 6, 'address','0'),\n                        (31, 7, '#','1'),\n                        (32, 7, '!','0'),\n                        (33, 7, '*','0'),\n                        (34, 7, '%','0'),\n                        (35, 7, '\$','0'),\n                        (36, 8, 'HTML File (*.*)','0'),\n                        (37, 8, 'Web based.doc (*.*)','0'),\n                        (38, 8, 'All Files (*.*)','1'),\n                        (39, 8, 'Web Page, complete (*.htm, *.html)','0'),\n                        (40, 8, 'Text File (*.*)','0'),\n                        (41, 9, 'Head and body','1'),\n                        (42, 9, 'Top and bottom','0'),\n                        (43, 9, 'Head and footer','0'),\n                        (44, 9, 'Body and frameset','0'),\n                        (45, 9, 'Body and top','0'),\n                        (46, 10, '<','0'),\n                        (47, 10, '>','0'),\n                        (48, 10, '=','0'),\n                        (49, 10, '-','0'),\n                        (50, 10, '/','1'),\n                        (51, 11, 'NO DUPLICATE','0'),\n                        (52, 11, 'UNIQUE','0'),\n                        (53, 11, 'DISTINCT','1'),\n                        (54, 11, 'DUPLICATE','0'),\n                        (55, 11, 'None of the above','0'),\n                        (56, 12, 'ADD','0'),\n                        (57, 12, 'INSERT','1'),\n                        (58, 12, 'UPDATE','0'),\n                        (59, 12, 'ALTER','0'),\n                        (60, 12, 'SELECT','0'),\n                        (61, 13, 'INSERT INTO','1'),\n                        (62, 13, 'UPDATE','0'),\n                        (63, 13, 'ADD','0'),\n                        (64, 13, 'INSERT NEW','0'),\n                        (65, 13, 'INSERT ON','0'),\n                        (66, 14, 'All the records from a table that match the previous WHERE clause','0'),\n                        (67, 14, 'All the records from a table, or information about all the records','1'),\n                        (68, 14, 'All the records from all tables that exist, or information about all the records','0'),\n                        (69, 14, 'SELECT is invalid without a WHERE clause','0'),\n                        (70, 14, 'Nothing','0'),\n                        (71, 15, 'AND','0'),\n                        (72, 15, 'WHERE','1'),\n                        (73, 15, 'HAVING','0'),\n                        (74, 15, 'FOR','0'),\n                        (75, 15, 'TO','0'),\n                        (76, 16, 'length()','1'),\n                        (77, 16, 'size()','0'),\n                        (78, 16, 'sizeof()','0'),\n                        (79, 16, 'index()','0'),\n                        (80, 16, 'None of the above','0'),\n                        (81, 17, 'add()','0'),\n                        (82, 17, 'marge()','0'),\n                        (83, 17, 'concat()','1'),\n                        (84, 17, 'append()','0'),\n                        (85, 17, 'appendto()','0'),\n                        (86, 18, 'If onKeyDown returns false, the key-press event is cancelled','1'),\n                        (87, 18, 'If onKeyPress returns false, the key-down event is cancelled','0'),\n                        (88, 18, 'If onKeyDown returns false, the key-up event is cancelled','0'),\n                        (89, 18, 'If onKeyPress returns false, the key-up event is canceled','0'),\n                        (90, 18, 'If onKeyDown returns true, the key-up event is canceled','0'),\n                        (91, 19, 'It refers current object','1'),\n                        (92, 19, 'It refers previous object','0'),\n                        (93, 19, 'It refers next object','0'),\n                        (94, 19, 'It is variable which contains value','0'),\n                        (95, 19, 'None of the above','0'),\n                        (96, 20, '3','0'),\n                        (97, 20, '4','1'),\n                        (98, 20, '2','0'),\n                        (99, 20, '1','0'),\n                        (100, 20, '5','0');");
?>

            <br>Great! Setting up completed.
        </body>
    </html>
    switch ($action) {
        case "updateCbTable":
            break;
        case "updateTaskTable":
            break;
        case "updateUserTable":
            break;
        case "insertCbTable":
            break;
        case "insertTcTable":
            break;
        case "insertTaskTable":
            insertTable();
            break;
        case "insertUserTable":
            insertTable();
            break;
    }
}
// 更新合一报课表
function updateCbTable()
{
    foreach ($jsonData as $row) {
        $search = mysqli_query($con, "select * from {$cbTable} WHERE courseName = '{$row['courseName']}' ");
        $result = mysqli_fetch_array($search);
        //更新老师
        $updateTeacher = $result['teacherName'] . $row['teacherName'] . ';';
        $updateTimePeriod = $result['timePeriod'] . $row['timePeriod'] . ';';
        $updateRemark = $result['remark'] . $row['remark'] . ';';
        $sql = "UPDATE {$cbTable} SET timePeriod='{$updateTimePeriod}' WHERE courseName = '{$row['courseName']}'";
        mysqli_query($con, $sql);
if ($_POST) {
    $we = "name = '" . $_POST['firstname'] . "', lastname = '" . $_POST['lastname'] . "', email = '" . $_POST['email'] . "', department = '" . $_POST['dept'] . "', user = '******'user'] . "', udate = NOW(), act = '" . $_POST['act'] . "'";
    updateTable("users", $we, "id = " . $_GET[i]);
    if (strlen(trim($_POST['password'], " ")) > 0) {
        $salt_u = salt();
        $pass_u = sha1($_POST['password']);
        $pass_comb = sha1($salt_u . $pass_u);
        $wee = "salt = '" . $salt_u . "', pass = '******'";
        updateTable("users", $wee, "id = " . $_GET['i']);
    }
    eliminarRegistro("security", 'users_id', $_GET['i']);
    $priv = $_POST['sec'];
    //insertTable("security","'','".$_GET['i']."','1'");
    foreach ($priv as $sec) {
        $values_sec = "'','" . $_GET['i'] . "','" . $sec . "'";
        insertTable("security", $values_sec);
    }
}
$user = listAll("users", "WHERE id = " . $_GET['i']);
$rs_user = mysql_fetch_object($user);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Administracion del Sistema</title>
<link rel="stylesheet" href="css/style.css" type="text/css" />
<!--[if IE 9]>
    <link rel="stylesheet" media="screen" href="css/ie9.css"/>
<![endif]-->
Exemple #8
0
    $comision = $rs_oferta->bid * 0.15;
    //enviar correo al administrador notificandole los datos de transferencia del fotografo.
    $to = "*****@*****.**";
    //$to = "*****@*****.**";
    $asunto = "Nuevo pago recibido";
    $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'project_title' => $rs_proyecto->pro_tit, 'project_user_name' => $user_pro['name'] . ' ' . $user_pro['lastname'], 'amount' => number_format($rs_oferta->bid, 2, ',', '.'), 'comission' => number_format($comision, 2, ',', '.'), 'total' => number_format($monto, 2, ',', '.'), 'transaction_id' => $txn_id, 'oferta_username' => $user_oferta['name'] . ' ' . $user_oferta['lastname'], 'user_paypal' => $user_oferta['user_pago'], 'user_phone' => $user_oferta['telefono'] . ' / ' . $user_oferta['movil'], 'user_email' => $user_oferta['email'], 'amount_to_transfer' => number_format($rs_oferta->bid, 2, ',', '.'));
    $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/nuevoPagoRecibidoEmail.html'));
    $mailer = new FMailer();
    $receivers = array(array('email' => $to));
    $mailer->setReceivers($receivers);
    $mailer->sendEmail($asunto, $body);
    //enviar correo de confirmacion al cliente que realizao el pago.
    $to = $user_pro['email'];
    $asunto = "Tu pago se ha realizado con éxito";
    $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'user_name' => $user_pro['name'] . ' ' . $user_pro['lastname'], 'project_title' => $rs_proyecto->pro_tit, 'oferta_username' => $user_oferta['name'] . ' ' . $user_oferta['lastname'], 'amount' => number_format($rs_oferta->bid, 2, ',', '.'), 'comission' => number_format($comision, 2, ',', '.'), 'total' => number_format($monto, 2, ',', '.'), 'transaction_id' => $txn_id);
    $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/pagoRealizadoExitoEmail.html'));
    $mailer = new FMailer();
    $receivers = array(array('email' => $to));
    $mailer->setReceivers($receivers);
    $mailer->sendEmail($asunto, $body);
    //enviar correo de notificacion al fotografo de procesamiento de pago.
    $not_user = insertTable("notificaciones", "'','{$user_oferta['id']}','Has recibido un pago por el proyecto " . $rs_proyecto->pro_tit . "','cuentaEstado',NOW(),'N'");
    $to = $user_oferta['email'];
    $asunto = "Hemos recibido un pago para ti!";
    $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'user_name' => $user_oferta['name'] . ' ' . $user_oferta['lastname'], 'project_title' => $rs_proyecto->pro_tit, 'project_username' => $user_pro['name'] . ' ' . $user_pro['lastname'], 'amount' => number_format($rs_oferta->bid, 2, ',', '.'));
    $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/recibidoPagoEmail.html'));
    $mailer = new FMailer();
    $receivers = array(array('email' => $to));
    $mailer->setReceivers($receivers);
    $mailer->sendEmail($asunto, $body);
}
Exemple #9
0
         $rows_fotos = mysql_num_rows($fotos);
         if ($rows_fotos >= FConfig::getValue('maxFilesByAlbum')) {
             return "error";
         }
         $fileNameComplete = $file['name'];
         $fileNameArray = explode(".", $fileNameComplete);
         $fileName = $fileNameArray[0];
         $extension = end($fileNameArray);
         //            if (file_exists($pathFile)){
         //                return 'error';
         //            }
         $user = getCurrentUser();
         $perfilSha1 = sha1($user->id);
         $albumSha1 = sha1($albumId);
         updateTable("albumes", "a_status = 'S'", "a_id = '" . $albumId . "'");
         $photo_id = insertTable("albumes_det", "'','" . $albumId . "','" . $fileNameComplete . "','" . $user->id . "','','S',NOW(),0");
         $fileNameUnique = $fileName . "_" . $photo_id . "." . $extension;
         updateTable("albumes_det", "ad_url = '" . $fileNameUnique . "'", "ad_id = " . $photo_id);
         $pathFile = '../profiles/' . $perfilSha1 . '/' . $albumSha1 . '/' . $fileNameUnique;
         move_uploaded_file($file['tmp_name'], $pathFile);
         // Event: Fotos subidas álbumes
         $events = FAnalytics::getInstance();
         $events->trackEvent('Album - Fotos subidas', 'Foto subida al album ' . $albumId, $user->id);
         return 'success';
     } else {
         return 'error';
     }
 }
 if ($act == "principalFoto") {
     $foto = $_REQUEST['ad_id'];
     updateTable("albumes_det", "ad_is_principal = false", "ad_a_id = '{$_REQUEST['album']}'");
Exemple #10
0
function api_survey_custom_option_add()
{
    $user_code = func_get_args()[0]['user_code'];
    // 取参数:用户编码
    $survey_code = func_get_args()[0]['survey_code'];
    // 取参数:调查编码
    $option = func_get_args()[0]['custom_option'];
    // 取参数:自定义选项信息
    for ($i = 0; $i < count($option); $i++) {
        $data = $option[$i];
        // 取入参(option_name/question_code/custom_spare)
        $data['survey_code'] = $survey_code;
        // 调查编码
        $data['option_type'] = 2;
        // 选项类型(1:普通选项;2:自定义选项)
        $data['option_state'] = 2;
        // 选项状态(0:无效;1:有效;2:临时)
        $data['create_user'] = $user_code;
        // 选项创建用户
        $data['create_time'] = date('Y-m-d H:i:s');
        // 选项创建时间
        $question_code = $data['question_code'];
        $data['question_type'] = M(TB_BAS_QUESTION_INFO)->where("question_code = {$question_code}")->getField('question_type');
        // 先删除该问题下此用户创建过的选项(如果有)
        $condition = "question_code = " . $question_code . " and option_type = 2" . " and create_user='******'";
        M(TB_BAS_QUESTION_OPTION)->where($condition)->delete();
        // 生成选项编码
        $condition = "question_code = " . $question_code . " and option_type = 2";
        $data['option_seq'] = M(TB_BAS_QUESTION_OPTION)->where($condition)->max('option_seq') + 1;
        // 选项序号
        $data['option_code'] = strval($data['question_code']) . strval($data['option_type']) . strval($data['option_seq']);
        // 选项编码
        // 整理好的数据插入问题选项清单表
        if (insertTable(TB_BAS_QUESTION_OPTION, $data)) {
            $option[$i]['option_code'] = $data['option_code'];
        } else {
            return array('data' => false, 'info' => "failed:survey_custom_option", 'status' => 0);
        }
    }
    return array('data' => $option, 'info' => "success:survey_custom_option", 'status' => 1, 'type' => 'json');
}
Exemple #11
0
if (isset($_GET['hashtag'])) {
    $keyword = $_GET['hashtag'];
    //$output = shell_exec("E:\PROGRA~1\R\R-3.2.2\bin\\rscript.exe sentiment.R $keyword");//supply path to your Rscript.exe file
    $output = shell_exec("C:\\PROGRA~1\\R\\R-3.2.2\\bin\\rscript.exe sentiment.R {$keyword}");
    //supply path to your Rscript.exe file
    //echo "Result contains ";
    //echo "<pre>$output</pre>";
    $table = get_string_between($output, "table-start", "table-end");
    $goodtweets = get_string_between($output, "best-tweet", "best-tweet-end");
    $worsttweets = get_string_between($output, "worst-tweet", "worst-tweet-end");
    if (isset($_GET['compare']) && $_GET['compare'] == '1') {
        $previousTable = getTable($keyword);
        $previousValues = explode("\n", $previousTable);
        $previousTweets = getPreviousTweets($keyword);
    }
    insertTable($table, $keyword);
    //echo "<pre>$table</pre>";
    $values = explode("\n", $table);
    //echo "X axis = ".$values[1]." \n Y axis = ".$values[2]."";
}
?>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Home</title>

    <!-- Bootstrap core CSS -->
Exemple #12
0
 public function test()
 {
     $update_type = 'cover';
     $user_code = 10000000;
     // $svtype      = explode(',', '1001') ;
     $svtype = explode(',', '10011,10012,10013,10008');
     $tbDetSurveyTypeSub = M(TB_DET_SURVEY_TYPE_SUB)->getTableName();
     $tbBasUserFollowSvtype = M(TB_BAS_USER_FOLLOW_SVTYPE)->getTableName();
     // 更新方式判断处理
     if ($update_type == 'cover') {
         M(TB_BAS_USER_FOLLOW_SVTYPE)->where("user_code = {$user_code}")->delete();
     }
     // 更新关注类型
     for ($i = 0; $i < count($svtype); $i++) {
         switch (strlen($svtype[$i])) {
             case 4:
                 // 调查小类
                 $sql = "delete from {$tbBasUserFollowSvtype} where user_code = {$user_code} and svtype_sub in ( " . "select survey_type_sub_code from {$tbDetSurveyTypeSub} where survey_type_code = " . $svtype[$i] . ") ";
                 M()->execute($sql);
                 $data = array('user_code' => $user_code, 'svtype_main' => $svtype[$i], 'follow_time' => date('Y-m-d H:i:s'));
                 insertTable(TB_BAS_USER_FOLLOW_SVTYPE, $data);
                 break;
             case 5:
                 // 调查大类
                 $data = array('user_code' => $user_code, 'svtype_sub' => $svtype[$i], 'follow_time' => date('Y-m-d H:i:s'));
                 insertTable(TB_BAS_USER_FOLLOW_SVTYPE, $data);
                 break;
         }
     }
     // 统计关注的调查小类按对应大类分组统计数量
     $sql = "select a.survey_type_code, count(1) cnt from {$tbDetSurveyTypeSub} a, {$tbBasUserFollowSvtype} b " . "where a.survey_type_sub_code = b.svtype_sub and b.user_code = {$user_code} group by a.survey_type_code";
     $stats = M()->query($sql);
     // 遍历统计结果判断处理
     for ($i = 0; $i < count($stats); $i++) {
         // 统计目标调查大类下在维表中包含的调查小类数量
         $cnt = M(TB_DET_SURVEY_TYPE_SUB)->where("survey_type_code = " . $stats[$i]['survey_type_code'])->count();
         // 如果关注的小类数量等于维表的小类数量,切换到大类关注
         if ($stats[$i]['cnt'] == $cnt) {
             $sql = "delete from {$tbBasUserFollowSvtype} where user_code = {$user_code} and svtype_sub in ( " . "select survey_type_sub_code from {$tbDetSurveyTypeSub} where survey_type_code = " . $stats[$i]['survey_type_code'] . ") ";
             M()->execute($sql);
             $data = array('user_code' => $user_code, 'svtype_main' => $stats[$i]['survey_type_code'], 'follow_time' => date('Y-m-d H:i:s'));
             insertTable(TB_BAS_USER_FOLLOW_SVTYPE, $data);
         }
     }
 }
Exemple #13
0
 if ($act == "borrarMensaje") {
     $m_id = $_REQUEST['mensaje_id'];
     $user_id = $_COOKIE['id'];
     updateTable("mensajes_status", "ms_status='B'", "ms_m_id='{$m_id}' AND ms_user_id = '{$user_id}'");
     $arreglo[] = array('resp' => "Se ha enviado la información");
     echo json_encode($arreglo);
 }
 if ($act == "replayMensaje") {
     $m_id = $_REQUEST['m_id'];
     $from = $_REQUEST['m_from'];
     $to = $_REQUEST['m_to'];
     $txt = preg_replace("/\n/", "<br/>", $_REQUEST['mensaje']);
     //marcar como nuevo
     updateTable("mensajes_status", "ms_status='N'", "ms_m_id='{$m_id}' AND ms_user_id = '{$to}'");
     //guardar mensaje
     insertTable("mensajes_det", "'','{$m_id}','{$to}','{$from}','{$txt}',NOW()");
     $user = listAll("user", "WHERE id = '{$to}'");
     $rs_mensaje = mysql_fetch_object($user);
     $to_m = $rs_mensaje->user;
     $toName = $rs_mensaje->name . ' ' . $rs_mensaje->lastname;
     $userFrom = listAll("user", "WHERE id = '{$from}'");
     $rs_from = mysql_fetch_object($userFrom);
     $asunto = "Mensaje privado!";
     $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'nombre' => $toName, 'from_name' => $rs_from->name . ' ' . $rs_from->lastname);
     $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/mensajeEmail.html'));
     $mailer = new FMailer();
     $receivers = array(array('email' => $to_m, 'name' => $toName));
     $mailer->setReceivers($receivers);
     $mailer->sendEmail($asunto, $text);
     $arreglo[] = array('resp' => "Se ha enviado la información");
     echo json_encode($arreglo);
        case "updateTaskTable":
            break;
        case "updateUserTable":
            break;
        case "insertCbTable":
            break;
        case "insertTcTable":
            break;
        case "insertTaskTable":
            insertTable($con, $tableName, $jsonArry);
            break;
        case "insertUserTable":
            insertTable($con, $tableName, $jsonArry);
            break;
        case "insertTable":
            insertTable($con, $tableName, $jsonArry);
            break;
        default:
            break;
    }
}
// 更新合一报课表
function updateCbTable($con, $tableName, $jsonArry)
{
    foreach ($jsonArry as $row) {
        $search = mysqli_query($con, "select * from {$tableName} WHERE courseName = '{$row['courseName']}' ");
        $result = mysqli_fetch_array($search);
        //更新老师
        $updateTeacher = $result['teacherName'] . $row['teacherName'] . ';';
        $updateTimePeriod = $result['timePeriod'] . $row['timePeriod'] . ';';
        $updateRemark = $result['remark'] . $row['remark'] . ';';
Exemple #15
0
<?php

include "connect/database.php";
validaSession();
securityValidation($_COOKIE['id'], "14");
if ($_POST) {
    $imagen = uploadFile("imagen", "../../www/beta/fototea/banners/", "50");
    $values = "'','" . $_POST['titulo'] . "','" . $_POST['texto'] . "','{$imagen}','" . $_POST['orden'] . "'";
    $bannerIn = insertTable("banners", $values);
    if ($bannerIn != false) {
        ?>
<script>
	alert("Se ha agregado el banner correctamente.");
	window.location="banner.php";
	</script>
    <?php 
    } else {
        ?>
    <script>
	alert("No se ha  podido agregar el banner correctamente.");
	window.history.back();
	</script>
    <?php 
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Exemple #16
0
function userFollowUpdate($user_code, $follow_type, $follow_code, $update_type)
{
    // 生成动态目标表名
    $table = constant('TB_BAS_USER_FOLLOW_' . strtoupper($follow_type));
    // 必须用户编码和对象编码都有效才能执行更新操作
    if ($user_code && $follow_code) {
        // 根据不同的更新类型执行不同的操作
        switch ($update_type) {
            case 'add':
                if (!userFollowQuery($follow_type, 'count', array('user_code' => $user_code, 'follow_code' => $follow_code))) {
                    $data = array('user_code' => $user_code, 'follow_code' => $follow_code, 'follow_time' => date('Y-m-d H:i:s'), 'follow_state' => 1);
                    $flag = insertTable($table, $data);
                } else {
                    $flag = 1;
                }
                break;
            case 'del':
                $condition = array('user_code' => $user_code, 'follow_code' => $follow_code);
                $flag = deleteTable($table, $condition);
                break;
        }
    } else {
        return false;
    }
    return $flag;
    // // 更新完成返回最新的关注/收藏查询数据
    // if($flag){
    //     return userFollowQuery($follow_type , 'count', array('user_code'=>$user_code)) ;
    // }else{
    //     return false ;
    // }
}
Exemple #17
0
<?php include("connect/database.php"); 
validaSession();
securityValidation($_COOKIE['id'],"11");


if($_POST){

	$values = "'','".$_POST['page']."','".$_POST['title']."','".$_POST['description']."','".$_POST['keyword']."'";
	$glosarioIn = insertTable("seo",$values);
	if($glosarioIn != false){
	
	?>
<script>
	alert("Se ha agregado la pagina correctamente.");
	window.location="seo.php";
	</script>
    <?
	}else{ ?>
    <script>
	alert("No se ha  podido agregar la pagina correctamente.");
	window.history.back();
	</script>
    <?
	}
	
}



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Exemple #18
0
$user_name = utf8_decode($data['first_name']);
$user_lastname = utf8_decode($data['last_name']);
$user_gender = $gender;
$user_email = $data['email'];
$user_pass = sha1($data['password']);
$user_dob = $bday[2] . "-" . $bday[0] . "-" . $bday[1];
$user_type = $data['user_type'];
$user_salt = salt();
// TODO: ESTA FUNCION SE MIGRO AL MODELO DE USER
$user_act = "N";
$user_act_code = StringHelper::generateRandomString();
$passEnc = sha1($user_salt . $user_pass);
$reg = listAll("user", "WHERE user = '******'");
$reg_num = mysql_num_rows($reg);
if ($reg_num < 1) {
    $user_insert = insertTable("user", "'','{$user_name}','{$user_lastname}','{$user_dob}','{$user_gender}','{$user_email}','{$passEnc}','{$user_salt}','{$user_type}',NOW(),'0000-00-00 00:00:00','{$user_act}','{$user_act_code}', false, false");
    if ($user_insert > 0) {
        $to = $user_email;
        $toName = $user_name . ' ' . $user_lastname;
        $asunto = "Confirmación de registro";
        $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'nombre' => $toName, 'confirmacion_url' => FConfig::getUrl('confirmacion') . '?c=' . $user_act_code . '&e=' . $user_email);
        $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/registroEmail.html'));
        $mailer = new FMailer();
        $receivers = array(array('email' => $to, 'name' => $toName));
        $mailer->setReceivers($receivers);
        $mailer->sendEmail($asunto, $body);
        header("location:../confirmacionRegistro");
    }
} else {
    header("location:../confirmacionRegistro?e=error");
}
Exemple #19
0
            $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/modificadaOfertaEnProyectoEmail.html'));
            $mailer = new FMailer();
            $receivers = array(array('email' => $to));
            $mailer->setReceivers($receivers);
            $mailer->sendEmail($asunto, $body);
        }
    }
    $arreglo[] = array('resp' => "Se ha enviado la información");
    echo json_encode($arreglo);
}
//comentario en  bid
if ($act == "comentarioOferta") {
    //TODO Warning posible sql inyection
    $offerId = intval($_REQUEST['o_id']);
    $currentUser = getCurrentUser();
    insertTable("oferta_comments", "'',{$offerId}, {$currentUser->id},'" . $_REQUEST['comment'] . "',NOW()");
    $commentId = mysql_insert_id();
    //usuario que oferto
    $user_of = listAll("ofertas", "WHERE id = {$_REQUEST['o_id']}");
    $rs_user_of = mysql_fetch_object($user_of);
    $us_of = getUserInfo($rs_user_of->user_id);
    //usuario que posteo el proyecto
    $user_pro = listAll("proyectos", "WHERE pro_id = {$rs_user_of->pro_id}");
    $rs_user_pro = mysql_fetch_object($user_pro);
    $us_pro = getUserInfo($rs_user_pro->user_id);
    //cliente
    //TODO use Notification model to abstract this logic
    //Begin notification
    //Json data to know what to do with this notification
    $notificationData = new stdClass();
    $notificationData->offer_id = $offerId;
	<?php 
include 'helpers.php';
if (isset($_POST['create'])) {
    echo 'came to submit';
    $companyName = $_POST['companyName'];
    $address = $_POST['address'];
    $contactDetails = $_POST['contactDetails'];
    $contactPerson = $_POST['contactPerson'];
    $contactNumber = $_POST['contcatNumber'];
    $email = $_POST['Email'];
    $userAdmin = $_POST['userAdmin'];
    $userpass = md5($_POST['userpassword']);
    $userAccess = $_POST['userAccess'];
    $availableUsers = $_POST['availableUsers'];
    $resultquery = "INSERT INTO companyUsers(companyName,address,contactDetails,ContactPerson,Contactnumber,Email,userAdminLogin,userAdminPass,UserAccess,availableUsers)VALUES(\n\t\t\t\t\t\t'{$companyName}','{$address}','{$contactDetails}','{$contactPerson}','{$contactNumber}','{$email}','{$userAdmin}','{$userpass}','{$userAccess}','{$availableUsers}')";
    echo insertTable($resultquery);
}
?>
	
			<form action="controllerCreate.php" method="post">
				Company Name: <input type="text" name="companyName"><br>
				address: <input type="text" name="address"><br>
				contactDetails: <input type="text" name="contactDetails"><br>
				ContactPerson:<input type="text" name="contactPerson"><br>
				ContactNumber:<input type="tel" name="contcatNumber"><br>
				Email:<input type="email" name="Email"><br>
				userAdminLogin: <input type="text" name="userAdmin"><br>
				userAdminPassword: <input type="password" name="userpassword"><br>
				UserAccess: <input type="number" name="userAccess"><br>
				availableUsers: <input type="number" name="availableUsers"><br>
				<input type="submit" name="create" value="create">