当前位置: 首页>>代码示例>>PHP>>正文


PHP CommonFunctions::func_graphGenerate方法代码示例

本文整理汇总了PHP中CommonFunctions::func_graphGenerate方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonFunctions::func_graphGenerate方法的具体用法?PHP CommonFunctions::func_graphGenerate怎么用?PHP CommonFunctions::func_graphGenerate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CommonFunctions的用法示例。


在下文中一共展示了CommonFunctions::func_graphGenerate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeCreate

 public function executeCreate(sfWebRequest $request)
 {
     //$this->forward404Unless($request->isMethod(sfRequest::POST));
     //if($request->isMethod(sfRequest::POST)){
     $data = $request->getParameterHolder()->getAll();
     //get all the data from request post/get
     $data_array = json_decode($data['data'], true);
     //convert the json string to array
     //$accessToken = $data_array['accessToken'];
     $activity_id = $data_array['activity_id'];
     $assessments = $data_array['assessments'];
     $device_id = $data_array['device_id'];
     $option_email = $data_array['email'];
     /*	
     echo "<pre>";
     print_r($assessments);
     exit();
     */
     $response = array();
     $assessmentAutoId = array();
     //	$activity_type_id = Doctrine::getTable('Activities')->func_getActivityTypeId($activity_id);
     $student_obj = Doctrine::getTable('Students');
     if (is_array($assessments) && count($assessments)) {
         $tbl_format = '<table width="100%">';
         foreach ($assessments as $assessment) {
             $auto_id = $assessment['auto_id'];
             $found_it = $assessment['found_it'];
             $taps = $assessment['Taps'];
             $target_word = $assessment['target_word'];
             $incorrect_word_taps = $assessment['incorrect_word_taps'];
             unset($assessment['auto_id']);
             unset($assessment['found_it']);
             unset($assessment['Taps']);
             unset($assessment['incorrect_word_taps']);
             $device_session_id = $assessment['device_session_id'];
             $device_session_id_explode = explode('_', $device_session_id);
             $student_id = $device_session_id_explode[0];
             unset($assessment['device_session_id']);
             $authenticated = $student_obj->func_checkStudentId($student_id);
             if ($authenticated[0]['student_id'] != '') {
                 foreach ($assessment as $assessment_parameter => $value) {
                     $this->table = 'AssessmentResultsWordHunt';
                     $tbl_format .= '<tr><td>' . $assessment_parameter . '</td><td>' . $value . '</td></tr>';
                     $ass_table = new $this->table();
                     $assessmentData = Doctrine::getTable($this->table)->func_checkActivityAutoId($device_id, $auto_id, $activity_id, $student_id, $device_session_id);
                     if ($assessmentData['auto_id'] == '') {
                         $getMaxTryNo = Doctrine_Manager::getInstance()->getConnection('doctrine')->getDbh()->query("SELECT max(try_number) as 'max'  from `assessment_results_word_hunt` where activity_id='" . $activity_id . "' and student_id='" . $student_id . "' and device_id='" . $device_id . "' and target_word='" . trim($target_word) . "'")->fetchAll();
                         $try_number = 1 + $getMaxTryNo['0']['max'];
                         $ass_table->activity_id = $activity_id;
                         $ass_table->student_id = $student_id;
                         $ass_table->found_it = $found_it;
                         $ass_table->auto_id = $auto_id;
                         $ass_table->taps = $taps;
                         $ass_table->try_number = $try_number;
                         $ass_table->incorrect_word_taps = $incorrect_word_taps;
                         $ass_table->found_it = $found_it;
                         $ass_table->target_word = $target_word;
                         $ass_table->device_id = $device_id;
                         $ass_table->device_session_id = $device_session_id;
                         $ass_table->time_stamp = date("Y-m-d h:i:s", time());
                         $ass_table->save();
                         $assessmentAutoId[$auto_id] = 1;
                     } else {
                         $assessmentAutoId[$auto_id] = 0;
                     }
                     unset($this->table);
                     unset($assessmentData);
                 }
             } else {
                 $response['STATUS'] = 0;
                 $response['MESSAGE'] = "Login Required!";
                 $json = json_encode($response);
                 return $this->renderText($json);
             }
         }
         $objCommon = new CommonFunctions();
         $objCommon->func_graphGenerate($student_id, $option_email);
         $response['STATUS'] = 1;
         $response['MESSAGE'] = "Data Inserted Successfully!";
         $response['autoIds'] = $assessmentAutoId;
     } else {
         $response['STATUS'] = 0;
         $response['MESSAGE'] = "No data Found!";
     }
     // end of if() that checks accessToken dg fdgd f
     /* } // end of if() that checks POST method
     		  
     		  else
     		  {
     			$response['STATUS'] = 0;
     			$response['MESSAGE'] = "You are not using post method!";
     			$response['accessToken'] = null;
     	  } */
     $json = json_encode($response);
     $obj_CommonFunctions = new CommonFunctions();
     //$obj_CommonFunctions->get_BookRelatedDataToMail($student_id, $tbl_format);
     return $this->renderText($json);
     //$this->setTemplate('getdata');
 }
开发者ID:rohitbatra1987,项目名称:ruckus_dev,代码行数:99,代码来源:actions.class.php


注:本文中的CommonFunctions::func_graphGenerate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。