Exemplo n.º 1
0
function consultaProgramas($conexion)
{
    $salida = '';
    //Realizamos la Consulta que nos traera todos los registros de la BD
    //$consulta=mysql_query('select id,nombre,edad,telefono,ciudad,status from user');
    //$consulta = mysql_query('SELECT conductores.*, conductores_imagenes.*, imagenes.* FROM conductores, conductores_imagenes, imagenes WHERE conductores.id_conductor = conductores_imagenes.id_conductor and imagenes.id_imagen = conductores_imagenes.id_imagen ORDER BY conductor');
    //$consulta = "SELECT programas.*, categoria.*, productores.* FROM programas, categoria, productores WHERE programas.id_categoria = categoria.id_categoria and productores.id_productor = programas.id_productor order by programas.nombre";
    $consulta = mysql_query("select * from programas LEFT join \n\t\tcategoria on programas.id_categoria=categoria.id_categoria");
    //$conductores = mysql_query($sql, $conexion) or die(mysql_error());
    //Validamos si hay o no registros
    if (mysql_num_rows($consulta) > 0) {
        while ($dato = mysql_fetch_array($consulta)) {
            $salida .= '	
			 	<tr>			 	
					<td>' . $dato["id_programa"] . '</td>
					<td>' . $dato["nombre"] . '</td>					
					<td><p style="width:200px; height:50px; overflow:hidden">' . $dato["descripcion"] . '</p></td>
					<td>' . $dato["correo"] . '</td>
					<td>' . $dato["categoria"] . '</td>
					<td style="display:none;">' . $dato["logo"] . '</td>
					<td style="display:none;">' . $dato["img_slide"] . '</td>
					<td style="display:none;">' . $dato["imgtop_programa"] . '</td>
					<td class="' . returnStatus($dato["estatus"]) . '">' . $dato["estatus"] . '</td>
					<td><a class="btn btn-info">Editar</a>
					<a class="btn btn-danger">Eliminar</a></td>
				</tr>
			 ';
        }
    } else {
        $salida = '
		 	<tr id="sinDatos">
				<td colspan="7">No hay Registros en la Base de Datos</td>
			</tr>
		 ';
    }
    return $salida;
}
Exemplo n.º 2
0
    if ($update->getName() != "MOPDiff") {
        die("Unknown data");
    }
}
foreach ($update->children() as $d) {
    if ($d->getName() == "cmp") {
        processCompetitor($cmpId, $d);
    } else {
        if ($d->getName() == "tm") {
            processTeam($cmpId, $d);
        } else {
            if ($d->getName() == "cls") {
                processClass($cmpId, $d);
            } else {
                if ($d->getName() == "org") {
                    processOrganization($cmpId, $d);
                } else {
                    if ($d->getName() == "ctrl") {
                        processControl($cmpId, $d);
                    } else {
                        if ($d->getName() == "competition") {
                            processCompetition($cmpId, $d);
                        }
                    }
                }
            }
        }
    }
}
returnStatus('OK');
 public function chooseOrgUserSave()
 {
     $org_id = getFormGetPostValue('org_id');
     $uids = getFormGetPostValue('uids');
     $array = explode(',', $uids);
     if ($array && count($array) > 0) {
         $dataList = array();
         foreach ($array as $id) {
             $dataList[] = array('id' => getGuid(), 'org_id' => $org_id, 'user_id' => $id);
         }
         $Model = M("SysOrgUser");
         $Model->addAll($dataList);
     }
     $this->ajaxReturn(returnStatus());
 }
 public function loginPost()
 {
     $status = true;
     $msg = '';
     $user_name = getFormGetPostValue('user_name');
     $password = getFormGetPostValue('password');
     if (empty($user_name) || empty($password)) {
         $status = false;
         $msg = '帐号或密码不能为空。';
     } else {
         $Modle = M('SysUser');
         $userInfo = $Modle->where("user_name='%s' and password='******'", $user_name, md5($password))->find();
         if (empty($userInfo)) {
             $status = false;
             $msg = '帐号或密码有误,请重试。';
         } else {
             $SysRoleUser = M('SysRoleUser');
             $roles = $SysRoleUser->where('user_id=%u', $userInfo['user_id'])->select();
             if (count($roles) == 0) {
                 $status = false;
                 $msg = '帐号未授权。';
             } else {
                 $roleids = array();
                 foreach ($roles as $value) {
                     $roleids[] = $value['role_id'];
                 }
                 // 加载菜单、请求
                 // role_id为0时是超级用户
                 if (in_array(0, $roleids)) {
                     session('isSuperUser', true);
                     $SysMenu = M('SysMenu');
                     $menus = $SysMenu->order('seq asc')->select();
                 } else {
                     session('isSuperUser', false);
                     $Model = M();
                     $menus = $Model->query("SELECT m.*\n            FROM ( SELECT * FROM sys_role_function rf WHERE rf.role_id in (%s) AND rf.type = 0 ) rf\n            JOIN sys_menu m ON m.menu_id = rf.mf_id order by m.seq asc", join(',', $roleids));
                     $map['role_id'] = array('in', $roleids);
                     $map['type'] = array('eq', 1);
                     $SysRoleFunction = M('SysRoleFunction');
                     $functionData = $SysRoleFunction->field('sys_function.text')->join('sys_function ON sys_function.function_id = sys_role_function.mf_id')->where($map)->select();
                     $functionList = array();
                     foreach ($functionData as $value) {
                         $functionList[] = $value['text'];
                     }
                 }
                 session('menus', $menus);
                 session('functions', $functionList);
                 session('userInfo', $userInfo);
                 session('isLock', false);
             }
         }
     }
     $this->ajaxReturn(returnStatus($status, $msg));
 }
Exemplo n.º 5
0
        returnStatus('error', 'Authentication Failed');
        exit;
    }
} else {
    MM_DiagnosticLog::log(MM_DiagnosticLog::$MM_ERROR, "System does not support sha256 hmac... proceeding to process schedules without auth");
}
$eventId = $request['reference_id'];
$eventType = $wpdb->get_var("SELECT event_type from " . MM_TABLE_SCHEDULED_EVENTS . " where id='{$eventId}'");
switch ($eventType) {
    case MM_ScheduledEvent::$PAYMENT_SERVICE_EVENT:
        $paymentEvent = new MM_ScheduledPaymentEvent($eventId);
        $billingStatus = $request['status'];
        $paymentEvent->setBillingStatus($billingStatus);
        if ($paymentEvent->getStatus() == MM_ScheduledEvent::$EVENT_PROCESSED) {
            returnStatus("ok", "Event {$eventId} already processed");
        }
        $paymentService = MM_PaymentServiceFactory::getPaymentServiceById($paymentEvent->getPaymentServiceId());
        if (is_null($paymentService)) {
            returnStatus("error", "Improper event configuration: Payment service with id {$paymentService->getPaymentServiceId()} not found");
        }
        $response = $paymentService->processScheduledPaymentEvent($paymentEvent);
        if (MM_PaymentServiceResponse::isError($response) || MM_PaymentServiceResponse::isFailed($response)) {
            returnStatus("error", $response->message);
        }
        returnStatus("ok", "");
        break;
    default:
        //TODO: logging
        returnStatus('error', 'Invalid Event Type');
        break;
}