コード例 #1
0
ファイル: Hotaru.php プロジェクト: hotarucms/hotarucms
 /**
  * Physically delete a user
  * Note: You should delete all their posts, comments, etc. first
  *
  * @param int $user_id (optional)
  */
 public function deleteUser($user_id = 0)
 {
     $userbase = UserBase::instance();
     return $userbase->deleteUser($this, $user_id);
 }
コード例 #2
0
ファイル: AdminPages.php プロジェクト: hotarucms/hotarucms
 public function ajaxStatsUsers($h)
 {
     $mergedData = array();
     //Get the first set of data you want to graph from the database
     //$databaseData1 = array(array('x_value' => 5, 'y_value' =>10), array('x_value' => 15, 'y_value' =>120));// someFunctionToGetDataFromDatabase($id);
     $user = UserBase::instance();
     $databaseData1 = $user->newUserCount($h);
     //print_r($databaseData1);
     //loop through the first set of data and pull out the values we want, then format
     foreach ($databaseData1 as $r) {
         $x = $r[0];
         $y = $r[1];
         $data1[] = array($x, $y);
     }
     //send our data values to $mergedData, add in your custom label and color
     $mergedData[] = array('label' => "Data 1", 'data' => $data1, 'color' => '#6bcadb');
     ////Get the second set of data you want to graph from the database
     ////$databaseData2 = someFunctionToGetDataFromDatabase($id);
     //$databaseData2 = array(array('x_value' => 5, 'y_value' =>50), array('x_value' => 15, 'y_value' =>80));// someFunctionToGetDataFromDatabase($id);
     //
     //
     //foreach($databaseData2 as $r)
     //{
     //    $x = $r['x_value'];
     //    $y = $r['y_value'];
     //    $data2[] = array ($x, $y);
     //}
     //send our data values to $mergedData, add in your custom label and color
     //$mergedData[] = array('label' => "Data 2" , 'data' => $data2, 'color' => '#6db000');
     //now we can JSON encode our data
     echo json_encode($mergedData);
 }